Class StructureListValidator
java.lang.Object
org.eclipse.birt.report.model.validators.AbstractSemanticValidator
org.eclipse.birt.report.model.validators.AbstractPropertyValidator
org.eclipse.birt.report.model.api.validators.StructureListValidator
public class StructureListValidator
extends org.eclipse.birt.report.model.validators.AbstractPropertyValidator
Validates one list property of element. The property type should structure
list.
Rule
The rule is that- all structures in this list property should be valid.
- the value of the property with
NamePropertyType
should be unique in the structure list.
Applicability
This validator is only applied to the property whose type is structure list of oneDesignElement
.-
Field Summary
FieldsFields inherited from class org.eclipse.birt.report.model.validators.AbstractSemanticValidator
modules, name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StructureListValidator
Returns the singleton validator instance.validate
(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element, String propName) Validates whether the list property specified bypropName
is invalid.validateForAdding
(DesignElementHandle element, IPropertyDefn propDefn, List<Object> list, IStructure toAdd) Validates whether a new structure can be added to structure list.validateForRenaming
(DesignElementHandle element, IPropertyDefn propDefn, List<Object> list, IStructure toRenamed, IPropertyDefn memberDefn, String newName) Validates whether a structure can be renamed to the given name.Methods inherited from class org.eclipse.birt.report.model.validators.AbstractSemanticValidator
canApplyToDesign, canApplyToLibrary, getName, isInTemplateParameterDefinitionSlot, setModules, setName
-
Field Details
-
NAME
Name of this validator.- See Also:
-
-
Constructor Details
-
StructureListValidator
public StructureListValidator()
-
-
Method Details
-
getInstance
Returns the singleton validator instance.- Returns:
- the validator instance
-
validateForAdding
public List<SemanticException> validateForAdding(DesignElementHandle element, IPropertyDefn propDefn, List<Object> list, IStructure toAdd) Validates whether a new structure can be added to structure list.- Parameters:
element
- the element holding the structure listpropDefn
- definition of the list propertylist
- the structure listtoAdd
- the structure to add- Returns:
- error list, each of which is the instance of
SemanticException
.
-
validate
public List<SemanticException> validate(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element, String propName) Validates whether the list property specified bypropName
is invalid.- Specified by:
validate
in classorg.eclipse.birt.report.model.validators.AbstractPropertyValidator
- Parameters:
module
- the moduleelement
- the element to validatepropName
- the name of the list property to validate- Returns:
- error list, each of which is the instance of
SemanticException
.
-
validateForRenaming
public List<SemanticException> validateForRenaming(DesignElementHandle element, IPropertyDefn propDefn, List<Object> list, IStructure toRenamed, IPropertyDefn memberDefn, String newName) Validates whether a structure can be renamed to the given name.- Parameters:
element
- the element holding the structure listpropDefn
- definition of the list propertylist
- the structure listtoRenamed
- the structure to renamememberDefn
- the member definitionnewName
- the new name- Returns:
- error list, each of which is the instance of
SemanticException
.
-