|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.nds.dirxml.engine.gcv.GCDefinitions
com.novell.nds.dirxml.engine.gcv.ShimParams
public class ShimParams
ShimParams
is an aggregation of GCValue
objects.
The difference between ShimParams
and its parent class
GCDefinitions
is that ShimParams
allows
GCVs of type "gcv-ref".
Methods are provided to parse an XML representation of Global Configuration Values and to serialize the contained collection of GCVs to an XML representation.
For user interface purposes the list of GCValue objects is ordered.
Nested Class Summary | |
---|---|
static class |
ShimParams.NoSuchReferenceException
GCVException indicating a gcv-ref or password reference wasn't found. |
static interface |
ShimParams.ReferenceResolver
Interface for providing values for referenced items in ShimParams definitions. |
Field Summary | |
---|---|
protected List |
defsList
|
protected boolean |
modified
|
Fields inherited from class com.novell.nds.dirxml.engine.gcv.GCDefinitions |
---|
DEFAULT_SEPARATOR, GC_CONFLICT_VALUE |
Constructor Summary | |
---|---|
ShimParams()
Construct an empty ShimParams object. |
Method Summary | |
---|---|
protected static com.novell.nds.dirxml.engine.gcv.GCList |
_construct(Element element,
com.novell.nds.dirxml.engine.gcv.GCList list)
Populate a GCDefinitions object and association GCValue objects
from a DOM XML element containing the XML representation. |
void |
addName(GCValue newValue)
Add a name to the defsList map. |
void |
appendValue(GCValue value)
Add a GCV to the end of the current list of GCVs. |
static ShimParams |
constructShimParams(byte[] bytes)
Construct a ShimParams object and associated GCValue objects
from an array of bytes containing the serialized XML representation. |
static ShimParams |
constructShimParams(Node parent)
Construct a ShimParams object and association GCValue objects
from a DOM XML document containing the XML representation. |
Element |
convertReferences(Node parent,
ShimParams.ReferenceResolver refResolver)
Convert GCV references in this ShimParams instance and return the top-level of the XML representation. |
GCValue |
getChildValue(String name)
Get a GCValue object that is a direct child of this instance by name. |
GCValue |
getValue(String name)
Get a GCValue object by name. |
boolean |
hasBeenModified()
Return true if this instance has been modified. |
void |
insertValue(GCValue newValue,
GCValue insertionPoint)
Insert a GCV into the current list of GCVs. |
void |
insertValue(GCValue newValue,
String insertionPoint)
Insert a GCV into the current list of GCVs. |
boolean |
isNameAllowed(String name)
Check to see if a name is allowed. |
Iterator |
iterator()
Return an Iterator instance that can be used to iterate
through the list of GCVs. |
void |
removeName(GCValue oldValue)
Remove a name from the defsList map. |
boolean |
removeValue(GCValue value)
Remove a GCV from the list of GCVs. |
boolean |
removeValue(String name)
Remove a GCV from the list of GCVs. |
void |
replaceValue(GCValue newValue,
GCValue oldValue)
Insert a GCV into the current list of GCVs. |
void |
resetModified()
Reset the modified flag for this instance such that hasBeenModified()
will return false . |
Iterator |
shallowIterator()
Return an Iterator instance that can be used to iterate
through the list of GCVs. |
Element |
toShimInitParams(Node parent,
ShimParams.ReferenceResolver refResolver)
Output this ShimParams instance as XML suitable for consumption by a DirXML application shim in an init document. |
Methods inherited from class com.novell.nds.dirxml.engine.gcv.GCDefinitions |
---|
apply, apply, checkAllowedType, construct, construct, construct, construct, construct, localize, merge, toBytes, toXml, toXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.novell.nds.dirxml.util.ConfigElement |
---|
hasBeenModified, resetModified |
Methods inherited from interface com.novell.nds.dirxml.engine.gcv.GCOwner |
---|
addName, appendValue, insertValue, insertValue, isNameAllowed, iterator, removeName, removeValue, removeValue, replaceValue, shallowIterator |
Field Detail |
---|
protected List defsList
protected boolean modified
Constructor Detail |
---|
public ShimParams()
ShimParams
object.
Method Detail |
---|
public static ShimParams constructShimParams(byte[] bytes) throws GCVException
ShimParams
object and associated GCValue
objects
from an array of bytes containing the serialized XML representation.
Typically, the array of bytes would come from the value of the DirXML-ConfigValues attribute.
bytes
- byte array containing serialized XML.
GCVException
- thrown if XML is incorrect in any way.public static ShimParams constructShimParams(Node parent) throws GCVException
ShimParams
object and association GCValue
objects
from a DOM XML document containing the XML representation.
Typically, the DOM document would be the result of parsing the value of the DirXML-ConfigValues attribute.
parent
- DOM Node with child <configuration-values> element
GCVException
- thrown if XML is incorrect in any way.public Element toShimInitParams(Node parent, ShimParams.ReferenceResolver refResolver) throws GCVException
parent
- Node
under which to place constructed XML.refResolver
- object from which to obtain values for GCV refs
Element
constructed.
GCVException
public Element convertReferences(Node parent, ShimParams.ReferenceResolver refResolver) throws GCVException
parent
- Node
under which to place constructed XML.refResolver
- object from which to obtain values for GCV refs
Element
constructed.
GCVException
protected static com.novell.nds.dirxml.engine.gcv.GCList _construct(Element element, com.novell.nds.dirxml.engine.gcv.GCList list) throws GCVException
GCDefinitions
object and association GCValue
objects
from a DOM XML element containing the XML representation.
Typically, the DOM element would be the result of parsing the value of the DirXML-ConfigValues attribute.
element
- DOM elementdefinitions
- the instance to populate.
GCVException
- thrown if XML is incorrect in any way.public boolean hasBeenModified()
true
if this instance has been modified.
The instance is considered to have been modified if a change was made
that affects the persistent representation since:
resetModified()
was last called
true
or false
resetModified()
,
#toXML(org.w3c.dom.Node)
public void resetModified()
hasBeenModified()
will return false
.
hasBeenModified()
public GCValue getValue(String name)
GCValue
object by name. This will do a deep
search for the GCV, meaning it will look at all descendant GCVs.
name
- the GCV name.
GCValue
object, or null
if name not found.public GCValue getChildValue(String name)
GCValue
object that is a direct child of this instance by name.
name
- the GCV name.
GCValue
object, or null
if name not found.public void appendValue(GCValue value) throws GCVArgumentException
appendValue
in interface GCOwner
value
- GCValue
object to add.
GCVArgumentException
- thrown if value
has the same
name as a GCV already in the list.public void insertValue(GCValue newValue, String insertionPoint) throws GCVArgumentException
insertValue
in interface GCOwner
newValue
- GCValue object to add.insertionPoint
- name of GCV in front of which newValue
is to
be inserted.
GCVArgumentException
- thrown if insertionPoint
doesn't match the
name of any GCV in the list, or if the name of newValue
matches the
name of a GCV already in the list.public void insertValue(GCValue newValue, GCValue insertionPoint) throws GCVArgumentException
insertValue
in interface GCOwner
newValue
- GCValue object to add.insertionPoint
- GCV in front of which newValue
is to
be inserted.
GCVArgumentException
- thrown if insertionPoint
doesn't appear in
the list, or if the name of newValue
matches the
name of a GCV already in the list.public void replaceValue(GCValue newValue, GCValue oldValue) throws GCVArgumentException
replaceValue
in interface GCOwner
newValue
- GCValue object to add.oldValue
- GCV to be replaced (must not be null).
GCVArgumentException
- thrown if oldValue
doesn't appear in
the list, or if the name of newValue
matches the
name of another GCV already in the list.public boolean removeValue(String name)
removeValue
in interface GCOwner
name
- name of GCV to remove.
true
if name
was found and removed,
false
otherwise.public boolean removeValue(GCValue value)
removeValue
in interface GCOwner
value
- the GCV to remove.
true
if the GCV was found and removed,
false
otherwise.public Iterator iterator()
Iterator
instance that can be used to iterate
through the list of GCVs. The iterator returned will iterate through
all descendant GCValue
s, including those that are children of Groups.
The Iterator
's next
() method returns
GCValue
instances.
iterator
in interface GCOwner
Iterator
instance.shallowIterator()
public Iterator shallowIterator()
Iterator
instance that can be used to iterate
through the list of GCVs. The iterator returned will iterate through
only GCValue
s that are direct children of the GCDefinitions
.
The Iterator
's next
() method returns
GCValue
instances.
shallowIterator
in interface GCOwner
Iterator
instance.iterator()
public boolean isNameAllowed(String name)
isNameAllowed
in interface GCOwner
name
- the name to check
true
or false
public void addName(GCValue newValue) throws GCVArgumentException
GCParent
.
addName
in interface GCOwner
newValue
- new GCValue
GCVArgumentException
public void removeName(GCValue oldValue)
GCParent
.
removeName
in interface GCOwner
oldValue
- GCValue
being removed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |