org.gxml.sa
Interface GxNameBridge<S>

All Superinterfaces:
SmNameBridge<S>

public interface GxNameBridge<S>
extends SmNameBridge<S>

The name bridge provides reliable support for symbols. Symbols enable string comparisons to be performed much faster than than character-by-character comparisons using String. These comparisons may then be applied to improving the performance of the comparison of element, attribute and type names where symbols are used to represent the namespace-uri and local-name parts of a xs:QName.

Implementations may choose how they wish to represent a symbol.

The semantics of the name bridge do not, however, insist that the implementation symbol be anything other than a String. However, the symbol must be comparable using Object.equals(java.lang.Object). If the implementation provides symbol support, the Object.equals(java.lang.Object) method implementation may be optimized.

The name bridge provides support for converting symbols to-and-from String, conversion of QName and SmNativeType to-and-from SmName, and utilities for commonly used namespaces.


Method Summary
 S empty()
          Returns a symbol equivalent to the empty string.
 boolean equal(S one, S two)
          Determines whether two symbols are equal.
 java.lang.String getPrefix(S namespaceURI, boolean mayUseDefaultMapping)
          Returns a prefix String by recognizing the namespaceURI symbol.
 boolean isEmpty(S symbol)
          Determines whether the specified symbol is equivalent to an empty string.
 boolean isXmlNamespaceURI(S symbol)
           
 SmName<S> name(javax.xml.namespace.QName name)
          Given an QName, return a corresponding SmName.
 S[] nameArray(int size)
          Allocates an empty array of symbols.
 SmNativeType nativeType(SmName<S> name)
          Given a name, return a corresponding SmNativeType.
 SmName<S> nativeType(SmNativeType nativeType)
          Given an SmNativeType, lookup a corresponding name.
 S symbolize(java.lang.String strval)
          Converts a String into a parametrized symbol.
 java.lang.String toString(S symbol)
          Converts a parametrized symbol into a String.
 
Methods inherited from interface org.gxml.xs.SmNameBridge
isNoNamespaceSchemaLocation, isW3cXmlSchemaInstanceNamespaceURI, isW3cXmlSchemaNamespaceURI, isXsiNil, isXsiSchemaLocation, isXsiType
 

Method Detail

empty

S empty()
Returns a symbol equivalent to the empty string.

Specified by:
empty in interface SmNameBridge<S>

equal

boolean equal(S one,
              S two)
Determines whether two symbols are equal.

Specified by:
equal in interface SmNameBridge<S>

getPrefix

java.lang.String getPrefix(S namespaceURI,
                           boolean mayUseDefaultMapping)
Returns a prefix String by recognizing the namespaceURI symbol.
The return value should conform to the following table:
namespaceURI mayUseDefaultMapping prefix
"" true ""
"http://www.w3.org/XML/1998/namespace" ignored "xml"
"http://www.w3.org/2000/xmlns/" ignored "xmlns"
otherwise ignored null


isEmpty

boolean isEmpty(S symbol)
Determines whether the specified symbol is equivalent to an empty string.

Specified by:
isEmpty in interface SmNameBridge<S>

isXmlNamespaceURI

boolean isXmlNamespaceURI(S symbol)

name

SmName<S> name(javax.xml.namespace.QName name)
Given an QName, return a corresponding SmName.

If the name argument is null, then null is returned.

Specified by:
name in interface SmNameBridge<S>
Parameters:
name - The QName, may be null.

nameArray

S[] nameArray(int size)
Allocates an empty array of symbols.

Specified by:
nameArray in interface SmNameBridge<S>
Parameters:
size - The size of the array of symbols.

nativeType

SmNativeType nativeType(SmName<S> name)
Given a name, return a corresponding SmNativeType.
If the name is not a built-in type, returns null.

Specified by:
nativeType in interface SmNameBridge<S>

nativeType

SmName<S> nativeType(SmNativeType nativeType)
Given an SmNativeType, lookup a corresponding name.

Specified by:
nativeType in interface SmNameBridge<S>

symbolize

S symbolize(java.lang.String strval)
Converts a String into a parametrized symbol.

Specified by:
symbolize in interface SmNameBridge<S>
Parameters:
strval - The String to be converted to a symbol.
Returns:
The symbol for the string or null if the input was null.

toString

java.lang.String toString(S symbol)
Converts a parametrized symbol into a String.

Specified by:
toString in interface SmNameBridge<S>


Copyright © 2009 TIBCO Software Inc. All Rights Reserved.