public interface DataComponent extends AbstractSWEIdentifiable, HasCopy
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.
Modifier and Type | Method and Description |
---|---|
void |
accept(DataComponentVisitor visitor) |
void |
addComponent(java.lang.String name,
DataComponent component)
Add a sub-component and registers a name for it
|
void |
assignNewDataBlock()
Create and assign a new datablock structure to this component.
|
void |
clearData()
Clear the datablock used by this component.
|
DataComponent |
clone()
Get a full recursive copy of this component.
|
DataComponent |
copy()
Return a structural copy of this component
The copy is done recursively, but only the structure is copied (not the data)
|
DataBlock |
createDataBlock()
Create a new datablock for holding data of this component
|
DataComponent |
getComponent(int index)
Get the sub-component located at the specified index
|
DataComponent |
getComponent(java.lang.String name)
Get the sub-component registered with the specified name
|
int |
getComponentCount()
Returns number of sub-components in this component
|
int |
getComponentIndex(java.lang.String name)
Get the index of the sub-component registered with this name
|
DataBlock |
getData()
Get the datablock associated to this component
|
java.lang.String |
getDefinition()
Gets the definition property
|
java.lang.String |
getName() |
boolean |
getOptional()
Gets the optional property
|
DataComponent |
getParent() |
boolean |
getUpdatable()
Gets the updatable property
|
boolean |
hasConstraints()
Recursively checks if constraints are specified in this component or
any of its sub-components
|
boolean |
hasData() |
boolean |
isSetDefinition()
Checks if definition is set
|
boolean |
isSetOptional()
Checks if optional is set
|
boolean |
isSetUpdatable()
Checks if updatable is set
|
DataComponent |
removeComponent(int index)
Remove the sub-component at the specified index
|
DataComponent |
removeComponent(java.lang.String name)
Remove sub-component with the specified name
|
void |
renewDataBlock()
Renew the datablock of this component.
|
void |
setData(DataBlock dataBlock)
Assign a new datablock to this component.
|
void |
setDefinition(java.lang.String definition)
Sets the definition property
|
void |
setName(java.lang.String name)
Sets the name of this component
|
void |
setOptional(boolean optional)
Sets the optional property
|
void |
setUpdatable(boolean updatable)
Sets the updatable property
|
void |
unSetOptional()
Unsets the optional property
|
void |
unSetUpdatable()
Unsets the updatable property
|
void |
validateData(java.util.List<ValidationException> errorList)
Validates datablock against constraints if any.
|
getDescription, getIdentifier, getLabel, isSetDescription, isSetIdentifier, isSetLabel, setDescription, setIdentifier, setLabel
addExtension, getExtensionList, getId, getNumExtensions, isSetId, setId
boolean getUpdatable()
boolean isSetUpdatable()
void setUpdatable(boolean updatable)
updatable
- void unSetUpdatable()
boolean getOptional()
boolean isSetOptional()
void setOptional(boolean optional)
optional
- void unSetOptional()
java.lang.String getDefinition()
boolean isSetDefinition()
void setDefinition(java.lang.String definition)
definition
- definition URIint getComponentCount()
DataComponent getComponent(int index)
index
- index of component to lookupDataComponent getComponent(java.lang.String name)
name
- name of component to lookupint getComponentIndex(java.lang.String name)
name
- name of component to lookupvoid addComponent(java.lang.String name, DataComponent component)
name
- name of component to usecomponent
- new sub-component to append to this componentDataComponent removeComponent(int index)
index
- DataComponent removeComponent(java.lang.String name)
name
- DataComponent getParent()
java.lang.String getName()
void setName(java.lang.String name)
name
- boolean hasData()
DataBlock getData()
void setData(DataBlock dataBlock)
dataBlock
- void clearData()
void validateData(java.util.List<ValidationException> errorList)
errorList
- list to which validation exceptions will be appendedboolean hasConstraints()
DataComponent copy()
DataComponent clone()
DataBlock createDataBlock()
void assignNewDataBlock()
void renewDataBlock()
void accept(DataComponentVisitor visitor)