Package org.jdom.output

Examples of org.jdom.output.XMLOutputter.outputString()


        Element valueSerializer = new Element(StoreDefinitionsMapper.STORE_VALUE_SERIALIZER_ELMT);
        StoreDefinitionsMapper.addSerializer(valueSerializer, storeDefinition.getValueSerializer());
        store.addContent(valueSerializer);

        XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat());
        return serializer.outputString(store);
    }

    /**
     * Given an xml string containing the store's serialization information,
     * obtains the key serializer definition
View Full Code Here


                doc.getRootElement().addContent(mapZone(n));
        }
        for(Node n: cluster.getNodes())
            doc.getRootElement().addContent(mapServer(n, displayZones));
        XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat());
        return serializer.outputString(doc.getRootElement());
    }

    private Element mapZone(Zone zone) {
        Element zoneElement = new Element(ZONE_ELMT);
        zoneElement.addContent(new Element(ZONE_ID_ELMT).setText(Integer.toString(zone.getId())));
View Full Code Here

                root.addContent(viewToElement(def));
            else
                root.addContent(storeToElement(def));
        }
        XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat());
        return serializer.outputString(root);
    }

    public String writeStore(StoreDefinition store) {
        XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat());
        if(store.isView())
View Full Code Here

    }

    public String writeStore(StoreDefinition store) {
        XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat());
        if(store.isView())
            return serializer.outputString(viewToElement(store));
        else
            return serializer.outputString(storeToElement(store));
    }

    private Element storeToElement(StoreDefinition storeDefinition) {
View Full Code Here

    public String writeStore(StoreDefinition store) {
        XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat());
        if(store.isView())
            return serializer.outputString(viewToElement(store));
        else
            return serializer.outputString(storeToElement(store));
    }

    private Element storeToElement(StoreDefinition storeDefinition) {
        Element store = new Element(STORE_ELMT);
        store.addContent(new Element(STORE_NAME_ELMT).setText(storeDefinition.getName()));
View Full Code Here

  public String toXmlString ()
  {
    Document jdom = toXmlDocument ();
    XMLOutputter outputter = new XMLOutputter ();
    return outputter.outputString (jdom);
  }

  public int size ()
  {
    return extractedSpans.size();
View Full Code Here

    private static String normXML(String s) throws JDOMException, IOException {
        String s2 = stripComment(s);
        String s3 = stripProlog(s2);
        Document d = new SAXBuilder().build(new ByteArrayInputStream(s3.getBytes()));
        XMLOutputter outputter  = new XMLOutputter(Format.getPrettyFormat());
        return outputter.outputString(d);
    }
   
    private static String stripComment(String s) {
        return Pattern.compile("<!--(.*?)-->", Pattern.DOTALL).matcher(s).replaceAll("");       
    }
View Full Code Here

       
        XMLOutputter outputter = new XMLOutputter(Format.getCompactFormat());
        StringBuilder sb = new StringBuilder();   
        List<Element> children = el.getChildren();
        for (Element child : children) {
            sb.append(outputter.outputString(child));
        }
        return sb.toString();
    }

    private static Object handleValue(Element val, String type) {
View Full Code Here

      keyElement.setAttribute("email", key.getEmail());
      keysElement.addContent(keyElement);
    }
    document.setRootElement(keysElement);
    XMLOutputter outputter = new XMLOutputter();
    return outputter.outputString(document);
  }
}
View Full Code Here

      policyElement.setAttribute("directive", policy.getDirective());
      policiesElement.addContent(policyElement);
    }
    document.setRootElement(policiesElement);
    XMLOutputter outputter = new XMLOutputter();
    return outputter.outputString(document);
  }
 
  /**
   * Creates a JSON representaion of an array of policies
   * @param policies the array of policies to represent
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.