org.inria.ns.reflex.xml
Class NamedItemBuilder

java.lang.Object
  extended by org.inria.ns.reflex.xml.NamedItemBuilder
All Implemented Interfaces:
EntryBuilder

public class NamedItemBuilder
extends Object
implements EntryBuilder

A default named item builder.

Each new named item is attached to the same parent.

Author:
Philippe Poulard

Constructor Summary
NamedItemBuilder(Object parent)
          Create a new builder.
 
Method Summary
 Object getParentEntry()
          Return the parent of the named items to build.
 Map.Entry newEntry(Object key, Object value)
          Create a new named item.
 void setParentEntry(Object parent)
          Set the parent of the named items to build.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedItemBuilder

public NamedItemBuilder(Object parent)
Create a new builder.

Parameters:
parent - The parent of the named items to build.

The NamedItemBuilder doesn't have a proper parent ; the parent given will be the parent of the named items.

Method Detail

setParentEntry

public void setParentEntry(Object parent)
Set the parent of the named items to build.

Parameters:
parent - The parent that each new named item will have.

getParentEntry

public Object getParentEntry()
Return the parent of the named items to build.

Returns:
The parent of the named items to build.

newEntry

public Map.Entry newEntry(Object key,
                          Object value)
Create a new named item.

Specified by:
newEntry in interface EntryBuilder
Parameters:
key - The QName of the named item.

If the key is not a QName, the string value of the key is taken as an NCName.

value - Its value.
Returns:
A new named item.
See Also:
QName