org.compass.core.xml.dom4j.converter
Class STAXReaderXmlContentConverter

java.lang.Object
  extended by org.compass.core.xml.dom4j.converter.AbstractXmlWriterXmlContentConverter
      extended by org.compass.core.xml.dom4j.converter.STAXReaderXmlContentConverter
All Implemented Interfaces:
CompassConfigurable, SupportsXmlContentWrapper, XmlContentConverter

public class STAXReaderXmlContentConverter
extends AbstractXmlWriterXmlContentConverter
implements SupportsXmlContentWrapper, CompassConfigurable

A dom4j xml content mapping converter, which uses dom4j STAXEventReader to convert the xml string into a Dom4jAliasedXmlObject.

Author:
kimchy

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.compass.core.converter.xsem.SupportsXmlContentWrapper
SupportsXmlContentWrapper.NotSupportedXmlContentWrapperException
 
Constructor Summary
STAXReaderXmlContentConverter()
           
 
Method Summary
 void configure(CompassSettings settings)
          Configure using the given settings.
protected  STAXEventReader doCreateStaxReader(CompassSettings settings)
           
 AliasedXmlObject fromXml(String alias, Reader xml)
          Uses dom4j XPP3Reader to convert the given xml string into a Dom4jAliasedXmlObject.
 boolean supports(String wrapper)
          This converter does not support a singleton wrapper strategy.
 String toXml1(XmlObject xmlObject)
           
 
Methods inherited from class org.compass.core.xml.dom4j.converter.AbstractXmlWriterXmlContentConverter
toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STAXReaderXmlContentConverter

public STAXReaderXmlContentConverter()
Method Detail

configure

public void configure(CompassSettings settings)
               throws CompassException
Description copied from interface: CompassConfigurable
Configure using the given settings.

Specified by:
configure in interface CompassConfigurable
Parameters:
settings - The settings for the configured object
Throws:
CompassException

doCreateStaxReader

protected STAXEventReader doCreateStaxReader(CompassSettings settings)

supports

public boolean supports(String wrapper)
This converter does not support a singleton wrapper strategy.

Specified by:
supports in interface SupportsXmlContentWrapper

fromXml

public AliasedXmlObject fromXml(String alias,
                                Reader xml)
                         throws ConversionException
Uses dom4j XPP3Reader to convert the given xml string into a Dom4jAliasedXmlObject.

Specified by:
fromXml in interface XmlContentConverter
Parameters:
alias - The alias that will be associated with the AliasedXmlObject
xml - The xml string to convert into an Dom4jAliasedXmlObject
Returns:
A Dom4jAliasedXmlObject parsed from the given xml string and associated with the given alias
Throws:
ConversionException - In case the xml parsing failed

toXml1

public String toXml1(XmlObject xmlObject)
              throws ConversionException
Throws:
ConversionException


Copyright (c) 2004-2008 The Compass Project.