org.enhydra.zeus
Interface Binder

All Known Implementing Classes:
BaseBinder

public interface Binder

Binder 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 Bindings.

This interface also provides uniformity in the overall handling of constraints; in other words, dealing with an XML Schema is generally fundamentally different than dealing with a DTD. However, working with a DTDBinder is identical, from an external perspective, to working with a SchemaBinder.

Author:
Brett McLaughlin, Maciej Zawadzki

Method Summary
 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.
 

Method Detail

setIsCollapsingSimpleElements

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.

Parameters:
isCollapsingSimpleElements - whether or not to collapse simple elements.

isCollapsingSimpleElements

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.

Returns:
boolean - whether simple elements are being collapsed.

setIsIgnoringIDAttributes

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 isCollapsingSimpleElements() is false, this has no effect.

Parameters:
ignoringIDAttributes - whether or not to ignore ID attributes.

isIgnoringIDAttributes

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 isCollapsingSimpleElements() is false, this has no effect.

Returns:
boolean - whether ID attributes are ignored.

getBindings

public 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.).

Returns:
List - the resultant Bindings from conversion of constraints.
Throws:
IOException - when errors in reading input occur.


Copyright © 2001 Enhydra. All Rights Reserved.