org.eclipse.emf.ecore.xml.type.util
Class XMLTypeUtil

java.lang.Object
  extended by org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil

public final class XMLTypeUtil
extends java.lang.Object

This class contains convenient static methods for working with XML-related information.


Field Summary
static int EQUALS
           
static int GREATER_THAN
           
static int INDETERMINATE
           
static int LESS_THAN
           
 
Constructor Summary
XMLTypeUtil()
           
 
Method Summary
static int compareCalendar(java.lang.Object calendar1, java.lang.Object calendar2)
           
static int compareDuration(java.lang.Object duration1, java.lang.Object duration2)
           
static EValidator.PatternMatcher createPatternMatcher(java.lang.String pattern)
           
static java.lang.Object createQName(java.lang.String namespaceUri, java.lang.String localPart, java.lang.String prefix)
          Creates a new QName object with the specified values
static java.lang.String getQNameLocalPart(java.lang.Object qName)
          Returns the localPart of a QName.
static java.lang.String getQNameNamespaceURI(java.lang.Object qName)
          Returns the namespaceURI of a QName.
static java.lang.String getQNamePrefix(java.lang.Object qName)
          Returns the prefix of a QName.
static boolean isNamePart(int codePoint)
          Returns whether the code point is a valid part of an XML Name.
static boolean isNameStart(int codePoint)
          Returns whether the code point is the valid start of an XML Name.
static boolean isNCNamePart(int codePoint)
          Returns whether the code point is a valid part of an XML NCName.
static boolean isNCNameStart(int codePoint)
          Returns whether the code point is the valid start of an XML NCName.
static boolean isSpace(char value)
           
static java.lang.String normalize(java.lang.String value, boolean collapse)
           
static javax.xml.namespace.QName setPrefix(javax.xml.namespace.QName qName, java.lang.String prefix)
          Updates the QName's prefix, if possible, and returns either the updated result, or a newly created QName with the new prefix, if the QName could not be directly updated.
static void setQNameValues(java.lang.Object qName, java.lang.String namespaceUri, java.lang.String localPart, java.lang.String prefix)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUALS

public static final int EQUALS
See Also:
Constant Field Values

LESS_THAN

public static final int LESS_THAN
See Also:
Constant Field Values

GREATER_THAN

public static final int GREATER_THAN
See Also:
Constant Field Values

INDETERMINATE

public static final int INDETERMINATE
See Also:
Constant Field Values
Constructor Detail

XMLTypeUtil

public XMLTypeUtil()
Method Detail

compareCalendar

public static int compareCalendar(java.lang.Object calendar1,
                                  java.lang.Object calendar2)

compareDuration

public static int compareDuration(java.lang.Object duration1,
                                  java.lang.Object duration2)

isSpace

public static boolean isSpace(char value)

normalize

public static java.lang.String normalize(java.lang.String value,
                                         boolean collapse)

createPatternMatcher

public static EValidator.PatternMatcher createPatternMatcher(java.lang.String pattern)

createQName

public static java.lang.Object createQName(java.lang.String namespaceUri,
                                           java.lang.String localPart,
                                           java.lang.String prefix)
Creates a new QName object with the specified values

Parameters:
namespaceUri - namespace uri value or null
localPart - localPart (not null)
prefix - prefix value or null (if null, an empty string will actually be used in the resulting QName)
Returns:
The newly created QName object

setQNameValues

@Deprecated
public static void setQNameValues(java.lang.Object qName,
                                             java.lang.String namespaceUri,
                                             java.lang.String localPart,
                                             java.lang.String prefix)
Deprecated. 

Sets the QName object values to the specified once

Parameters:
namespaceUri - namespace uri value or null
localPart - localPart (not null)
prefix - prefix value or null

setPrefix

public static javax.xml.namespace.QName setPrefix(javax.xml.namespace.QName qName,
                                                  java.lang.String prefix)
Updates the QName's prefix, if possible, and returns either the updated result, or a newly created QName with the new prefix, if the QName could not be directly updated.

Parameters:
qName - the QName to be updated.
prefix - the new prefix.
Returns:
a QName with the same namespace URI and local part as the argument, but with the new prefix.

getQNameNamespaceURI

public static java.lang.String getQNameNamespaceURI(java.lang.Object qName)
Returns the namespaceURI of a QName.


getQNameLocalPart

public static java.lang.String getQNameLocalPart(java.lang.Object qName)
Returns the localPart of a QName.


getQNamePrefix

public static java.lang.String getQNamePrefix(java.lang.Object qName)
Returns the prefix of a QName.


isNameStart

public static boolean isNameStart(int codePoint)
Returns whether the code point is the valid start of an XML Name.


isNamePart

public static boolean isNamePart(int codePoint)
Returns whether the code point is a valid part of an XML Name.


isNCNameStart

public static boolean isNCNameStart(int codePoint)
Returns whether the code point is the valid start of an XML NCName.


isNCNamePart

public static boolean isNCNamePart(int codePoint)
Returns whether the code point is a valid part of an XML NCName.


Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.