⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jaxp_fpdl_serializer.java.svn-base

📁 Fire-Workflow-Engine-All-In-One-20090208 包含全部文档
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
        startElement.setAttribute(ID, startNode.getId());        startElement.setAttribute(NAME, startNode.getName());        startElement.setAttribute(DISPLAY_NAME, startNode.getDisplayName());        Util4JAXPSerializer.addElement(document, startElement, DESCRIPTION, startNode.getDescription());        writeExtendedAttributes(startNode.getExtendedAttributes(), startElement, document);    }    protected void writeSynchronizers(List synchronizers, Element parent, Document document)            throws FPDLSerializerException {        if (synchronizers == null || synchronizers.size() == 0) {            return;        }        Element synchronizersElement = Util4JAXPSerializer.addElement(document, parent,                SYNCHRONIZERS);        Iterator iter = synchronizers.iterator();        while (iter.hasNext()) {            writeSynchronizer((Synchronizer) iter.next(), synchronizersElement, document);        }    }    protected void writeSynchronizer(Synchronizer synchronizer, Element parent, Document document)            throws FPDLSerializerException {        Element synchronizerElement = Util4JAXPSerializer.addElement(document, parent,                SYNCHRONIZER);        synchronizerElement.setAttribute(ID, synchronizer.getId());        synchronizerElement.setAttribute(NAME, synchronizer.getName());        synchronizerElement.setAttribute(DISPLAY_NAME, synchronizer.getDisplayName());        Util4JAXPSerializer.addElement(document, synchronizerElement, DESCRIPTION,                synchronizer.getDescription());        writeExtendedAttributes(synchronizer.getExtendedAttributes(),                synchronizerElement, document);    }    protected void writeActivities(List activities, Element parent, Document document)            throws FPDLSerializerException {        if (activities == null || activities.size() == 0) {            return;        }        Element activitiesElement = Util4JAXPSerializer.addElement(document, parent,                ACTIVITIES);        Iterator iter = activities.iterator();        while (iter.hasNext()) {            writeActivity((Activity) iter.next(), activitiesElement, document);        }    }    protected void writeActivity(Activity activity, Element parent, Document document)            throws FPDLSerializerException {        Element activityElement = Util4JAXPSerializer.addElement(document, parent, ACTIVITY);        activityElement.setAttribute(ID, activity.getId());        activityElement.setAttribute(NAME, activity.getName());        activityElement.setAttribute(DISPLAY_NAME, activity.getDisplayName());        activityElement.setAttribute(COMPLETION_STRATEGY, activity.getCompletionStrategy());        Util4JAXPSerializer.addElement(document, activityElement, DESCRIPTION, activity.getDescription());        writeEventListeners(activity.getEventListeners(), activityElement, document);        writeExtendedAttributes(activity.getExtendedAttributes(),                activityElement, document);        writeTasks(activity.getTasks(), activityElement, document);    }    protected void writeTasks(List tasks, Element parent, Document document)            throws FPDLSerializerException {        Element tasksElement = Util4JAXPSerializer.addElement(document, parent, TASKS);        Iterator iter = tasks.iterator();        while (iter.hasNext()) {            writeTask((Task) iter.next(), tasksElement, document);        }    }    protected void writeTask(Task task, Element parent, Document document)            throws FPDLSerializerException {        Element taskElement = Util4JAXPSerializer.addElement(document, parent, TASK);        taskElement.setAttribute(ID, task.getId());        taskElement.setAttribute(NAME, task.getName());        taskElement.setAttribute(DISPLAY_NAME, task.getDisplayName());        taskElement.setAttribute(TYPE, task.getType());//        taskElement.setAttribute(START_MODE, task.getStartMode());        taskElement.setAttribute(COMPLETION_STRATEGY, task.getAssignmentStrategy());        taskElement.setAttribute(DEFAULT_VIEW, task.getDefaultView());        taskElement.setAttribute(PRIORITY, Integer.toString(task.getPriority()));        taskElement.setAttribute(EXECUTION, task.getExecution());        Util4JAXPSerializer.addElement(document, taskElement, DESCRIPTION, task.getDescription());        writeForm(EDIT_FORM, task.getEditForm(), taskElement, document);        writeForm(VIEW_FORM, task.getViewForm(), taskElement, document);        writeForm(LIST_FORM, task.getListForm(), taskElement, document);        this.writeApplication(task.getApplication(), taskElement, document);        this.writeSubWorkflowProcess(task.getSubWorkflowProcess(), taskElement, document);        this.writePerformer(task.getPerformer(), taskElement, document);        writeDuration(task.getDuration(), taskElement, document);        writeEventListeners(task.getEventListeners(), taskElement, document);        writeExtendedAttributes(task.getExtendedAttributes(), taskElement, document);    }    protected void writeDuration(Duration duration, Element parent, Document document) {        if (duration == null) {            return;        }        Element durationElement = Util4JAXPSerializer.addElement(document, parent, DURATION);        durationElement.setAttribute(VALUE, Integer.toString(duration.getValue()));        durationElement.setAttribute(UNIT, duration.getUnit());        durationElement.setAttribute(IS_BUSINESS_TIME, Boolean.toString(duration.isBusinessTime()));    }    protected void writeForm(String formName, Form form, Element parent, Document document) {        if (form == null) {            return;        }        Element editFormElement = Util4JAXPSerializer.addElement(document, parent, formName);        editFormElement.setAttribute(NAME, form.getName());        editFormElement.setAttribute(DISPLAY_NAME, form.getDisplayName());        Util4JAXPSerializer.addElement(document, editFormElement, DESCRIPTION, form.getDescription());        Util4JAXPSerializer.addElement(document, editFormElement, URI, form.getUri());    }    protected void writeTransitions(List transitions, Element parent, Document document)            throws FPDLSerializerException {        if (transitions == null || transitions.size() == 0) {            return;        }        Element transitionsElement = Util4JAXPSerializer.addElement(document, parent,                TRANSITIONS);        Iterator iter = transitions.iterator();        while (iter.hasNext()) {            writeTransition((Transition) iter.next(), transitionsElement, document);        }    }    protected void writeTransition(Transition transition, Element parent, Document document)            throws FPDLSerializerException {        Element transitionElement = Util4JAXPSerializer.addElement(document, parent,                TRANSITION);        transitionElement.setAttribute(ID, transition.getId());        transitionElement.setAttribute(FROM, transition.getFromNode().getId());        transitionElement.setAttribute(TO, transition.getToNode().getId());        transitionElement.setAttribute(NAME, transition.getName());        transitionElement.setAttribute(DISPLAY_NAME, transition.getDisplayName());        Util4JAXPSerializer.addElement(document, transitionElement, CONDITION, transition.getCondition());        writeExtendedAttributes(transition.getExtendedAttributes(),                transitionElement, document);    }    protected Element writeExtendedAttributes(Map extendedAttributes,            Element parent, Document document) {        if (extendedAttributes == null || extendedAttributes.size() == 0) {            return null;        }        Element extendedAttributesElement =                Util4JAXPSerializer.addElement(document, parent,                EXTENDED_ATTRIBUTES);//                        parent//				.addElement(EXTENDED_ATTRIBUTES);        Iterator keys = extendedAttributes.keySet().iterator();        while (keys.hasNext()) {            Object key = keys.next();            Object value = extendedAttributes.get(key);            Element extendedAttributeElement = Util4JAXPSerializer.addElement(document,                    extendedAttributesElement, EXTENDED_ATTRIBUTE);            extendedAttributeElement.setAttribute(NAME, key.toString());            if (value != null) {                extendedAttributeElement.setAttribute(VALUE, value.toString());            }        }        return extendedAttributesElement;    }    protected void writePerformer(Participant participant, Element parent, Document document) {        if (participant == null) {            return;        }        Element participantElement = Util4JAXPSerializer.addElement(document, parent,                PERFORMER);        participantElement.setAttribute(NAME, participant.getName());        participantElement.setAttribute(DISPLAY_NAME, participant.getDisplayName());        Util4JAXPSerializer.addElement(document, participantElement, DESCRIPTION, participant.getDescription());        Util4JAXPSerializer.addElement(document, participantElement, ASSIGNMENT_HANDLER,                participant.getAssignmentHandler());    }    protected void writeSubWorkflowProcess(SubWorkflowProcess subWorkflowProcess, Element parent, Document document) {        if (subWorkflowProcess == null) {            return;        }        Element subflowElement = Util4JAXPSerializer.addElement(document, parent,                SUB_WORKFLOW_PROCESS);        subflowElement.setAttribute(NAME, subWorkflowProcess.getName());        subflowElement.setAttribute(DISPLAY_NAME, subWorkflowProcess.getDisplayName());        Util4JAXPSerializer.addElement(document, subflowElement, DESCRIPTION, subWorkflowProcess.getDescription());        Util4JAXPSerializer.addElement(document, subflowElement, WORKFLOW_PROCESS_ID,                subWorkflowProcess.getWorkflowProcessId());    }    protected void writeApplication(Application application, Element parent, Document document)            throws FPDLSerializerException {        if (application == null) {            return;        }        Element applicationElement = Util4JAXPSerializer.addElement(document, parent,                APPLICATION);        applicationElement.setAttribute(NAME, application.getName());        applicationElement.setAttribute(DISPLAY_NAME, application.getDisplayName());        Util4JAXPSerializer.addElement(document, applicationElement, DESCRIPTION, application.getDescription());        Util4JAXPSerializer.addElement(document, applicationElement, HANDLER, application.getHandler());    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -