Package org.apache.torque.generator.qname

# Klasse QualifiedName

java.lang.Object
org.apache.torque.generator.qname.QualifiedName

public final class QualifiedName extends Object
This class contains a name which has a namespace. The namespace defines the scope where the name is valid, and is made up of hierarchical bits separated by a dot (`SEPARATOR`). A qualified name is in the scope of its own namespace and all children namespaces of its own namespace (i.e. the namespaces "deeper down" the hierarchy). For example, the namespace org.apache.torque is in the scope of org.apache but not in the scope of org.apache.torque.generator. As a special case, if the namespace is the empty String, the name is valid in all namespaces. The namespace and the name are also separated by a dot (`SEPARATOR`). Instances of this class are immutable. To prevent mutable subclasses, this class is final.

- ## Feldübersicht

  Felder
  Modifizierer und Typ
  Feld
  Beschreibung
  `static final char`
  `SEPARATOR`
  The separator between namespace parts and between namespacee and local name in the string representation of a QualifiedName.

- ## Konstruktorübersicht

  Konstruktoren
  Konstruktor
  Beschreibung
  `QualifiedName(String qualifiedName)`
  Creates a QualifiedName from its string representation, which is namespace:name.
  `QualifiedName(String nameOrQualifiedName, String defaultNamespace)`
  Creates a QualifiedName from a fully qualified name or the name and the namespace parts of a QualifiedName.
  `QualifiedName(String nameOrQualifiedName, Namespace defaultNamespace)`
  Creates a QualifiedName from a fully qualified name or the name and the namespace parts of a QualifiedName.

- ## Methodenübersicht

  Modifizierer und Typ
  Methode
  Beschreibung
  `boolean`
  `equals(Object o)`
  Returns if this object equals another object.
  `String`
  `getName()`
  Returns the name part of the QualifiedName.
  `Namespace`
  `getNamespace()`
  Returns the namespace of the QualifiedName.
  `Namespace`
  `getParentNamespace()`
  Returns the parent of the Qualified name's namespace.
  `int`
  `hashCode()`
  Returns a hashcode for the QualifiedName.
  `boolean`
  `isInRootNamespace()`
  Returns if the namespace of this qualified name is the root namespace.
  `boolean`
  `isVisibleFrom(Namespace otherNamespace)`
  Returns if this qualified name is visible from another namespace.
  `String`
  `toString()`
  Returns the String representation of the QualifiedName, which is namespace.name if namespace is not empty, or name if namespace is empty.

  ### Von Klasse geerbte Methoden java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Felddetails

  - ### SEPARATOR

    public static final char SEPARATOR
    The separator between namespace parts and between namespacee and local name in the string representation of a QualifiedName.
    Siehe auch:
      - Konstantenfeldwerte

- ## Konstruktordetails

  - ### QualifiedName

    public QualifiedName(String qualifiedName)
    Creates a QualifiedName from its string representation, which is namespace:name. The namespace part may be empty (in which case the default namespace is used), but not the name part.
    Parameter:
      `qualifiedName` - the string representation of the QualifiedName, must contain a non-empty name part.
    Löst aus:
      `NullPointerException` - if qualifiedName is null

  - ### QualifiedName

    public QualifiedName(String nameOrQualifiedName, String defaultNamespace)
    Creates a QualifiedName from a fully qualified name or the name and the namespace parts of a QualifiedName.
    Parameter:
      `nameOrQualifiedName` - either the name part of the QualifiedName, or a fully qualified name. May not be null and must contain an non-empty name part.
      `defaultNamespace` - the namespace of the QualifiedName, may be null if nameOrQualifiedName has a namespace part.
    Löst aus:
      `IllegalArgumentException` - if name has an empty name part, or if no namespace is found (nameOrQualifiedName has no namespace part and defaultNamespace is null)
      `NullPointerException` - if name is null.

  - ### QualifiedName

    public QualifiedName(String nameOrQualifiedName, Namespace defaultNamespace)
    Creates a QualifiedName from a fully qualified name or the name and the namespace parts of a QualifiedName.
    Parameter:
      `nameOrQualifiedName` - either the name part of the QualifiedName, or a fully qualified name. May not be null and must contain an non-empty name part.
      `defaultNamespace` - the namespace of the QualifiedName, may be null if nameOrQualifiedName has a namespace part.
    Löst aus:
      `IllegalArgumentException` - if name has an empty name part, or if no namespace is found (nameOrQualifiedName has no namespace part and defaultNamespace is null)
      `NullPointerException` - if name is null.

- ## Methodendetails

  - ### getName

    public String getName()
    Returns the name part of the QualifiedName.
    Gibt zurück:
      the name part of the QualifiedName, never null.

  - ### getNamespace

    public Namespace getNamespace()
    Returns the namespace of the QualifiedName.
    Gibt zurück:
      the namespace of the QualifiedName, may be null.

  - ### isVisibleFrom

    public boolean isVisibleFrom(Namespace otherNamespace)
    Returns if this qualified name is visible from another namespace. This is true if the namespace is a "child" of this qualified name's namespace. Note that for being a child, all the parts of the namespace separated by a dot must be equal. For example, "org.apache.torque:name" is visible from the namespaces "org.apache.torque.generator" and "org.apache.torque", but not from "org.apache"
    Parameter:
      `otherNamespace` - the namespace against this QualifiedName should be checked, not null.
    Gibt zurück:
      true if this QualifiedName is visible from the given namespace, false otherwise.
    Löst aus:
      `NullPointerException` - if otherNamespace is null.

  - ### getParentNamespace

    public Namespace getParentNamespace()
    Returns the parent of the Qualified name's namespace. If this qualified name is in the root namespace, the root namespace is returned.
    Gibt zurück:
      the parent namespace of the qualified name's namespace, never null.
    Siehe auch:
      - `Namespace.getParent()`

  - ### isInRootNamespace

    public boolean isInRootNamespace()
    Returns if the namespace of this qualified name is the root namespace.
    Gibt zurück:
      true if the namespace is the root namespace, false otherwise.

  - ### toString

    public String toString()
    Returns the String representation of the QualifiedName, which is namespace.name if namespace is not empty, or name if namespace is empty.
    Setzt außer Kraft:
      `toString` in Klasse `Object`
    Gibt zurück:
      a String representation of the QualifiedName.

  - ### equals

    public boolean equals(Object o)
    Returns if this object equals another object. This is the case if the other object is also a QualifiedName and its name and namespace are the same as this object's name and namespace.
    Setzt außer Kraft:
      `equals` in Klasse `Object`
    Parameter:
      `o` - the other object to compare this object to.
    Gibt zurück:
      true if this object equals the other object, false otherwise.
    Siehe auch:
      - `Object.equals(Object)`

  - ### hashCode

    public int hashCode()
    Returns a hashcode for the QualifiedName. The hashcode is consistent with equals.
    Setzt außer Kraft:
      `hashCode` in Klasse `Object`
    Gibt zurück:
      a hashcode for the qualified name.
    Siehe auch:
      - `Object.hashCode()`