org.eclipse.emf.validation.util
Class XmlConfig

java.lang.Object
  extended byorg.eclipse.emf.validation.util.XmlConfig

public class XmlConfig
extends java.lang.Object

Static utilities for loading the constraint provider configurations from XML documents.

This class is not intended to be used outside of the validation framework.


Field Summary
static java.lang.String A_CACHE
           
static java.lang.String A_CATEGORIES
           
static java.lang.String A_CLASS
           
static java.lang.String A_ENABLED
           
static java.lang.String A_ID
           
static java.lang.String A_LANG
           
static java.lang.String A_MANDATORY
           
static java.lang.String A_MODE
           
static java.lang.String A_NAME
           
static java.lang.String A_NAMESPACE_URI
           
static java.lang.String A_PATH
           
static java.lang.String A_SEVERITY
           
static java.lang.String A_STATUS_CODE
           
static java.lang.String A_VALUE
           
static java.lang.String E_CATEGORY
           
static java.lang.String E_CONSTRAINT
           
static java.lang.String E_CONSTRAINT_PROVIDER
           
static java.lang.String E_CONSTRAINTS
           
static java.lang.String E_DESCRIPTION
           
static java.lang.String E_EVENT
           
static java.lang.String E_FEATURE
           
static java.lang.String E_INCLUDE
           
static java.lang.String E_INCLUDED_CONSTRAINTS
           
static java.lang.String E_MESSAGE
           
static java.lang.String E_PACKAGE
           
static java.lang.String E_PARAM
           
static java.lang.String E_TARGET
           
 
Method Summary
static void flushResourceBundles()
          Flushes the resource bundles that were loaded for localization of strings in an XML constraint provider's XML constraint declarations.
static java.lang.String getParameter(org.eclipse.core.runtime.IConfigurationElement constraint, java.lang.String name)
          Gets the value of the named parameter on the specified constraint configuration element.
static java.lang.String[] getParameterValues(org.eclipse.core.runtime.IConfigurationElement constraint, java.lang.String name)
          Gets the values of the named parameter in the order in which they appear on the specified constraint configuration element.
static org.eclipse.core.runtime.IConfigurationElement load(org.eclipse.core.runtime.IConfigurationElement parent, java.net.URL url)
          Loads a <constraints> element from the specified url.
static org.eclipse.core.runtime.IConfigurationElement parseConstraintsWithIncludes(org.eclipse.core.runtime.IConfigurationElement constraints)
          Parses a <constraints> element into an Eclipse configuration element data structure, with support for including constraints from separate XML files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

E_CONSTRAINT_PROVIDER

public static final java.lang.String E_CONSTRAINT_PROVIDER
See Also:
Constant Field Values

A_ID

public static final java.lang.String A_ID
See Also:
Constant Field Values

A_MODE

public static final java.lang.String A_MODE
See Also:
Constant Field Values

A_CACHE

public static final java.lang.String A_CACHE
See Also:
Constant Field Values

E_PACKAGE

public static final java.lang.String E_PACKAGE
See Also:
Constant Field Values

A_NAMESPACE_URI

public static final java.lang.String A_NAMESPACE_URI
See Also:
Constant Field Values

E_CONSTRAINTS

public static final java.lang.String E_CONSTRAINTS
See Also:
Constant Field Values

A_CATEGORIES

public static final java.lang.String A_CATEGORIES
See Also:
Constant Field Values

E_INCLUDED_CONSTRAINTS

public static final java.lang.String E_INCLUDED_CONSTRAINTS
See Also:
Constant Field Values

E_CONSTRAINT

public static final java.lang.String E_CONSTRAINT
See Also:
Constant Field Values

A_LANG

public static final java.lang.String A_LANG
See Also:
Constant Field Values

A_SEVERITY

public static final java.lang.String A_SEVERITY
See Also:
Constant Field Values

A_STATUS_CODE

public static final java.lang.String A_STATUS_CODE
See Also:
Constant Field Values

A_CLASS

public static final java.lang.String A_CLASS
See Also:
Constant Field Values

E_INCLUDE

public static final java.lang.String E_INCLUDE
See Also:
Constant Field Values

A_PATH

public static final java.lang.String A_PATH
See Also:
Constant Field Values

E_TARGET

public static final java.lang.String E_TARGET
See Also:
Constant Field Values

E_EVENT

public static final java.lang.String E_EVENT
See Also:
Constant Field Values

A_NAME

public static final java.lang.String A_NAME
See Also:
Constant Field Values

E_FEATURE

public static final java.lang.String E_FEATURE
See Also:
Constant Field Values

E_DESCRIPTION

public static final java.lang.String E_DESCRIPTION
See Also:
Constant Field Values

E_MESSAGE

public static final java.lang.String E_MESSAGE
See Also:
Constant Field Values

E_PARAM

public static final java.lang.String E_PARAM
See Also:
Constant Field Values

A_VALUE

public static final java.lang.String A_VALUE
See Also:
Constant Field Values

E_CATEGORY

public static final java.lang.String E_CATEGORY
See Also:
Constant Field Values

A_MANDATORY

public static final java.lang.String A_MANDATORY
See Also:
Constant Field Values

A_ENABLED

public static final java.lang.String A_ENABLED
See Also:
Constant Field Values
Method Detail

parseConstraintsWithIncludes

public static org.eclipse.core.runtime.IConfigurationElement parseConstraintsWithIncludes(org.eclipse.core.runtime.IConfigurationElement constraints)
                                                                                   throws org.eclipse.core.runtime.CoreException
Parses a <constraints> element into an Eclipse configuration element data structure, with support for including constraints from separate XML files.

Parameters:
constraints - an Eclipse configuration element obtained either from Eclipse's extension point parser or from this utility class
Returns:
the Eclipse-ish representation of the XML constraint configurations
Throws:
org.eclipse.core.runtime.CoreException - if there is any problem either in accessing an existing configuration element or in parsing the XML to create new ones

getParameter

public static java.lang.String getParameter(org.eclipse.core.runtime.IConfigurationElement constraint,
                                            java.lang.String name)
Gets the value of the named parameter on the specified constraint configuration element. If the parameter occurs more than once, only the first name will be retrieved.

Parameters:
constraint - the <constraint> configuration element
name - the name of the parameter to retrieve
Returns:
the parameter's value, or null if no such parameter is defined
See Also:
XmlConfig.getParameterValues(org.eclipse.core.runtime.IConfigurationElement, java.lang.String)

getParameterValues

public static java.lang.String[] getParameterValues(org.eclipse.core.runtime.IConfigurationElement constraint,
                                                    java.lang.String name)
Gets the values of the named parameter in the order in which they appear on the specified constraint configuration element.

Parameters:
constraint - the <constraint> configuration element
name - the name of the parameter to retrieve
Returns:
the parameter's values, in order. Will be an empty array (not null) if no occurrences of the parameter are found
See Also:
XmlConfig.getParameter(org.eclipse.core.runtime.IConfigurationElement, java.lang.String)

load

public static org.eclipse.core.runtime.IConfigurationElement load(org.eclipse.core.runtime.IConfigurationElement parent,
                                                                  java.net.URL url)
                                                           throws org.eclipse.core.runtime.CoreException
Loads a <constraints> element from the specified url.

Parameters:
parent - the configuration element which is to be the parent of the new <constraints> element
url - the location of the document defining the <constraints> element
Returns:
the configuration element representing the XML document
Throws:
org.eclipse.core.runtime.CoreException - on any problem accessing a configuration element or parsing an XML file

flushResourceBundles

public static void flushResourceBundles()
Flushes the resource bundles that were loaded for localization of strings in an XML constraint provider's XML constraint declarations.


Copyright 2002, 2006 IBM Corporation and others.
All Rights Reserved.