Class ValueAttribute

java.lang.Object
org.immutables.value.processor.meta.TypeIntrospectionBase
org.immutables.value.processor.meta.ValueAttribute
All Implemented Interfaces:
HasStyleInfo

public final class ValueAttribute extends TypeIntrospectionBase implements HasStyleInfo
It's pointless to refactor this mess until 1) Some sort of type calculus toolkit used/created 2) Facets/Implicits in Generator toolkit with auto-memoising implemented
  • Field Details

    • NON_WHOLE_TYPE_VARIABLE

      private static final ValueAttribute.WholeTypeVariable NON_WHOLE_TYPE_VARIABLE
    • CONSTRUCTOR_PARAMETER_DEFAULT_ORDER

      private static final int CONSTRUCTOR_PARAMETER_DEFAULT_ORDER
      See Also:
    • CONSTRUCTOR_NOT_A_PARAMETER

      private static final int CONSTRUCTOR_NOT_A_PARAMETER
      See Also:
    • GUAVA_IMMUTABLE_PREFIX

      private static final String GUAVA_IMMUTABLE_PREFIX
    • VALUE_ATTRIBUTE_NAME

      private static final String VALUE_ATTRIBUTE_NAME
      See Also:
    • ID_ATTRIBUTE_NAME

      private static final String ID_ATTRIBUTE_NAME
      See Also:
    • EMPTY_SERIALIZED_NAMES

      private static final String[] EMPTY_SERIALIZED_NAMES
    • names

    • isGenerateDefault

      public boolean isGenerateDefault
    • isGenerateDerived

      public boolean isGenerateDerived
    • isGenerateAbstract

      public boolean isGenerateAbstract
    • isGenerateLazy

      public boolean isGenerateLazy
    • isAttributeBuilder

      public boolean isAttributeBuilder
    • typeParameters

      public com.google.common.collect.ImmutableList<String> typeParameters
    • annotationInjections

      public com.google.common.collect.ImmutableList<AnnotationInjections.AnnotationInjection> annotationInjections
    • reporter

      public Reporter reporter
    • containingType

      public ValueType containingType
    • attributeValueType

      @Nullable public ValueType attributeValueType
    • returnType

      TypeMirror returnType
    • element

      Element element
    • returnTypeName

      String returnTypeName
    • attributeBuilderDescriptor

      @Nullable private AttributeBuilderDescriptor attributeBuilderDescriptor
    • hasEnumFirstTypeParameter

      public boolean hasEnumFirstTypeParameter
    • containedTypeElement

      @Nullable TypeElement containedTypeElement
    • containedSecondaryTypeElement

      @Nullable private TypeElement containedSecondaryTypeElement
    • generateOrdinalValueSet

      private boolean generateOrdinalValueSet
    • arrayComponent

      private TypeMirror arrayComponent
    • nullability

      @Nullable private NullabilityAnnotationInfo nullability
    • nullabilityInSupertype

      @Nullable private NullabilityAnnotationInfo nullabilityInSupertype
    • rawTypeName

      @Nullable private String rawTypeName
    • criteriaModel

      @Nullable private CriteriaModel criteriaModel
    • docComment

      public com.google.common.collect.ImmutableList<String> docComment
    • deprecated

      public boolean deprecated
    • jsonQualifierAnnotations

      private List<CharSequence> jsonQualifierAnnotations
    • serializedName

      @Nullable private String serializedName
    • alternateSerializedNames

      private String[] alternateSerializedNames
    • isGsonOther

      @Nullable private Boolean isGsonOther
    • orderKind

      private ValueAttribute.OrderKind orderKind
    • defaultInterface

      @Nullable private String defaultInterface
    • expectedSubtypes

      @Nullable private List<String> expectedSubtypes
    • parameterOrder

      private int parameterOrder
    • typeKind

      private AttributeTypeKind typeKind
    • jacksonAnyGetter

      public boolean jacksonAnyGetter
    • jacksonValue

      public boolean jacksonValue
    • hasTypeVariables

      public boolean hasTypeVariables
    • importsResolver

      private ImportsTypeStringResolver importsResolver
    • instantiation

      @Nullable public Instantiation instantiation
    • thrownCheckedExceptions

      private Set<String> thrownCheckedExceptions
    • nullElements

      public ValueAttribute.NullElements nullElements
    • isSuppressedOptional

      public boolean isSuppressedOptional
    • builderSwitcherModel

      @Nullable public SwitcherModel builderSwitcherModel
    • isBuilderParameter

      public boolean isBuilderParameter
    • hasSomeUnresolvedTypes

      boolean hasSomeUnresolvedTypes
    • isGenerateImmutableCopyOf

      public boolean isGenerateImmutableCopyOf
  • Constructor Details

    • ValueAttribute

      public ValueAttribute()
  • Method Details

    • name

      public String name()
    • criteria

      public CriteriaModel criteria()
      Expose criteria metadata like list of matchers for current attribute.
    • isBoolean

      public boolean isBoolean()
    • isInt

      public boolean isInt()
    • isShort

      public boolean isShort()
    • isChar

      public boolean isChar()
    • isByte

      public boolean isByte()
    • isLong

      public boolean isLong()
    • isStringType

      public boolean isStringType()
    • charType

      public boolean charType()
    • atNullability

      public String atNullability()
    • atNullabilityOriginal

      public String atNullabilityOriginal()
    • atNullabilityLocal

      public String atNullabilityLocal()
    • isSimpleLiteralType

      public boolean isSimpleLiteralType()
    • hasSimpleScalarElementType

      public boolean hasSimpleScalarElementType()
    • requiresAlternativeStrictConstructor

      public boolean requiresAlternativeStrictConstructor()
    • isSettable

      public boolean isSettable()
    • isGettable

      public boolean isGettable()
    • isIgnorable

      public boolean isIgnorable()
    • isOmittable

      public boolean isOmittable()
    • isMandatory

      public boolean isMandatory()
    • validation

    • hasCriteria

      public boolean hasCriteria()
      Checks if type defined by this attribute has associated criteria (see @Criteria)
    • isNullable

      public boolean isNullable()
    • isNullabilitySynthetic

      public boolean isNullabilitySynthetic()
    • isMaybeComparableKey

      public boolean isMaybeComparableKey()
    • isComparable

      public boolean isComparable()
      Overrides:
      isComparable in class TypeIntrospectionBase
    • getJsonQualiferAnnotations

      public List<CharSequence> getJsonQualiferAnnotations()
    • getAlternateSerializedNames

      public String[] getAlternateSerializedNames()
    • getSerializedName

      public String getSerializedName()
      Serialized name, actully specified via annotation
      Returns:
      name for JSON as overriden.
    • getMarshaledName

      public String getMarshaledName()
      Marshaled name for compatibility with repository.
      Returns:
      get JSON name either specified or default.
    • isGsonOther

      public boolean isGsonOther()
    • isForcedEmpty

      public boolean isForcedEmpty()
    • internalTypeMirror

      protected TypeMirror internalTypeMirror()
      Specified by:
      internalTypeMirror in class TypeIntrospectionBase
    • getType

      public String getType()
    • getAnnotations

      public List<CharSequence> getAnnotations()
    • getFieldAnnotations

      public List<CharSequence> getFieldAnnotations()
    • getConstructorParameterAnnotations

      public CharSequence getConstructorParameterAnnotations()
    • getJacksonFieldsAnnotations

      public List<CharSequence> getJacksonFieldsAnnotations()
    • jacksonPropertyAnnotation

      private CharSequence jacksonPropertyAnnotation()
    • getBuilderAttributeAnnotation

      public List<CharSequence> getBuilderAttributeAnnotation()
    • extractAnnotationsForElement

      private List<CharSequence> extractAnnotationsForElement(ElementType elementType, Set<String> additionalAnnotations)
    • isJsonIgnore

      public boolean isJsonIgnore()
    • isDataIgnore

      public boolean isDataIgnore()
    • typeParameters

      public List<String> typeParameters()
    • isMapType

      public boolean isMapType()
    • isMultimapType

      public boolean isMultimapType()
    • isListType

      public boolean isListType()
    • isSetType

      public boolean isSetType()
    • hasNaturalOrder

      public boolean hasNaturalOrder()
    • hasReverseOrder

      public boolean hasReverseOrder()
    • isSortedSetType

      public boolean isSortedSetType()
    • isSortedMapType

      public boolean isSortedMapType()
    • isGenerateSortedSet

      public boolean isGenerateSortedSet()
    • isGenerateSortedMap

      public boolean isGenerateSortedMap()
    • isGenerateSortedMultiset

      public boolean isGenerateSortedMultiset()
    • checkOrderAnnotations

      private void checkOrderAnnotations()
    • configureOrdering

      private void configureOrdering(ValueAttribute.OrderKind orderKind, String annotationName)
    • reportOrderingError

      private void reportOrderingError(String annotationName, String msg)
    • isJdkOptional

      public boolean isJdkOptional()
    • isFugueOptional

      public boolean isFugueOptional()
    • isGuavaOptional

      public boolean isGuavaOptional()
    • isJavaslangOptional

      public boolean isJavaslangOptional()
    • isJdkSpecializedOptional

      public boolean isJdkSpecializedOptional()
    • isOptionalType

      public boolean isOptionalType()
    • isCollectionType

      public boolean isCollectionType()
    • isGenerateEnumSet

      public boolean isGenerateEnumSet()
    • isGuavaImmutableDeclared

      public boolean isGuavaImmutableDeclared()
    • defaultInterface

      public String defaultInterface()
    • inferDefaultInterface

      private String inferDefaultInterface()
    • isInterfaceDefaultMethod

      public boolean isInterfaceDefaultMethod()
    • isGenerateTransientDerived

      public boolean isGenerateTransientDerived()
    • isGenerateEnumMap

      public boolean isGenerateEnumMap()
    • hasVirtualImpl

      public boolean hasVirtualImpl()
    • getUnwrappedElementType

      public String getUnwrappedElementType()
    • getUnwrappedValueElementType

      public String getUnwrappedValueElementType()
    • getWrappedElementType

      public String getWrappedElementType()
    • hasContainedElementType

      private boolean hasContainedElementType()
    • getRawType

      public String getRawType()
    • getConsumedElementType

      public String getConsumedElementType()
    • hasEnumFirstTypeParameter

      public boolean hasEnumFirstTypeParameter()
    • extractRawType

      private String extractRawType(String className)
    • isUnwrappedElementPrimitiveType

      public boolean isUnwrappedElementPrimitiveType()
    • isUnwrappedSecondaryElementPrimitiveType

      public boolean isUnwrappedSecondaryElementPrimitiveType()
    • firstTypeParameter

      public String firstTypeParameter()
    • secondTypeParameter

      public String secondTypeParameter()
    • getElementType

      public String getElementType()
    • getExpectedSubtypes

      public List<String> getExpectedSubtypes()
    • tryFindSubtypes

      private com.google.common.collect.ImmutableList<String> tryFindSubtypes(TypeElement supertypeElement)
    • isGenerateJdkOnly

      public boolean isGenerateJdkOnly()
    • isGenerateJdk9

      public boolean isGenerateJdk9()
    • isGenerateOrdinalValueSet

      public boolean isGenerateOrdinalValueSet()
    • isArrayType

      public boolean isArrayType()
    • isReferenceArrayType

      public boolean isReferenceArrayType()
    • isPrimitiveArrayType

      public boolean isPrimitiveArrayType()
    • isOptionalAcceptNullable

      public boolean isOptionalAcceptNullable()
    • introspectType

      protected void introspectType()
      Overrides:
      introspectType in class TypeIntrospectionBase
    • optionalSpecializedType

      private String optionalSpecializedType()
    • typeKind

      public AttributeTypeKind typeKind()
    • isPrimitiveWrapperType

      public boolean isPrimitiveWrapperType()
    • isRegularMarshalableType

      private static boolean isRegularMarshalableType(String name)
    • isRequiresMarshalingAdapter

      public boolean isRequiresMarshalingAdapter()
    • isRequiresMarshalingSecondaryAdapter

      public boolean isRequiresMarshalingSecondaryAdapter()
    • wrapArrayToIterable

      public boolean wrapArrayToIterable()
    • getRawCollectionType

      public String getRawCollectionType()
      Suitable for JavaDocs, intemediate name mangling and for Guava intergration.
      Returns:
      the raw collection type
    • isMultisetType

      public boolean isMultisetType()
    • isCustomCollectionType

      public boolean isCustomCollectionType()
    • getRawMapType

      public String getRawMapType()
    • getSecondaryElementType

      public String getSecondaryElementType()
    • getUnwrappedSecondaryElementType

      public String getUnwrappedSecondaryElementType()
    • getWrappedFirstElementType

      public String getWrappedFirstElementType()
    • getWrappedSecondaryElementType

      public String getWrappedSecondaryElementType()
    • getUnwrapperOrRawSecondaryElementType

      public String getUnwrapperOrRawSecondaryElementType()
    • getUnwrapperOrRawElementType

      public String getUnwrapperOrRawElementType()
    • isNumberType

      public boolean isNumberType()
    • isFloatType

      public boolean isFloatType()
    • isFloat

      public boolean isFloat()
    • isDouble

      public boolean isDouble()
    • hasTypeAnnotations

      public boolean hasTypeAnnotations()
    • isNonRawElementType

      public boolean isNonRawElementType()
    • isNonRawSecondaryElementType

      public boolean isNonRawSecondaryElementType()
    • isContainerType

      public boolean isContainerType()
    • getWrapperType

      public String getWrapperType()
    • isPrimitive

      public boolean isPrimitive()
    • isAttributeBuilder

      public boolean isAttributeBuilder()
    • getConstructorParameterOrder

      int getConstructorParameterOrder()
    • computeConstructorParameterOrder

      private int computeConstructorParameterOrder()
    • isAnnotationValueAttribute

      private boolean isAnnotationValueAttribute()
    • thereAreNoOtherMandatoryAttributes

      boolean thereAreNoOtherMandatoryAttributes()
    • toSignature

      public String toSignature()
    • getAccess

      public String getAccess()
    • getIntializerAccess

      public String getIntializerAccess()
    • isPrimitiveElement

      public boolean isPrimitiveElement()
    • isSafeUncheckedCovariantCast

      public boolean isSafeUncheckedCovariantCast()
    • isAuxiliary

      public boolean isAuxiliary()
    • isEncoding

      public boolean isEncoding()
    • isMarkedAsMongoId

      private boolean isMarkedAsMongoId()
    • isMarkedAsCriteriaId

      private boolean isMarkedAsCriteriaId()
      Is it marked as Criteria.Id ?
    • isIdAttribute

      boolean isIdAttribute()
    • isRedacted

      private boolean isRedacted()
    • isRedactedCompletely

      public boolean isRedactedCompletely()
    • getRedactedMask

      public String getRedactedMask()
    • initAndValidate

      void initAndValidate(@Nullable Instantiator.InstantiationCreator instantiationCreator)
      Initialized Validates things that were not validated otherwise
      Parameters:
      instantiationCreator - can instantiate encodings
    • validateThrowsClause

      private void validateThrowsClause()
    • collectThrownCheckedExceptions

      private com.google.common.collect.ImmutableSet<String> collectThrownCheckedExceptions()
    • getThrownCheckedExceptions

      public Set<String> getThrownCheckedExceptions()
    • initAttributeBuilder

      private void initAttributeBuilder()
    • initImmutableCopyOf

      private void initImmutableCopyOf()
    • initOrderKind

      private void initOrderKind()
    • initTypeName

      private void initTypeName()
    • initAttributeValueType

      private void initAttributeValueType()
    • canAccessImplementation

      private boolean canAccessImplementation(Proto.Protoclass p)
    • implementationModifiableType

      public String implementationModifiableType()
    • implementationType

      public String implementationType()
    • hasAttributeValue

      public boolean hasAttributeValue()
    • attributeValueKindIsCollectionOfModifiable

      public boolean attributeValueKindIsCollectionOfModifiable()
    • isAttributeValueKindCopy

      public boolean isAttributeValueKindCopy()
    • isAttributeValueKindModifyFrom

      public boolean isAttributeValueKindModifyFrom()
    • getConstructorParameters

      public Set<ValueAttribute> getConstructorParameters()
    • initTypeKind

      private void initTypeKind()
    • supportBuiltinContainerTypes

      private boolean supportBuiltinContainerTypes()
    • getWholeTypeVariable

      public ValueAttribute.WholeTypeVariable getWholeTypeVariable()
    • getSecondaryWholeTypeVariable

      public ValueAttribute.WholeTypeVariable getSecondaryWholeTypeVariable()
    • getWholeTypeVariable

      private ValueAttribute.WholeTypeVariable getWholeTypeVariable(boolean secondary)
    • hasEnumContainedElementType

      private boolean hasEnumContainedElementType()
    • getDeclaringType

      Proto.DeclaringType getDeclaringType()
    • validateTypeAndAnnotations

      private void validateTypeAndAnnotations()
    • hasNakedWildcardArguments

      private boolean hasNakedWildcardArguments()
    • isAccessorNullableAccessor

      @Nullable private NullabilityAnnotationInfo isAccessorNullableAccessor(Element element)
    • initSpecialAnnotations

      private void initSpecialAnnotations()
    • isNullableAnnotation

      private boolean isNullableAnnotation(Name simpleName, Name qualifiedName)
    • isNullableCollector

      public boolean isNullableCollector()
    • isDeferCollectionAllocation

      public boolean isDeferCollectionAllocation()
    • initMiscellaneous

      private void initMiscellaneous()
    • isValidationCustomized

      public boolean isValidationCustomized()
    • initBuilderParamsIfApplicable

      private void initBuilderParamsIfApplicable()
    • maybeInitJavaBean

      private void maybeInitJavaBean()
      Init (or override) internal attributes specific to JavaBeans
    • hasBuilderSwitcherDefault

      public boolean hasBuilderSwitcherDefault()
    • isBuilderSwitcher

      public boolean isBuilderSwitcher()
    • canUseNullAsUndefined

      public boolean canUseNullAsUndefined()
    • requiresTrackIsSet

      public boolean requiresTrackIsSet()
    • getEnumElements

      public Collection<TypeElement> getEnumElements()
    • hasConstructorParameterCustomOrder

      boolean hasConstructorParameterCustomOrder()
    • protoclass

      private Proto.Protoclass protoclass()
    • getGenericArgs

      public String getGenericArgs()
    • getAttributeBuilderDescriptor

      public AttributeBuilderDescriptor getAttributeBuilderDescriptor()
    • report

      Reporter report()
    • getTypeTokenOfElement

      public CharSequence getTypeTokenOfElement()
    • getTypeTokenOfSecondaryElement

      public CharSequence getTypeTokenOfSecondaryElement()
    • originalElement

      public Element originalElement()
    • originalTypeElement

      public Element originalTypeElement()
    • style

      public StyleInfo style()
      Specified by:
      style in interface HasStyleInfo
    • supportsInternalImplConstructor

      public boolean supportsInternalImplConstructor()
    • fieldInjectedAnnotations

      public Collection<String> fieldInjectedAnnotations()
    • accessorInjectedAnnotations

      public Collection<String> accessorInjectedAnnotations()
    • syntheticFieldsInjectedAnnotations

      public Collection<String> syntheticFieldsInjectedAnnotations()
    • initializerInjectedAnnotations

      public Collection<String> initializerInjectedAnnotations()
    • constructorParameterInjectedAnnotations

      public Collection<String> constructorParameterInjectedAnnotations()
    • elementInitializerInjectedAnnotations

      public Collection<String> elementInitializerInjectedAnnotations()
    • collectInjections

      private Collection<String> collectInjections(AnnotationInjections.InjectAnnotation.Where target)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • initNullabilitySupertype

      void initNullabilitySupertype(ExecutableElement accessor)
    • isNullableInSupertype

      public boolean isNullableInSupertype()
    • atNullableInSupertypeLocal

      public String atNullableInSupertypeLocal()
    • limitLengthInToString

      public int limitLengthInToString()
    • shouldLimitLengthInToString

      public boolean shouldLimitLengthInToString()
    • isBeanFriendlyModifiable

      public boolean isBeanFriendlyModifiable()