| Home >> All >> org >> apache >> commons >> [ betwixt Javadoc ] |
Page 1 2
org.apache.commons.betwixt: Javadoc index of package org.apache.commons.betwixt.
Package Samples:
org.apache.commons.betwixt.io.id: Package contains classes dealing directly with the reading and writing of beans.
org.apache.commons.betwixt.io.read: Package contains classes dealing directly with the reading and writing of beans.
org.apache.commons.betwixt.digester: This package contains the main betwixt introspection code.
org.apache.commons.betwixt.registry: This package contains the main betwixt introspection code.
org.apache.commons.betwixt.expression
org.apache.commons.betwixt.io
org.apache.commons.betwixt.derived
org.apache.commons.betwixt.dotbetwixt
org.apache.commons.betwixt.examples.rss
org.apache.commons.betwixt.introspection
org.apache.commons.betwixt.nowrap
org.apache.commons.betwixt.recursion
Classes:
BeanWriter: BeanWriter outputs beans as XML to an io stream. The output for each bean is an xml fragment (rather than a well-formed xml-document). This allows bean representations to be appended to a document by writing each in turn to the stream. So to create a well formed xml document, you'll need to write the prolog to the stream first. If you append more than one bean to the stream, then you'll need to add a wrapping root element as well. The line ending to be used is set by setEndOfLine(java.lang.String) 55 . The output can be formatted (with whitespace) for easy reading by calling enablePrettyPrint() ...
AbstractBeanWriter: Abstract superclass for bean writers. This class encapsulates the processing logic. Subclasses provide implementations for the actual expression of the xml. SAX Inspired Writing API This class is intended to be used by subclassing: concrete subclasses perform the actual writing by providing suitable implementations for the following methods inspired by SAX : start() 55 - called when processing begins startElement(WriteContext, String, String, String, Attributes) 55 - called when the start of an element should be written bodyText(WriteContext, String) 55 - called when the start of an element should ...
TestClassProperty: This test is the result of a problem I had with outputting a bean's class property as XML. I had a request for that feature quite a while ago and the #org.apache.commons.betwixt.strategy.PropertySupressionStretegy was added to made this possible. It worked quite well, until I used beans described in dot-betwixt files that also output the class property like the following: <info primitiveTypes="element"> <element name="test-class"> <attribute name="test-prop-1" property="testPropertyOne"/> <attribute name="test-prop-2" property="testPropertyTwo"/> <element name="class" ...
XMLBeanInfoRegistry: Plug in registry for XMLBeanInfo 's. This decouples the implementation of the XMLBeanInfo cache. Users can plug in the standard implementations found in this package to switch caching on and off. Alternatively, they can plug-in an exotic cache of their own devising. Users can also prime a cache with XMLBeanInfo classes created programmatically. To find a XMLBeanInfo for a class, XMLIntrospector checks in the registry first before starting introspection. If the registry returns an XMLBeanInfo , then that's used. Otherwise, the XMLBeanInfo will be found by standard introspection and then put(java.lang.Class, ...
TestAttributeQNameProblem: I would SAX 'start element' event's attributes always expect to have qName equal to localName for simple, unprefixed XML tags. But that seems not to be true for betwixt output and breaks my application completely. For the debugging output to STDOUT I would expect output like: XML: start document event XML: start element qName 'test-class', localName 'test-class', URI: - Attribute qName 'test-prop-1', localName 'test-prop-1' of CDATA: abc - Attribute qName 'test-prop-2', localName 'test-prop-2' of CDATA: 12 - Attribute qName 'id', localName 'id' of ID: 1 XML: end element 'test-class' XML: end document ...
Context: Context describes the context used to evaluate bean expressions. This is mostly a bean together with a number of context variables. Context variables are named objects. In other words, a context variable associates an object with a string. Logging during expression evaluation is done through the logging instance held by this class. The object initiating the evaluation should control this logging and so passing a Log instance is enforced by the constructors. Context is a natural place to include shared evaluation code. One of the problems that you get with object graphs is that they can be cyclic. ...
RandomIDGenerator: Generates ID 's at random. The random number source is java.util.Random . Random ID 's are very useful if you're inserting elements created by Betwixt into a stream with existing elements. Using random ID 's should reduce the danger of collision with existing element ID 's. This class can generate positive-only ids (the default) or it can generate a mix of negative and postive ones. This behaviour can be set by setPositiveIds(boolean) 55 or by using the RandomIDGenerator(boolean onlyPositiveIds) 55 constructor.
XMLBeanInfo: XMLBeanInfo represents the XML metadata information used to map a Java Bean cleanly to XML. This provides a default introspection mechansim, rather like java.beans.BeanInfo which can be customized through some mechansim, either via Java code or XSLT for example. ID and IDREF Attribute Names These special attributes are defined in the xml specification. They are used by Betwixt to write bean graphs with cyclic references. In most cases, these will take the values 'id' and 'idref' respectively but these names can be varied in the DTD. Therefore, these names are specified by this class but default ...
MapEntryAdder: MapEntryAdder is used to add entries to a map. MapEntryAdder supplies two updaters: getKeyUpdater() 55 which allows the entry key to be updated getValueUpdater() 55 which allows the entry value to be updated When both of these updaters have been called, the entry adder method is called. Once this has happened then the values can be updated again. Note that only the Context passed by the last update will be used.
ReadContext: Extends Context to provide read specific functionality. Three stacks are used to manage the reading: Action mapping stack contains the MappingAction 's used to execute the mapping of the current element and it's ancesters back to the document root. Result stack contains the objects which are bound to the current element and to each of it's ancester's back to the root Element mapping stack records the names of the element and the classes to which they are bound
MappingDerivationStrategy: Pluggable strategy determines whether introspection or bind time typing should be used when finding mappings. The type of a property is determined at introspection time but the actual type of the instance can differ at bind time (when the xml is actually being processed). This strategy is used to set (at a per-element level) whether the bind or introspection time type should be used to calculate the mapping to be used. Note: this strategy is intentionally course. Typically, the best approach is to use a custom strategy to set coursely grained rules (for example: all implemetations of 'IAnimal' ...
WriteContext: Context against which content should be written. Usage: This (logical) interface is a Parameter Object allowing additional, Betwixt -specific information to be passed through the SAX-inspired writing API. It is likely that access will be required to methods in the Context used by the AbstractBeanWriter but it seems better to add these as neccessary using delegation rather than extending org.apache.commons.betwixt.expression.Context .
BaseMixedContentEncodingStrategy: Basic implementation for MixedContentEncodingStrategy supports variations of most common use case. This supports subclasses that choose to encode body content either as a CDATA section or by escaping the characters. Implementations should override encodeAsCDATA(org.apache.commons.betwixt.ElementDescriptor) 55 with an appropriate decision algorithm.
XMLIntrospector: XMLIntrospector an introspector of beans to create a XMLBeanInfo instance. By default, XMLBeanInfo caching is switched on. This means that the first time that a request is made for a XMLBeanInfo for a particular class, the XMLBeanInfo is cached. Later requests for the same class will return the cached value. Note : This class makes use of the java.bean.Introspector class, which contains a BeanInfoSearchPath. To make sure betwixt can do his work correctly, this searchpath is completely ignored during processing. The original values will be restored after processing finished
ClassNormalizer: Class normalization strategy. The normalized Class is the Class that Betwixt should introspect. This strategy class allows the introspected Class to be varied. This implementation simply returns the Class given. Used by Betwixt to allow superclasses or interfaces to be subsittuted before an object is introspected. This allows users to feed in logical interfaces and make Betwixt ignore properties other than those in the interface. It also allows support for Proxy 's. Together, these features allow Betwixt to deal with Entity Beans properly by viewing them through their remote interfaces.
IntrospectionConfiguration: Stores introspection phase binding configuration. There are two phase in Betwixt's processing. The first phase is the introspection of the bean. Strutural configuration settings effect this phase. The second phase comes when Betwixt dynamically uses reflection to execute the mapping. This object stores configuration settings pertaining to the first phase. These common settings have been collected into one class so that they can be more easily shared not only between the objects that execute the introspection but also (by a user) between different XMLIntrospector s.
DecapitalizeNameMapper: A name mapper which converts types to a decapitalized String. This conversion decapitalizes in the standard java beans way (as per java.beans.Introspector ). This means that the first letter only will be decapitalized except for the case where the first and second characters are both upper case. When both are upper case, then the name will be left alown. So a bean type of Foo will be converted to the element name "foo" FooBar will be converted to "fooBar" . But URL will remain as "URL" .
IDGenerator: Interface allowing pluggable ID attribute value generators. IDGenerator 's are used to generate ID attribute values by BeanWriter . A user can specify the generation mechanism by passing an implementation to AbstractBeanWriter.setIdGenerator(org.apache.commons.betwixt.io.IDGenerator) 55 . Standard implementations are included with that supply random and sequantial values.
ObjectStringConverter: Strategy class for string <-> object conversions. Implementations of this interface are used by Betwixt to perform string <-> object conversions. This performs only the most basic conversions. Most applications will use a subclass. It is strongly recommended that (in order to support round tripping) that objectToString and stringToObject are inverse functions. In other words, given the same flavour, context and type the applying objectToString to the result of stringToObject should be equal to the original input.
PolymorphicReferenceResolver: Resolves polymorphic references. A polymorphic reference is an element whose name and type resolution are postponed till bind-time. When the xml is read, the type can then resolved from by calling resolveType(org.apache.commons.betwixt.io.read.ElementMapping, org.apache.commons.betwixt.io.read.ReadContext) 55 .
SequentialIDGenerator: Generates ID 's in numeric sequence. A simple counter is used. Every time that nextIdImpl() 55 is called, this counter is incremented. By default, the counter starts at zero. A user can set the initial value by using the SequentialIDGenerator(int start) 55 constructor.
MixedContentEncodingStrategy: Encodes body content. Usage: Used by org.apache.commons.betwixt.io.BeanWriter to encode body content before it is written into the textual output. This gives flexibility in this stage allowing (for example) some properties to use character escaping whilst others use CDATA wrapping. Note: the word encoding here is used in the sense of escaping a sequence of character data.
BindingConfiguration: Stores mapping phase binding configuration. There are two phase in Betwixt's processing. The first phase is the introspection of the bean. Strutural configuration settings effect this phase. The second phase comes when Betwixt dynamically uses reflection to execute the mapping. This object stores configuration settings pertaining to the second phase. These common settings have been collected into one class to make round tripping easier since the same BindingConfiguration can be shared.
DefaultObjectStringConverter: Default string <-> object conversion strategy. This delegates to ConvertUtils except when the type is assignable from java.util.Date but not from java.sql.Date . In this case, the format used is (in SimpleDateFormat terms) EEE MMM dd HH:mm:ss zzz yyyy . This is the same as the output of the toString method on java.util.Date. This should preserve the existing symantic behaviour whilst allowing round tripping of dates (given the default settings).
AbstractIDGenerator: Abstract superclass for org.apache.commons.betwixt.io.IDGenerator implementations. It implements the entire IDGenerator interface. When nextId is called, this class sets the LastId property (as well as returning the value). Subclasses should override nextIdImpl() 55 .
| Home | Contact Us | Privacy Policy | Terms of Service |