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