2016/05/28 - Apache Tuscany has been retired.
For more information, please explore the Attic.
org.apache.tuscany.sca.databinding.javabeans
Class XML2JavaBeanTransformer<T>
java.lang.Object
org.apache.tuscany.sca.databinding.impl.BaseTransformer<T,java.lang.Object>
org.apache.tuscany.sca.databinding.javabeans.XML2JavaBeanTransformer<T>
- All Implemented Interfaces:
- PullTransformer<T,java.lang.Object>, Transformer
- Direct Known Subclasses:
- DOMNode2JavaBeanTransformer, OMElement2Exception
public abstract class XML2JavaBeanTransformer<T>
- extends BaseTransformer<T,java.lang.Object>
- implements PullTransformer<T,java.lang.Object>
Transformer to convert data from XML to JavaBean
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SET
public static final java.lang.String SET
- See Also:
- Constant Field Values
QNAME_MESSAGE
public static final javax.xml.namespace.QName QNAME_MESSAGE
mapper
protected SimpleTypeMapperImpl mapper
XML2JavaBeanTransformer
public XML2JavaBeanTransformer()
getWeight
public int getWeight()
- Description copied from interface:
Transformer
- Get the cost of the transformation. The weight can be used to choose the most efficient path if there are more
than one available from the source to the target.
- Specified by:
getWeight
in interface Transformer
- Overrides:
getWeight
in class BaseTransformer<T,java.lang.Object>
- Returns:
- An integer representing the cost of the transformation
transform
public java.lang.Object transform(T source,
TransformationContext context)
- Description copied from interface:
PullTransformer
- Transform source data into the result type.
- Specified by:
transform
in interface PullTransformer<T,java.lang.Object>
- Parameters:
source
- The source datacontext
- The context for the transformation
- Returns:
- The transformed result
toJavaObject
public java.lang.Object toJavaObject(javax.xml.namespace.QName xmlType,
T xmlElement,
TransformationContext context)
getText
public abstract java.lang.String getText(T source)
throws XML2JavaMapperException
- Throws:
XML2JavaMapperException
getChildElements
public abstract java.util.Iterator<T> getChildElements(T parent)
throws XML2JavaMapperException
- Throws:
XML2JavaMapperException
getElementName
public abstract java.lang.String getElementName(T element)
throws XML2JavaMapperException
- Throws:
XML2JavaMapperException
isTextElement
public abstract boolean isTextElement(T element)
throws XML2JavaMapperException
- Throws:
XML2JavaMapperException
isTextOnly
public abstract boolean isTextOnly(T element)
throws XML2JavaMapperException
- Throws:
XML2JavaMapperException
getFirstChildWithName
public abstract T getFirstChildWithName(T element,
javax.xml.namespace.QName name)
throws XML2JavaMapperException
- Throws:
XML2JavaMapperException
getRootElement
public abstract T getRootElement(T element)
throws XML2JavaMapperException
- Throws:
XML2JavaMapperException
getTargetType
public java.lang.Class<java.lang.Object> getTargetType()
- Specified by:
getTargetType
in class BaseTransformer<T,java.lang.Object>
getTargetDataBinding
public java.lang.String getTargetDataBinding()
- Description copied from interface:
Transformer
- Get the target type that this transformer transforms data into. The type is used as the key when the transformer
is registered with TransformerRegistry.
- Specified by:
getTargetDataBinding
in interface Transformer
- Overrides:
getTargetDataBinding
in class BaseTransformer<T,java.lang.Object>
- Returns:
- A key identifying the target type