org.andromda.core.namespace
Class NamespaceRegistry

java.lang.Object
  extended by org.andromda.core.namespace.NamespaceRegistry

public class NamespaceRegistry
extends Object

Represents a namespace registry. This is where all components within a namespace are registered.

Author:
Chad Brandon, Bob Fields

Constructor Summary
NamespaceRegistry()
           
 
Method Summary
 void addPropertyDefinition(PropertyDefinition propertyDefinition)
          Adds a property definition to the group of defintions.
 void addPropertyDefinitions(PropertyDefinition[] propertyDefinitions)
          Adds all property definitions to the current property definitions.
(package private)  void addResourceRoot(URL resourceRoot)
          Adds a resource root to this namespace (since a namespace can consist of multiple locations)
(package private)  void copy(NamespaceRegistry registry)
          Copies all contents from the registry to this instance.
 String getName()
          Gets the name of the namespace registry.
 String[] getPaths(String name)
          Gets the initialization paths for the given component name.
 PropertyDefinition getPropertyDefinition(String name)
          Attempts to retrieve the property definition for the given name.
 PropertyDefinition[] getPropertyDefinitions()
          Gets all property definitions belonging to this registry.
 String[] getRegisteredComponents()
          Gets the names registered components.
 URL[] getResourceRoots()
          Gets the resource root of this namespace.
 boolean isShared()
          Gets whether or not the namespace defined by this registry is shared.
 void registerComponent(Component component)
          Registers the component with the give name in this registry.
 void setName(String name)
          SEts the name of the namespace registry.
 void setShared(boolean shared)
          Sets whether or not the namespace defined by this registry is shared.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamespaceRegistry

public NamespaceRegistry()
Method Detail

getName

public String getName()
Gets the name of the namespace registry.

Returns:
Returns the name.

setName

public void setName(String name)
SEts the name of the namespace registry.

Parameters:
name - The name to set.

isShared

public boolean isShared()
Gets whether or not the namespace defined by this registry is shared. By default namespaces are NOT shared.

Returns:
Returns the shared.

setShared

public void setShared(boolean shared)
Sets whether or not the namespace defined by this registry is shared.

Parameters:
shared - The shared to set.

registerComponent

public void registerComponent(Component component)
Registers the component with the give name in this registry.

Parameters:
component - the component of the registry.

getRegisteredComponents

public String[] getRegisteredComponents()
Gets the names registered components.

Returns:
the names of the registered components.

getPaths

public String[] getPaths(String name)
Gets the initialization paths for the given component name.

Parameters:
name - the name of the component.
Returns:
the paths or null if none are found.

getPropertyDefinition

public PropertyDefinition getPropertyDefinition(String name)
Attempts to retrieve the property definition for the given name.

Parameters:
name -
Returns:
the property definition or null if one could not be found.

addPropertyDefinitions

public void addPropertyDefinitions(PropertyDefinition[] propertyDefinitions)
Adds all property definitions to the current property definitions.

Parameters:
propertyDefinitions - the collection of property definitions.

copy

final void copy(NamespaceRegistry registry)
Copies all contents from the registry to this instance.

Parameters:
registry - the registry to copy.

getPropertyDefinitions

public PropertyDefinition[] getPropertyDefinitions()
Gets all property definitions belonging to this registry.

Returns:
all property definitions.

addPropertyDefinition

public void addPropertyDefinition(PropertyDefinition propertyDefinition)
Adds a property definition to the group of defintions.

Parameters:
propertyDefinition - the property definition.

getResourceRoots

public URL[] getResourceRoots()
Gets the resource root of this namespace.

Returns:
Returns the resource.

addResourceRoot

final void addResourceRoot(URL resourceRoot)
Adds a resource root to this namespace (since a namespace can consist of multiple locations)

Parameters:
resourceRoot - The resource root to set.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2003-2012 AndroMDA.org. All Rights Reserved.