All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.axis.message.addressing.FaultSubcodeValues Maven / Gradle / Ivy

Go to download

WS-Addressing implementation for Axis 1.4. Starting from the Apache Addressing project, closed in 2005, this project wants to provide a common implementation for any open source project that rely on non-interoperable modifications of the original source code.

The newest version!
/*
 *  Copyright (c) 2008 Rodrigo Ruiz
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.apache.axis.message.addressing;

import java.io.ObjectStreamException;
import java.util.HashMap;

import javax.xml.namespace.QName;

import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.EnumDeserializer;
import org.apache.axis.encoding.ser.EnumSerializer;

/**
 * Java content class for FaultSubcodeValues element declaration.
 * 

* The following schema fragment specifies the expected content contained within * this java content object. (defined at * http://schemas.xmlsoap.org/ws/2004/08/addressing line 110) * *

 * <xs:simpleType name="FaultSubcodeValues">
 *  <xs:restriction base="xs:QName">
 *      <xs:enumeration value="wsa:InvalidMessageInformationHeader"/>
 *      <xs:enumeration value="wsa:MessageInformationHeaderRequired"/>
 *      <xs:enumeration value="wsa:DestinationUnreachable"/>
 *      <xs:enumeration value="wsa:ActionNotSupported"/>
 *      <xs:enumeration value="wsa:EndpointUnavailable"/>
 *  </xs:restriction>
 * </xs:simpleType>
 * 
* * @author Davanum Srinivas * @version $Revision: 14 $ */ public class FaultSubcodeValues implements java.io.Serializable { /** * serialVersionUID attribute. */ private static final long serialVersionUID = -1501465950657426083L; /** * Value map. */ private static final HashMap TABLE = new HashMap(); /** SubCode. */ public static final QName V1 = qname("InvalidMessageInformationHeader"); /** SubCode. */ public static final QName V2 = qname("MessageInformationHeaderRequired"); /** SubCode. */ public static final QName V3 = qname("DestinationUnreachable"); /** SubCode. */ public static final QName V4 = qname("ActionNotSupported"); /** SubCode. */ public static final QName V5 = qname("EndpointUnavailable"); /** Enumeration value. */ public static final FaultSubcodeValues VALUE1 = new FaultSubcodeValues(V1); /** Enumeration value. */ public static final FaultSubcodeValues VALUE2 = new FaultSubcodeValues(V2); /** Enumeration value. */ public static final FaultSubcodeValues VALUE3 = new FaultSubcodeValues(V3); /** Enumeration value. */ public static final FaultSubcodeValues VALUE4 = new FaultSubcodeValues(V4); /** Enumeration value. */ public static final FaultSubcodeValues VALUE5 = new FaultSubcodeValues(V5); /** * Type meta-data. */ private static TypeDesc typeDesc = new TypeDesc(FaultSubcodeValues.class); static { typeDesc.setXmlType(qname("FaultSubcodeValues")); } /** * Converts a string into an enumerated value. * * @param value String * @return Value * @throws IllegalArgumentException If the string does not match any value */ public static FaultSubcodeValues fromString(String value) throws IllegalArgumentException { try { return fromValue(QName.valueOf(value)); } catch (Exception e) { throw new IllegalArgumentException(); } } /** * Converts a QName into an enumerated value. * * @param value QName * @return Value * @throws IllegalArgumentException If the QName does not match any value */ public static FaultSubcodeValues fromValue(QName value) throws IllegalArgumentException { FaultSubcodeValues enumeration = TABLE.get(value); if (enumeration == null) { throw new IllegalArgumentException(); } else { return enumeration; } } /** * Gets a Deserializer instance for this class. * * @param mType Mech type * @param jType Java type * @param xType XML type * @return A Deserializer instance */ public static Deserializer getDeserializer(String mType, Class jType, QName xType) { return new EnumDeserializer(jType, xType); } /** * Gets a Serializer instance for this class. * * @param mType Mech type * @param jType Java type * @param xType XML type * @return A Serializer instance */ public static Serializer getSerializer(String mType, Class jType, QName xType) { return new EnumSerializer(jType, xType); } /** * Return type meta-data object. * * @return The type description */ public static TypeDesc getTypeDesc() { return typeDesc; } /** * Shortcut for QName instantiation. * * @param localName QName local name * @return QName using the Addressing URI name-space */ private static QName qname(String localName) { return new QName(Constants.NS_URI_ADDRESSING_DEFAULT, localName); } /** * Code value. */ private QName value; /** * Creates a new instance. * * @param value Fault code */ protected FaultSubcodeValues(QName value) { this.value = value; TABLE.put(this.value, this); } /** * {@inheritDoc} */ @Override public boolean equals(Object obj) { return obj == this; } /** * Gets the value. * * @return Value */ public QName getValue() { return this.value; } /** * {@inheritDoc} */ @Override public int hashCode() { return this.value.toString().hashCode(); } /** * Enforces that the only instances of this class are the ones defined as * constants. * * @return One of the constants * @throws ObjectStreamException If an error occurs */ public Object readResolve() throws ObjectStreamException { return fromValue(this.value); } /** * {@inheritDoc} */ @Override public String toString() { return this.value.toString(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy