Package org.jibx.schema.codegen
Class Name
- java.lang.Object
-
- org.jibx.schema.codegen.Name
-
public class Name extends java.lang.ObjectName representation forItemand related structures. Names may be shared between different levels of the item structure in some cases (such as an element that contains only a single value, with several layers of indirection), and this class supports name sharing while retaining the ability to modify the actual name text (necessary to avoid name conflicts in the generated code).- Author:
- Dennis M. Sosnoski
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetText()Get item name.booleanisChecked()Check if name has been checked for conflicts.booleanisFixed()Check if name is fixed by configuration.voidsetChecked(boolean checked)Set flag for name checked for conflicts.voidsetText(java.lang.String name)Set item name.java.lang.StringtoString()Generate printable description of name.
-
-
-
Constructor Detail
-
Name
public Name()
Default constructor. This just creates a non-fixed name with no initial value.
-
Name
public Name(java.lang.String name)
Constructor.- Parameters:
name- fixed name text (nullif not fixed)
-
Name
public Name(Name base)
Copy constructor.- Parameters:
base-
-
-
Method Detail
-
isFixed
public boolean isFixed()
Check if name is fixed by configuration.- Returns:
trueif fixed,falseif not
-
isChecked
public boolean isChecked()
Check if name has been checked for conflicts. This flag is used by the actual class generated code (ClassHolder) to track which names have already been entered into the set of names used by a class.- Returns:
- checked
-
setChecked
public void setChecked(boolean checked)
Set flag for name checked for conflicts. This flag is used by the actual class generated code (ClassHolder) to track which names have already been entered into the set of names used by a class.- Parameters:
checked-
-
getText
public java.lang.String getText()
Get item name.- Returns:
- name (
nullif unspecified)
-
setText
public void setText(java.lang.String name)
Set item name. It is an error to call this method ifisFixed()returns true.- Parameters:
name- (nullif unspecified)
-
toString
public java.lang.String toString()
Generate printable description of name. This is intended for use in logging output.- Overrides:
toStringin classjava.lang.Object- Returns:
- description
-
-