|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.util.xml.confix.CompositeObjectFactory
public class CompositeObjectFactory
This instance implements an ObjectFactoryIF that internally
maps child object factories to XML namepspace prefixes OR URIs.
| Constructor Summary | |
|---|---|
CompositeObjectFactory()
Creates a new CompositeObjectFactory instance. |
|
| Method Summary | |
|---|---|
boolean |
containsObjectFactory(java.lang.String aNamespaceURIorPrefix)
Returns true if an object factory is internally mapped to the given namespace or prefix. |
ObjectFactoryIF |
getFactoryFor(java.lang.String aNamespaceURIorPrefix)
Returns the child object factory internally mapped to the given namespace or prefix. |
CreationStatus |
newObjectFor(java.lang.String aPrefix,
java.lang.String aNamespaceURI,
java.lang.String anElementName,
java.lang.Object aParent)
Creates an object for the element passed in. |
void |
registerFactory(java.lang.String aNamespaceURIorPrefix,
ObjectFactoryIF aFactory)
Registers the object factory passed in for the namespace URI passed in. |
void |
setMapToPrefix(boolean mapToPrefix)
Indicates if internal factories are mapped to namespace URIs or prefixes; if true, object factories are mapped to
prefixes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeObjectFactory()
| Method Detail |
|---|
public void setMapToPrefix(boolean mapToPrefix)
true, object factories are mapped to
prefixes. By default, an instance of this class maps object factories
to the URI.
mapToPrefix - if true, object factories are mapped to
prefixes.
public void registerFactory(java.lang.String aNamespaceURIorPrefix,
ObjectFactoryIF aFactory)
aNamespaceURIorPrefix - The namespace URI or prefix to associate with the factory.aFactory - The object factory to register.
IllegalArgumentExcption - If a factory is already registered for
the passed in namespace URI.
public ObjectFactoryIF getFactoryFor(java.lang.String aNamespaceURIorPrefix)
throws java.lang.IllegalArgumentException
aNamespaceURIorPrefix - a XML namepsace prefix or URI.
ObjectFactoryIF.
java.lang.IllegalArgumentException - if no factory can be found for the given
namespace of prefix.public boolean containsObjectFactory(java.lang.String aNamespaceURIorPrefix)
true if an object factory is internally mapped to the given
namespace or prefix.
public CreationStatus newObjectFor(java.lang.String aPrefix,
java.lang.String aNamespaceURI,
java.lang.String anElementName,
java.lang.Object aParent)
throws ObjectCreationException
setMapToPrefix(...) method.
newObjectFor in interface ObjectFactoryIFaPrefix - The namespace prefix of the element.aNamespaceURI - The namespace URI of the element.anElementName - The element name for wich to create an object.aParent - The parent object of the object to create.
ObjectCreationException - If an error occurs creating the object.setMapToPrefix(boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||