public class BindingOrganizer extends Object
| Constructor and Description |
|---|
BindingOrganizer(boolean force,
boolean track,
boolean addcon,
boolean in,
boolean out,
boolean trim)
Constructor taking flags used with constructed bindings.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 flagpublic 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 flagpublic BindingHolder getBinding(Object obj)
obj - object associated with bindingnull 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 holderpublic 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 - Binding prefixholder - Binding holderpublic static boolean isEqual(Object a, Object b)
a - first object to be comparedb - second object to be comparedtrue if both objects are null, or if a.equals(b);
false otherwisepublic 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 - Format Elementpublic Iterator iterateBindings()
null values may be present in the collection, due to bindings
which have been eliminated.public void addRootUris(Collection uris)
uris - URIspublic 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 bindingpublic 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 usetrue if valid, false if errorIOException - Errorpublic void writeBindings(File dir) throws org.jibx.runtime.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 definitionsorg.jibx.runtime.JiBXException - ErrorIOException - I/O ErrorCopyright © 2005–2016 jibx.org. All rights reserved.