Class NameModifierImpl
- java.lang.Object
-
- com.sun.tools.corba.ee.idl.toJavaPortable.NameModifierImpl
-
- All Implemented Interfaces:
NameModifier
public class NameModifierImpl extends java.lang.Object implements NameModifier
-
-
Constructor Summary
Constructors Constructor Description NameModifierImpl()
NameModifierImpl(java.lang.String pattern)
Construct a NameModifier from a pattern of the form xxx%xxx.NameModifierImpl(java.lang.String prefix, java.lang.String suffix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
invalidChar(char ch, boolean isFirst)
Return true if ch is invalid as a character in an identifier.java.lang.String
makeName(java.lang.String base)
Create a modified name from the base name.
-
-
-
Constructor Detail
-
NameModifierImpl
public NameModifierImpl()
-
NameModifierImpl
public NameModifierImpl(java.lang.String prefix, java.lang.String suffix)
-
NameModifierImpl
public NameModifierImpl(java.lang.String pattern)
Construct a NameModifier from a pattern of the form xxx%xxx. The pattern must consist of characters chosen from the set [A-Za-z0-9%$_]. In addition, the pattern must contain exactly one % character. Finally, if % is not the first char in the pattern, the pattern must not start with a number.The semantics of makeName are very simply: just replace the % character with the base in the pattern and return the result.
-
-
Method Detail
-
invalidChar
private boolean invalidChar(char ch, boolean isFirst)
Return true if ch is invalid as a character in an identifier. If ch is a number, it is invalid only if isFirst is true.
-
makeName
public java.lang.String makeName(java.lang.String base)
Description copied from interface:NameModifier
Create a modified name from the base name.- Specified by:
makeName
in interfaceNameModifier
-
-