public class AttributeValueSets extends Object
AttributeValueSets and provides methods for
serializing and deserializing attribute value sets from XML streams.| Constructor and Description |
|---|
AttributeValueSets()
Creates an empty collection of attribute value sets.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributeValueSet(String id,
AttributeValueSet attributeValueSet)
Adds an
AttributeValueSet to this collection. |
void |
addAttributeValueSet(String id,
AttributeValueSet attributeValueSet,
String newLabel,
String newDescription)
Adds an
AttributeValueSet to this collection replacing its label and
description. |
static AttributeValueSets |
deserialize(InputStream inputStream)
Deserializes a collection of
AttributeValueSets from an XML stream. |
AttributeValueSet |
getAttributeValueSet(String id)
Returns the
AttributeValueSet corresponding to the provided id
or null if no AttributeValueSet corresponds to the
id. |
AttributeValueSet |
getAttributeValueSet(String id,
boolean useDefault)
Returns the
AttributeValueSet corresponding to the provided id
or the default AttributeValueSet (possibly null) if no
AttributeValueSet corresponds to the id. |
Set<String> |
getAttributeValueSetIds()
Returns identifiers of all
AttributeValueSets in this collection. |
Set<AttributeValueSet> |
getAttributeValueSetsBasedOn(AttributeValueSet baseAttributeValueSet)
Returns all
AttributeValueSets from this collection that are based,
directly or indirectly, on the provided baseAttributeValueSet. |
AttributeValueSet |
getDefaultAttributeValueSet()
Returns the default
AttributeValueSet of this AttributeValueSets or
the first available AttributeValueSet if
getDefaultAttributeValueSetId() is null. |
String |
getDefaultAttributeValueSetId()
Returns the identifier of the default
AttributeValueSet within this
AttributeValueSets. |
void |
removeAttributeValueSet(String id)
Removes the
AttributeValueSet corresponding to the provided id
from this collection. |
void |
serialize(OutputStream stream)
Serializes this collection of
AttributeValueSets to an XML stream. |
void |
setDefaultAttributeValueSetId(String defaultAttributeValueSetId)
Sets the default attribute value set id for this
AttributeValueSets. |
String |
toString() |
public AttributeValueSets()
public void addAttributeValueSet(String id, AttributeValueSet attributeValueSet)
AttributeValueSet to this collection.id - unique identifier of the AttributeValueSet within the collection.attributeValueSet - AttributeValueSet to be addedpublic void addAttributeValueSet(String id, AttributeValueSet attributeValueSet, String newLabel, String newDescription)
AttributeValueSet to this collection replacing its label and
description. This method may sometimes be useful because AttributeValueSets
are immutable with respect to their label and description.id - unique identifier of the AttributeValueSet within the collection.attributeValueSet - AttributeValueSet to be addednewLabel - new label for the AttributeValueSetnewDescription - new description for the AttributeValueSetpublic Set<String> getAttributeValueSetIds()
AttributeValueSets in this collection.AttributeValueSets in this collection.public String getDefaultAttributeValueSetId()
AttributeValueSet within this
AttributeValueSets. The default identifier can be null.public void setDefaultAttributeValueSetId(String defaultAttributeValueSetId)
AttributeValueSets. An
AttributeValueSet with this id must exist in this
AttributeValueSets.public AttributeValueSet getAttributeValueSet(String id)
AttributeValueSet corresponding to the provided id
or null if no AttributeValueSet corresponds to the
id.AttributeValueSet corresponding to the provided id
or null if no AttributeValueSet corresponds to the
id.public AttributeValueSet getAttributeValueSet(String id, boolean useDefault)
AttributeValueSet corresponding to the provided id
or the default AttributeValueSet (possibly null) if no
AttributeValueSet corresponds to the id.id - identifier of the AttributeValueSet to returnuseDefault - if true, the default AttributeValueSet will
be returned if the AttributeValueSet with the provided id does
not exist.AttributeValueSet corresponding to the provided id
or the default AttributeValueSet (possibly null) if no
AttributeValueSet corresponds to the id.public AttributeValueSet getDefaultAttributeValueSet()
AttributeValueSet of this AttributeValueSets or
the first available AttributeValueSet if
getDefaultAttributeValueSetId() is null. If this
AttributeValueSets is empty, null will be returned.public void removeAttributeValueSet(String id)
AttributeValueSet corresponding to the provided id
from this collection. If any other AttributeValueSets in this collection
are based on the set being removed, the associations are corrected accordingly,
i.e. sets based on the set being removed become based on the set the removed set is
based on. Also, if the removed AttributeValueSet was the default,
null will be set as this AttributeValueSets' default
AttributeValueSet. If no AttributeValueSet corresponds to the
provided id, no action is taken.id - identifier of the AttributeValueSet to be removedpublic Set<AttributeValueSet> getAttributeValueSetsBasedOn(AttributeValueSet baseAttributeValueSet)
AttributeValueSets from this collection that are based,
directly or indirectly, on the provided baseAttributeValueSet.baseAttributeValueSet - the base attribute value setpublic void serialize(OutputStream stream) throws Exception
AttributeValueSets to an XML stream.stream - the stream to serialize this AttributeValueSets to. The stream
will not be closed.Exception - in case of any problems with serializationpublic static AttributeValueSets deserialize(InputStream inputStream) throws Exception
AttributeValueSets from an XML stream.inputStream - the InputStream to deserialize a
AttributeValueSets from. The stream will not be
closed.AttributeValueSetsException - is case of any problems with deserialization.