public class DataChoiceImpl extends AbstractDataComponentImpl implements DataChoice
Exclusive list of DataComponents (Choice) 08-2014: Updated to implement new API autogenerated from XML schema
Modifier and Type | Field and Description |
---|---|
protected Category |
choiceValue |
protected DataComponentPropertyList<DataComponent> |
itemList |
protected int |
selected |
protected static int |
UNSELECTED |
protected static String |
UNSELECTED_ERROR |
dataBlock, definition, encodingInfo, INDENT, MAX_ARRAY_ERRORS, optional, parent, scalarCount, updatable
description, identifier, label
extensionList, id
Constructor and Description |
---|
DataChoiceImpl() |
DataChoiceImpl(int size) |
Modifier and Type | Method and Description |
---|---|
void |
accept(DataComponentVisitor visitor) |
void |
addComponent(String name,
DataComponent component)
Add a sub-component and registers a name for it
|
void |
addItem(String name,
DataComponent item)
Adds a new item property
|
protected void |
checkIndex(int index)
Check that the integer index given is in range: 0 to item list size
|
void |
clearData()
Clear the datablock used by this component.
|
DataChoiceImpl |
copy()
Return a structural copy of this component
The copy is done recursively, but only the structure is copied (not the data)
|
AbstractDataBlock |
createDataBlock()
Create a new datablock for holding data of this component
|
Category |
getChoiceValue()
Gets the choiceValue property
|
AbstractDataComponentImpl |
getComponent(int index)
Get the sub-component located at the specified index
|
AbstractDataComponentImpl |
getComponent(String name)
Get the sub-component registered with the specified name
|
int |
getComponentCount()
Returns number of sub-components in this component
|
int |
getComponentIndex(String name)
Get the index of the sub-component registered with this name
|
DataComponent |
getItem(String name)
Gets the item property with the given name
|
OgcPropertyList<DataComponent> |
getItemList()
Gets the list of item properties
|
int |
getNumItems()
Returns number of item properties
|
int |
getSelected() |
AbstractDataComponentImpl |
getSelectedItem()
Gets the selected item in this choice
|
boolean |
hasConstraints()
Recursively checks if constraints are specified in this component or
any of its sub-components
|
boolean |
isSetChoiceValue()
Checks if choiceValue is set
|
AbstractDataComponentImpl |
removeComponent(int index)
Remove the sub-component at the specified index
|
AbstractDataComponentImpl |
removeComponent(String name)
Remove sub-component with the specified name
|
void |
setChoiceValue(Category choiceValue)
Sets the choiceValue property
|
void |
setData(DataBlock dataBlock)
Assign a new datablock to this component.
|
void |
setSelectedItem(int index)
Sets the choice selection to the item with the given index
|
void |
setSelectedItem(String name)
Sets the choice selection to the item with the given name
|
String |
toString(String indent)
Returns String representation of this DataContainer
|
void |
unselect() |
protected void |
updateAtomCount(int childAtomCountDiff)
Update datablock atomCount (for resizable array support)
Needed to update atom count info in all parents of a
DataArray that has been resized!
|
protected void |
updateStartIndex(int startIndex)
Update datablock start index (for array support)
Needed when data is selected by DataArray getComponent(int)
and the DataArray is using a parallel or primitive DataBlock
|
void |
validateData(List<ValidationException> errorList)
Validates dataBlock against constraints if any.
|
assignNewDataBlock, clone, copyTo, getData, getDefinition, getEncodingInfo, getName, getOptional, getParent, getUpdatable, isSetDefinition, isSetOptional, isSetUpdatable, renewDataBlock, setDefinition, setEncodingInfo, setName, setOptional, setParent, setUpdatable, toString, unSetOptional, unSetUpdatable
copyTo, getDescription, getIdentifier, getLabel, isSetDescription, isSetIdentifier, isSetLabel, setDescription, setIdentifier, setLabel
addExtension, copyTo, getExtensionList, getId, getNumExtensions, isSetId, setId
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
assignNewDataBlock, clone, getData, getDefinition, getName, getOptional, getParent, getUpdatable, isSetDefinition, isSetOptional, isSetUpdatable, renewDataBlock, setDefinition, setName, setOptional, setUpdatable, unSetOptional, unSetUpdatable
getDescription, getIdentifier, getLabel, isSetDescription, isSetIdentifier, isSetLabel, setDescription, setIdentifier, setLabel
addExtension, getExtensionList, getId, getNumExtensions, isSetId, setId
protected static int UNSELECTED
protected static String UNSELECTED_ERROR
protected int selected
protected Category choiceValue
protected DataComponentPropertyList<DataComponent> itemList
public DataChoiceImpl()
public DataChoiceImpl(int size)
public DataChoiceImpl copy()
DataComponent
copy
in interface HasCopy
copy
in interface DataChoice
copy
in interface DataComponent
copy
in class AbstractDataComponentImpl
protected void updateStartIndex(int startIndex)
AbstractDataComponentImpl
updateStartIndex
in class AbstractDataComponentImpl
protected void updateAtomCount(int childAtomCountDiff)
AbstractDataComponentImpl
updateAtomCount
in class AbstractDataComponentImpl
public void addComponent(String name, DataComponent component)
DataComponent
addComponent
in interface DataComponent
addComponent
in class AbstractDataComponentImpl
name
- name of component to usecomponent
- new sub-component to append to this componentpublic AbstractDataComponentImpl getComponent(int index)
DataComponent
getComponent
in interface DataComponent
getComponent
in class AbstractDataComponentImpl
index
- index of component to lookuppublic AbstractDataComponentImpl getComponent(String name)
DataComponent
getComponent
in interface DataComponent
getComponent
in class AbstractDataComponentImpl
name
- name of component to lookuppublic int getComponentIndex(String name)
DataComponent
getComponentIndex
in interface DataComponent
getComponentIndex
in class AbstractDataComponentImpl
name
- name of component to lookuppublic AbstractDataComponentImpl removeComponent(int index)
DataComponent
removeComponent
in interface DataComponent
public AbstractDataComponentImpl removeComponent(String name)
DataComponent
removeComponent
in interface DataComponent
public void setData(DataBlock dataBlock)
DataComponent
setData
in interface DataComponent
setData
in class AbstractDataComponentImpl
public void clearData()
DataComponent
clearData
in interface DataComponent
clearData
in class AbstractDataComponentImpl
public void validateData(List<ValidationException> errorList)
DataComponent
validateData
in interface DataComponent
validateData
in class AbstractDataComponentImpl
errorList
- list to which validation exceptions will be appendedpublic AbstractDataBlock createDataBlock()
DataComponent
createDataBlock
in interface DataComponent
createDataBlock
in class AbstractDataComponentImpl
protected void checkIndex(int index)
index
- intDataException
public int getComponentCount()
DataComponent
getComponentCount
in interface DataComponent
getComponentCount
in class AbstractDataComponentImpl
public int getSelected()
public AbstractDataComponentImpl getSelectedItem()
DataChoice
getSelectedItem
in interface DataChoice
public void setSelectedItem(int index)
DataChoice
setSelectedItem
in interface DataChoice
public void setSelectedItem(String name)
DataChoice
setSelectedItem
in interface DataChoice
public void unselect()
public String toString(String indent)
AbstractDataComponentImpl
toString
in class AbstractDataComponentImpl
indent
- intpublic boolean hasConstraints()
DataComponent
hasConstraints
in interface DataComponent
hasConstraints
in class AbstractDataComponentImpl
public Category getChoiceValue()
getChoiceValue
in interface DataChoice
public boolean isSetChoiceValue()
isSetChoiceValue
in interface DataChoice
public void setChoiceValue(Category choiceValue)
setChoiceValue
in interface DataChoice
public OgcPropertyList<DataComponent> getItemList()
getItemList
in interface DataChoice
public int getNumItems()
getNumItems
in interface DataChoice
public DataComponent getItem(String name)
getItem
in interface DataChoice
public void addItem(String name, DataComponent item)
addItem
in interface DataChoice
public void accept(DataComponentVisitor visitor)
accept
in interface DataComponent
Copyright © 2016 Sensia Software LLC. All rights reserved.