net.sf.jasperreports.engine.component

## Class ComponentKey

- java.lang.Object
- - net.sf.jasperreports.engine.component.ComponentKey

- All Implemented Interfaces:
    java.io.Serializable

      public class ComponentKey
      extends java.lang.Object
      implements java.io.Serializable

  A key identifying a component type/class.

  A component type is identified by a namespace and a component name. An instance of this class includes in addition a namespace prefix, which is required when producing a JRXML representation of the component (via `JRXmlWriter`).

  Version:
    $Id: ComponentKey.java 5878 2013-01-07 20:23:13Z teodord $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)
  See Also:
    `JRComponentElement.getComponentKey()`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ComponentKey(java.lang.String namespace, java.lang.String namespacePrefix, java.lang.String name)` Create a component type key.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object o)`
    `java.lang.String` | `getName()` Returns the component name.
    `java.lang.String` | `getNamespace()` Returns the component namespace.
    `java.lang.String` | `getNamespacePrefix()` Returns the namespace prefix which is to be used when producing an XML representation of a component of this type.
    `int` | `hashCode()`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### ComponentKey

          public ComponentKey(java.lang.String namespace,
                      java.lang.String namespacePrefix,
                      java.lang.String name)

      Create a component type key.
      Parameters:
        `namespace` - the component namespace
        `namespacePrefix` - the prefix to use for the namespace
        `name` - the component name

  - ### Method Detail

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### getNamespace

          public java.lang.String getNamespace()

      Returns the component namespace.

      This value must match the namespece of a components bundle, as returned by `ComponentsXmlParser.getNamespace()`.

      Returns:
        the component namespace

    - #### getName

          public java.lang.String getName()

      Returns the component name.

      The value must match a component name in the components bundle, as used in `ComponentsBundle.getComponentManager(String)`.

      Returns:
        the coponent name

    - #### getNamespacePrefix

          public java.lang.String getNamespacePrefix()

      Returns the namespace prefix which is to be used when producing an XML representation of a component of this type.
      Returns:
        the namespace prefix

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com