|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.zeus.transform.BaseTransformer
is the interface for converting a set of
Zeus Transformer
objects from a set of
XML-based names and identities (created by a Zeus
Binding
instance) to another set of
Binder
Binding
objects. This second
set of objects is only an intermediate set, which is then used by a
to create Java classes.
Generator
This allows a user to specify a mapping file and thereby transform a set of XML names into another set of names, either for ensuring legal Java names, for using more business-centric names, or any other user desired basis.
BaseTransformer
is an abstract, base implementation of
Transformer
, and provides common functionality. All
Transformer
implementations should extend this base class.
Field Summary | |
protected Source |
source
The to read mapping information from |
Constructor Summary | |
BaseTransformer(Source source)
This constructor takes in a
to read mapping information from and allow generation of the
transformation mappings from it. |
Method Summary | |
void |
addValueEnumeration(ValueEnumeration valueEnumeration)
This will add a new to those
available to this Transformer . |
TransformerOptions |
getTransformerOptions()
This returns the current for
this transformer. |
ValueEnumeration |
getValueEnumeration(java.lang.String name)
This will retrieve the for the
supplied name. |
void |
setTransformerOptions(TransformerOptions transformerOptions)
This allows setting of the for
this transformer. |
java.util.List |
transform(java.util.List bindings)
This method performs the work of transforming a set of Zeus objects. |
abstract java.util.List |
transform(java.util.List bindings,
boolean recursing)
This method performs the work of transforming a set of Zeus objects. |
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 mapping information fromConstructor Detail |
public BaseTransformer(Source source)
This constructor takes in a
to read mapping information from and allow generation of the
transformation mappings from it.
Source
source
- Source
to read mapping input from.Method Detail |
public void setTransformerOptions(TransformerOptions transformerOptions)
This allows setting of the
for
this transformer.
TransformerOptions
setTransformerOptions
in interface Transformer
transformerOptions
- the options for this transformerpublic TransformerOptions getTransformerOptions()
This returns the current
for
this transformer.
TransformerOptions
getTransformerOptions
in interface Transformer
TransformerOptions
- the options in use for this
transformer.public void addValueEnumeration(ValueEnumeration valueEnumeration)
This will add a new
to those
available to this ValueEnumeration
Transformer
.
addValueEnumeration
in interface Transformer
valueEnumeration
- the enumeration to add for this transformer.public ValueEnumeration getValueEnumeration(java.lang.String name) throws NoSuchValueEnumerationException
This will retrieve the
for the
supplied name.
ValueEnumeration
If the supplied name is not associated with a
ValueEnumeration
, this is considered an exceptional
condition; any
Transformer
construct looking for a
ValueEnumeration
by name expects to find one,
or the supplied mapping information is in error. Therefore,
in this case, a
is thrown.
NoSuchValueEnumerationException
getValueEnumeration
in interface Transformer
ValueEnumeration
- the enumeration for the supplied
name.NoSuchValueEnumerationException
- - when an
enumeration with the supplied name cannot be found.public java.util.List transform(java.util.List bindings) throws java.io.IOException, ZeusException
This method performs the work of transforming a set of Zeus
objects. It then
returns a new set of Binding
Binding
objects
(in List
form) with transformed names, types, and values.
When this method is invoked, it attempts to see if parsing of the mapping file has already occurred. If it has not, parsing of that file will occur within this method.
It is important to note that the number of bindings returned from this method may not be the same as the number supplied. This is due to some XML elements/attributes being converted to value objects, while other mapping instructions may actually create new binding objects.
transform
in interface Transformer
bindings
- List
of bindings to process for
transformation.List
- the transformed bindings.IOException
- - when errors occur in parsing
a mapping configuration file.ZeusException
- - when errors occuring in
transformation.public abstract java.util.List transform(java.util.List bindings, boolean recursing) throws java.io.IOException, ZeusException
This method performs the work of transforming a set of Zeus
objects. It then
returns a new set of Binding
Binding
objects
(in List
form) with transformed names, types, and values.
When this method is invoked, it attempts to see if parsing of the mapping file has already occurred. If it has not, parsing of that file will occur within this method.
It is important to note that the number of bindings returned from this method may not be the same as the number supplied. This is due to some XML elements/attributes being converted to value objects, while other mapping instructions may actually create new binding objects.
bindings
- List
of bindings to process for
transformation.recursing
- indication of if this is within a recursion loop.List
- the transformed bindings.IOException
- - when errors occur in parsing
a mapping configuration file.ZeusException
- - when errors occuring in
transformation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |