public class MessageType extends ProtoContainerElement
| Modifier and Type | Method and Description |
|---|---|
static MessageType |
create(ProtoContainerElement parent,
com.google.protobuf.DescriptorProtos.DescriptorProto proto,
java.lang.String path,
ExtensionPool extensionPool)
Creates a message backed up by the given proto.
|
java.lang.Iterable<Field> |
getCyclicFields()
Returns all fields which have cyclic types.
|
com.google.common.collect.ImmutableList<Field> |
getFields()
Returns all fields.
|
java.lang.Iterable<Field> |
getMapFields()
Returns all fields which are maps.
|
java.lang.Iterable<Field> |
getMessageFields()
Returns all fields which have message type.
|
java.lang.Iterable<Field> |
getNonCyclicFields()
Returns all fields which have non-cyclic types.
|
java.lang.Iterable<Field> |
getNonMessageFields()
Returns all fields which have non-message type.
|
java.lang.Iterable<Field> |
getNonOneofScopedFields()
Returns all fields which are not oneof-scoped.
|
java.lang.Iterable<Field> |
getNonRepeatedFields()
Returns all fields which are not repeated.
|
com.google.common.collect.ImmutableList<Oneof> |
getOneofs()
Returns all oneofs associated with this type.
|
java.lang.Iterable<Field> |
getOneofScopedFields()
Returns all fields which are oneof-scoped.
|
java.util.Map<com.google.protobuf.Descriptors.FieldDescriptor,java.lang.Object> |
getOptionFields()
Return this element's options from the proto.
|
com.google.protobuf.DescriptorProtos.DescriptorProto |
getProto()
Returns the underlying proto representation.
|
java.lang.Iterable<Field> |
getReachableFields()
Returns the fields reachable with the active scoper.
|
java.lang.Iterable<Field> |
getRepeatedFields()
Returns all fields which are repeated.
|
boolean |
isCyclic()
Returns true if this message or one of its sub-messages refers back to this message.
|
boolean |
isDeprecated()
Returns true if this object represents something that is configured as deprecated.
|
boolean |
isExtensible()
Returns true if this type can be extended.
|
boolean |
isMapEntry()
Returns true if the type is generated for Map entry.
|
Field |
lookupField(java.lang.String name)
Looks up the field by its name.
|
void |
setFieldByNameMap(com.google.common.collect.ImmutableMap<java.lang.String,Field> fieldByName)
For setting the field-by-name map.
|
void |
setOneofs(com.google.common.collect.ImmutableList<Oneof> oneofs)
For setting the oneofs list.
|
java.lang.String |
toString() |
buildChildren, getEnums, getMessagesgetFile, getFullName, getLocation, getModel, getParent, getSimpleName, getSyntax, isReachableaddAttribute, getAttribute, getAttributeOrDefault, hasAttribute, putAttribute, removeAttributepublic static MessageType create(ProtoContainerElement parent, com.google.protobuf.DescriptorProtos.DescriptorProto proto, java.lang.String path, ExtensionPool extensionPool)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isDeprecated()
isDeprecated in class ProtoElementpublic com.google.protobuf.DescriptorProtos.DescriptorProto getProto()
public java.util.Map<com.google.protobuf.Descriptors.FieldDescriptor,java.lang.Object> getOptionFields()
ProtoElementgetOptionFields in class ProtoElementpublic boolean isExtensible()
public boolean isMapEntry()
public com.google.common.collect.ImmutableList<Field> getFields()
public java.lang.Iterable<Field> getReachableFields()
public com.google.common.collect.ImmutableList<Oneof> getOneofs()
public void setOneofs(com.google.common.collect.ImmutableList<Oneof> oneofs)
@Nullable public Field lookupField(java.lang.String name)
public void setFieldByNameMap(com.google.common.collect.ImmutableMap<java.lang.String,Field> fieldByName)
public boolean isCyclic()
public java.lang.Iterable<Field> getMessageFields()
public java.lang.Iterable<Field> getNonMessageFields()
public java.lang.Iterable<Field> getCyclicFields()
public java.lang.Iterable<Field> getNonCyclicFields()
public java.lang.Iterable<Field> getRepeatedFields()
public java.lang.Iterable<Field> getNonRepeatedFields()
public java.lang.Iterable<Field> getOneofScopedFields()
public java.lang.Iterable<Field> getNonOneofScopedFields()
public java.lang.Iterable<Field> getMapFields()