jlibs.xml
Class Namespaces

java.lang.Object
  extended by jlibs.xml.Namespaces

public class Namespaces
extends Object

This class most commonly used namespaces and their common prefixes.

This class contains constants to many standard namespaces which we use in our daily projects.

 import static jlibs.xml.Namespaces.*;

 System.out.println(URI_SOAP);
 System.out.println(URI_WSDL);
 
It can also suggest standard prefixes used for those namespaces.
 import static jlibs.xml.Namespaces.*;
 
 String prefix = Namespaces.suggestPrefix(URI_WSDL);
 System.out.println(prefix); // prints "wsdl"
 
getSuggested() returns Properties object where key is URI and value is suggested prefix.

NOTE:
The naming convention that should be followed for an uri is:

 String URI_<suggestedPrefixInUppercase> = "<namespaceURI>";
 

Author:
Santhosh Kumar T

Field Summary
static String URI_BPWS
           
static String URI_HTTP
          WSDL namespace for WSDL HTTP GET & POST binding
static String URI_MIME
          WSDL namespace for WSDL MIME binding
static String URI_PLINK
           
static String URI_SOAP
          WSDL namespace for WSDL SOAP 1.1 binding
static String URI_SOAP12
          WSDL namespace for WSDL SOAP 1.2 binding
static String URI_SOAP12ENC
          Encoding namespace as defined by SOAP 1.2
static String URI_SOAP12ENV
          Envelope namespace as defined by SOAP 1.2
static String URI_SOAPENC
          Encoding namespace as defined by SOAP 1.1
static String URI_SOAPENV
          Envelope namespace as defined by SOAP 1.1
static String URI_WSDL
          WSDL namespace for WSDL framework
static String URI_XHTML
           
static String URI_XML
          The official XML Namespace name URI
static String URI_XMLNS
          Namespace URI used by the official XML attribute used for specifying XML Namespace declarations "xmlns"
static String URI_XPATH
           
static String URI_XSD
          Schema namespace as defined by XSD
static String URI_XSI
          Instance namespace as defined by XSD
static String URI_XSL
          Namespace used by XSL Documents
 
Constructor Summary
Namespaces()
           
 
Method Summary
static Properties getSuggested()
          returns Properties object where key is URI and value is suggested prefix.
static String suggestPrefix(String uri)
          Returns suggested prefix fore the given uri.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URI_XML

public static final String URI_XML
The official XML Namespace name URI

See Also:
Constant Field Values

URI_XMLNS

public static final String URI_XMLNS
Namespace URI used by the official XML attribute used for specifying XML Namespace declarations "xmlns"

See Also:
Constant Field Values

URI_XSD

public static final String URI_XSD
Schema namespace as defined by XSD

See Also:
Constant Field Values

URI_XSI

public static final String URI_XSI
Instance namespace as defined by XSD

See Also:
Constant Field Values

URI_XSL

public static final String URI_XSL
Namespace used by XSL Documents

See Also:
Constant Field Values

URI_BPWS

public static final String URI_BPWS
See Also:
Constant Field Values

URI_XHTML

public static final String URI_XHTML
See Also:
Constant Field Values

URI_XPATH

public static final String URI_XPATH
See Also:
Constant Field Values

URI_PLINK

public static final String URI_PLINK
See Also:
Constant Field Values

URI_WSDL

public static final String URI_WSDL
WSDL namespace for WSDL framework

See Also:
Constant Field Values

URI_HTTP

public static final String URI_HTTP
WSDL namespace for WSDL HTTP GET & POST binding

See Also:
Constant Field Values

URI_MIME

public static final String URI_MIME
WSDL namespace for WSDL MIME binding

See Also:
Constant Field Values

URI_SOAP

public static final String URI_SOAP
WSDL namespace for WSDL SOAP 1.1 binding

See Also:
Constant Field Values

URI_SOAP12

public static final String URI_SOAP12
WSDL namespace for WSDL SOAP 1.2 binding

See Also:
Constant Field Values

URI_SOAPENV

public static final String URI_SOAPENV
Envelope namespace as defined by SOAP 1.1

See Also:
Constant Field Values

URI_SOAP12ENV

public static final String URI_SOAP12ENV
Envelope namespace as defined by SOAP 1.2

See Also:
Constant Field Values

URI_SOAPENC

public static final String URI_SOAPENC
Encoding namespace as defined by SOAP 1.1

See Also:
Constant Field Values

URI_SOAP12ENC

public static final String URI_SOAP12ENC
Encoding namespace as defined by SOAP 1.2

See Also:
Constant Field Values
Constructor Detail

Namespaces

public Namespaces()
Method Detail

suggestPrefix

public static String suggestPrefix(String uri)
Returns suggested prefix fore the given uri.

Parameters:
uri - namespace uri
Returns:
empty string if uri is null or empty. If the uri is one of the constants defined in this class, then it returns commonly used prefix. Otherwise it returns null.

getSuggested

public static Properties getSuggested()
returns Properties object where key is URI and value is suggested prefix.



Copyright © 2015. All rights reserved.