001: /*
002: * Copyright (c) 2002-2003 by OpenSymphony
003: * All rights reserved.
004: */
005: package com.opensymphony.workflow.loader;
006:
007: import org.w3c.dom.Element;
008:
009: /**
010: * Date: Nov 10, 2004 Time: 2:38:56 AM
011: * @author hani
012: */
013: public class DescriptorFactory {
014: //~ Static fields/initializers /////////////////////////////////////////////
015:
016: private static DescriptorFactory factory = new DescriptorFactory();
017:
018: //~ Constructors ///////////////////////////////////////////////////////////
019:
020: public DescriptorFactory() {
021: }
022:
023: //~ Methods ////////////////////////////////////////////////////////////////
024:
025: public static void setFactory(DescriptorFactory factory) {
026: DescriptorFactory.factory = factory;
027: }
028:
029: public static DescriptorFactory getFactory() {
030: return factory;
031: }
032:
033: public ActionDescriptor createActionDescriptor() {
034: return new ActionDescriptor();
035: }
036:
037: public ActionDescriptor createActionDescriptor(Element action) {
038: return new ActionDescriptor(action);
039: }
040:
041: public ConditionDescriptor createConditionDescriptor() {
042: return new ConditionDescriptor();
043: }
044:
045: public ConditionDescriptor createConditionDescriptor(
046: Element function) {
047: return new ConditionDescriptor(function);
048: }
049:
050: public ConditionalResultDescriptor createConditionalResultDescriptor() {
051: return new ConditionalResultDescriptor();
052: }
053:
054: public ConditionalResultDescriptor createConditionalResultDescriptor(
055: Element element) {
056: return new ConditionalResultDescriptor(element);
057: }
058:
059: public ConditionsDescriptor createConditionsDescriptor() {
060: return new ConditionsDescriptor();
061: }
062:
063: public ConditionsDescriptor createConditionsDescriptor(
064: Element element) {
065: return new ConditionsDescriptor(element);
066: }
067:
068: public FunctionDescriptor createFunctionDescriptor() {
069: return new FunctionDescriptor();
070: }
071:
072: public FunctionDescriptor createFunctionDescriptor(Element function) {
073: return new FunctionDescriptor(function);
074: }
075:
076: public JoinDescriptor createJoinDescriptor(Element join) {
077: return new JoinDescriptor(join);
078: }
079:
080: public JoinDescriptor createJoinDescriptor() {
081: return new JoinDescriptor();
082: }
083:
084: public PermissionDescriptor createPermissionDescriptor() {
085: return new PermissionDescriptor();
086: }
087:
088: public PermissionDescriptor createPermissionDescriptor(
089: Element permission) {
090: return new PermissionDescriptor(permission);
091: }
092:
093: public RegisterDescriptor createRegisterDescriptor(Element register) {
094: return new RegisterDescriptor(register);
095: }
096:
097: public RegisterDescriptor createRegisterDescriptor() {
098: return new RegisterDescriptor();
099: }
100:
101: public ResultDescriptor createResultDescriptor() {
102: return new ResultDescriptor();
103: }
104:
105: public ResultDescriptor createResultDescriptor(Element element) {
106: return new ResultDescriptor(element);
107: }
108:
109: public SplitDescriptor createSplitDescriptor() {
110: return new SplitDescriptor();
111: }
112:
113: public SplitDescriptor createSplitDescriptor(Element split) {
114: return new SplitDescriptor(split);
115: }
116:
117: public StepDescriptor createStepDescriptor() {
118: return new StepDescriptor();
119: }
120:
121: public StepDescriptor createStepDescriptor(Element step) {
122: return new StepDescriptor(step);
123: }
124:
125: public StepDescriptor createStepDescriptor(Element step,
126: AbstractDescriptor parent) {
127: return new StepDescriptor(step, parent);
128: }
129:
130: public ValidatorDescriptor createValidatorDescriptor() {
131: return new ValidatorDescriptor();
132: }
133:
134: public ValidatorDescriptor createValidatorDescriptor(
135: Element validator) {
136: return new ValidatorDescriptor(validator);
137: }
138:
139: public WorkflowDescriptor createWorkflowDescriptor(Element root) {
140: return new WorkflowDescriptor(root);
141: }
142:
143: public WorkflowDescriptor createWorkflowDescriptor() {
144: return new WorkflowDescriptor();
145: }
146: }
|