Package net.opengis.swe.v20
Interface DataComponent
- All Superinterfaces:
AbstractSWE
,AbstractSWEIdentifiable
,HasCopy
,Serializable
- All Known Subinterfaces:
BlockComponent
,Boolean
,Category
,CategoryOrRange
,CategoryRange
,Count
,CountOrRange
,CountRange
,DataArray
,DataChoice
,DataRecord
,GeometryData
,Matrix
,Quantity
,QuantityOrRange
,QuantityRange
,RangeComponent
,ScalarComponent
,SimpleComponent
,Text
,Time
,TimeOrRange
,TimeRange
,Vector
- All Known Implementing Classes:
AbstractArrayImpl
,AbstractDataComponentImpl
,AbstractRangeComponentImpl
,AbstractRecordImpl
,AbstractSimpleComponentImpl
,BooleanImpl
,CategoryImpl
,CategoryRangeImpl
,CountImpl
,CountRangeImpl
,DataArrayImpl
,DataChoiceImpl
,DataList
,DataRecordImpl
,DataValue
,GeometryDataImpl
,MatrixImpl
,QuantityImpl
,QuantityRangeImpl
,SWEData
,TextImpl
,TimeImpl
,TimeRangeImpl
,VectorImpl
Base interface for all SWE Common data components. It provides an API auto-generated from XML schemas as well as a generic API that useful to navigate a component tree in a more generic manner.
- Since:
- Nov 10, 2014
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(DataComponentVisitor visitor) void
addComponent
(String name, DataComponent component) Add a sub-component and registers a name for itvoid
Create and assign a new datablock structure to this component.void
Clear the datablock used by this component.clone()
Get a full recursive copy of this component.copy()
Return a structural copy of this component The copy is done recursively, but only the structure is copied (not the data)Create a new datablock for holding data of this componentgetComponent
(int index) Get the sub-component located at the specified indexgetComponent
(String name) Get the sub-component registered with the specified nameint
Returns number of sub-components in this componentint
getComponentIndex
(String name) Get the index of the sub-component registered with this namegetData()
Get the datablock associated to this componentGets the definition propertygetName()
boolean
Gets the optional propertyboolean
Gets the updatable propertyboolean
Recursively checks if constraints are specified in this component or any of its sub-componentsboolean
hasData()
boolean
Checks if definition is setboolean
Checks if optional is setboolean
Checks if updatable is setremoveComponent
(int index) Remove the sub-component at the specified indexremoveComponent
(String name) Remove sub-component with the specified namevoid
Renew the datablock of this component.void
Assign a new datablock to this component.void
setDefinition
(String definition) Sets the definition propertyvoid
Sets the name of this componentvoid
setOptional
(boolean optional) Sets the optional propertyvoid
setUpdatable
(boolean updatable) Sets the updatable propertyvoid
Unsets the optional propertyvoid
Unsets the updatable propertyvoid
validateData
(List<ValidationException> errorList) Validates datablock against constraints if any.Methods inherited from interface net.opengis.swe.v20.AbstractSWE
addExtension, getExtensionList, getId, getNumExtensions, isSetId, setId
Methods inherited from interface net.opengis.swe.v20.AbstractSWEIdentifiable
getDescription, getIdentifier, getLabel, isSetDescription, isSetIdentifier, isSetLabel, setDescription, setIdentifier, setLabel
-
Method Details
-
getUpdatable
boolean getUpdatable()Gets the updatable property- Returns:
- true if component can be updated dynamically
-
isSetUpdatable
boolean isSetUpdatable()Checks if updatable is set- Returns:
- true if the updatable attribute is set
-
setUpdatable
void setUpdatable(boolean updatable) Sets the updatable property- Parameters:
updatable
-
-
unSetUpdatable
void unSetUpdatable()Unsets the updatable property -
getOptional
boolean getOptional()Gets the optional property- Returns:
- true if component value is optional in the stream
-
isSetOptional
boolean isSetOptional()Checks if optional is set- Returns:
- true if the optional attribute is set
-
setOptional
void setOptional(boolean optional) Sets the optional property- Parameters:
optional
-
-
unSetOptional
void unSetOptional()Unsets the optional property -
getDefinition
String getDefinition()Gets the definition property- Returns:
- definition URI
-
isSetDefinition
boolean isSetDefinition()Checks if definition is set- Returns:
- true if the definition attribute is set
-
setDefinition
Sets the definition property- Parameters:
definition
- definition URI
-
getComponentCount
int getComponentCount()Returns number of sub-components in this component- Returns:
- number of direct sub-components
-
getComponent
Get the sub-component located at the specified index- Parameters:
index
- index of component to lookup- Returns:
- child component or null if none exists at the specified index
-
getComponent
Get the sub-component registered with the specified name- Parameters:
name
- name of component to lookup- Returns:
- child component or null if none exists with the specified name
-
getComponentIndex
Get the index of the sub-component registered with this name- Parameters:
name
- name of component to lookup- Returns:
- index of child component or -1 if none exists with the specified name
-
addComponent
Add a sub-component and registers a name for it- Parameters:
name
- name of component to usecomponent
- new sub-component to append to this component
-
removeComponent
Remove the sub-component at the specified index- Parameters:
index
-- Returns:
- the component that was just removed
-
removeComponent
Remove sub-component with the specified name- Parameters:
name
-- Returns:
- the component that was just removed
-
getParent
DataComponent getParent()- Returns:
- parent component of this component
-
getName
String getName()- Returns:
- name of sub-component
-
setName
Sets the name of this component- Parameters:
name
-
-
hasData
boolean hasData()- Returns:
- true if a datablock is associated to this component
-
getData
DataBlock getData()Get the datablock associated to this component- Returns:
- datablock object or null if none has been generated yet
-
setData
Assign a new datablock to this component. This will recursively assign the right datablocks to sub-components recursively.- Parameters:
dataBlock
-
-
clearData
void clearData()Clear the datablock used by this component. This will also clear data from all the sub-components recursively. -
validateData
Validates datablock against constraints if any. No exceptions are thrown, rather they are appended to the provided list.- Parameters:
errorList
- list to which validation exceptions will be appended
-
hasConstraints
boolean hasConstraints()Recursively checks if constraints are specified in this component or any of its sub-components- Returns:
- true if at least one constraint is found, false otherwise
-
copy
DataComponent copy()Return a structural copy of this component The copy is done recursively, but only the structure is copied (not the data) -
clone
DataComponent clone()Get a full recursive copy of this component. Both structure and data are copied- Returns:
- clone of this component, including sub-components
-
createDataBlock
DataBlock createDataBlock()Create a new datablock for holding data of this component- Returns:
- new datablock object
-
assignNewDataBlock
void assignNewDataBlock()Create and assign a new datablock structure to this component. This will also assign the right datablocks to sub-components recursively. -
renewDataBlock
void renewDataBlock()Renew the datablock of this component. This method is faster than recreating a datablock from scratch with createDataBlock(). -
accept
-