01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: //
21: // This file was generated by the JavaTM Architecture for XML Binding(JAXB)
22: // Reference Implementation, v2.0-06/22/2005 01:29 PM(ryans)-EA2
23: // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
24: // Any modifications to this file will be lost upon recompilation of the source
25: // schema.
26: // Generated on: 2005.09.05 at 07:05:33 PM MSD
27: //
28: package org.netbeans.modules.bpel.model.api.support;
29:
30: /**
31: * Java class for tRoles.
32: * <p>
33: * The following schema fragment specifies the expected content contained within
34: * this class.
35: * <p>
36: *
37: * <pre>
38: * <simpleType name="tRoles">
39: * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
40: * <enumeration value="myRole"/>
41: * <enumeration value="partnerRole"/>
42: * </restriction>
43: * </simpleType>
44: * </pre>
45: */
46: public enum Roles implements EnumValue {
47:
48: MY_ROLE("myRole"), PARTNER_ROLE("partnerRole"), INVALID(); // NOI18N
49:
50: Roles(String v) {
51: myValue = v;
52: }
53:
54: Roles() {
55: }
56:
57: /*
58: * (non-Javadoc)
59: *
60: * @see java.lang.Object#toString()
61: */
62: /** {@inheritDoc} */
63: public String toString() {
64: return "" + myValue;
65: }
66:
67: /*
68: * (non-Javadoc)
69: *
70: * @see org.netbeans.modules.soa.model.bpel.api.support.EnumValue#isInvalid()
71: */
72: /** {@inheritDoc} */
73: public boolean isInvalid() {
74: return this .equals(INVALID);
75: }
76:
77: /**
78: * Returns enumeration via its string representation.
79: *
80: * @param str
81: * string that represent enumeration.
82: * @return enumeration.
83: */
84: public static Roles forString(String str) {
85: if (str == null) {
86: return null;
87: }
88: Roles[] roles = Roles.values();
89: for (int i = 0; i < roles.length; i++) {
90: if (roles[i].toString().equals(str)) {
91: return roles[i];
92: }
93: }
94: return INVALID;
95: }
96:
97: private String myValue;
98:
99: }
|