org.eclipse.jst.jsf.contentmodel.annotation.internal.provisional
Class CMAnnotationHelper

java.lang.Object
  extended byorg.eclipse.jst.jsf.contentmodel.annotation.internal.provisional.CMAnnotationHelper

public class CMAnnotationHelper
extends java.lang.Object

Class meant for all public access to the design-time meta-data (CMAnnotations) values.

  • Annotation files are registered against a uri (eg. http://java.sun.com/jsf/core) using the extension-point org.eclipse.jst.jsf.contentmodel.annotations.annotationFiles.
  • Any number of annotation files can be associated with the uri and against any element or attribute.
  • It is recommended that a single plugin should avoid registering meta-data for the same attribute or element from different annotationFiles.
  • A CMAnnotation allows for a collection of property values for a named property.
  • Querying the registry using this helper class can return lists of CMAnnotationPropertyValue which allows the caller to make the determination of whether the property value is of interest or not.
  • The caller can also query the registry for specific plugin supplied annotation meta-data.
  • -- include link to doc--
  • See Also:
    CMElementAnnotation, CMAttributeAnnotation, CMAnnotationPropertyValue, extension-point

    Constructor Summary
    CMAnnotationHelper()
               
     
    Method Summary
    static java.util.List getCMAttributeProperties(java.lang.String uri, java.lang.String cmElementName, java.lang.String cmAttrName, java.lang.String meta_prop_name)
              Returns a list of CMAnnotationPropertyValue objects for a given property name and uri/tag/tag attribute combo.
    static java.util.List getCMAttributeProperties(java.lang.String bundleId, java.lang.String uri, java.lang.String cmElementName, java.lang.String cmAttrName, java.lang.String meta_prop_name)
              Returns a list of CMAnnotationPropertyValue objects for a given bundleId, property name and uri/tag/tag attribute combo.
    static java.lang.String getCMAttributePropertyValue(java.lang.String bundleId, java.lang.String uri, java.lang.String cmElementName, java.lang.String cmAttrName, java.lang.String meta_prop_name)
              Convenience method to return the first string value for a given bundle, uri, element, attr, and meta_prop_name.
    static java.util.List getCMAttributePropertyValues(java.lang.String bundleId, java.lang.String uri, java.lang.String cmElementName, java.lang.String cmAttrName, java.lang.String meta_prop_name)
              Convenience method to return the list of property values for a given bundle, uri, element, attr, and meta_prop_name.
    static java.util.List getCMElementProperties(java.lang.String uri, java.lang.String cmElementName, java.lang.String meta_prop_name)
              Returns a list of CMAnnotationPropertyValue objects for a given property name and uri/tag element combo.
    static java.util.List getCMElementProperties(java.lang.String bundleId, java.lang.String uri, java.lang.String cmElementName, java.lang.String meta_prop_name)
              Returns a list of CMAnnotationPropertyValue objects for a given bundle, property name and uri/tag element combo.
    static java.lang.String getCMElementPropertyValue(java.lang.String bundleId, java.lang.String uri, java.lang.String cmElementName, java.lang.String meta_prop_name)
              Convenience method to return the first string value for a given bundle, uri, element, and meta_prop_name.
    static java.util.List getCMElementPropertyValues(java.lang.String bundleId, java.lang.String uri, java.lang.String cmElementName, java.lang.String meta_prop_name)
              Convenience method to return the list of property values for a given bundle, uri, element, and meta_prop_name.
    static boolean hasAnnotations(java.lang.String uri)
              Return whether or not there are annotation files for a given uri.
    static boolean hasAnnotations(java.lang.String bundleId, java.lang.String uri)
              Return whether or not there are annotation files for a given uri and bundleId.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    CMAnnotationHelper

    public CMAnnotationHelper()
    Method Detail

    getCMAttributeProperties

    public static java.util.List getCMAttributeProperties(java.lang.String uri,
                                                          java.lang.String cmElementName,
                                                          java.lang.String cmAttrName,
                                                          java.lang.String meta_prop_name)
    Returns a list of CMAnnotationPropertyValue objects for a given property name and uri/tag/tag attribute combo. A list is being returned because it is possible that there are multiple annotation files with the same named property. Caller can decide what to do. Will return empty if annotation is not found or meta-data property name not present.

    Parameters:
    uri -
    cmElementName -
    cmAttrName -
    meta_prop_name -
    Returns:
    list of CMAnnotationPropertyValue objects

    getCMAttributeProperties

    public static java.util.List getCMAttributeProperties(java.lang.String bundleId,
                                                          java.lang.String uri,
                                                          java.lang.String cmElementName,
                                                          java.lang.String cmAttrName,
                                                          java.lang.String meta_prop_name)
    Returns a list of CMAnnotationPropertyValue objects for a given bundleId, property name and uri/tag/tag attribute combo. A list is being returned because it is possible that there are multiple annotation files with the same named property. Caller can decide what to do. Use this method if you are not looking for a property value from a specific bundle. Usually the caller. Will return empty if annotation is not found or meta-data property name not present.

    Parameters:
    bundleId -
    uri -
    cmElementName -
    cmAttrName -
    meta_prop_name -
    Returns:
    list of CMAnnotationPropertyValue objects

    getCMAttributePropertyValue

    public static java.lang.String getCMAttributePropertyValue(java.lang.String bundleId,
                                                               java.lang.String uri,
                                                               java.lang.String cmElementName,
                                                               java.lang.String cmAttrName,
                                                               java.lang.String meta_prop_name)
    Convenience method to return the first string value for a given bundle, uri, element, attr, and meta_prop_name. Caller needs to be aware that this could be a multi-value property. If so, getCMAttributePropertyValues should probably be called. Caller must be sure that only one annotation meta-data file is associated with this uri from the specified bundle. If there are multiple annotations, only the first bundle's values will be returned. Will return null if annotation is not found or meta-data property name not present.

    Parameters:
    bundleId -
    uri -
    cmElementName -
    cmAttrName -
    meta_prop_name -
    Returns:
    property value as String

    getCMAttributePropertyValues

    public static java.util.List getCMAttributePropertyValues(java.lang.String bundleId,
                                                              java.lang.String uri,
                                                              java.lang.String cmElementName,
                                                              java.lang.String cmAttrName,
                                                              java.lang.String meta_prop_name)
    Convenience method to return the list of property values for a given bundle, uri, element, attr, and meta_prop_name. Caller must be sure that only one annotation meta-data file is associated with this uri from the specified bundle. If there are multiple annotations, only the first bundle's values will be returned. Will return empty list if annotation is not found or meta-data property name not present.

    Parameters:
    bundleId -
    uri -
    cmElementName -
    cmAttrName -
    meta_prop_name -
    Returns:
    property values as List

    getCMElementProperties

    public static java.util.List getCMElementProperties(java.lang.String uri,
                                                        java.lang.String cmElementName,
                                                        java.lang.String meta_prop_name)
    Returns a list of CMAnnotationPropertyValue objects for a given property name and uri/tag element combo. A list is being returned because it is possible that there are multiple annotation files with the same named property. Caller can decide what to do. Will return empty list if annotation is not found or meta-data property name not present.

    Parameters:
    uri -
    cmElementName -
    meta_prop_name -
    Returns:
    list of CMAnnotationPropertyValue objects

    getCMElementProperties

    public static java.util.List getCMElementProperties(java.lang.String bundleId,
                                                        java.lang.String uri,
                                                        java.lang.String cmElementName,
                                                        java.lang.String meta_prop_name)
    Returns a list of CMAnnotationPropertyValue objects for a given bundle, property name and uri/tag element combo. A list is being returned because it is possible that there are multiple annotation files with the same named property. Caller can decide what to do. Use this method if you are not looking for a property value from a specific bundle. Usually the caller. Will return empty list if annotation is not found or meta-data property name not present.

    Parameters:
    bundleId -
    uri -
    cmElementName -
    meta_prop_name -
    Returns:
    list of CMAnnotationPropertyValue objects

    getCMElementPropertyValue

    public static java.lang.String getCMElementPropertyValue(java.lang.String bundleId,
                                                             java.lang.String uri,
                                                             java.lang.String cmElementName,
                                                             java.lang.String meta_prop_name)
    Convenience method to return the first string value for a given bundle, uri, element, and meta_prop_name. Caller needs to be aware that this could be a multi-value property. If so, getCMAttributePropertyValues should probably be called. Caller must be sure that only one annotation meta-data file is associated with this uri from the specified bundle. If there are multiple annotations, only the first bundle's values will be returned. Will return null if annotation is not found or meta-data property name not present.

    Parameters:
    bundleId -
    uri -
    cmElementName -
    meta_prop_name -
    Returns:
    property value as String

    getCMElementPropertyValues

    public static java.util.List getCMElementPropertyValues(java.lang.String bundleId,
                                                            java.lang.String uri,
                                                            java.lang.String cmElementName,
                                                            java.lang.String meta_prop_name)
    Convenience method to return the list of property values for a given bundle, uri, element, and meta_prop_name. Caller must be sure that only one annotation meta-data file is associated with this uri from the specified bundle. If there are multiple annotations, only the first bundle's values will be returned. Will return empty list if annotation is not found or meta-data property name not present.

    Parameters:
    bundleId -
    uri -
    cmElementName -
    meta_prop_name -
    Returns:
    List of property values as Strings

    hasAnnotations

    public static boolean hasAnnotations(java.lang.String bundleId,
                                         java.lang.String uri)
    Return whether or not there are annotation files for a given uri and bundleId.

    Parameters:
    bundleId -
    uri -
    Returns:
    boolean

    hasAnnotations

    public static boolean hasAnnotations(java.lang.String uri)
    Return whether or not there are annotation files for a given uri.

    Parameters:
    uri -
    Returns:
    boolean