Package org.jibx.schema.codegen
Class Name
- java.lang.Object
-
- org.jibx.schema.codegen.Name
-
public class Name extends java.lang.Object
Name representation forItem
and 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.String
getText()
Get item name.boolean
isChecked()
Check if name has been checked for conflicts.boolean
isFixed()
Check if name is fixed by configuration.void
setChecked(boolean checked)
Set flag for name checked for conflicts.void
setText(java.lang.String name)
Set item name.java.lang.String
toString()
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 (null
if 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:
true
if fixed,false
if 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 (
null
if 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
- (null
if unspecified)
-
toString
public java.lang.String toString()
Generate printable description of name. This is intended for use in logging output.- Overrides:
toString
in classjava.lang.Object
- Returns:
- description
-
-