Package com.thoughtworks.xstream.io.xml

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


    // retrieve metadata folder
    _metadataFolder = _tmlFile.getParent().getFolder(new Path("metadata"));
    if (_metadataFolder.exists()) {
      _metadataFile = _metadataFolder.getFile(_tmlFile.getName().substring(0, _tmlFile.getName().length() - _tmlFile.getFileExtension().length()) + "metadata.xml");
      if (_metadataFile.exists()) {
        XStream xstream = new XStream(new DomDriver());
        xstream.alias(TMLMetadataInfo.XSTREAM_ALIAS, TMLMetadataInfo.class);
        Reader reader = null;
        try {
          if(!_metadataFile.isSynchronized(IResource.DEPTH_ZERO)){
            _metadataFile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
View Full Code Here


      TMLMetadataInfo metaData = new TMLMetadataInfo();
      metaData.setDirectAccess(directAccess);
      metaData.setDescription(description);
      metaData.setCacheable(cacheable);
      metaData.setCategory(category);
      XStream xstream = new XStream(new DomDriver());
      xstream.alias(TMLMetadataInfo.XSTREAM_ALIAS, TMLMetadataInfo.class);
      Writer writer = null;
      try {
        if (!_metadataFolder.exists()) {
          _metadataFolder.create(true, true, new NullProgressMonitor())
View Full Code Here

  public static TMLTagDefinitions fromXML(Reader in) {
    return (TMLTagDefinitions) createXStream().fromXML(in);
  }

  private static XStream createXStream() {
    XStream xstream = new XStream(new DomDriver());
    xstream.setClassLoader(TMLTagDefinitions.class.getClassLoader());
    xstream.setMode(XStream.NO_REFERENCES);
    xstream.alias("tagDefinitions", TMLTagDefinitions.class);
    xstream.alias("tag", TMLTag.class);
    xstream.alias("attribute", TMLTagAttribute.class);
View Full Code Here

    public static XStream getAnnotationProcessableXStreamInstance() {
        final XStream xstream;
        if(ClassResolver.isPresent(XPP_CLASS)) {
            xstream = new XStream();
        } else {
            xstream = new XStream(new DomDriver());
        }
        xstream.autodetectAnnotations(true);
        return xstream;
    }
View Full Code Here

  }
 
  private static class DOMXStream extends ThreadLocal {

    protected Object initialValue(){
      return  new BoboXStream(new DomDriver());
    }
View Full Code Here

  }

  public Collection query() {
    try {
      if (new File(filename).exists()) {
        XStream xstream = new XStream(new DomDriver());
        xstream.setMode(XStream.ID_REFERENCES);
        FileReader reader = new FileReader(filename);
        objects = (Set) xstream.fromXML(reader);
        reader.close();
      }
View Full Code Here

    }
  }

  public void close() {
    try {
      XStream xstream = new XStream(new DomDriver());
      xstream.setMode(XStream.ID_REFERENCES);
      FileWriter writer = new FileWriter(filename);
      xstream.toXML(objects, writer);
      writer.close();
    } catch (Exception e) {
View Full Code Here

  /**
   * Writes objects to XML-File.
   */
  public void write(Collection objects) {
    try {
      XStream xstream = new XStream(new DomDriver());
      xstream.setMode(XStream.ID_REFERENCES);
      FileWriter writer = new FileWriter(filename);
      xstream.toXML(new ArrayList(objects), writer);
      writer.close();
    } catch (IOException e) {
View Full Code Here

  /**
   * Reads collection from XML-File.
   */
  public Collection read() {
    try {
      XStream xstream = new XStream(new DomDriver());
      xstream.setMode(XStream.ID_REFERENCES);
      FileReader reader = new FileReader(filename);
      List objects = (List) xstream.fromXML(reader);
      reader.close();
      return objects;
View Full Code Here

        log.debug("lastname " + lastname);
        log.debug("profilePictureUrl " + profilePictureUrl);
        log.debug("email " + email);

        // XStream xStream = new XStream(new XppDriver());
        XStream xStream = new XStream(new DomDriver("UTF-8"));
        xStream.setMode(XStream.NO_REFERENCES);
        String xmlString = xStream.toXML(remoteSessionObject);

        log.debug("xmlString " + xmlString);
View Full Code Here

TOP

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

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.