Enum NamespaceVersion
- java.lang.Object
-
- java.lang.Enum<NamespaceVersion>
-
- 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)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QNameasQName(XmlToken token)Resolves XML token into a fully qualified name within given namespace version.StringgetDefaultNamespacePrefix()Method returns default namespace prefix for given namespace version.static NamespaceVersiongetLatestVersion()Returns latest supported version of the policy namespacestatic XmlTokenresolveAsToken(QName name)Resolves FQN into a policy XML token.static NamespaceVersionresolveVersion(String uri)Resolves URI represented as a String into an enumeration value.static NamespaceVersionresolveVersion(QName name)Resolves fully qualified name defined in the WS-Policy namespace into an enumeration value.StringtoString()static NamespaceVersionvalueOf(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.
-
-
-
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 nameNullPointerException- 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 returnsnull.- Parameters:
uri- WS-Policy namespace URI- Returns:
- Enumeration value that represents given URI or
nullif 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 returnsnull- Parameters:
name- fully qualified name defined in the WS-Policy namespace- Returns:
- Enumeration value that represents given namespace or
nullif 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 invokingresolveVersion(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.UNKNOWNvalue 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
tokenwithin given namespace version. Method returnsnullin case the token is not supported in given namespace version or in caseXmlToken.UNKNOWNwas used as an input parameter. - Throws:
IllegalArgumentException
-
toString
public String toString()
- Overrides:
toStringin classEnum<NamespaceVersion>
-
-