Package org.jdom

Examples of org.jdom.Document


        if(rootTag.length() == 0){
            ArgCheck.isNotZeroLength(rootTag,CorePlugin.Util.getString("JdomHelper.The_root_tag_name_may_not_be_zero-length_12")); //$NON-NLS-1$
        }
       
        Element root = new Element( rootTag );
        return new Document( root );
    }
View Full Code Here


    public List parseXMLQueryFile(String queryScenarioID, File queryFile, String querySetID) throws IOException, JDOMException {

  List<QueryTest> queries = new LinkedList();
//        HashMap queryMap = new HashMap();
        SAXBuilder builder = SAXBuilderHelper.createSAXBuilder(false);
        Document queryDocument = builder.build(queryFile);
        List queryElements = queryDocument.getRootElement().getChildren(TagNames.Elements.QUERY);
        Iterator iter = queryElements.iterator();
        while ( iter.hasNext() ) {
            Element queryElement = (Element) iter.next();
            String queryName = queryElement.getAttributeValue(TagNames.Attributes.NAME);
            if ( queryElement.getChild(TagNames.Elements.EXCEPTION) == null ) {
View Full Code Here

        QueryResults queryResults;
        ResultsHolder expectedResults = null;

        final SAXBuilder builder = SAXBuilderHelper.createSAXBuilder(false);
        final Document resultsDocument = builder.build(resultsFile);
        final String query = resultsDocument.getRootElement().getChildText(TagNames.Elements.QUERY);
        final List resultElements = resultsDocument.getRootElement().getChildren(TagNames.Elements.QUERY_RESULTS);
        final Iterator iter = resultElements.iterator();
        while ( iter.hasNext() ) {
            final Element resultElement = (Element) iter.next();
            final String resultName = resultElement.getAttributeValue(TagNames.Attributes.NAME);
            queryResults = consumeMsg(new QueryResults(), resultElement);
View Full Code Here

     * @exception JDOMException if there is an error consuming the message.
     */
    public Element parseXMLResultsFile(File resultsFile, Element parent) throws IOException, JDOMException {

        SAXBuilder builder = SAXBuilderHelper.createSAXBuilder(false);
        Document resultsDocument = builder.build(resultsFile);
        List resultElements = resultsDocument.getRootElement().getChildren(TagNames.Elements.QUERY_RESULTS);
        Iterator iter = resultElements.iterator();
        while ( iter.hasNext() ) {
            Element resultElement = (Element) iter.next();
            if ( resultElement.getChild(TagNames.Elements.SELECT) == null ) {
                // We've got an exception
View Full Code Here

      }

      // Output xml
      XMLOutputter outputter = new XMLOutputter(JdomHelper.getFormat(
        "  ", true)); //$NON-NLS-1$
      outputter.output(new Document(rootElement), outputStream);

  } catch (SQLException e) {
      throw new QueryTestFailedException(
        "Failed to convert results to JDOM: " + e.getMessage()); //$NON-NLS-1$
  } catch (JDOMException e) {
View Full Code Here

      rootElement.addContent(resultElement);

      // Output xml
      XMLOutputter outputter = new XMLOutputter(JdomHelper.getFormat(
        "  ", true)); //$NON-NLS-1$
      outputter.output(new Document(rootElement), outputStream);

  } catch (SQLException e) {
      throw new QueryTestFailedException(
        "Failed to convert error results to JDOM: " + e.getMessage()); //$NON-NLS-1$
  } catch (JDOMException e) {
View Full Code Here

      XmlDocumentReader xmlReader = new XmlDocumentReader();
      for (int i=0; i<eDocUriList.size(); i++) {
        Element eDocUri = (Element)eDocUriList.get(i);
        String docUri = eDocUri.getText();
        try {
          Document includedDoc = xmlReader.initializeDocument(docUri,false);
          java.util.List includedObjDefs = getChildDefinitions(includedDoc.getRootElement());
          for (int h=0; h<includedObjDefs.size(); h++) {
            objDefs.add((Element)includedObjDefs.get(h));
          }
        }
        catch (XmlDocumentReaderException e) {
View Full Code Here

    }

    try {
      XmlDocumentReader xmlReader = new XmlDocumentReader();
      boolean v = getValidation();
      Document cDoc =
        xmlReader.initializeDocument(new StringReader(configDocContents), v);
      setConfigDoc(cDoc);
    }
    catch (XmlDocumentReaderException e) {
      String errMessage =
View Full Code Here

      refreshObjectFromFile(name);
    }
  }

  private void refreshObjectFromFile(String objectName) throws EnterpriseConfigurationObjectException {
    Document configDoc = null;
    String docUri = getDocUri();
    try {
      XmlDocumentReader xmlReader = new XmlDocumentReader();
      if (docUri == null || docUri.length() == 0) {
        // we must be in a command
View Full Code Here

    Attribute aDefer = configElement.getAttribute("deferInitialization");
    if (aDefer != null) {
      deferInitialization = new Boolean(aDefer.getValue()).booleanValue();
    }

    Document enterpriseObjectsDoc = null;
    String messageObjectClassName = configElement.getChild("ObjectClass").getText();
    String messageObjectName = messageObjectClassName.substring(messageObjectClassName.lastIndexOf('.') + 1);
    String eoDocUri = null;

    java.util.List props = configElement.getChildren();
View Full Code Here

TOP

Related Classes of org.jdom.Document

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.