Package org.dom4j

Examples of org.dom4j.DocumentFactory


  }

  public static DocumentFactory getDocumentFactory() {

    ClassLoader cl = ClassLoaderHelper.getContextClassLoader();
    DocumentFactory factory;
    try {
      Thread.currentThread().setContextClassLoader( XMLHelper.class.getClassLoader() );
      factory = DocumentFactory.getInstance();
    }
    finally {
View Full Code Here


    /**
     * @since 1.4
     */
    public Dom4JDriver(final NameCoder nameCoder) {
        this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
        outputFormat.setTrimText(false);
    }
View Full Code Here

    /**
     * @since 1.4
     */
    public Dom4JWriter(final Branch root, final NameCoder nameCoder) {
        this(root, new DocumentFactory(), nameCoder);
    }
View Full Code Here

     * @since 1.2.1
     * @deprecated As of 1.4 use {@link Dom4JWriter#Dom4JWriter(Branch, NameCoder)} instead
     */
    @Deprecated
    public Dom4JWriter(final Branch root, final XmlFriendlyReplacer replacer) {
        this(root, new DocumentFactory(), (NameCoder)replacer);
    }
View Full Code Here

    public Dom4JWriter(final Branch root, final XmlFriendlyReplacer replacer) {
        this(root, new DocumentFactory(), (NameCoder)replacer);
    }

    public Dom4JWriter(final Branch root) {
        this(root, new DocumentFactory(), new XmlFriendlyNameCoder());
    }
View Full Code Here

    /**
     * @since 1.2.1
     */
    public Dom4JWriter() {
        this(new DocumentFactory(), new XmlFriendlyNameCoder());
    }
View Full Code Here

   public void run()
   {
      processDir(jbossHome);
      try
      {
         DocumentFactory df = DocumentFactory.getInstance();
         Document doc = df.createDocument();
         Element root = doc.addElement("jar-versions");
         Iterator iter = jars.iterator();
         while( iter.hasNext() )
         {
            JarInfo info = (JarInfo) iter.next();
View Full Code Here

     * @return
     * @throws FPDLSerializerException
     */
    public Document workflowProcessToDom(WorkflowProcess workflowProcess)
            throws FPDLSerializerException {
        DocumentFactory df = new DocumentFactory();

        // serialize the Package
        Element workflowProcessElement = df.createElement(new QName(
                WORKFLOW_PROCESS, FPDL_NS));
        workflowProcessElement.addNamespace(FPDL_NS_PREFIX, FPDL_URI);
//      workflowProcessElement.addNamespace(XSD_NS_PREFIX, XSD_URI);
//      workflowProcessElement.addNamespace(XSI_NS_PREFIX, XSI_URI);
        workflowProcessElement.addAttribute(ID, workflowProcess.getId());
        workflowProcessElement.addAttribute(NAME, workflowProcess.getName());
        workflowProcessElement.addAttribute(DISPLAY_NAME, workflowProcess.getDisplayName());
        workflowProcessElement.addAttribute(RESOURCE_FILE, workflowProcess.getResourceFile());
        workflowProcessElement.addAttribute(RESOURCE_MANAGER, workflowProcess.getResourceManager());

        Util4Serializer.addElement(workflowProcessElement, DESCRIPTION,
                workflowProcess.getDescription());
        if (workflowProcess.getTaskInstanceCreator() != null && !workflowProcess.getTaskInstanceCreator().trim().equals("")) {
            workflowProcessElement.addAttribute(TASK_INSTANCE_CREATOR, workflowProcess.getTaskInstanceCreator());
        }
        if (workflowProcess.getFormTaskInstanceRunner()!=null && !workflowProcess.getFormTaskInstanceRunner().trim().equals("")){
            workflowProcessElement.addAttribute(FORM_TASK_INSTANCE_RUNNER, workflowProcess.getFormTaskInstanceRunner());
        }
        if (workflowProcess.getToolTaskInstanceRunner()!=null && !workflowProcess.getToolTaskInstanceRunner().trim().equals("")){
            workflowProcessElement.addAttribute(TOOL_TASK_INSTANCE_RUNNER, workflowProcess.getToolTaskInstanceRunner());
        }
        if (workflowProcess.getSubflowTaskInstanceRunner()!=null && !workflowProcess.getSubflowTaskInstanceRunner().trim().equals("")){
            workflowProcessElement.addAttribute(SUBFLOW_TASK_INSTANCE_RUNNER, workflowProcess.getSubflowTaskInstanceRunner());
        }
        if (workflowProcess.getFormTaskInstanceCompletionEvaluator()!=null && !workflowProcess.getFormTaskInstanceCompletionEvaluator().trim().equals("")){
            workflowProcessElement.addAttribute(FORM_TASK_INSTANCE_COMPLETION_EVALUATOR, workflowProcess.getFormTaskInstanceCompletionEvaluator());
        }
        if (workflowProcess.getToolTaskInstanceCompletionEvaluator()!=null && !workflowProcess.getToolTaskInstanceCompletionEvaluator().trim().equals("")){
            workflowProcessElement.addAttribute(TOOL_TASK_INSTANCE_COMPLETION_EVALUATOR, workflowProcess.getToolTaskInstanceCompletionEvaluator());
        }
        if (workflowProcess.getSubflowTaskInstanceCompletionEvaluator()!=null && !workflowProcess.getSubflowTaskInstanceCompletionEvaluator().trim().equals("")){
            workflowProcessElement.addAttribute(SUBFLOW_TASK_INSTANCE_COMPLETION_EVALUATOR, workflowProcess.getSubflowTaskInstanceCompletionEvaluator());
        }         
        writeDataFields(workflowProcess.getDataFields(), workflowProcessElement);
        writeStartNode(workflowProcess.getStartNode(), workflowProcessElement);

        writeTasks(workflowProcess.getTasks(), workflowProcessElement);

        writeActivities(workflowProcess.getActivities(), workflowProcessElement);
        writeSynchronizers(workflowProcess.getSynchronizers(),
                workflowProcessElement);
        writeEndNodes(workflowProcess.getEndNodes(), workflowProcessElement);
        writeTransitions(workflowProcess.getTransitions(),
                workflowProcessElement);

        writeLoops(workflowProcess.getLoops(), workflowProcessElement);

        writeEventListeners(workflowProcess.getEventListeners(), workflowProcessElement);

        writeExtendedAttributes(workflowProcess.getExtendedAttributes(),
                workflowProcessElement);

        Document document = df.createDocument(workflowProcessElement);
        document.addDocType(FPDL_NS_PREFIX + ":" + WORKFLOW_PROCESS, PUBLIC_ID, SYSTEM_ID);
        return document;

    }
View Full Code Here

     * @see org.fireflow.model.io.IFPDLParser#parse(java.io.InputStream)
     */
    public WorkflowProcess parse(InputStream in) throws IOException,
            FPDLParserException {
        try {
            SAXReader reader = new SAXReader(new DocumentFactory());
            reader.setEntityResolver(new EntityResolver() {

                String emptyDtd = "";
                ByteArrayInputStream bytels = new ByteArrayInputStream(emptyDtd.getBytes());

View Full Code Here

*/
public class MySigleton4DocumentFactory implements SingletonStrategy {

    public Object instance() {
        System.out.println("============InSideMySigleton4DocumentFactory........");
        return new DocumentFactory();
    }
View Full Code Here

TOP

Related Classes of org.dom4j.DocumentFactory

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.