001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: //
021: // This file was generated by the JavaTM Architecture for XML Binding(JAXB)
022: // Reference Implementation, v2.0-06/22/2005 01:29 PM(ryans)-EA2
023: // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
024: // Any modifications to this file will be lost upon recompilation of the source
025: // schema.
026: // Generated on: 2005.09.05 at 07:05:33 PM MSD
027: //
028: package org.netbeans.modules.bpel.model.api.support;
029:
030: /**
031: * Java class for tBoolean.
032: * <p>
033: * The following schema fragment specifies the expected content contained within
034: * this class.
035: * <p>
036: *
037: * <pre>
038: * <simpleType name="tBoolean">
039: * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
040: * <enumeration value="yes"/>
041: * <enumeration value="no"/>
042: * </restriction>
043: * </simpleType>
044: * </pre>
045: */
046: public enum TBoolean implements EnumValue {
047:
048: NO("no"), YES("yes"), INVALID(); // NOI18N
049:
050: TBoolean() {
051: }
052:
053: TBoolean(String v) {
054: value = v;
055: }
056:
057: /*
058: * (non-Javadoc)
059: *
060: * @see java.lang.Object#toString()
061: */
062: /** {@inheritDoc} */
063: public String toString() {
064: return "" + value;
065: }
066:
067: /*
068: * (non-Javadoc)
069: *
070: * @see org.netbeans.modules.soa.model.bpel.api.support.EnumValue#isInvalid()
071: */
072: /** {@inheritDoc} */
073: public boolean isInvalid() {
074: return this .equals(INVALID);
075: }
076:
077: /**
078: * @deprecated Method can return null value. So it means that
079: * boolean type is not appropriate type for represent this enum.
080: * @return boolean representation of enumeration.
081: */
082: @Deprecated
083: public Boolean getBoolean() {
084: if (this .equals(NO)) {
085: return Boolean.FALSE;
086: }
087: if (this .equals(YES)) {
088: return Boolean.TRUE;
089: }
090: return null;
091: }
092:
093: /**
094: * Returns enum by its string value.
095: *
096: * @param str
097: * string representation.
098: * @return enum.
099: */
100: public static TBoolean forString(String str) {
101: if (str == null) {
102: return null;
103: }
104: TBoolean[] values = TBoolean.values();
105: for (TBoolean value : values) {
106: if (value.toString().equals(str)) {
107: return value;
108: }
109: }
110: return INVALID;
111: }
112:
113: private String value;
114: }
|