Package com.thoughtworks.xstream.io.xml

Examples of com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer


public final class DTMReader extends AbstractDocumentReader {

    private DTMElement currentElement;

    public DTMReader(DTMDocument docmentRoot) {
        this((DTMElement) docmentRoot.firstChild(), new XmlFriendlyReplacer());
    }
View Full Code Here


    public DTMReader(DTMDocument docmentRoot, XmlFriendlyReplacer replacer) {
        this((DTMElement) docmentRoot.firstChild(), replacer);
    }

    public DTMReader(DTMElement rootElement) {
        super(rootElement, new XmlFriendlyReplacer());
    }
View Full Code Here

    }

    private static XStream initializeXStream() {
        // This constructor prevents underscores from being replaced with double
        // underscores
        XStream xStream = new XStream(new DomDriver("UTF-8", new XmlFriendlyReplacer("|", "_")));

        //if you use annotated xstream POJOs register them here
//      xStream.processAnnotations(CssParameter.class);
        return xStream;
    }
View Full Code Here

    HierarchicalStreamWriter streamWriter;
    if (node instanceof Document) {
      streamWriter = new DomWriter((Document) node);
    }
    else if (node instanceof Element) {
      streamWriter = new DomWriter((Element) node, node.getOwnerDocument(), new XmlFriendlyReplacer());
    }
    else {
      throw new IllegalArgumentException("DOMResult contains neither Document nor Element");
    }
    marshal(graph, streamWriter);
View Full Code Here

    /** Flag that tells if the reader is still "before" the first node. */
    protected boolean justStarted = true;

    public XppReader(XmlPullParser parser) {
        super(new XmlFriendlyReplacer());
        this.parser = parser;

        /*
         * As addition to the "hack" beyond we have to ensure that the parser works,
         * too, if XStream really pulls the very first
View Full Code Here

        private XStream createXStreamWithReplacer(String dollar, String underscore) {
            Exception ex;
            try {
                Constructor constructor = type.getConstructor(new Class[]{
                    String.class, String.class, int.class});
                XmlFriendlyReplacer replacer = (XmlFriendlyReplacer)constructor
                    .newInstance(new Object[]{dollar, underscore, new Integer(0)});
                return new XStream(new XppDriver(replacer));
            } catch (NoSuchMethodException e) {
                ex = e;
            } catch (InstantiationException e) {
View Full Code Here

    QName qname = new QName("http://www.w3.org/2005/Atom", "atom");
    qnameMap.registerMapping(qname, DefaultRelation.class);
    // we need the replacer because
    // xstream replaces an _ with __ (two underscore) more information at
    // http://xstream.codehaus.org/faq.html#XML_double_underscores
    XmlFriendlyReplacer replacer = new XmlFriendlyReplacer("$", "_");
    helper = new XStreamHelper(new StaxDriver(qnameMap, replacer));
  }
View Full Code Here

    private XStream xStream;

    @Override
    public void start() {
        xStream = new XStream(new AbstractXmlDriver(new XmlFriendlyReplacer()) {
            @Override
            public HierarchicalStreamReader createReader(Reader in) {
                return new XppReader(in, xmlFriendlyReplacer());
            }
View Full Code Here

  private ReadEvent currentReadEvent = null;

  HashMap<String, String> lookaheadMap = new HashMap<String, String>();

  public LookAheadXppReader(Reader reader) {
    this(reader, new XmlFriendlyReplacer());
  }
View Full Code Here

{

  private static boolean xppLibraryPresent;

  public LookAheadXppDriver() {
    super(new XmlFriendlyReplacer());
  }
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.