|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jibx.binding.model.BindingOrganizer
public class BindingOrganizer
Organizer for a set of bindings under construction. This tracks the individual bindings by default namespace or by associated object (to allow multiple bindings using a single namespace), and manages the relationships between the different bindings.
| Constructor Summary | |
|---|---|
BindingOrganizer(boolean force,
boolean track,
boolean addcon,
boolean in,
boolean out,
boolean trim)
Constructor taking flags used with constructed bindings. |
|
| Method Summary | |
|---|---|
BindingHolder |
addBinding(Object obj,
String uri,
String prefix,
boolean dflt)
Add a binding to the set in use. |
void |
addBindingObject(Object obj,
BindingHolder holder)
Associate a control object with an existing binding. |
void |
addDefaultPrefix(String uri,
String pref)
Set the default prefix for a namespace, if none already set. |
void |
addFormat(FormatElement format)
Add a format definition to the binding. |
void |
addRootUris(Collection uris)
Adds a collection of namespace URIs to be referenced at root binding level. |
void |
addTypeNameReference(BindingHolder hold,
String uri,
Object obj)
Add reference from binding to a type name defined in the same or another binding. |
BindingHolder |
configureFiles(String rootname,
String trgtpack,
List pregens)
Configure the names to be used for writing bindings to files. |
void |
forceBindingPrefix(String prefix,
BindingHolder holder)
Force specified prefix to be used for binding. |
BindingHolder |
getBinding(Object obj)
Get the binding associated with a particular control object and namespace, if defined. |
List |
getKeys()
Get the list of binding key objects. |
BindingHolder |
getRequiredBinding(Object obj)
Get the binding associated with a particular control object. |
static boolean |
isEqual(Object a,
Object b)
General object comparison method. |
Iterator |
iterateBindings()
Iterate the collection of bindings. |
boolean |
validateBindings(BindingHolder root,
File dir,
ValidationContext vctx)
Validate the constructed bindings. |
void |
writeBindings(File dir)
Write the bindings to supplied destination path. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BindingOrganizer(boolean force,
boolean track,
boolean addcon,
boolean in,
boolean out,
boolean trim)
force - force classes flagtrack - track source flagaddcon - add constructors flagin - input binding flagout - output binding flagtrim - trim whitespace flag| Method Detail |
|---|
public BindingHolder addBinding(Object obj,
String uri,
String prefix,
boolean dflt)
obj - object associated with binding (can be namespace URI, if only one binding per namespace)uri - namespace URI (null if no namespace)prefix - namespace prefix (null if not specified, empty string if unprefixed default namespace)dflt - namespace is default for elements in binding flag
public BindingHolder getBinding(Object obj)
obj - object associated with binding
null if not yet definedpublic BindingHolder getRequiredBinding(Object obj)
obj - object associated with binding (can be namespace URI, if only one binding per namespace)
public void addBindingObject(Object obj,
BindingHolder holder)
obj - object associated with binding (can be namespace URI, if only one binding per namespace)holder - binding holder
public void addDefaultPrefix(String uri,
String pref)
uri - namespace URIpref - prefix to be used (empty string if to be default namespace)
public void forceBindingPrefix(String prefix,
BindingHolder holder)
prefix - holder -
public static boolean isEqual(Object a,
Object b)
a - first object to be comparedb - second object to be compared
true if both objects are null, or if a.equals(b);
false otherwise
public void addTypeNameReference(BindingHolder hold,
String uri,
Object obj)
hold - binding containing referenceuri - namespace URI for type nameobj - object associated with referenced bindingpublic void addFormat(FormatElement format)
format - public Iterator iterateBindings()
null values may be present in the collection, due to bindings
which have been eliminated.
public void addRootUris(Collection uris)
uris - public List getKeys()
public BindingHolder configureFiles(String rootname,
String trgtpack,
List pregens)
rootname - file name for root or singleton binding definitiontrgtpack - target package for binding (null if unspecified)pregens - pregenerated bindings to be included in root binding
public boolean validateBindings(BindingHolder root,
File dir,
ValidationContext vctx)
throws IOException
configureFiles(String, String, List) must be called before this
method is called, in order to complete the root binding definition.
root - root binding holder (returned by configureFiles(String, String, List))dir - target directory for writing binding definitionsvctx - validation context to use
true if valid, false if error
IOException
public void writeBindings(File dir)
throws JiBXException,
IOException
configureFiles(String, String, List) must be called
before this method is called, in order to configure the file names and complete the root binding definition.
dir - target directory for writing binding definitions
JiBXException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||