Package org.epics.pvdata.factory
Class BaseFieldBuilder
- java.lang.Object
-
- org.epics.pvdata.factory.BaseFieldBuilder
-
- All Implemented Interfaces:
FieldBuilder
public class BaseFieldBuilder extends Object implements FieldBuilder
FieldBuilderimplementation.- Author:
- mse
-
-
Constructor Summary
Constructors Constructor Description BaseFieldBuilder()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldBuilderadd(String name, Field field)Add aField(e.g.FieldBuilderadd(String name, ScalarType scalarType)Add aScalar.FieldBuilderaddArray(String name, Field element)Add array ofFieldelements.FieldBuilderaddArray(String name, ScalarType scalarType)Add variable size array ofScalarelements.FieldBuilderaddBoundedArray(String name, ScalarType scalarType, int bound)Add bounded-size array ofScalarelements.FieldBuilderaddBoundedString(String name, int maxLength)Add a bounded string.FieldBuilderaddFixedArray(String name, ScalarType scalarType, int size)Add fixed-size array ofScalarelements.FieldBuilderaddNestedStructure(String name)Add new nestedStructure.FieldBuilderaddNestedStructureArray(String name)Add new nestedStructure[].FieldBuilderaddNestedUnion(String name)Add new nestedUnion.FieldBuilderaddNestedUnionArray(String name)Add new nestedUnion[].StructurecreateStructure()Create aStructure.UnioncreateUnion()Create anUnion.FieldBuilderendNested()Complete the creation of a nested object.FieldBuildersetId(String id)Set ID of an object to be created.
-
-
-
Method Detail
-
setId
public FieldBuilder setId(String id)
Description copied from interface:FieldBuilderSet ID of an object to be created.- Specified by:
setIdin interfaceFieldBuilder- Parameters:
id- the id to be set- Returns:
- this instance of a
FieldBuilder
-
add
public FieldBuilder add(String name, ScalarType scalarType)
Description copied from interface:FieldBuilderAdd aScalar.- Specified by:
addin interfaceFieldBuilder- Parameters:
name- the name of the arrayscalarType- the type of the scalar to add- Returns:
- this instance of a
FieldBuilder
-
addBoundedString
public FieldBuilder addBoundedString(String name, int maxLength)
Description copied from interface:FieldBuilderAdd a bounded string.- Specified by:
addBoundedStringin interfaceFieldBuilder- Parameters:
name- the name of the bounded stringmaxLength- the maximum string length- Returns:
- this instance of a
FieldBuilder
-
add
public FieldBuilder add(String name, Field field)
Description copied from interface:FieldBuilderAdd aField(e.g.Structure,Union).- Specified by:
addin interfaceFieldBuilder- Parameters:
name- the name of the arrayfield- a field to add- Returns:
- this instance of a
FieldBuilder
-
addArray
public FieldBuilder addArray(String name, ScalarType scalarType)
Description copied from interface:FieldBuilderAdd variable size array ofScalarelements.- Specified by:
addArrayin interfaceFieldBuilder- Parameters:
name- the name of the arrayscalarType- the type of the scalar element- Returns:
- this instance of a
FieldBuilder
-
addFixedArray
public FieldBuilder addFixedArray(String name, ScalarType scalarType, int size)
Description copied from interface:FieldBuilderAdd fixed-size array ofScalarelements.- Specified by:
addFixedArrayin interfaceFieldBuilder- Parameters:
name- the name of the arrayscalarType- type of the scalar elementsize- the size of the Array to add- Returns:
- this instance of a
FieldBuilder
-
addBoundedArray
public FieldBuilder addBoundedArray(String name, ScalarType scalarType, int bound)
Description copied from interface:FieldBuilderAdd bounded-size array ofScalarelements.- Specified by:
addBoundedArrayin interfaceFieldBuilder- Parameters:
name- the name of the arrayscalarType- the type of the scalar elementbound- the maximum capacity (size) of the array- Returns:
- this instance of a
FieldBuilder
-
addArray
public FieldBuilder addArray(String name, Field element)
Description copied from interface:FieldBuilderAdd array ofFieldelements.- Specified by:
addArrayin interfaceFieldBuilder- Parameters:
name- the name of the arrayelement- the type of each array element- Returns:
- this instance of a
FieldBuilder
-
createStructure
public Structure createStructure()
Description copied from interface:FieldBuilderCreate aStructure. This resets this instance state and allows newFieldinstance to be created.- Specified by:
createStructurein interfaceFieldBuilder- Returns:
- the new instance of a
Structurecreated
-
createUnion
public Union createUnion()
Description copied from interface:FieldBuilderCreate anUnion. This resets this instance state and allows newFieldinstance to be created.- Specified by:
createUnionin interfaceFieldBuilder- Returns:
- the new instance of an
Unioncreated
-
addNestedStructure
public FieldBuilder addNestedStructure(String name)
Description copied from interface:FieldBuilderAdd new nestedStructure.createNested()method must be called to complete creation of the nestedStructure.- Specified by:
addNestedStructurein interfaceFieldBuilder- Parameters:
name- the nested structure name- Returns:
- a new instance of a
FieldBuilderis returned - See Also:
FieldBuilder.endNested()
-
addNestedUnion
public FieldBuilder addNestedUnion(String name)
Description copied from interface:FieldBuilderAdd new nestedUnion.createNested()method must be called to complete creation of the nestedUnion.- Specified by:
addNestedUnionin interfaceFieldBuilder- Parameters:
name- the nested union name- Returns:
- a new instance of a
FieldBuilderis returned - See Also:
FieldBuilder.endNested()
-
addNestedStructureArray
public FieldBuilder addNestedStructureArray(String name)
Description copied from interface:FieldBuilderAdd new nestedStructure[].createNested()method must be called to complete creation of the nestedStructure.- Specified by:
addNestedStructureArrayin interfaceFieldBuilder- Parameters:
name- the nested structure array name- Returns:
- a new instance of a
FieldBuilderis returned - See Also:
FieldBuilder.endNested()
-
addNestedUnionArray
public FieldBuilder addNestedUnionArray(String name)
Description copied from interface:FieldBuilderAdd new nestedUnion[].createNested()method must be called to complete creation of the nestedUnion.- Specified by:
addNestedUnionArrayin interfaceFieldBuilder- Parameters:
name- the nested union array name.- Returns:
- a new instance of a
FieldBuilderis returned. - See Also:
FieldBuilder.endNested()
-
endNested
public FieldBuilder endNested()
Description copied from interface:FieldBuilderComplete the creation of a nested object.- Specified by:
endNestedin interfaceFieldBuilder- Returns:
- a previous (parent)
FieldBuilder. - See Also:
FieldBuilder.addNestedStructure(String),FieldBuilder.addNestedUnion(String)
-
-