soapical.likeoldsax
Class NamespaceIron

java.lang.Object
  extended bysoapical.likeoldsax.NamespaceIron
All Implemented Interfaces:
LikeOldSAXConstants

public class NamespaceIron
extends java.lang.Object
implements LikeOldSAXConstants

Unifies the handling of SAX2 namespace and namespace prefixes, no matter how SAX2 has been configured.

Version:
$Revision: 1.1.1.1 $
$Date: 2003/04/21 09:43:18 $
Author:
Eric Kow (kow at loria point fr)

Field Summary
 
Fields inherited from interface soapical.likeoldsax.LikeOldSAXConstants
CDATA, EMPTY_STRING, QNAME_DELIMETER, XMLNS
 
Constructor Summary
NamespaceIron()
           
 
Method Summary
static java.lang.String getLocalName(java.lang.String qName)
          Returns the non-qualified version of the argument
static java.lang.String getPrefix(java.lang.String qName)
          Returns the prefix portion of the argument
static boolean isQName(java.lang.String name)
           
static java.lang.String toNcName(java.lang.String localName, java.lang.String qName)
          Returns a non-prefixed name given the localName and qName parameters which would normally be passed.
static java.lang.String toQName(java.lang.String prefix, java.lang.String localName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceIron

public NamespaceIron()
Method Detail

toNcName

public static java.lang.String toNcName(java.lang.String localName,
                                        java.lang.String qName)
Returns a non-prefixed name given the localName and qName parameters which would normally be passed. This function is meant to iron out the craziness in the SAX2 API, which could work any of 4 different ways depending on how the parser is configured! Madness! What was the guy thinking?


toQName

public static java.lang.String toQName(java.lang.String prefix,
                                       java.lang.String localName)

isQName

public static boolean isQName(java.lang.String name)

getLocalName

public static java.lang.String getLocalName(java.lang.String qName)
Returns the non-qualified version of the argument

Returns:
the part of the qName which follows the prefix, but if the name is not qualified, returns the name itself.

getPrefix

public static java.lang.String getPrefix(java.lang.String qName)
Returns the prefix portion of the argument

Returns:
the part of the qName which denotes the prefix (without any delimeters); or "" if this is not a qualified name