net.sf.csutils.core.utils
Class RegistryObjects

java.lang.Object
  extended by net.sf.csutils.core.utils.RegistryObjects

public class RegistryObjects
extends java.lang.Object

Utility method for working with registry objects.


Constructor Summary
RegistryObjects()
           
 
Method Summary
static java.util.Locale asLocale(java.lang.String pLocale)
          Converts the given string into a locale.
static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociations(javax.xml.registry.infomodel.RegistryObject pObject)
          Returns the given objects associations.
static java.util.Collection<javax.xml.registry.infomodel.Classification> getClassifications(javax.xml.registry.infomodel.RegistryObject pObject)
          Returns the given objects classifications.
static java.lang.String getDescription(javax.xml.registry.infomodel.RegistryObject pRo)
          Returns the registry objects description.
static java.lang.String getDescription(javax.xml.registry.infomodel.RegistryObject pRo, java.util.Locale pLocale)
          Returns the registry objects description with the given Locale.
static java.lang.String getDescription(javax.xml.registry.infomodel.RegistryObject pRo, java.lang.String pLocale)
          Returns the registry objects description with the given Locale.
static java.lang.String getName(javax.xml.registry.infomodel.RegistryObject pRo)
          Returns the registry objects name.
static java.lang.String getName(javax.xml.registry.infomodel.RegistryObject pRo, java.util.Locale pLocale)
          Returns the registry objects name with the given Locale.
static java.lang.String getName(javax.xml.registry.infomodel.RegistryObject pRo, java.lang.String pLocale)
          Returns the registry objects name with the given Locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryObjects

public RegistryObjects()
Method Detail

getName

public static java.lang.String getName(javax.xml.registry.infomodel.RegistryObject pRo)
                                throws javax.xml.registry.JAXRException
Returns the registry objects name. Attempts the following methods to find a name:
  1. Calls the InternationalString.getValue() method and uses the result, if it is non-null, and non-empty.
  2. Calls the InternationalString.getValue(Locale) method with the Locale.US locale and uses the result, if it is non-null, and non-empty.
  3. Calls the InternationalString.getValue(Locale) method with the Locale.ENGLISH locale and uses the result, if it is non-null, and non-empty.
  4. Calls the InternationalString.getLocalizedStrings() method and uses the first non-null, and non-empty value that is found.

Parameters:
pRo - The registry object to query for its name.
Returns:
The registry objects name, if any, or null.
Throws:
javax.xml.registry.JAXRException - The operation failed.

getName

public static java.lang.String getName(javax.xml.registry.infomodel.RegistryObject pRo,
                                       java.lang.String pLocale)
                                throws javax.xml.registry.JAXRException
Returns the registry objects name with the given Locale.

Parameters:
pRo - The registry object to query for its name.
pLocale - The locales name as a string; internally asLocale(String) is invoked to convert the string into a locale.
Returns:
The registry objects name with the given locale, if any, or null.
Throws:
javax.xml.registry.JAXRException - The operation failed.

getName

public static java.lang.String getName(javax.xml.registry.infomodel.RegistryObject pRo,
                                       java.util.Locale pLocale)
                                throws javax.xml.registry.JAXRException
Returns the registry objects name with the given Locale.

Parameters:
pRo - The registry object to query for its name.
pLocale - The locales name.
Returns:
The registry objects name with the given locale, if any, or null.
Throws:
javax.xml.registry.JAXRException - The operation failed.

getDescription

public static java.lang.String getDescription(javax.xml.registry.infomodel.RegistryObject pRo)
                                       throws javax.xml.registry.JAXRException
Returns the registry objects description. Attempts the following methods to find a description:
  1. Calls the InternationalString.getValue() method and uses the result, if it is non-null, and non-empty.
  2. Calls the InternationalString.getValue(Locale) method with the Locale.US locale and uses the result, if it is non-null, and non-empty.
  3. Calls the InternationalString.getValue(Locale) method with the Locale.ENGLISH locale and uses the result, if it is non-null, and non-empty.
  4. Calls the InternationalString.getLocalizedStrings() method and uses the first non-null, and non-empty value that is found.

Parameters:
pRo - The registry object to query for its description.
Returns:
The registry objects description, if any, or null.
Throws:
javax.xml.registry.JAXRException - The operation failed.

getDescription

public static java.lang.String getDescription(javax.xml.registry.infomodel.RegistryObject pRo,
                                              java.lang.String pLocale)
                                       throws javax.xml.registry.JAXRException
Returns the registry objects description with the given Locale.

Parameters:
pRo - The registry object to query for its description.
pLocale - The locales name as a string; internally asLocale(String) is invoked to convert the string into a locale.
Returns:
The registry objects description with the given locale, if any, or null.
Throws:
javax.xml.registry.JAXRException - The operation failed.

getDescription

public static java.lang.String getDescription(javax.xml.registry.infomodel.RegistryObject pRo,
                                              java.util.Locale pLocale)
                                       throws javax.xml.registry.JAXRException
Returns the registry objects description with the given Locale.

Parameters:
pRo - The registry object to query for its description.
pLocale - The locales name.
Returns:
The registry objects description with the given locale, if any, or null.
Throws:
javax.xml.registry.JAXRException - The operation failed.

asLocale

public static java.util.Locale asLocale(java.lang.String pLocale)
Converts the given string into a locale.

Parameters:
pLocale - The locales name; use the hyphen ('-') or underscore ('_') characters as separators for language, country, and variant.
Returns:
The locale with the given name.

getAssociations

public static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociations(javax.xml.registry.infomodel.RegistryObject pObject)
                                                                                      throws javax.xml.registry.JAXRException
Returns the given objects associations. Shortcut for
   (Collection) pObject.getAssociations()
 

Parameters:
pObject - The registry object to query for associations.
Returns:
The associations of the given registry object.
Throws:
javax.xml.registry.JAXRException - The operation failed.

getClassifications

public static java.util.Collection<javax.xml.registry.infomodel.Classification> getClassifications(javax.xml.registry.infomodel.RegistryObject pObject)
                                                                                            throws javax.xml.registry.JAXRException
Returns the given objects classifications. Shortcut for
   (Collection) pObject.getClassifications()
 

Parameters:
pObject - The registry object to query for classifications.
Returns:
The classifications of the given registry object.
Throws:
javax.xml.registry.JAXRException - The operation failed.


Copyright © 2009-2010. All Rights Reserved.