Class DefinitionFile
java.lang.Object
de.haumacher.msgbuf.data.AbstractDataObject
de.haumacher.msgbuf.generator.ast.WithOptions
de.haumacher.msgbuf.generator.ast.DefinitionFile
- All Implemented Interfaces:
DataObject,ReflectiveDataObject,Observable
Representation of a
.proto file with top-level Definitions.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
WithOptions.TypeKind, WithOptions.Visitor<R,A> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIdentifier for theDefinitionFiletype in JSON format.static final Stringstatic final StringFields inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
_listener, OPTIONS__PROP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDefinition(Definition value) Adds a value to thegetDefinitions()list.static DefinitionFilecreate()Creates aDefinitionFileinstance.final List<Definition>All definitions in this file.final QNameThe package name for all types in this file.final booleanChecks, whethergetPackage()has a value.protected final voidinternalAddDefinition(Definition value) Implementation ofaddDefinition(de.haumacher.msgbuf.generator.ast.Definition)without chain call utility.protected final voidinternalSetDefinitions(List<? extends Definition> value) Internal setter forgetDefinitions()without chain call utility.protected final voidinternalSetPackage(QName value) Internal setter forgetPackage()without chain call utility.jsonType()kind()The type code of this instance.Adds a key value pair to theWithOptions.getOptions()map.static DefinitionFileReads a new instance from the given reader.protected voidreadField(JsonReader in, String field) final voidremoveDefinition(Definition value) Removes a value from thegetDefinitions()list.voidsetDefinitions(List<? extends Definition> value) setOptions(Map<String, Option> value) setPackage(QName value) <R,A> R visit(WithOptions.Visitor<R, A> v, A arg) Accepts the given visitor.protected voidwriteFields(JsonWriter out) Methods 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, writeContent
-
Field Details
-
DEFINITION_FILE__TYPE
Identifier for theDefinitionFiletype in JSON format.- See Also:
-
PACKAGE__PROP
- See Also:
-
DEFINITIONS__PROP
- See Also:
-
-
Constructor Details
-
DefinitionFile
protected DefinitionFile()Creates aDefinitionFileinstance.- See Also:
-
-
Method Details
-
create
Creates aDefinitionFileinstance. -
kind
Description copied from class:WithOptionsThe type code of this instance.- Specified by:
kindin classWithOptions
-
getPackage
The package name for all types in this file. -
setPackage
- See Also:
-
internalSetPackage
Internal setter forgetPackage()without chain call utility. -
hasPackage
public final boolean hasPackage()Checks, whethergetPackage()has a value. -
getDefinitions
All definitions in this file. -
setDefinitions
- See Also:
-
internalSetDefinitions
Internal setter forgetDefinitions()without chain call utility. -
addDefinition
Adds a value to thegetDefinitions()list. -
internalAddDefinition
Implementation ofaddDefinition(de.haumacher.msgbuf.generator.ast.Definition)without chain call utility. -
removeDefinition
Removes a value from thegetDefinitions()list. -
setOptions
- Overrides:
setOptionsin classWithOptions- See Also:
-
putOption
Description copied from class:WithOptionsAdds a key value pair to theWithOptions.getOptions()map.- Overrides:
putOptionin classWithOptions
-
jsonType
-
properties
- Specified by:
propertiesin interfaceReflectiveDataObject- Overrides:
propertiesin classWithOptions
-
get
- Specified by:
getin interfaceReflectiveDataObject- Overrides:
getin classWithOptions
-
set
- Specified by:
setin interfaceReflectiveDataObject- Overrides:
setin classWithOptions
-
readDefinitionFile
Reads a new instance from the given reader.- Throws:
IOException
-
writeFields
- Overrides:
writeFieldsin classWithOptions- Throws:
IOException
-
readField
- Overrides:
readFieldin classWithOptions- Throws:
IOException
-
visit
Description copied from class:WithOptionsAccepts the given visitor.- Specified by:
visitin classWithOptions
-