com.softwareag.centrasite.appl.framework.utils
Class JAXRUtils

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.utils.JAXRUtils

public class JAXRUtils
extends java.lang.Object

Container class for JAXR utility methods.


Constructor Summary
JAXRUtils()
           
 
Method Summary
static java.util.Collection<javax.xml.registry.infomodel.Association> asAssociationCollection(java.util.Collection<?> pCollection)
           
static java.util.Collection<javax.xml.registry.infomodel.Classification> asClassificationCollection(java.util.Collection<?> pCollection)
           
static java.util.Collection<javax.xml.registry.infomodel.Concept> asConceptCollection(java.util.Collection<?> pCollection)
           
static javax.xml.registry.infomodel.Classification findClassificationByConcept(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String key)
          Retrieves a classification from RegistryObject by a concept key.
static java.util.Collection<javax.xml.registry.infomodel.Classification> findClassificationsByConcept(javax.xml.registry.infomodel.RegistryObject ro, javax.xml.registry.infomodel.Concept concept)
          Retrieves classifications from RegistryObject by a concept.
static java.util.Collection<javax.xml.registry.infomodel.Classification> findClassificationsByConcept(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String key)
          Retrieves classifications from RegistryObject by a concept key.
static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociations(java.util.Collection<javax.xml.registry.infomodel.Association> pAssociations, AssociationFilter pFilter)
          Returns all associations in the given collection, that match the given filter.
static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociations(javax.xml.registry.infomodel.RegistryObject pObject)
          Returns the given registry objects associations.
static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndType(javax.xml.registry.infomodel.RegistryObject pRo, java.lang.String associationType)
          Returns all associations with the given source object and the given association type.
static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndTypeAndTarget(javax.xml.registry.infomodel.RegistryObject pRo, java.lang.String associationType, javax.xml.registry.infomodel.RegistryObject target)
          Returns all associations with the given source object, the given association type, and the given target object.
static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndTypeAndTargetType(javax.xml.registry.infomodel.RegistryObject pRo, java.lang.String associationType, java.lang.String objectType)
          Returns all associations with the given source object, the given association type, and the given object type.
static javax.xml.registry.infomodel.Classification getClassification(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String key)
          Retrieves a Classification form a RegistryObject by a given key.
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 getFirstSlotValue(javax.xml.registry.infomodel.RegistryObject pObject, java.lang.String pName)
          Returns the first value, of the slot with the given name, if any, or null.
static java.lang.String getLocalName(javax.xml.registry.infomodel.Concept concept)
          Returns the local name of this concept.
static java.lang.String getLocalStringValue(javax.xml.registry.infomodel.InternationalString internationalString, java.util.Locale locale)
           Returns the InternationalString value for the given locale.
static java.util.Collection<java.lang.String> getSlotValues(javax.xml.registry.infomodel.RegistryObject pObject, java.lang.String pName)
          Returns collection of values, of the slot with the given name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXRUtils

public JAXRUtils()
Method Detail

getFirstSlotValue

public static java.lang.String getFirstSlotValue(javax.xml.registry.infomodel.RegistryObject pObject,
                                                 java.lang.String pName)
                                          throws javax.xml.registry.JAXRException
Returns the first value, of the slot with the given name, if any, or null.

Throws:
javax.xml.registry.JAXRException

getSlotValues

public static java.util.Collection<java.lang.String> getSlotValues(javax.xml.registry.infomodel.RegistryObject pObject,
                                                                   java.lang.String pName)
                                                            throws javax.xml.registry.JAXRException
Returns collection of values, of the slot with the given name. Returns empty list in case of missing slot.

Throws:
javax.xml.registry.JAXRException

asClassificationCollection

public static final java.util.Collection<javax.xml.registry.infomodel.Classification> asClassificationCollection(java.util.Collection<?> pCollection)
Parameters:
pCollection -
Returns:
Collection

asAssociationCollection

public static final java.util.Collection<javax.xml.registry.infomodel.Association> asAssociationCollection(java.util.Collection<?> pCollection)
Parameters:
pCollection -
Returns:
Collection

asConceptCollection

public static final java.util.Collection<javax.xml.registry.infomodel.Concept> asConceptCollection(java.util.Collection<?> pCollection)
Parameters:
pCollection -
Returns:
Collection

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.

Throws:
javax.xml.registry.JAXRException

getClassification

public static javax.xml.registry.infomodel.Classification getClassification(javax.xml.registry.infomodel.RegistryObject ro,
                                                                            java.lang.String key)
                                                                     throws javax.xml.registry.JAXRException
Retrieves a Classification form a RegistryObject by a given key.

Throws:
javax.xml.registry.JAXRException

findClassificationByConcept

public static javax.xml.registry.infomodel.Classification findClassificationByConcept(javax.xml.registry.infomodel.RegistryObject ro,
                                                                                      java.lang.String key)
                                                                               throws javax.xml.registry.JAXRException
Retrieves a classification from RegistryObject by a concept key.

Throws:
javax.xml.registry.JAXRException

findClassificationsByConcept

public static java.util.Collection<javax.xml.registry.infomodel.Classification> findClassificationsByConcept(javax.xml.registry.infomodel.RegistryObject ro,
                                                                                                             java.lang.String key)
                                                                                                      throws javax.xml.registry.JAXRException
Retrieves classifications from RegistryObject by a concept key.

Throws:
javax.xml.registry.JAXRException

findClassificationsByConcept

public static java.util.Collection<javax.xml.registry.infomodel.Classification> findClassificationsByConcept(javax.xml.registry.infomodel.RegistryObject ro,
                                                                                                             javax.xml.registry.infomodel.Concept concept)
                                                                                                      throws javax.xml.registry.JAXRException
Retrieves classifications from RegistryObject by a concept.

Throws:
javax.xml.registry.JAXRException

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 registry objects associations.

Throws:
javax.xml.registry.JAXRException

getAssociations

public static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociations(java.util.Collection<javax.xml.registry.infomodel.Association> pAssociations,
                                                                                             AssociationFilter pFilter)
                                                                                      throws javax.xml.registry.JAXRException
Returns all associations in the given collection, that match the given filter.

Throws:
javax.xml.registry.JAXRException

getAssociationsBySourceAndTypeAndTargetType

public static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndTypeAndTargetType(javax.xml.registry.infomodel.RegistryObject pRo,
                                                                                                                         java.lang.String associationType,
                                                                                                                         java.lang.String objectType)
                                                                                                                  throws javax.xml.registry.JAXRException
Returns all associations with the given source object, the given association type, and the given object type.

Throws:
javax.xml.registry.JAXRException

getAssociationsBySourceAndType

public static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndType(javax.xml.registry.infomodel.RegistryObject pRo,
                                                                                                            java.lang.String associationType)
                                                                                                     throws javax.xml.registry.JAXRException
Returns all associations with the given source object and the given association type.

Throws:
javax.xml.registry.JAXRException

getAssociationsBySourceAndTypeAndTarget

public static java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndTypeAndTarget(javax.xml.registry.infomodel.RegistryObject pRo,
                                                                                                                     java.lang.String associationType,
                                                                                                                     javax.xml.registry.infomodel.RegistryObject target)
                                                                                                              throws javax.xml.registry.JAXRException
Returns all associations with the given source object, the given association type, and the given target object.

Throws:
javax.xml.registry.JAXRException

getLocalName

public static java.lang.String getLocalName(javax.xml.registry.infomodel.Concept concept)
                                     throws javax.xml.registry.JAXRException
Returns the local name of this concept.

Throws:
javax.xml.registry.JAXRException

getLocalStringValue

public static java.lang.String getLocalStringValue(javax.xml.registry.infomodel.InternationalString internationalString,
                                                   java.util.Locale locale)

Returns the InternationalString value for the given locale. If the given Locale is null uses the default JVM locale.

If there is no value for the given locale this method searches for non empty value depending on the boolean argument.

Parameters:
internationalString -
locale -
searchNonEmptyValue - Determines if the first non empty value should be returned in case there is no value for the given locale.
Returns:
String