Package io.protostuff.compiler.model
Class Message
- java.lang.Object
-
- io.protostuff.compiler.model.AbstractElement
-
- io.protostuff.compiler.model.AbstractDescriptor
-
- io.protostuff.compiler.model.AbstractUserTypeContainer
-
- io.protostuff.compiler.model.Message
-
- All Implemented Interfaces:
Descriptor,Element,EnumContainer,ExtensionContainer,FieldContainer,FieldType,GroupContainer,MessageContainer,Type,UserType,UserTypeContainer
- Direct Known Subclasses:
Group
public class Message extends AbstractUserTypeContainer implements UserType, UserTypeContainer, FieldContainer, GroupContainer
Message node.- Author:
- Kostiantyn Shchepanovskyi
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Range>extensionRangesprotected List<Field>fieldsprotected StringfullyQualifiedNameprotected List<Group>groupsprotected List<Oneof>oneofsprotected Protoprotoprotected List<String>reservedFieldNamesprotected List<Range>reservedFieldRanges-
Fields inherited from class io.protostuff.compiler.model.AbstractUserTypeContainer
declaredExtensions, enums, messages, parent
-
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 Message(UserTypeContainer parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtensionRange(Range range)voidaddField(Field field)voidaddGroup(Group group)voidaddOneof(Oneof oneof)voidaddReservedFieldName(String name)voidaddReservedFieldRange(Range range)StringgetCanonicalName()ReturnsFieldType.getFullyQualifiedName()without leading dot.DescriptorTypegetDescriptorType()List<Range>getExtensionRanges()FieldgetField(int tag)FieldgetField(String name)intgetFieldCount()List<Field>getFields()Returns all fields in this message, including group fields and oneof fields.StringgetFullyQualifiedName()Returns fully qualified name for this user type.List<Group>getGroups()StringgetNamespace()Returns string prefix that is common for all children full names.OneofgetOneof(String name)Get oneof node by it's name.List<Oneof>getOneofs()ProtogetProto()List<String>getReservedFieldNames()List<Range>getReservedFieldRanges()booleanisEnum()Test if this type is enum.booleanisMap()Test if this type is map.booleanisMapEntry()booleanisMessage()Test if this type is message.booleanisNested()Test if this type is nested (declared inside of other message).booleanisScalar()Test if this type is scalar.voidsetExtensionRanges(List<Range> extensionRanges)voidsetFields(List<Field> fields)voidsetFullyQualifiedName(String fullyQualifiedName)voidsetGroups(List<Group> groups)voidsetOneofs(List<Oneof> oneofs)voidsetProto(Proto proto)voidsetReservedFieldNames(List<String> reservedFieldNames)voidsetReservedFieldRanges(List<Range> reservedFieldRanges)StringtoString()-
Methods inherited from class io.protostuff.compiler.model.AbstractUserTypeContainer
addDeclaredExtension, addEnum, addMessage, getDeclaredExtensions, getEnums, getMessages, getParent, setEnums
-
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.Descriptor
getOptions
-
Methods inherited from interface io.protostuff.compiler.model.Element
getCommentLines, getComments, getSourceCodeLocation
-
Methods inherited from interface io.protostuff.compiler.model.EnumContainer
addEnum, getEnum, getEnums
-
Methods inherited from interface io.protostuff.compiler.model.ExtensionContainer
addDeclaredExtension, getDeclaredExtensions
-
Methods inherited from interface io.protostuff.compiler.model.MessageContainer
addMessage, getMessage, getMessages
-
-
-
-
Constructor Detail
-
Message
public Message(UserTypeContainer parent)
-
-
Method Detail
-
getDescriptorType
public DescriptorType getDescriptorType()
- Specified by:
getDescriptorTypein interfaceDescriptor
-
getFields
public List<Field> getFields()
Returns all fields in this message, including group fields and oneof fields.- Specified by:
getFieldsin interfaceFieldContainer
-
setFields
public void setFields(List<Field> fields)
- Specified by:
setFieldsin interfaceFieldContainer
-
addField
public void addField(Field field)
- Specified by:
addFieldin interfaceFieldContainer
-
getField
public Field getField(String name)
- Specified by:
getFieldin interfaceFieldContainer
-
getField
public Field getField(int tag)
- Specified by:
getFieldin interfaceFieldContainer
-
addOneof
public void addOneof(Oneof oneof)
-
getFullyQualifiedName
public String getFullyQualifiedName()
Description copied from interface:UserTypeReturns fully qualified name for this user type. It always starts with dot.- Specified by:
getFullyQualifiedNamein interfaceFieldType- Specified by:
getFullyQualifiedNamein interfaceType- Specified by:
getFullyQualifiedNamein interfaceUserType
-
setFullyQualifiedName
public void setFullyQualifiedName(String fullyQualifiedName)
- Specified by:
setFullyQualifiedNamein interfaceUserType
-
getCanonicalName
public String getCanonicalName()
Description copied from interface:FieldTypeReturnsFieldType.getFullyQualifiedName()without leading dot.- Specified by:
getCanonicalNamein interfaceFieldType- Specified by:
getCanonicalNamein interfaceType
-
isNested
public boolean isNested()
Description copied from interface:UserTypeTest if this type is nested (declared inside of other message).
-
isScalar
public boolean isScalar()
Description copied from interface:FieldTypeTest if this type is scalar.
-
isEnum
public boolean isEnum()
Description copied from interface:FieldTypeTest if this type is enum.
-
isMessage
public boolean isMessage()
Description copied from interface:FieldTypeTest if this type is message.
-
isMap
public boolean isMap()
Description copied from interface:FieldTypeTest if this type is map.
-
getNamespace
public String getNamespace()
Description copied from interface:UserTypeContainerReturns string prefix that is common for all children full names. For root container it is a dot if package is not set.- Specified by:
getNamespacein interfaceUserTypeContainer
-
getGroups
public List<Group> getGroups()
- Specified by:
getGroupsin interfaceGroupContainer
-
setGroups
public void setGroups(List<Group> groups)
- Specified by:
setGroupsin interfaceGroupContainer
-
addGroup
public void addGroup(Group group)
- Specified by:
addGroupin interfaceGroupContainer
-
addExtensionRange
public void addExtensionRange(Range range)
-
getReservedFieldRanges
public List<Range> getReservedFieldRanges()
- Specified by:
getReservedFieldRangesin interfaceUserType
-
addReservedFieldRange
public void addReservedFieldRange(Range range)
- Specified by:
addReservedFieldRangein interfaceUserType
-
getReservedFieldNames
public List<String> getReservedFieldNames()
- Specified by:
getReservedFieldNamesin interfaceUserType
-
addReservedFieldName
public void addReservedFieldName(String name)
- Specified by:
addReservedFieldNamein interfaceUserType
-
getFieldCount
public int getFieldCount()
- Specified by:
getFieldCountin interfaceFieldContainer
-
isMapEntry
public boolean isMapEntry()
-
-