Package io.protostuff.compiler.model
Class Field
- java.lang.Object
-
- io.protostuff.compiler.model.AbstractElement
-
- io.protostuff.compiler.model.AbstractDescriptor
-
- io.protostuff.compiler.model.Field
-
- All Implemented Interfaces:
Descriptor,Element
public class Field extends AbstractDescriptor
Field node.- Author:
- Kostiantyn Shchepanovskyi
-
-
Field Summary
Fields Modifier and Type Field Description static DynamicMessage.ValueDV_TRUEprotected intindexstatic intMAX_TAG_VALUEprotected FieldModifiermodifierprotected inttagprotected FieldTypetypeprotected StringtypeName-
Fields inherited from class io.protostuff.compiler.model.AbstractDescriptor
name, options
-
Fields inherited from class io.protostuff.compiler.model.AbstractElement
comments, sourceCodeLocation
-
-
Constructor Summary
Constructors Constructor Description Field(FieldContainer parent)Create a field instance for given parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DescriptorTypegetDescriptorType()intgetIndex()Field index in the container (order, starting from 1).FieldModifiergetModifier()OneofgetOneof()FieldContainergetParent()intgetTag()FieldTypegetType()StringgetTypeName()booleanhasModifier()booleanisMap()Returns true if this message is generated by parser as a holder for a map entries.booleanisOneofPart()booleanisRepeated()Test if this field is `repeated`.voidsetIndex(int index)voidsetModifier(FieldModifier modifier)voidsetOneof(Oneof oneof)voidsetParent(Message parent)voidsetTag(int tag)voidsetType(FieldType type)voidsetTypeName(String typeName)StringtoString()-
Methods inherited from class io.protostuff.compiler.model.AbstractDescriptor
getName, getOptions, setName
-
Methods inherited from class io.protostuff.compiler.model.AbstractElement
addComment, getCommentLines, getComments, getSourceCodeLocation, setComments, setSourceCodeLocation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.protostuff.compiler.model.Element
getCommentLines, getComments, getSourceCodeLocation
-
-
-
-
Field Detail
-
MAX_TAG_VALUE
public static final int MAX_TAG_VALUE
- See Also:
- Constant Field Values
-
DV_TRUE
public static final DynamicMessage.Value DV_TRUE
-
modifier
protected FieldModifier modifier
-
typeName
protected String typeName
-
type
protected FieldType type
-
tag
protected int tag
-
index
protected int index
-
-
Constructor Detail
-
Field
public Field(FieldContainer parent)
Create a field instance for given parent. If parent is an oneof, also set field as oneof field.
-
-
Method Detail
-
getParent
public FieldContainer getParent()
-
setParent
public void setParent(Message parent)
-
getModifier
public FieldModifier getModifier()
-
setModifier
public void setModifier(FieldModifier modifier)
-
hasModifier
public boolean hasModifier()
-
getTypeName
public String getTypeName()
-
setTypeName
public void setTypeName(String typeName)
-
getTag
public int getTag()
-
setTag
public void setTag(int tag)
-
getType
public FieldType getType()
-
setType
public void setType(FieldType type)
-
getIndex
public int getIndex()
Field index in the container (order, starting from 1).
-
setIndex
public void setIndex(int index)
-
getOneof
public Oneof getOneof()
-
setOneof
public void setOneof(Oneof oneof)
-
isOneofPart
public boolean isOneofPart()
-
isRepeated
public boolean isRepeated()
Test if this field is `repeated`.
-
isMap
public boolean isMap()
Returns true if this message is generated by parser as a holder for a map entries.
-
getDescriptorType
public DescriptorType getDescriptorType()
-
-