Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.axis.wsdl.toJava
Class Namespaces  view Namespaces download Namespaces.java

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byorg.apache.axis.wsdl.toJava.Namespaces
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class Namespaces
extends java.util.HashMap

This class is essentially a HashMap of pairs with a few extra wizzbangs.


Nested Class Summary
 
Nested classes inherited from class java.util.HashMap
 
Nested classes inherited from class java.util.AbstractMap
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
private  java.lang.String defaultPackage
          Field defaultPackage
private static char javaPkgSeparator
          Field javaPkgSeparator
private  java.util.Map pkg2NamespacesMap
          Field pkg2Namespaces : reverse mapping of Namespaces
private static char[] pkgSeparators
          Toknens in a namespace that are treated as package name part separators.
private  java.lang.String root
          Field root
 
Fields inherited from class java.util.HashMap
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
private Namespaces(Namespaces clone)
          Instantiate a clone of an existing Namespaces object.
  Namespaces(java.lang.String root)
          Instantiate a Namespaces object whose packages will all reside under root.
 
Method Summary
 java.lang.Object clone()
          Instantiate a clone of this Namespaces object.
 java.lang.String getAsDir(java.lang.String key)
          Get the package name in directory format (dots replaced by slashes).
 java.lang.String getCreate(java.lang.String key)
          Get the package name for the given namespace.
(package private)  java.lang.String getCreate(java.lang.String key, boolean create)
          Get the package name for the given namespace.
 java.util.Map getPkg2NamespacesMap()
           
private  java.lang.String javify(java.lang.String pkg)
          Make sure each package name doesn't conflict with a Java keyword.
 void mkdir(java.lang.String pkg)
          Make a directory for the given package under root.
private static java.lang.String normalizePackageName(java.lang.String pkg, char separator)
          Method normalizePackageName
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Puts the supplied value into the Map, mapped by the supplied key.
 void putAll(java.util.Map map)
          Like HashMap's putAll, this adds the given map's contents to this map.
 void setDefaultPackage(java.lang.String defaultPackage)
          Set a package name that overrides the namespace map
 java.lang.String toDir(java.lang.String pkg)
          Return the given package name in directory format (dots replaced by slashes).
 
Methods inherited from class java.util.HashMap
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

root

private java.lang.String root
Field root


defaultPackage

private java.lang.String defaultPackage
Field defaultPackage


pkgSeparators

private static final char[] pkgSeparators
Toknens in a namespace that are treated as package name part separators.


javaPkgSeparator

private static final char javaPkgSeparator
Field javaPkgSeparator


pkg2NamespacesMap

private java.util.Map pkg2NamespacesMap
Field pkg2Namespaces : reverse mapping of Namespaces

Constructor Detail

Namespaces

public Namespaces(java.lang.String root)
Instantiate a Namespaces object whose packages will all reside under root.


Namespaces

private Namespaces(Namespaces clone)
Instantiate a clone of an existing Namespaces object.

Method Detail

normalizePackageName

private static java.lang.String normalizePackageName(java.lang.String pkg,
                                                     char separator)
Method normalizePackageName


clone

public java.lang.Object clone()
Instantiate a clone of this Namespaces object.


getCreate

public java.lang.String getCreate(java.lang.String key)
Get the package name for the given namespace. If there is no entry in the HashMap for this namespace, create one.


getCreate

java.lang.String getCreate(java.lang.String key,
                           boolean create)
Get the package name for the given namespace. If there is no entry in the HashMap for this namespace, create one if create flag is on, return null otherwise.


getAsDir

public java.lang.String getAsDir(java.lang.String key)
Get the package name in directory format (dots replaced by slashes). If the package name doesn't exist in the HashMap, return "".


toDir

public java.lang.String toDir(java.lang.String pkg)
Return the given package name in directory format (dots replaced by slashes). If pkg is null, "" is returned.


putAll

public void putAll(java.util.Map map)
Like HashMap's putAll, this adds the given map's contents to this map. But it also makes sure the value strings are javified.


javify

private java.lang.String javify(java.lang.String pkg)
Make sure each package name doesn't conflict with a Java keyword. Ie., org.apache.import.test becomes org.apache.import_.test.


mkdir

public void mkdir(java.lang.String pkg)
Make a directory for the given package under root.


setDefaultPackage

public void setDefaultPackage(java.lang.String defaultPackage)
Set a package name that overrides the namespace map


put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Description copied from class: java.util.HashMap
Puts the supplied value into the Map, mapped by the supplied key. The value may be retrieved by any object which equals() this key. NOTE: Since the prior value could also be null, you must first use containsKey if you want to see if you are replacing the key's mapping.


getPkg2NamespacesMap

public java.util.Map getPkg2NamespacesMap()