Class 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 Detail

      • CONSTRUCTOR_PARAMETER_DEFAULT_ORDER

        private static final int CONSTRUCTOR_PARAMETER_DEFAULT_ORDER
        See Also:
        Constant Field Values
      • CONSTRUCTOR_NOT_A_PARAMETER

        private static final int CONSTRUCTOR_NOT_A_PARAMETER
        See Also:
        Constant Field Values
      • GUAVA_IMMUTABLE_PREFIX

        private static final java.lang.String GUAVA_IMMUTABLE_PREFIX
      • VALUE_ATTRIBUTE_NAME

        private static final java.lang.String VALUE_ATTRIBUTE_NAME
        See Also:
        Constant Field Values
      • ID_ATTRIBUTE_NAME

        private static final java.lang.String ID_ATTRIBUTE_NAME
        See Also:
        Constant Field Values
      • EMPTY_SERIALIZED_NAMES

        private static final java.lang.String[] EMPTY_SERIALIZED_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<java.lang.String> typeParameters
      • containingType

        public ValueType containingType
      • attributeValueType

        @Nullable
        public ValueType attributeValueType
      • returnType

        javax.lang.model.type.TypeMirror returnType
      • element

        javax.lang.model.element.Element element
      • returnTypeName

        java.lang.String returnTypeName
      • hasEnumFirstTypeParameter

        public boolean hasEnumFirstTypeParameter
      • containedTypeElement

        @Nullable
        javax.lang.model.element.TypeElement containedTypeElement
      • containedSecondaryTypeElement

        @Nullable
        private javax.lang.model.element.TypeElement containedSecondaryTypeElement
      • generateOrdinalValueSet

        private boolean generateOrdinalValueSet
      • arrayComponent

        private javax.lang.model.type.TypeMirror arrayComponent
      • rawTypeName

        @Nullable
        private java.lang.String rawTypeName
      • docComment

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

        public boolean deprecated
      • jsonQualifierAnnotations

        private java.util.List<java.lang.CharSequence> jsonQualifierAnnotations
      • serializedName

        @Nullable
        private java.lang.String serializedName
      • alternateSerializedNames

        private java.lang.String[] alternateSerializedNames
      • isGsonOther

        @Nullable
        private java.lang.Boolean isGsonOther
      • defaultInterface

        @Nullable
        private java.lang.String defaultInterface
      • expectedSubtypes

        @Nullable
        private java.util.List<java.lang.String> expectedSubtypes
      • parameterOrder

        private int parameterOrder
      • jacksonAnyGetter

        public boolean jacksonAnyGetter
      • jacksonValue

        public boolean jacksonValue
      • hasTypeVariables

        public boolean hasTypeVariables
      • thrownCheckedExceptions

        private java.util.Set<java.lang.String> thrownCheckedExceptions
      • isSuppressedOptional

        public boolean isSuppressedOptional
      • builderSwitcherModel

        @Nullable
        public SwitcherModel builderSwitcherModel
      • isBuilderParameter

        public boolean isBuilderParameter
      • hasSomeUnresolvedTypes

        boolean hasSomeUnresolvedTypes
      • isGenerateImmutableCopyOf

        public boolean isGenerateImmutableCopyOf
    • Constructor Detail

      • ValueAttribute

        public ValueAttribute()
    • Method Detail

      • name

        public java.lang.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 java.lang.String atNullability()
      • atNullabilityOriginal

        public java.lang.String atNullabilityOriginal()
      • atNullabilityLocal

        public java.lang.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()
      • 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()
      • getJsonQualiferAnnotations

        public java.util.List<java.lang.CharSequence> getJsonQualiferAnnotations()
      • getAlternateSerializedNames

        public java.lang.String[] getAlternateSerializedNames()
      • getSerializedName

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

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

        public boolean isGsonOther()
      • isForcedEmpty

        public boolean isForcedEmpty()
      • getType

        public java.lang.String getType()
      • getAnnotations

        public java.util.List<java.lang.CharSequence> getAnnotations()
      • getFieldAnnotations

        public java.util.List<java.lang.CharSequence> getFieldAnnotations()
      • getConstructorParameterAnnotations

        public java.lang.CharSequence getConstructorParameterAnnotations()
      • getJacksonFieldsAnnotations

        public java.util.List<java.lang.CharSequence> getJacksonFieldsAnnotations()
      • jacksonPropertyAnnotation

        private java.lang.CharSequence jacksonPropertyAnnotation()
      • getBuilderAttributeAnnotation

        public java.util.List<java.lang.CharSequence> getBuilderAttributeAnnotation()
      • extractAnnotationsForElement

        private java.util.List<java.lang.CharSequence> extractAnnotationsForElement​(java.lang.annotation.ElementType elementType,
                                                                                    java.util.Set<java.lang.String> additionalAnnotations)
      • isJsonIgnore

        public boolean isJsonIgnore()
      • isDataIgnore

        public boolean isDataIgnore()
      • typeParameters

        public java.util.List<java.lang.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,
                                       java.lang.String annotationName)
      • reportOrderingError

        private void reportOrderingError​(java.lang.String annotationName,
                                         java.lang.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 java.lang.String defaultInterface()
      • inferDefaultInterface

        private java.lang.String inferDefaultInterface()
      • isInterfaceDefaultMethod

        public boolean isInterfaceDefaultMethod()
      • isGenerateTransientDerived

        public boolean isGenerateTransientDerived()
      • isGenerateEnumMap

        public boolean isGenerateEnumMap()
      • hasVirtualImpl

        public boolean hasVirtualImpl()
      • getUnwrappedElementType

        public java.lang.String getUnwrappedElementType()
      • getUnwrappedValueElementType

        public java.lang.String getUnwrappedValueElementType()
      • getWrappedElementType

        public java.lang.String getWrappedElementType()
      • hasContainedElementType

        private boolean hasContainedElementType()
      • getRawType

        public java.lang.String getRawType()
      • getConsumedElementType

        public java.lang.String getConsumedElementType()
      • hasEnumFirstTypeParameter

        public boolean hasEnumFirstTypeParameter()
      • extractRawType

        private java.lang.String extractRawType​(java.lang.String className)
      • isUnwrappedElementPrimitiveType

        public boolean isUnwrappedElementPrimitiveType()
      • isUnwrappedSecondaryElementPrimitiveType

        public boolean isUnwrappedSecondaryElementPrimitiveType()
      • firstTypeParameter

        public java.lang.String firstTypeParameter()
      • secondTypeParameter

        public java.lang.String secondTypeParameter()
      • getElementType

        public java.lang.String getElementType()
      • getExpectedSubtypes

        public java.util.List<java.lang.String> getExpectedSubtypes()
      • tryFindSubtypes

        private com.google.common.collect.ImmutableList<java.lang.String> tryFindSubtypes​(javax.lang.model.element.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()
      • optionalSpecializedType

        private java.lang.String optionalSpecializedType()
      • isPrimitiveWrapperType

        public boolean isPrimitiveWrapperType()
      • isRegularMarshalableType

        private static boolean isRegularMarshalableType​(java.lang.String name)
      • isRequiresMarshalingAdapter

        public boolean isRequiresMarshalingAdapter()
      • isRequiresMarshalingSecondaryAdapter

        public boolean isRequiresMarshalingSecondaryAdapter()
      • wrapArrayToIterable

        public boolean wrapArrayToIterable()
      • getRawCollectionType

        public java.lang.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 java.lang.String getRawMapType()
      • getSecondaryElementType

        public java.lang.String getSecondaryElementType()
      • getUnwrappedSecondaryElementType

        public java.lang.String getUnwrappedSecondaryElementType()
      • getWrappedFirstElementType

        public java.lang.String getWrappedFirstElementType()
      • getWrappedSecondaryElementType

        public java.lang.String getWrappedSecondaryElementType()
      • getUnwrapperOrRawSecondaryElementType

        public java.lang.String getUnwrapperOrRawSecondaryElementType()
      • getUnwrapperOrRawElementType

        public java.lang.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 java.lang.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 java.lang.String toSignature()
      • getAccess

        public java.lang.String getAccess()
      • getIntializerAccess

        public java.lang.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 java.lang.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<java.lang.String> collectThrownCheckedExceptions()
      • getThrownCheckedExceptions

        public java.util.Set<java.lang.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 java.lang.String implementationModifiableType()
      • implementationType

        public java.lang.String implementationType()
      • hasAttributeValue

        public boolean hasAttributeValue()
      • attributeValueKindIsCollectionOfModifiable

        public boolean attributeValueKindIsCollectionOfModifiable()
      • isAttributeValueKindCopy

        public boolean isAttributeValueKindCopy()
      • isAttributeValueKindModifyFrom

        public boolean isAttributeValueKindModifyFrom()
      • getConstructorParameters

        public java.util.Set<ValueAttribute> getConstructorParameters()
      • initTypeKind

        private void initTypeKind()
      • supportBuiltinContainerTypes

        private boolean supportBuiltinContainerTypes()
      • hasEnumContainedElementType

        private boolean hasEnumContainedElementType()
      • validateTypeAndAnnotations

        private void validateTypeAndAnnotations()
      • hasNakedWildcardArguments

        private boolean hasNakedWildcardArguments()
      • isAccessorNullableAccessor

        @Nullable
        private NullabilityAnnotationInfo isAccessorNullableAccessor​(javax.lang.model.element.Element element)
      • initSpecialAnnotations

        private void initSpecialAnnotations()
      • isNullableAnnotation

        private boolean isNullableAnnotation​(javax.lang.model.element.Name simpleName,
                                             javax.lang.model.element.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 java.util.Collection<javax.lang.model.element.TypeElement> getEnumElements()
      • hasConstructorParameterCustomOrder

        boolean hasConstructorParameterCustomOrder()
      • getGenericArgs

        public java.lang.String getGenericArgs()
      • getTypeTokenOfElement

        public java.lang.CharSequence getTypeTokenOfElement()
      • getTypeTokenOfSecondaryElement

        public java.lang.CharSequence getTypeTokenOfSecondaryElement()
      • originalElement

        public javax.lang.model.element.Element originalElement()
      • originalTypeElement

        public javax.lang.model.element.Element originalTypeElement()
      • supportsInternalImplConstructor

        public boolean supportsInternalImplConstructor()
      • fieldInjectedAnnotations

        public java.util.Collection<java.lang.String> fieldInjectedAnnotations()
      • accessorInjectedAnnotations

        public java.util.Collection<java.lang.String> accessorInjectedAnnotations()
      • syntheticFieldsInjectedAnnotations

        public java.util.Collection<java.lang.String> syntheticFieldsInjectedAnnotations()
      • initializerInjectedAnnotations

        public java.util.Collection<java.lang.String> initializerInjectedAnnotations()
      • constructorParameterInjectedAnnotations

        public java.util.Collection<java.lang.String> constructorParameterInjectedAnnotations()
      • elementInitializerInjectedAnnotations

        public java.util.Collection<java.lang.String> elementInitializerInjectedAnnotations()
      • toString

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

        void initNullabilitySupertype​(javax.lang.model.element.ExecutableElement accessor)
      • isNullableInSupertype

        public boolean isNullableInSupertype()
      • atNullableInSupertypeLocal

        public java.lang.String atNullableInSupertypeLocal()
      • limitLengthInToString

        public int limitLengthInToString()
      • shouldLimitLengthInToString

        public boolean shouldLimitLengthInToString()
      • isBeanFriendlyModifiable

        public boolean isBeanFriendlyModifiable()