private Optional<StyleInfo> determineStyle() {
      if (declaringType().isPresent()) {
        DeclaringType type = declaringType().get();

        Optional<DeclaringType> enclosing = type.enclosingOf();
        if (enclosing.isPresent()) {
          Optional<StyleInfo> enclosingStyle = enclosing.get().style();
          if (enclosing.get() != type) {
            Optional<StyleInfo> style = type.style();
            if (style.isPresent()
                && enclosingStyle.isPresent()
                && !style.equals(enclosingStyle)) {
              warnAboutIncompatibleStyles();
            }
          }
          if (enclosingStyle.isPresent()) {
            return enclosingStyle;
          }
        } else {
          Optional<StyleInfo> style = type.style();
          if (style.isPresent()) {
            return style;
          }
          Optional<DeclaringType> topLevel = type.enclosingTopLevel();
          if (topLevel.isPresent() && topLevel.get().style().isPresent()) {
            return topLevel.get().style();
          }
        }
      }
      return packageOf().style();
    }
Element used mostly for error reporting,
real model provided by {@link #sourceElement()}.
value-processor/src/org/immutables/value/processor/meta/Proto.java