@NotThreadSafe public abstract class AbstractThriftMetadataBuilder extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<com.facebook.swift.codec.metadata.MethodInjection> |
builderMethodInjections |
protected java.lang.reflect.Type |
builderType |
protected ThriftCatalog |
catalog |
protected java.util.List<com.facebook.swift.codec.metadata.ConstructorInjection> |
constructorInjections |
protected java.util.List<java.lang.String> |
documentation |
protected java.util.List<com.facebook.swift.codec.metadata.Extractor> |
extractors |
protected java.util.List<com.facebook.swift.codec.metadata.FieldInjection> |
fieldInjections |
protected java.util.List<com.facebook.swift.codec.metadata.FieldMetadata> |
fields |
protected MetadataErrors |
metadataErrors |
protected java.util.List<com.facebook.swift.codec.metadata.MethodInjection> |
methodInjections |
protected java.lang.String |
structName |
protected java.lang.reflect.Type |
structType |
Modifier | Constructor and Description |
---|---|
protected |
AbstractThriftMetadataBuilder(ThriftCatalog catalog,
java.lang.reflect.Type structType) |
Modifier and Type | Method and Description |
---|---|
protected void |
addBuilderMethods() |
protected void |
addConstructors(java.lang.reflect.Type type) |
protected void |
addField(java.lang.reflect.Field fieldField,
boolean allowReaders,
boolean allowWriters) |
protected void |
addFields(java.lang.Class<?> clazz,
boolean allowReaders,
boolean allowWriters) |
protected void |
addMethod(java.lang.reflect.Type type,
java.lang.reflect.Method method,
boolean allowReaders,
boolean allowWriters) |
protected void |
addMethods(java.lang.reflect.Type type,
boolean allowReaders,
boolean allowWriters) |
abstract ThriftStructMetadata |
build() |
protected ThriftMethodInjection |
buildBuilderConstructorInjections() |
protected abstract ThriftFieldMetadata |
buildField(java.util.Collection<com.facebook.swift.codec.metadata.FieldMetadata> input) |
protected java.lang.Iterable<ThriftFieldMetadata> |
buildFieldInjections() |
protected java.util.List<ThriftMethodInjection> |
buildMethodInjections() |
protected java.util.List<ThriftParameterInjection> |
buildParameterInjections(java.util.List<com.facebook.swift.codec.metadata.ParameterInjection> parameters) |
protected abstract java.lang.Class<?> |
extractBuilderClass() |
protected java.lang.String |
extractFieldName(short id,
java.util.Collection<com.facebook.swift.codec.metadata.FieldMetadata> fields) |
protected com.facebook.swift.codec.ThriftField.Requiredness |
extractFieldRequiredness(short fieldId,
java.lang.String fieldName,
java.util.Collection<com.facebook.swift.codec.metadata.FieldMetadata> fields) |
protected void |
extractFromConstructors() |
protected void |
extractFromFields() |
protected void |
extractFromMethods() |
protected abstract java.lang.String |
extractName() |
java.lang.Class<?> |
getBuilderClass() |
MetadataErrors |
getMetadataErrors() |
protected java.util.List<com.facebook.swift.codec.metadata.ParameterInjection> |
getParameterInjections(java.lang.reflect.Type type,
java.lang.annotation.Annotation[][] parameterAnnotations,
java.lang.reflect.Type[] parameterTypes,
java.lang.String[] parameterNames) |
java.lang.Class<?> |
getStructClass() |
protected boolean |
hasThriftFieldAnnotation(java.lang.reflect.Method method) |
protected java.util.Set<java.lang.String> |
inferThriftFieldIds()
Assigns all fields an id if possible.
|
protected void |
inferThriftFieldIds(com.google.common.collect.Multimap<java.lang.String,com.facebook.swift.codec.metadata.FieldMetadata> fieldsByName,
java.util.Set<java.lang.String> fieldsWithConflictingIds) |
protected boolean |
isValidateGetter(java.lang.reflect.Method method) |
protected abstract boolean |
isValidateSetter(java.lang.reflect.Method method) |
protected void |
normalizeThriftFields(ThriftCatalog catalog) |
protected abstract void |
validateConstructors() |
protected void |
verifyClass(java.lang.Class<? extends java.lang.annotation.Annotation> annotation) |
protected void |
verifyFieldType(short id,
java.lang.String name,
java.util.Collection<com.facebook.swift.codec.metadata.FieldMetadata> fields,
ThriftCatalog catalog)
Verifies that the the fields all have a supported Java type and that all fields map to the
exact same ThriftType.
|
protected final java.lang.String structName
protected final java.lang.reflect.Type structType
protected final java.lang.reflect.Type builderType
protected final java.util.List<java.lang.String> documentation
protected final java.util.List<com.facebook.swift.codec.metadata.FieldMetadata> fields
protected final java.util.List<com.facebook.swift.codec.metadata.Extractor> extractors
protected final java.util.List<com.facebook.swift.codec.metadata.MethodInjection> builderMethodInjections
protected final java.util.List<com.facebook.swift.codec.metadata.ConstructorInjection> constructorInjections
protected final java.util.List<com.facebook.swift.codec.metadata.FieldInjection> fieldInjections
protected final java.util.List<com.facebook.swift.codec.metadata.MethodInjection> methodInjections
protected final ThriftCatalog catalog
protected final MetadataErrors metadataErrors
protected AbstractThriftMetadataBuilder(ThriftCatalog catalog, java.lang.reflect.Type structType)
protected abstract java.lang.String extractName()
protected abstract java.lang.Class<?> extractBuilderClass()
protected abstract void validateConstructors()
protected abstract boolean isValidateSetter(java.lang.reflect.Method method)
protected abstract ThriftFieldMetadata buildField(java.util.Collection<com.facebook.swift.codec.metadata.FieldMetadata> input)
public abstract ThriftStructMetadata build()
public MetadataErrors getMetadataErrors()
public java.lang.Class<?> getStructClass()
public java.lang.Class<?> getBuilderClass()
protected final void verifyClass(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
protected final void extractFromConstructors()
protected final void addConstructors(java.lang.reflect.Type type)
protected final void addBuilderMethods()
protected final void extractFromFields()
protected final void addFields(java.lang.Class<?> clazz, boolean allowReaders, boolean allowWriters)
protected final void addField(java.lang.reflect.Field fieldField, boolean allowReaders, boolean allowWriters)
protected final void extractFromMethods()
protected final void addMethods(java.lang.reflect.Type type, boolean allowReaders, boolean allowWriters)
protected final void addMethod(java.lang.reflect.Type type, java.lang.reflect.Method method, boolean allowReaders, boolean allowWriters)
protected final boolean hasThriftFieldAnnotation(java.lang.reflect.Method method)
protected final boolean isValidateGetter(java.lang.reflect.Method method)
protected final java.util.List<com.facebook.swift.codec.metadata.ParameterInjection> getParameterInjections(java.lang.reflect.Type type, java.lang.annotation.Annotation[][] parameterAnnotations, java.lang.reflect.Type[] parameterTypes, java.lang.String[] parameterNames)
protected final void normalizeThriftFields(ThriftCatalog catalog)
protected final java.util.Set<java.lang.String> inferThriftFieldIds()
protected final void inferThriftFieldIds(com.google.common.collect.Multimap<java.lang.String,com.facebook.swift.codec.metadata.FieldMetadata> fieldsByName, java.util.Set<java.lang.String> fieldsWithConflictingIds)
protected final java.lang.String extractFieldName(short id, java.util.Collection<com.facebook.swift.codec.metadata.FieldMetadata> fields)
protected final com.facebook.swift.codec.ThriftField.Requiredness extractFieldRequiredness(short fieldId, java.lang.String fieldName, java.util.Collection<com.facebook.swift.codec.metadata.FieldMetadata> fields)
protected final void verifyFieldType(short id, java.lang.String name, java.util.Collection<com.facebook.swift.codec.metadata.FieldMetadata> fields, ThriftCatalog catalog)
protected final ThriftMethodInjection buildBuilderConstructorInjections()
protected final java.lang.Iterable<ThriftFieldMetadata> buildFieldInjections()
protected final java.util.List<ThriftMethodInjection> buildMethodInjections()
protected final java.util.List<ThriftParameterInjection> buildParameterInjections(java.util.List<com.facebook.swift.codec.metadata.ParameterInjection> parameters)
Copyright © 2019. All rights reserved.