Package org.jibx.schema.codegen
Class Name
java.lang.Object
org.jibx.schema.codegen.Name
Name representation for
Item
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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetText()
Get item name.boolean
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
Set item name.toString()
Generate printable description of name.
-
Field Details
-
m_fixed
private final boolean m_fixedFlag for name fixed by user request. -
m_checked
private boolean m_checkedName checked (and possibly adjusted) for conflicts flag. -
m_text
Actual name text.
-
-
Constructor Details
-
Name
public Name()Default constructor. This just creates a non-fixed name with no initial value. -
Name
Constructor.- Parameters:
name
- fixed name text (null
if not fixed)
-
Name
Copy constructor.- Parameters:
base
-
-
-
Method Details
-
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
Get item name.- Returns:
- name (
null
if unspecified)
-
setText
Set item name. It is an error to call this method ifisFixed()
returns true.- Parameters:
name
- (null
if unspecified)
-
toString
Generate printable description of name. This is intended for use in logging output.
-