Package org.glassfish.rmic.iiop
Class NameContext
- java.lang.Object
-
- org.glassfish.rmic.iiop.NameContext
-
class NameContext extends java.lang.Object
A NameContext enables detection of strings which differ only in case.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
NameContext.Name
-
Field Summary
Fields Modifier and Type Field Description private boolean
allowCollisions
private java.util.Hashtable<java.lang.String,NameContext.Name>
table
-
Constructor Summary
Constructors Constructor Description NameContext(boolean allowCollisions)
Construct a context.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
add(java.lang.String name)
Add a name to this context.void
assertPut(java.lang.String name)
Add a name to this context.void
clear()
Remove all entries.static NameContext
forName(java.lang.String name, boolean allowCollisions, BatchEnvironment env)
Get a context for the given name.java.lang.String
get(java.lang.String name)
Get a name from the context.void
put(java.lang.String name)
Add a name to this context..
-
-
-
Field Detail
-
table
private java.util.Hashtable<java.lang.String,NameContext.Name> table
-
allowCollisions
private final boolean allowCollisions
-
-
Method Detail
-
forName
public static NameContext forName(java.lang.String name, boolean allowCollisions, BatchEnvironment env)
Get a context for the given name. Name may be null, in which case this method will return the default context.
-
assertPut
public void assertPut(java.lang.String name) throws java.lang.Exception
Add a name to this context. If constructed with allowCollisions false and a collision occurs, this method will throw an exception in which the message contains the string: "name" and "collision".- Throws:
java.lang.Exception
-
put
public void put(java.lang.String name)
Add a name to this context..
-
add
private java.lang.String add(java.lang.String name)
Add a name to this context. If constructed with allowCollisions false and a collision occurs, this method will return a message string, otherwise returns null.
-
get
public java.lang.String get(java.lang.String name)
Get a name from the context. If it has collisions, the name will be converted as specified in section 5.2.7.
-
clear
public void clear()
Remove all entries.
-
-