Package org.zkoss.zk.ui.metainfo

## Class ComponentDefinitionMap

- java.lang.Object
- - org.zkoss.zk.ui.metainfo.ComponentDefinitionMap

- All Implemented Interfaces:
    `java.io.Serializable`, `java.lang.Cloneable`

      public class ComponentDefinitionMap
      extends java.lang.Object
      implements java.lang.Cloneable, java.io.Serializable

  A map of component definitions. Used with `PageDefinition.getComponentDefinitionMap()` and `LanguageDefinition`.

  It is thread-safe (since it is used in `LanguageDefinition`).

  Author:
    tomyeh
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ComponentDefinitionMap​(boolean ignoreCase)` | Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `add​(ComponentDefinition compdef)` | Adds a component definition to this map.
    `java.lang.Object` | `clone()` |
    `boolean` | `contains​(java.lang.String name)` | Returns whether the specified component exists.
    `ComponentDefinition` | `get​(java.lang.Class cls)` | Returns the component definition of the specified class, or null if not found.
    `ComponentDefinition` | `get​(java.lang.String name)` | Returns the component definition of the specified name, or null if not not found.
    `java.util.Collection<ComponentDefinition>` | `getDefinitions()` | Returns a readonly collection of component definitions (`ComponentDefinition`) defined in this map.
    `java.util.Collection<java.lang.String>` | `getNames()` | Returns a readonly collection of the names (String) of component definitions defined in this map.
    `boolean` | `isCaseInsensitive()` | Returns whether the component names are case-insensitive.

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

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ComponentDefinitionMap

          public ComponentDefinitionMap​(boolean ignoreCase)

      Constructor.

  - ### Method Detail

    - #### isCaseInsensitive

          public boolean isCaseInsensitive()

      Returns whether the component names are case-insensitive.

    - #### getNames

          public java.util.Collection<java.lang.String> getNames()

      Returns a readonly collection of the names (String) of component definitions defined in this map.

    - #### getDefinitions

          public java.util.Collection<ComponentDefinition> getDefinitions()

      Returns a readonly collection of component definitions (`ComponentDefinition`) defined in this map.
      Since:
        3.6.3

    - #### add

          public void add​(ComponentDefinition compdef)

      Adds a component definition to this map.

      Thread safe.

    - #### contains

          public boolean contains​(java.lang.String name)

      Returns whether the specified component exists.

    - #### get

          public ComponentDefinition get​(java.lang.String name)

      Returns the component definition of the specified name, or null if not not found.

      Note: unlike `LanguageDefinition.getComponentDefinition(java.lang.String)`, this method doesn't throw ComponentNotFoundException if not found. It just returns null.

    - #### get

          public ComponentDefinition get​(java.lang.Class cls)

      Returns the component definition of the specified class, or null if not found.

      Note: unlike `LanguageDefinition.getComponentDefinition(java.lang.String)`, this method doesn't throw ComponentNotFoundException if not found. It just returns null.

    - #### clone

          public java.lang.Object clone()

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