Class FieldDescriptor
- java.lang.Object
-
- org.infinispan.protostream.impl.AnnotatedDescriptorImpl
-
- org.infinispan.protostream.descriptors.FieldDescriptor
-
- All Implemented Interfaces:
AnnotatedDescriptor
public final class FieldDescriptor extends AnnotatedDescriptorImpl implements AnnotatedDescriptor
Represents a field in a proto file.- Since:
- 2.0
- Author:
- gustavonalle, anistor@redhat.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldDescriptor.Builder
-
Field Summary
-
Fields inherited from class org.infinispan.protostream.impl.AnnotatedDescriptorImpl
annotations, documentation, fullName, name, processedAnnotations
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AnnotationConfiguration
getAnnotationConfig(AnnotationElement.Annotation annotation)
Subclasses are responsible for fetching theAnnotationConfiguration
from the appropriate config (it it exists) and to validate that the target is suitable.Descriptor
getContainingMessage()
Object
getDefaultValue()
EnumDescriptor
getEnumType()
FileDescriptor
getFileDescriptor()
Return the containing files's descriptorJavaType
getJavaType()
Label
getLabel()
Descriptor
getMessageType()
int
getNumber()
Option
getOption(String name)
Object
getOptionByName(String name)
List<Option>
getOptions()
Type
getType()
String
getTypeName()
int
getWireTag()
boolean
hasDefaultValue()
boolean
isExtension()
boolean
isPacked()
boolean
isRepeated()
boolean
isRequired()
String
toString()
-
Methods inherited from class org.infinispan.protostream.impl.AnnotatedDescriptorImpl
getAnnotations, getAnnotationsConfig, getDocumentation, getFullName, getName, getProcessedAnnotation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.protostream.descriptors.AnnotatedDescriptor
getAnnotations, getDocumentation, getFullName, getName, getProcessedAnnotation
-
-
-
-
Method Detail
-
getNumber
public int getNumber()
-
getWireTag
public int getWireTag()
-
getType
public Type getType()
-
getMessageType
public Descriptor getMessageType()
-
getLabel
public Label getLabel()
-
isRequired
public boolean isRequired()
-
isRepeated
public boolean isRepeated()
-
isPacked
public boolean isPacked()
-
getDefaultValue
public Object getDefaultValue()
-
isExtension
public boolean isExtension()
-
hasDefaultValue
public boolean hasDefaultValue()
-
getJavaType
public JavaType getJavaType()
-
getEnumType
public EnumDescriptor getEnumType()
-
getTypeName
public String getTypeName()
-
getFileDescriptor
public FileDescriptor getFileDescriptor()
Description copied from interface:AnnotatedDescriptor
Return the containing files's descriptor- Specified by:
getFileDescriptor
in interfaceAnnotatedDescriptor
- Returns:
- the containing files's descriptor (never
null
)
-
getContainingMessage
public Descriptor getContainingMessage()
-
getAnnotationConfig
protected AnnotationConfiguration getAnnotationConfig(AnnotationElement.Annotation annotation)
Description copied from class:AnnotatedDescriptorImpl
Subclasses are responsible for fetching theAnnotationConfiguration
from the appropriate config (it it exists) and to validate that the target is suitable.- Specified by:
getAnnotationConfig
in classAnnotatedDescriptorImpl
- Returns:
- null if the annotation is not found
-
-