|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.hyades.logging.events.cbe.util.EventValidation
Helper methods for the several validate
methods spread across
the EMF generated classes.
Constructor Summary | |
---|---|
EventValidation()
|
Method Summary | |
---|---|
static java.lang.String |
getComponentName(org.eclipse.emf.ecore.EObject component)
Returns the complete name of a component in the EMF model. |
static java.lang.String |
getComponentName(org.eclipse.emf.ecore.EObject component,
java.lang.String name)
Returns the complete name of a component in the EMF model. |
static void |
throwMissingPropertyException(java.lang.String className,
java.lang.String resourceKey,
java.lang.Object[] params)
Deprecated. As of 3.1, use instantiate a new MissingPropertyException with a localized message using EventHelpers#getString(String, Object[]). |
static void |
throwValidationException(java.lang.String className,
java.lang.String resourceKey,
java.lang.Object[] params)
Deprecated. As of 3.1, use instantiate a new ValidationException with a localized message using EventHelpers#getString(String, Object[]). |
static void |
validateId(java.lang.String classname,
org.eclipse.emf.ecore.EObject o,
org.eclipse.emf.ecore.EStructuralFeature att)
Checks whether a string conforms to the ID type |
static void |
validateId(java.lang.String classname,
org.eclipse.emf.ecore.EObject o,
org.eclipse.emf.ecore.EStructuralFeature att,
java.lang.String id)
Checks whether a string conforms to the ID type |
static void |
validateLength(java.lang.String classname,
org.eclipse.emf.ecore.EObject o,
org.eclipse.emf.ecore.EStructuralFeature att,
int maxLength)
Checks whether a string conforms to the maximum length |
static void |
validateLength(java.lang.String classname,
org.eclipse.emf.ecore.EObject o,
org.eclipse.emf.ecore.EStructuralFeature att,
int minLength,
int maxLength)
Checks whether a string conforms to the maximum length |
static void |
validateMutuallyExclusiveAttributes(java.lang.String classname,
org.eclipse.emf.ecore.EObject o,
org.eclipse.emf.ecore.EStructuralFeature att1,
org.eclipse.emf.ecore.EStructuralFeature att2)
Checks whether two attributes are mutually exclusive |
static void |
validateRequiredProperties(java.lang.String className,
org.eclipse.emf.ecore.EObject elementInstance)
Determines whether one of the required attributes for a given CBE element is not set to null . |
static void |
validateStringIdList(java.lang.String classname,
org.eclipse.emf.ecore.EObject o,
org.eclipse.emf.ecore.EStructuralFeature att)
Checks whether the elements of the list conforms to the ID type |
static void |
validateVersion(java.lang.String classname,
org.eclipse.emf.ecore.EObject o,
org.eclipse.emf.ecore.EStructuralFeature att)
We support version 1.0.1 or null |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventValidation()
Method Detail |
public static java.lang.String getComponentName(org.eclipse.emf.ecore.EObject component, java.lang.String name)
component
- component for the name retrievalname
- feature name
public static java.lang.String getComponentName(org.eclipse.emf.ecore.EObject component)
component
- component for the name retrieval
public static void validateRequiredProperties(java.lang.String className, org.eclipse.emf.ecore.EObject elementInstance) throws ValidationException
null
.
elementInstance
- target element for verification.
ValidationException
- if one of the required attributes is null
.public static void validateId(java.lang.String classname, org.eclipse.emf.ecore.EObject o, org.eclipse.emf.ecore.EStructuralFeature att, java.lang.String id) throws ValidationException
ValidationException
public static void validateId(java.lang.String classname, org.eclipse.emf.ecore.EObject o, org.eclipse.emf.ecore.EStructuralFeature att) throws ValidationException
ValidationException
public static void validateStringIdList(java.lang.String classname, org.eclipse.emf.ecore.EObject o, org.eclipse.emf.ecore.EStructuralFeature att) throws ValidationException
ValidationException
public static void validateLength(java.lang.String classname, org.eclipse.emf.ecore.EObject o, org.eclipse.emf.ecore.EStructuralFeature att, int minLength, int maxLength) throws ValidationException
ValidationException
public static void validateLength(java.lang.String classname, org.eclipse.emf.ecore.EObject o, org.eclipse.emf.ecore.EStructuralFeature att, int maxLength) throws ValidationException
ValidationException
public static void validateMutuallyExclusiveAttributes(java.lang.String classname, org.eclipse.emf.ecore.EObject o, org.eclipse.emf.ecore.EStructuralFeature att1, org.eclipse.emf.ecore.EStructuralFeature att2) throws ValidationException
att1
- is a basic objectatt2
- is a basic object
ValidationException
public static void validateVersion(java.lang.String classname, org.eclipse.emf.ecore.EObject o, org.eclipse.emf.ecore.EStructuralFeature att) throws ValidationException
ValidationException
public static void throwValidationException(java.lang.String className, java.lang.String resourceKey, java.lang.Object[] params) throws ValidationException
className
- class name of the method from which the exception
was thrown.resourceKey
- key in the resource bundle.params
- parameters for the message.
ValidationException
- containing the message associated with the
validation failure.public static void throwMissingPropertyException(java.lang.String className, java.lang.String resourceKey, java.lang.Object[] params) throws ValidationException
className
- class name of the method from which the exception
was thrown.resourceKey
- key in the resource bundle.params
- parameters for the message.
ValidationException
- containing the message associated with the
validation failure.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |