|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.zeus.binder.BaseBinder
provides an interface for all constraint
representations to use. It defines the contract for conversion
between an arbitrary constraint representation (XML Schema, DTD,
Relax schema, etc) to a set of Zeus
Binder
s.
Binding
This implementation of Binder
handles the
basic functionality of dealing with input so that
other implementations don't have to code these methods.
Thus, XXXBinder
classes should extend
this class, rather than directly implementing
Binder
, and will get this functionality
"for free."
Field Summary | |
protected boolean |
isCollapsingSimpleElements
Whether or not simple elements are being collapsed. |
protected boolean |
isIgnoringIDAttributes
Whether or not ID attributes are ignored |
protected Source |
source
The to read input from |
Constructor Summary | |
BaseBinder(Source source)
This constructor takes in a
to read input from and allow generation of the
s from it. |
Method Summary | |
abstract java.util.List |
getBindings()
This is integral portion of the Binder . |
boolean |
isCollapsingSimpleElements()
This will indicate whether simple elements are being collapsed for this binder. |
boolean |
isIgnoringIDAttributes()
This will indicate if the id attribute on elements handled
by this Binder should be ignored in determine if an
element is collapsible. |
void |
setIsCollapsingSimpleElements(boolean isCollapsingSimpleElements)
This sets whether or not to "collapse" simple elements. |
void |
setIsIgnoringIDAttributes(boolean isIgnoringIDAttributes)
This indicates if the id attribute on elements handled by
this Binder should be ignored in determine if an
element is collapsible. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Source source
Source
to read input fromprotected boolean isCollapsingSimpleElements
protected boolean isIgnoringIDAttributes
Constructor Detail |
public BaseBinder(Source source)
This constructor takes in a
to read input from and allow generation of the
Source
s from it.
Binding
source
- Source
to read input from.Method Detail |
public void setIsCollapsingSimpleElements(boolean isCollapsingSimpleElements)
This sets whether or not to "collapse" simple elements. An element is
simple if it only has character-based content, and no attributes. If
these are collapsed, then they are not turned into full-fledged
Java objects (with only a getValue()
method), but instead
become properties with primitive return values on their parents. So
an element named "display-name" with only textual content could be
accessed through it's parent object by invoking
getDisplayName()
on the parent, instead of
getDisplayName().getValue()
. By default, elements are
not collapsed.
setIsCollapsingSimpleElements
in interface Binder
isCollapsingSimpleElements
- whether or not to collapse simple
elements.public boolean isCollapsingSimpleElements()
This will indicate whether simple elements are being collapsed for
this binder. An element is
simple if it only has character-based content, and no attributes. If
these are collapsed, then they are not turned into full-fledged
Java objects (with only a getValue()
method), but instead
become properties with primitive return values on their parents. So
an element named "display-name" with only textual content could be
accessed through it's parent object by invoking
getDisplayName()
on the parent, instead of
getDisplayName().getValue()
. By default, elements are
not collapsed.
isCollapsingSimpleElements
in interface Binder
boolean
- whether simple elements are being
collapsed.public void setIsIgnoringIDAttributes(boolean isIgnoringIDAttributes)
This indicates if the id
attribute on elements handled by
this Binder
should be ignored in determine if an
element is collapsible. If
is false, this has
no effect.
isCollapsingSimpleElements
setIsIgnoringIDAttributes
in interface Binder
ignoringIDAttributes
- whether or not to ignore ID attributes.public boolean isIgnoringIDAttributes()
This will indicate if the id
attribute on elements handled
by this Binder
should be ignored in determine if an
element is collapsible. If
is false, this has
no effect.
isCollapsingSimpleElements
isIgnoringIDAttributes
in interface Binder
boolean
- whether ID attributes are ignored.public abstract java.util.List getBindings() throws java.io.IOException
This is integral portion of the Binder
. It
is responsible for returning a Zeus representation of
the set of constraints that this binding represents,
resulting from the input representation (which could
be an XML Schema, DTD, Relax schema, etc.).
There is a temptation to implement a lazy-loading mechanism
here, but that should not be done. That's because
the
may stay the same but the actual
input (abstracted by the Source
Source
may change
"under the covers." So don't implement lazy-loading here!
getBindings
in interface Binder
List
- the resultant
Binding
s from conversion of
constraints.IOException
- when errors in reading
input occur.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |