net.sourceforge.esw.collection
Class MetaUtil
java.lang.Object
|
+--net.sourceforge.esw.collection.MetaUtil
- public class MetaUtil
- extends java.lang.Object
Utility methods for Collections API.
Method Summary |
static void |
checkMetaCollectionNotNull(IMetaCollection aCollection)
If the specified IMetaCollection instance is
null , throws a TransducerException stating so. |
static INode |
guaranteeNode(INode aParentNode,
java.lang.Object aIdentifer,
INodeContextFactory aFactory)
Ensures that the parent node contains a child with this identifier. |
static INode |
stickValueIntoNode(INode aParentNode,
java.lang.Object aIdentifer,
java.lang.Object aValue,
INodeContextFactory aFactory)
Checks the parent INode instance to see if it contains a child
INode instance with the specified identifer and sets the value
of that INode instance to the specified value if found. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MetaUtil
public MetaUtil()
stickValueIntoNode
public static INode stickValueIntoNode(INode aParentNode,
java.lang.Object aIdentifer,
java.lang.Object aValue,
INodeContextFactory aFactory)
- Checks the parent
INode
instance to see if it contains a child
INode
instance with the specified identifer and sets the value
of that INode
instance to the specified value if found.
Otherwise, it uses the specified INodeContextFactory
instance
to create a new INode
instance with the specified identifer
and value.
- Parameters:
aParentNode
- the parent to which the target node should belong.aIdentifer
- the identifier for which to check and create if needed.aValue
- the value to set upon the specified target INode
instance.aFactory
- the INodeContextFactory
instance for
creational patterns.- Returns:
- the target
INode
instance, either created or
retrieved from the parent INode
instance.
guaranteeNode
public static INode guaranteeNode(INode aParentNode,
java.lang.Object aIdentifer,
INodeContextFactory aFactory)
- Ensures that the parent node contains a child with this identifier. Checks
the parent
INode
instance to see if it contains a child
INode
instance with the specified identifer. Otherwise, it
uses the specified INodeContextFactory
instance to create a
new INode
instance with the specified identifer.
- Parameters:
aParentNode
- the parent to which the target node should belong.aIdentifer
- the identifier for which to check and create if needed.aFactory
- the INodeContextFactory
instance for
creational patterns.- Returns:
- the target
INode
instance, either created or
retrieved from the parent INode
instance.
checkMetaCollectionNotNull
public static void checkMetaCollectionNotNull(IMetaCollection aCollection)
throws TransducerException
- If the specified
IMetaCollection
instance is
null
, throws a TransducerException
stating so.
Otherwise, returns normally.
- Parameters:
aCollection
- the IMetaCollection
instance to check if
null
.- Throws:
TransducerException
- if the specified
IMetaCollection
instance is null
.
Copyright 2002 Free Software Foundation. All Rights Reserved.