View Javadoc

1   /*
2    * $Id: AbstractObjectCreationFactory.java,v 1.1 2004/12/15 14:18:09 patforna Exp $
3    *
4    * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
5    * Berne University of Applied Sciences
6    * School of Engineering and Information Technology
7    * All rights reserved.
8    */
9   package bexee.model.xmltobpel;
10  
11  import org.xml.sax.Attributes;
12  
13  import bexee.model.AttributeNames;
14  import bexee.model.StandardAttributes;
15  import bexee.model.process.BPELProcess;
16  
17  /***
18   * This class should be used as superclass by all classes wishing to transform
19   * BPEL xml elements into corresponding objects. The subclasses of this class
20   * will be then used by a <a
21   * href="http://jakarta.apache.org/commons/digester/">Digester </a> for object
22   * creation (see the Digester <factory-create-rule />).
23   * 
24   * @author Pawel Kowalski
25   * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:09 $
26   */
27  public abstract class AbstractObjectCreationFactory extends
28          org.apache.commons.digester.AbstractObjectCreationFactory implements
29          AttributeNames {
30  
31      //***************************************************/
32      // methods
33      //***************************************************/
34  
35      /***
36       * Get the standard BPEL attributes (name, joinCondition and
37       * suppressJoinFailure) from the <code>org.xml.sax.Attributes</code> and
38       * wrap them in a <code>StandardAttributes</code> object for further
39       * processing.
40       * 
41       * @param attributes
42       *            an <code>Attributes</code> value
43       * @return an <code>StandardAttributes</code> value
44       */
45      protected StandardAttributes getStandardAttributes(Attributes attributes) {
46          return new StandardAttributes(attributes);
47      }
48  
49      protected BPELElementFactory getElementFactory() {
50          return BPELElementFactory.getInstance((BPELProcess) getDigester()
51                  .getRoot());
52      }
53  }