Class Field
- All Implemented Interfaces:
DataObject,ReflectiveDataObject,FieldOperations,Observable
A field definition of a
MessageDef.-
Nested Class Summary
Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.Part
Part.Visitor<R,A> Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
WithOptions.TypeKind -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIdentifier for theFieldtype in JSON format.static final Stringstatic final Stringstatic final StringFields inherited from class de.haumacher.msgbuf.generator.ast.Part
INDEX__PROP, NAME__PROP, OWNER__PROPFields inherited from class de.haumacher.msgbuf.generator.ast.DefinitionBase
COMMENT__PROPFields inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
_listener, OPTIONS__PROP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Fieldcreate()Creates aFieldinstance.final TypegetType()The type of values that can be stored in this field.final booleanhasType()Checks, whethergetType()has a value.protected final voidinternalSetRepeated(boolean value) Internal setter forisRepeated()without chain call utility.protected final voidinternalSetTransient(boolean value) Internal setter forisTransient()without chain call utility.protected final voidinternalSetType(Type value) Internal setter forgetType()without chain call utility.final booleanWhether this field contains multiple values of itsgetType().final booleanWhether this field is not serialized when a message is created.jsonType()kind()The type code of this instance.Adds a key value pair to theWithOptions.getOptions()map.static FieldreadField(JsonReader in) Reads a new instance from the given reader.protected voidreadField(JsonReader in, String field) self()The implementation.voidsetComment(String value) setIndex(int value) setOptions(Map<String, Option> value) setOwner(Definition value) setRepeated(boolean value) setTransient(boolean value) <R,A> R visit(Part.Visitor<R, A> v, A arg) Accepts the given visitor.protected voidwriteFields(JsonWriter out) Methods inherited from class de.haumacher.msgbuf.generator.ast.Part
getIndex, getName, getOwner, hasOwner, internalSetIndex, internalSetName, internalSetOwner, readPart, visitMethods inherited from class de.haumacher.msgbuf.generator.ast.DefinitionBase
getComment, internalSetComment, readDefinitionBase, visitMethods inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
getOptions, internalPutOption, internalRegisterListener, internalSetOptions, internalUnregisterListener, readWithOptions, registerListener, removeOption, unregisterListener, writeToMethods inherited from class de.haumacher.msgbuf.data.AbstractDataObject
readContent, readFields, toString, writeContentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.haumacher.msgbuf.generator.FieldOperations
container, getReverse, getReverseAnnotation, isContainer, isDerived, isRef, isReverse, isReverseOf
-
Field Details
-
FIELD__TYPE
Identifier for theFieldtype in JSON format.- See Also:
-
TRANSIENT__PROP
- See Also:
-
REPEATED__PROP
- See Also:
-
TYPE__PROP
- See Also:
-
-
Constructor Details
-
Method Details
-
create
Creates aFieldinstance. -
kind
Description copied from class:WithOptionsThe type code of this instance.- Specified by:
kindin classWithOptions
-
isTransient
public final boolean isTransient()Whether this field is not serialized when a message is created. -
setTransient
- See Also:
-
internalSetTransient
protected final void internalSetTransient(boolean value) Internal setter forisTransient()without chain call utility. -
isRepeated
public final boolean isRepeated()Whether this field contains multiple values of itsgetType(). -
setRepeated
- See Also:
-
internalSetRepeated
protected final void internalSetRepeated(boolean value) Internal setter forisRepeated()without chain call utility. -
getType
The type of values that can be stored in this field. -
setType
- See Also:
-
internalSetType
Internal setter forgetType()without chain call utility. -
hasType
public final boolean hasType()Checks, whethergetType()has a value. -
setName
-
setIndex
-
setOwner
-
setComment
- Overrides:
setCommentin classPart- See Also:
-
setOptions
- Overrides:
setOptionsin classPart- See Also:
-
putOption
Description copied from class:WithOptionsAdds a key value pair to theWithOptions.getOptions()map. -
jsonType
- Specified by:
jsonTypein interfaceReflectiveDataObject
-
properties
- Specified by:
propertiesin interfaceReflectiveDataObject- Overrides:
propertiesin classPart
-
get
- Specified by:
getin interfaceReflectiveDataObject- Overrides:
getin classPart
-
set
- Specified by:
setin interfaceReflectiveDataObject- Overrides:
setin classPart
-
readField
Reads a new instance from the given reader.- Throws:
IOException
-
writeFields
- Overrides:
writeFieldsin classPart- Throws:
IOException
-
readField
- Overrides:
readFieldin classPart- Throws:
IOException
-
self
Description copied from interface:FieldOperationsThe implementation.- Specified by:
selfin interfaceFieldOperations
-
visit
Description copied from class:PartAccepts the given visitor.
-