|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.xml.javax.converter.NodeXmlContentConverter
public class NodeXmlContentConverter
Uses JSE to convert an xml content to and from NodeAliasedXmlObject.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.compass.core.converter.xsem.SupportsXmlContentWrapper |
|---|
SupportsXmlContentWrapper.NotSupportedXmlContentWrapperException |
| Field Summary | |
|---|---|
protected DocumentBuilder |
documentBuilder
|
protected Transformer |
transformer
|
| Constructor Summary | |
|---|---|
NodeXmlContentConverter()
|
|
| Method Summary | |
|---|---|
void |
configure(CompassSettings settings)
Configure using the given settings. |
protected DocumentBuilder |
doCreateDocumentBuilder(CompassSettings settings)
An extension point allowing to control how a DocumentBuilder is
created. |
protected Transformer |
doCreateTransformer(CompassSettings settings)
An extension point allowing to control how a Transformer is
created. |
AliasedXmlObject |
fromXml(String alias,
Reader xml)
Uses the already created DocumentBuilder
and parse the given xml into a NodeAliasedXmlObject. |
boolean |
supports(String wrapper)
This converter does not support a singleton wrapper strategy. |
String |
toXml(XmlObject xmlObject)
Converts a NodeXmlObject into an xml string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DocumentBuilder documentBuilder
protected Transformer transformer
| Constructor Detail |
|---|
public NodeXmlContentConverter()
| Method Detail |
|---|
public void configure(CompassSettings settings)
throws CompassException
CompassConfigurable
configure in interface CompassConfigurablesettings - The settings for the configured object
CompassException
protected DocumentBuilder doCreateDocumentBuilder(CompassSettings settings)
throws ParserConfigurationException
DocumentBuilder is
created. By default uses DocumentBuilderFactory.newInstance().newDocumentBuilder().
ParserConfigurationException
protected Transformer doCreateTransformer(CompassSettings settings)
throws TransformerConfigurationException
Transformer is
created. By default uses TransformerFactory.newInstance().newTransformer().
TransformerConfigurationExceptionpublic boolean supports(String wrapper)
supports in interface SupportsXmlContentWrapper
public AliasedXmlObject fromXml(String alias,
Reader xml)
throws ConversionException
DocumentBuilder
and parse the given xml into a NodeAliasedXmlObject.
fromXml in interface XmlContentConverteralias - The alias that will be associated with the NodeAliasedXmlObjectxml - The xml string to parse into NodeAliasedXmlObject
NodeAliasedXmlObject parsed from the given xml string and associated with the given alias
ConversionException - In case the xml parsing failed
public String toXml(XmlObject xmlObject)
throws ConversionException
NodeXmlObject into an xml string.
Uses the created Transformer to do it.
toXml in interface XmlContentConverterxmlObject - The NodeXmlObject to convert into an xml string
NodeXmlObject
ConversionException - Should not really happen...
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||