Class Name

java.lang.Object
org.jibx.schema.codegen.Name

public class Name extends Object
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
    Modifier and Type
    Field
    Description
    private boolean
    Name checked (and possibly adjusted) for conflicts flag.
    private final boolean
    Flag for name fixed by user request.
    private String
    Actual name text.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    Name(String name)
    Constructor.
    Name(Name base)
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get item name.
    boolean
    Check if name has been checked for conflicts.
    boolean
    Check if name is fixed by configuration.
    void
    setChecked(boolean checked)
    Set flag for name checked for conflicts.
    void
    Set item name.
    Generate printable description of name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • m_fixed

      private final boolean m_fixed
      Flag for name fixed by user request.
    • m_checked

      private boolean m_checked
      Name checked (and possibly adjusted) for conflicts flag.
    • m_text

      private String m_text
      Actual name text.
  • Constructor Details

    • Name

      public Name()
      Default constructor. This just creates a non-fixed name with no initial value.
    • Name

      public Name(String name)
      Constructor.
      Parameters:
      name - fixed name text (null if not fixed)
    • Name

      public Name(Name base)
      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

      public String getText()
      Get item name.
      Returns:
      name (null if unspecified)
    • setText

      public void setText(String name)
      Set item name. It is an error to call this method if isFixed() returns true.
      Parameters:
      name - (null if unspecified)
    • toString

      public String toString()
      Generate printable description of name. This is intended for use in logging output.
      Overrides:
      toString in class Object
      Returns:
      description