@Value.Derived
    @Value.Auxiliary
    public Optional<DeclaringType> enclosingOf() {
      if (declaringType().isPresent()) {
        // this should come before isFactory check, bogus, I know
        if (kind().isNestedFactoryOrConstructor()) {
          Optional<DeclaringType> enclosingOf = declaringType().get().enclosingOf();
          if (!enclosingOf.isPresent() && kind().isFactory()) {
            return declaringType();
          }
          return enclosingOf;
        }
        if (kind().isFactory()) {
          return declaringType();
        }
        if (kind().isNested()) {
          if (kind().isIncluded()) {
            return declaringType();
          }
          return declaringType().get().enclosingOf();
        }
      }
      return Optional.absent();
    }
Element used mostly for error reporting,
real model provided by {@link #sourceElement()}.
value-processor/src/org/immutables/value/processor/meta/Proto.java