View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4    * Schema.
5    * $Id: InvocationType.java,v 1.14 2007/01/04 16:26:06 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.resource.types;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import java.io.Serializable;
15  import java.util.Enumeration;
16  import java.util.Hashtable;
17  import org.exolab.castor.xml.Marshaller;
18  import org.exolab.castor.xml.Unmarshaller;
19  
20  /***
21   * Class InvocationType.
22   * 
23   * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:06 $
24   */
25  public class InvocationType implements java.io.Serializable {
26  
27  
28        //--------------------------/
29       //- Class/Member Variables -/
30      //--------------------------/
31  
32      /***
33       * The Custom type
34       */
35      public static final int CUSTOM_TYPE = 0;
36  
37      /***
38       * The instance of the Custom type
39       */
40      public static final InvocationType CUSTOM = new InvocationType(CUSTOM_TYPE, "Custom");
41  
42      /***
43       * The Extended type
44       */
45      public static final int EXTENDED_TYPE = 1;
46  
47      /***
48       * The instance of the Extended type
49       */
50      public static final InvocationType EXTENDED = new InvocationType(EXTENDED_TYPE, "Extended");
51  
52      /***
53       * The WebService type
54       */
55      public static final int WEBSERVICE_TYPE = 2;
56  
57      /***
58       * The instance of the WebService type
59       */
60      public static final InvocationType WEBSERVICE = new InvocationType(WEBSERVICE_TYPE, "WebService");
61  
62      /***
63       * The WebBrowser type
64       */
65      public static final int WEBBROWSER_TYPE = 3;
66  
67      /***
68       * The instance of the WebBrowser type
69       */
70      public static final InvocationType WEBBROWSER = new InvocationType(WEBBROWSER_TYPE, "WebBrowser");
71  
72      /***
73       * The GLUService type
74       */
75      public static final int GLUSERVICE_TYPE = 4;
76  
77      /***
78       * The instance of the GLUService type
79       */
80      public static final InvocationType GLUSERVICE = new InvocationType(GLUSERVICE_TYPE, "GLUService");
81  
82      /***
83       * Field _memberTable
84       */
85      private static java.util.Hashtable _memberTable = init();
86  
87      /***
88       * Field type
89       */
90      private int type = -1;
91  
92      /***
93       * Field stringValue
94       */
95      private java.lang.String stringValue = null;
96  
97  
98        //----------------/
99       //- Constructors -/
100     //----------------/
101 
102     private InvocationType(int type, java.lang.String value) {
103         super();
104         this.type = type;
105         this.stringValue = value;
106     } //-- org.astrogrid.registry.beans.resource.types.InvocationType(int, java.lang.String)
107 
108 
109       //-----------/
110      //- Methods -/
111     //-----------/
112 
113     /***
114      * Method enumerateReturns an enumeration of all possible
115      * instances of InvocationType
116      */
117     public static java.util.Enumeration enumerate()
118     {
119         return _memberTable.elements();
120     } //-- java.util.Enumeration enumerate() 
121 
122     /***
123      * Method getTypeReturns the type of this InvocationType
124      */
125     public int getType()
126     {
127         return this.type;
128     } //-- int getType() 
129 
130     /***
131      * Method init
132      */
133     private static java.util.Hashtable init()
134     {
135         Hashtable members = new Hashtable();
136         members.put("Custom", CUSTOM);
137         members.put("Extended", EXTENDED);
138         members.put("WebService", WEBSERVICE);
139         members.put("WebBrowser", WEBBROWSER);
140         members.put("GLUService", GLUSERVICE);
141         return members;
142     } //-- java.util.Hashtable init() 
143 
144     /***
145      * Method toStringReturns the String representation of this
146      * InvocationType
147      */
148     public java.lang.String toString()
149     {
150         return this.stringValue;
151     } //-- java.lang.String toString() 
152 
153     /***
154      * Method valueOfReturns a new InvocationType based on the
155      * given String value.
156      * 
157      * @param string
158      */
159     public static org.astrogrid.registry.beans.resource.types.InvocationType valueOf(java.lang.String string)
160     {
161         java.lang.Object obj = null;
162         if (string != null) obj = _memberTable.get(string);
163         if (obj == null) {
164             String err = "'" + string + "' is not a valid InvocationType";
165             throw new IllegalArgumentException(err);
166         }
167         return (InvocationType) obj;
168     } //-- org.astrogrid.registry.beans.resource.types.InvocationType valueOf(java.lang.String) 
169 
170 }