org.enhydra.zeus.binder
Class BaseBinder
java.lang.Object
|
+--org.enhydra.zeus.binder.BaseBinder
- All Implemented Interfaces:
- Binder
- Direct Known Subclasses:
- DTDBinder, SchemaBinder
- public abstract class BaseBinder
- extends java.lang.Object
- implements 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
Binding
s.
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."
- Version:
- 1.0
- Author:
- Brett McLaughlin
Constructor Summary |
BaseBinder(Source source)
This constructor takes in a Source
to read input from and allow generation of the
Binding s from it. |
Method Summary |
abstract java.util.List |
getBindings()
This is integral portion of the Binder . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
source
protected Source source
- The
Source
to read input from
BaseBinder
public BaseBinder(Source source)
This constructor takes in a Source
to read input from and allow generation of the
Binding
s from it.
- Parameters:
source
- Source
to read input from.
getBindings
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 Source
may stay the same but the actual
input (abstracted by the Source
may change
"under the covers." So don't implement lazy-loading here!
- Specified by:
getBindings
in interface Binder
- Returns:
List
- the resultant
Binding
s from conversion of
constraints.- Throws:
IOException
- when errors in reading
input occur.
Copyright © 2001 Enhydra. All Rights Reserved.