Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlCursor$TokenType


  /**
   * get the TableCell which belongs to the TableCell
   * @param cell
   */
  public XWPFTableCell getTableCell(CTTc cell) {
    XmlCursor cursor = cell.newCursor();
    cursor.toParent();
    XmlObject o = cursor.getObject();
    if(!(o instanceof CTRow)){
      return null;
    }
    CTRow row = (CTRow)o;
    cursor.toParent();
    o = cursor.getObject();
        cursor.dispose();
    if(! (o instanceof CTTbl)){
      return null;
    }
    CTTbl tbl = (CTTbl) o;
    XWPFTable table = getTable(tbl);
View Full Code Here


            initFootnotes();
          
           
            // parse the document with cursor and add
            // the XmlObject to its lists
        XmlCursor cursor = ctDocument.getBody().newCursor();
            cursor.selectPath("./*");
            while (cursor.toNextSelection()) {
                XmlObject o = cursor.getObject();
                if (o instanceof CTP) {
                  XWPFParagraph p = new XWPFParagraph((CTP)o, this);
                  bodyElements.add(p);
                  paragraphs.add(p);
                }
                if (o instanceof CTTbl) {
                  XWPFTable t = new XWPFTable((CTTbl)o, this);
                  bodyElements.add(t);
                  tables.add(t);
                }
            }
            cursor.dispose();
     
            // Sort out headers and footers
      if (doc.getDocument().getBody().getSectPr() != null)
        headerFooterPolicy = new XWPFHeaderFooterPolicy(this);
       
View Full Code Here

      //TODO handle: not creating POSIX element if HPCProfile already exists
      return getPOSIXApplication(value);
    }
   
    if (getPOSIXApplication(value) == null) {
      XmlCursor acursor = application.newCursor();
      acursor.toEndToken();
      acursor.insertElement(POSIX_APPLICATION);
      acursor.dispose();
    }
    return getPOSIXApplication(value);
  }
View Full Code Here

  public static SPMDApplicationType getOrCreateSPMDApplication(JobDefinitionType value) {
   
    ApplicationType application = getOrCreateApplication(value);
   
    if (getSPMDApplication(value) == null) {
      XmlCursor acursor = application.newCursor();
      acursor.toEndToken();
      acursor.insertElement(SPMD_APPLICATION);
      acursor.dispose();
    }
    return getSPMDApplication(value);
  }
View Full Code Here

  public static SPMDApplicationType getSPMDApplication(JobDefinitionType value) {
    if (value != null &&
        value.getJobDescription() != null &&
        value.getJobDescription().isSetApplication() ) {
      XmlCursor acursor = value.getJobDescription().getApplication().newCursor();
      if (acursor.toFirstChild()) {
        do {
          if(acursor.getName().equals(SPMD_APPLICATION)) {
            XmlObject result = acursor.getObject();
            acursor.dispose();
            return (SPMDApplicationType) result;
          }
        } while (acursor.toNextSibling());
        acursor.dispose();
        return null;
      } else {
        acursor.dispose();                              
        return null;
      }
    } else {
      return null;
    }
View Full Code Here

 
  public static POSIXApplicationType getPOSIXApplication(JobDefinitionType value) {
    if (value != null &&
        value.getJobDescription() != null &&
        value.getJobDescription().isSetApplication() ) {
      XmlCursor acursor = value.getJobDescription().getApplication().newCursor();
      if (acursor.toFirstChild()) {
        do {
          if(acursor.getName().equals(POSIX_APPLICATION)) {
            XmlObject result = acursor.getObject();
            acursor.dispose();
            return (POSIXApplicationType) result;
          }
        } while (acursor.toNextSibling());
        acursor.dispose();
        return null;
      } else {
        acursor.dispose();                              
        return null;
      }
    } else {
      return null;
    }
View Full Code Here

      //TODO handle: creating HPC element if POSIX already exists
      return getHPCProfileApplication(value);
    }
   
    if (getHPCProfileApplication(value) == null) {
      XmlCursor acursor = application.newCursor();
      acursor.toEndToken();
      acursor.insertElement(HPC_PROFILE_APPLICATION);
      acursor.dispose();
    }
    return getHPCProfileApplication(value);
  }
View Full Code Here

 
  public static HPCProfileApplicationType getHPCProfileApplication(JobDefinitionType value) {
    if (value != null &&
        value.getJobDescription() != null &&
        value.getJobDescription().isSetApplication() ) {
      XmlCursor acursor = value.getJobDescription().getApplication().newCursor();
      if (acursor.toFirstChild()) {
        do {
          if(acursor.getName().equals(HPC_PROFILE_APPLICATION)) {
            XmlObject result = acursor.getObject();
            acursor.dispose();
            return (HPCProfileApplicationType) result;
          }
        } while (acursor.toNextSibling());
        acursor.dispose();
        return null;
      } else {
        acursor.dispose();                              
        return null;
      }
    } else {
      return null;
    }
View Full Code Here

        defaultTableModel.addRow(new Object[] { getIOStringList()[1], parameter.getParameterName(), parameter.getParameterType().getName(),parameter.getParameterDescription()})
    }
      addNewRowIfLastIsNotEmpty();
      Boolean selected = false;
      if (descType.getPortType()!=null && descType.getPortType().getMethod()!=null) {
      XmlCursor cursor = descType.getPortType().getMethod().newCursor();
//      cursor.toNextToken();
      String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
      cursor.dispose();
      selected = false;
      if (value != null) {
        selected = Boolean.parseBoolean(value);
      }
    }
View Full Code Here

        getServiceDescriptionType().getPortType().setMethod(getServiceDescriptionType().getPortType().addNewMethod());
      }
    }
    public void setForceFileStagingToWorkDir(Boolean force){
      setupMethod();
      XmlCursor cursor = getServiceDescriptionType().getPortType().getMethod().newCursor();
      cursor.toNextToken();
    if (!cursor.setAttributeText(new QName("http://airavata.apache.org/schemas/gfac/2012/12","forceFileStagingToWorkDir"),force.toString())){
      cursor.insertAttributeWithValue("forceFileStagingToWorkDir",force.toString());
    }
    cursor.dispose();
    }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlCursor$TokenType

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.