public class Namespaces extends Object implements Serializable
Namespace
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
DEFAULT
This is passed as the cartridge name for the
getProperty(java.lang.String, java.lang.String) method if we wish to use a 'default' Namespace
for Plugins. |
Constructor and Description |
---|
Namespaces() |
Modifier and Type | Method and Description |
---|---|
void |
addNamespace(Namespace namespace)
Adds a namespace to this collection of namespaces.
|
void |
addNamespaces(Namespace[] namespaces)
Adds all
namespaces to this instance. |
void |
addRegistry(NamespaceRegistry registry)
Adds a namespace registry to this instance.
|
void |
clear()
Clears out the current namespaces.
|
Namespace |
getNamespace(String namespaceName)
Gets the Namespace with the corresponding
namespaceName . |
Collection<NamespaceRegistry> |
getNamespaceRegistries()
Gets all available namespace registries (these are namespaces
which have been discovered but are not necessarily configured).
|
Collection<Namespace> |
getNamespaces()
Gets the namespaces registered in this namespaces instance.
|
Collection<Property> |
getProperties(String namespaceName,
String propertyName)
Retrieves a property from the Namespace with the namespaceName.
|
Collection<Property> |
getProperties(String namespaceName,
String propertyName,
boolean showWarning)
Retrieves a property from the Namespace with the namespaceName.
|
Property |
getProperty(String namespaceName,
String propertyName)
Retrieves a property from the Namespace with the namespaceName.
|
Property |
getProperty(String namespaceName,
String propertyName,
boolean showWarning)
Retrieves a property from the Namespace with the namespaceName.
|
PropertyDefinition[] |
getPropertyDefinitions(String namespaceName)
Retrieves all property definitions for the given namespace.
|
String |
getPropertyValue(String namespace,
String name)
Attempts to get the value of a property from the given
namespace with the given name by first attempting
to retrieve it from the namespace and if no property is defined
in the namespace we retrieve the default value (if one is defined). |
NamespaceRegistry |
getRegistry(String namespace)
Retrieves the namespace registry for the given namespace, or returns null
if it doesn't exist.
|
URL[] |
getResourceRoots(String namespace)
Attempts to retrieve the resource root of the namespace.
|
static Namespaces |
instance()
Returns the singleton instance of this Namespaces
|
boolean |
isComponentPresent(String namespace,
String component)
Indicates whether or not the
component is present within the given
namespace |
boolean |
isShared(String namespace)
Indicates if the given
namespace is
shared or not. |
boolean |
namespacePresent(String namespaceName)
Indicates if the namespace is present within this instance.
|
public static final String DEFAULT
getProperty(java.lang.String, java.lang.String)
method if we wish to use a 'default' Namespace
for Plugins. This is so we don't need to define a specific mapping for each Plugin if we don't want. If a
namespaceName exists with a specific Plugin name, then that will be used instead of the 'default'public Namespaces()
public static Namespaces instance()
public Collection<Namespace> getNamespaces()
public void addNamespace(Namespace namespace)
namespace
- the Namespace to add to this instance.public void addNamespaces(Namespace[] namespaces)
namespaces
to this instance.namespaces
- the array of namespaces to add.public Namespace getNamespace(String namespaceName)
namespaceName
.namespaceName
- public boolean namespacePresent(String namespaceName)
namespaceName
- the name of the namespace.public Property getProperty(String namespaceName, String propertyName)
ignore
attribute of the
Property instance is set to true
then lookup of the property will not be attempted and null will
just be returned instead. If the property is not found and ignore
is not true
a warning
message is logged.namespaceName
- name of the Plugin to which the namespace appliespropertyName
- name of the namespace property to find.public Collection<Property> getProperties(String namespaceName, String propertyName)
ignore
attribute of the
Property instance is set to true
then lookup of the property will not be attempted and null will
just be returned instead. If the property is not found and ignore
is not true
a warning
message is logged.namespaceName
- name of the Plugin to which the namespace appliespropertyName
- name of the namespace property to find.public Property getProperty(String namespaceName, String propertyName, boolean showWarning)
ignore
attribute of the
Property instance is set to true
then lookup of the property will not be attempted and null will
just be returned instead.namespaceName
- name of the Plugin to which the namespace appliespropertyName
- name of the namespace property to find.showWarning
- true/false if we'd like to display a warning if the property/namespace can not be found.public Collection<Property> getProperties(String namespaceName, String propertyName, boolean showWarning)
ignore
attribute of the
Property instance is set to true
then lookup of the property will not be attempted and null will
just be returned instead.namespaceName
- name of the Plugin to which the namespace appliespropertyName
- name of the namespace property to find.showWarning
- true/false if we'd like to display a warning if the property/namespace can not be found.public PropertyDefinition[] getPropertyDefinitions(String namespaceName)
namespaceName
- the name of the namespace.public Collection<NamespaceRegistry> getNamespaceRegistries()
public void addRegistry(NamespaceRegistry registry)
NamespaceRegistry
descriptor (used to describe NamespaceComponent
) instances.registry
- the NamespaceRegistry
instance to add.public boolean isShared(String namespace)
namespace
is
shared or not.namespace
- the namespace to check.public String getPropertyValue(String namespace, String name)
namespace
with the given name
by first attempting
to retrieve it from the namespace and if no property is defined
in the namespace we retrieve the default value (if one is defined).namespace
- the namespace for which to retreive the value.name
- the name of the value to retrieve.public URL[] getResourceRoots(String namespace)
namespace
- the namespace of which to retrieve the resource.public boolean isComponentPresent(String namespace, String component)
component
is present within the given
namespace
namespace
- the name of the namespace.component
- the name of the component type.public NamespaceRegistry getRegistry(String namespace)
namespace
- the namespace name.public void clear()
Copyright © 2003–2014 AndroMDA.org. All rights reserved.