|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Configures a mapper. Contains information that the mapper uses to guide its behavior.
To construct a Configuration, we recommend reading it from XML,
using MAP_FROM_XML
and an ObjectXMLReader
.
This interface is read-only. Use another interface to construct or mutate a configuration.
Nested Class Summary | |
static class |
Configuration.MarshalSelector
Identifies a configuration parameter and the circumstances in which it will affect marshalling. |
static class |
Configuration.Selector
Identifies a configuration parameter. |
static class |
Configuration.UnmarshalSelector
Identifies a configuration parameter and the circumstances in which it will affect unmarshalling. |
Field Summary | |
static XMLName |
CLASS
|
static java.lang.String |
EMPTY_STRING
A zero-length String. |
static XMLName |
EXCLUDE_PROPERTIES
|
static XMLName |
FACTORY
|
static XMLName |
GETTER
|
static XMLName |
IDENTIFIER
|
static XMLName |
INCLUDE_PROPERTIES
|
static MapFromXML |
MAP_FROM_XML
The recommended mapping for unmarshalling a Configuration from XML. |
static XMLName |
MAPPER
|
static XMLName |
MARSHALLER
|
static java.lang.String |
MINIMAL_XML
XML from which one can unmarshal a simple configuration. |
static XMLName |
MODEL
|
static XMLName |
NAMER
|
static XMLThing |
NO_XML
Indicates the absence of any XML element or attribute. |
static XMLName |
PACKAGES
|
static XMLName |
PROPERTY
|
static XMLName |
RECEIVER
|
static XMLName |
SETTER
|
static XMLName |
UNMARSHALLER
|
static XMLName |
XML
|
Method Summary | |
java.lang.Object |
get(Configuration.Selector selector)
Get configuration information. |
Field Detail |
public static final MapFromXML MAP_FROM_XML
<mapping> <choose namer="my.soap.Namer" packages="my.favorite java.lang"/> <when class="my.favorite.Thing"> <choose getter="my.soap.ThingAccessor" setter="my.soap.ThingAccessor"/> </when> <when ... <when ... <when property="class" class="java.lang.Class"> <choose element="-none-"/> </when> </mapping>
Each <choose> element contains parameters that affect mapping. <choose> elements are often wrapped in a <when> element, to limit their effect to specific circumstances. These elements are ordered, with defaults at the end and more specific configuration at the beginning.
When the mapper needs a configuration parameter, it calls its Configuration, which scans the <mapping> for the desired parameter in a <choose> element, but skips over <when> elements that don't match the current circumstances. (The code isn't quite so simple, but it behaves this way.)
A <choose> element may contain these configuration parameters, as attributes:
DefaultMapper
.
Namer
.
ObjectFactory
.
Getter
.
BitBucketSetter
.
This class must implement Setter
.
Unmarshaller
.
Marshaller
.
XMLReceiver
.
Beck uses the schema to guide how it copies data from Java to XML. Specifically, the ordering of XML elements and their namespaces will be taken from the schema, in cases where the schema specifies a simple ordering of elements. A more complicated schema (with alternative or open-ended element sequencing)
A <when> element may specify these circumstances, as attributes:
Predicate
.
A Predicate is useful for decision criteria that are too complex
for a simple <when> element.
Each <when> attribute is evaluated as a Boolean expression. Their values are 'and'ed together; that is, a <when> element is ignored if any of its attributes evaluate to 'false'. <when> elements can be nested to make a decision tree. A simple 'or else' sequence can be expressed with consecutive <when> elements, since they are evaluated in the order they appear in the XML (and evaluation stops as soon as the desired configuration parameter is found).
Customized software may support additional attributes in <when> or <choose> elements. For example, a Predicate may interpret additional <when> attributes as decision factors.
This object is thread-safe (unlike most implementations of MapFromXML).
public static final java.lang.String MINIMAL_XML
public static final XMLName MAPPER
public static final XMLName PACKAGES
public static final XMLName NAMER
public static final XMLName FACTORY
public static final XMLName IDENTIFIER
public static final XMLName GETTER
public static final XMLName SETTER
public static final XMLName MARSHALLER
public static final XMLName UNMARSHALLER
public static final XMLName RECEIVER
public static final XMLName CLASS
public static final XMLName PROPERTY
public static final XMLName EXCLUDE_PROPERTIES
public static final XMLName INCLUDE_PROPERTIES
public static final XMLName XML
public static final XMLName MODEL
public static final XMLThing NO_XML
null
.)
public static final java.lang.String EMPTY_STRING
Method Detail |
public java.lang.Object get(Configuration.Selector selector)
selector
- identifies what information is wanted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |