org.apache.woden.wsdl20.fragids
Class FragmentIdentifier

java.lang.Object
  extended by org.apache.woden.wsdl20.fragids.FragmentIdentifier

public class FragmentIdentifier
extends java.lang.Object

This Class extends the XPointer class to work with WSDL fragment identifiers which are WSDL XPointer in effect.

Author:
Dan Harvey (danharvey42@gmail.com) TODO Add methods to find WSDL component from the FragmentIdentifier. Add deserialisation code in a constructor with a String argument. (Pass this onto XPointer to do the work?)

Constructor Summary
FragmentIdentifier(ComponentPart wsdlPart)
          Constructs a new empty Fragment Identifier
 
Method Summary
 NCName getXmlNamespacePrefix(QName qname)
          Returns the prefix for the Xml namespace of the QName in the XPointer.
 NCName getXmlNamespacePrefix(java.lang.String namespace)
          Returns the prefix for the Xml namespace in the XPointer.
 QName prefixQNameNamespace(QName qname)
          Returns a QName prefixed from the map of local namespaces and prefixes.
 java.lang.String toString()
          Returns a String serialisation of this fragment identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FragmentIdentifier

public FragmentIdentifier(ComponentPart wsdlPart)
Constructs a new empty Fragment Identifier

Parameters:
wsdlPart - The WSDL2.0 component pointer part for this fragment identifier.
Method Detail

toString

public java.lang.String toString()
Returns a String serialisation of this fragment identifier.

Overrides:
toString in class java.lang.Object
Returns:
a String fragment identifier

getXmlNamespacePrefix

public NCName getXmlNamespacePrefix(QName qname)
Returns the prefix for the Xml namespace of the QName in the XPointer. If the namespace does not have a prefix in the XPointer it will create a new prefix with the prefix from the QName or one of the form nsXX and add a xmlns Pointer Part, then return that.

Parameters:
qname - The QName containing the namespace and a prefix.
Returns:
a NCName of the prefix for the namespace.

getXmlNamespacePrefix

public NCName getXmlNamespacePrefix(java.lang.String namespace)
Returns the prefix for the Xml namespace in the XPointer. If the namespace does not have a prefix in the XPointer it will create a new prefix of the form nsXX and add a xmlns Pointer Part, then return that.

Parameters:
namespace - The namespace to get the prefix for.
Returns:
a NCName of the prefix for the namespace.

prefixQNameNamespace

public QName prefixQNameNamespace(QName qname)
Returns a QName prefixed from the map of local namespaces and prefixes. The namespace and localpart remain unchanged.

Parameters:
qname - the QName used to lookup the namespace and copy.
Returns:
a QName with the new prefix, but same namespace and localpart.


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.