Top Description Fields Constructors Methods
com.sun.xml.xsom

public final Class XmlString

extends Object
Class Inheritance
Annotations
@SuppressWarnings:exports
Imports
com.sun.tools.rngdatatype.ValidationContext

String with in-scope namespace binding information.

In a general case, text (PCDATA/attributes) that appear in XML schema cannot be correctly interpreted unless you also have in-scope namespace binding (a case in point is QName.) Therefore, it's convenient to handle the lexical representation and the in-scope namespace binding in a pair.

Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
public final ValidationContext
context

Used to resole in-scope namespace bindings.

private static final ValidationContext
public final String
value

Textual value.

Constructor Summary

AccessConstructor and Description
public
XmlString(String value, ValidationContext context)

Creates a new from a lexical representation and in-scope namespaces.

public
XmlString(String value)

Creates a new with empty in-scope namespace bindings.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

namespace URI of this prefix. If the specified prefix is not declared, the implementation returns null.
resolvePrefix
(String prefix)

Resolves a namespace prefix to the corresponding namespace URI.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

contextback to summary
public final ValidationContext context

Used to resole in-scope namespace bindings.

NULL_CONTEXTback to summary
private static final ValidationContext NULL_CONTEXT
valueback to summary
public final String value

Textual value. AKA lexical representation.

Constructor Detail

XmlStringback to summary
public XmlString(String value, ValidationContext context)

Creates a new from a lexical representation and in-scope namespaces.

XmlStringback to summary
public XmlString(String value)

Creates a new with empty in-scope namespace bindings.

Method Detail

resolvePrefixback to summary
public String resolvePrefix(String prefix)

Resolves a namespace prefix to the corresponding namespace URI. This method is used for resolving prefixes in the value (such as when value represents a QName type.)

If the prefix is "" (empty string), the method returns the default namespace URI.

If the prefix is "xml", then the method returns "http://www.w3.org/XML/1998/namespace", as defined in the XML Namespaces Recommendation.

Returns:String

namespace URI of this prefix. If the specified prefix is not declared, the implementation returns null.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.