com.sun.xml.ws.policy.sourcemodel.wspolicy
Enum NamespaceVersion

java.lang.Object
  extended by java.lang.Enum<NamespaceVersion>
      extended by com.sun.xml.ws.policy.sourcemodel.wspolicy.NamespaceVersion
All Implemented Interfaces:
Serializable, Comparable<NamespaceVersion>

public enum NamespaceVersion
extends Enum<NamespaceVersion>

Author:
Marek Potociar (marek.potociar at sun.com)

Enum Constant Summary
v1_2
           
v1_5
           
 
Method Summary
 QName asQName(XmlToken token)
          Resolves XML token into a fully qualified name within given namespace version.
 String getDefaultNamespacePrefix()
          Method returns default namespace prefix for given namespace version.
static NamespaceVersion getLatestVersion()
          Returns latest supported version of the policy namespace
static XmlToken resolveAsToken(QName name)
          Resolves FQN into a policy XML token.
static NamespaceVersion resolveVersion(QName name)
          Resolves fully qualified name defined in the WS-Policy namespace into an enumeration value.
static NamespaceVersion resolveVersion(String uri)
          Resolves URI represented as a String into an enumeration value.
 String toString()
           
static NamespaceVersion valueOf(String name)
          Returns the enum constant of this type with the specified name.
static NamespaceVersion[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

v1_2

public static final NamespaceVersion v1_2

v1_5

public static final NamespaceVersion v1_5
Method Detail

values

public static NamespaceVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (NamespaceVersion c : NamespaceVersion.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static NamespaceVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

resolveVersion

public static NamespaceVersion resolveVersion(String uri)
Resolves URI represented as a String into an enumeration value. If the URI doesn't represent any existing enumeration value, method returns null.

Parameters:
uri - WS-Policy namespace URI
Returns:
Enumeration value that represents given URI or null if no enumeration value exists for given URI.

resolveVersion

public static NamespaceVersion resolveVersion(QName name)
Resolves fully qualified name defined in the WS-Policy namespace into an enumeration value. If the URI in the name doesn't represent any existing enumeration value, method returns null

Parameters:
name - fully qualified name defined in the WS-Policy namespace
Returns:
Enumeration value that represents given namespace or null if no enumeration value exists for given namespace.

getLatestVersion

public static NamespaceVersion getLatestVersion()
Returns latest supported version of the policy namespace

Returns:
latest supported policy namespace version.

resolveAsToken

public static XmlToken resolveAsToken(QName name)
Resolves FQN into a policy XML token. The version of the token can be determined by invoking resolveVersion(QName).

Parameters:
name - fully qualified name defined in the WS-Policy namespace
Returns:
XML token enumeration that represents this fully qualified name. If the token or the namespace is not resolved XmlToken.UNKNOWN value is returned.

getDefaultNamespacePrefix

public String getDefaultNamespacePrefix()
Method returns default namespace prefix for given namespace version.

Returns:
default namespace prefix for given namespace version

asQName

public QName asQName(XmlToken token)
              throws IllegalArgumentException
Resolves XML token into a fully qualified name within given namespace version.

Parameters:
token - XML token enumeration value.
Returns:
fully qualified name of the token within given namespace version. Method returns null in case the token is not supported in given namespace version or in case XmlToken.UNKNOWN was used as an input parameter.
Throws:
IllegalArgumentException

toString

public String toString()
Overrides:
toString in class Enum<NamespaceVersion>


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.