org.eclipse.birt.report.model.api.validators
Class GroupNameValidator

java.lang.Object
  extended by org.eclipse.birt.report.model.validators.AbstractSemanticValidator
      extended by org.eclipse.birt.report.model.validators.AbstractElementValidator
          extended by org.eclipse.birt.report.model.api.validators.GroupNameValidator

public class GroupNameValidator
extends org.eclipse.birt.report.model.validators.AbstractElementValidator

Validates the ducplicat group name in one table with data set.

Rule

The rule is that one listing element with data set doesn't allow duplicate group name to appear in this element and its content listing element without data set. But if the content listing element has data set, the group name can be duplicate with that in container.

Applicability

This validator is only applied to ListingElement.


Field Summary
 
Fields inherited from class org.eclipse.birt.report.model.validators.AbstractSemanticValidator
modules, name
 
Constructor Summary
GroupNameValidator()
           
 
Method Summary
static GroupNameValidator getInstance()
          Returns the singleton validator instance.
 java.util.List validate(ListingHandle element)
          Validates whether the given element contains the duplicate group name.
 java.util.List validate(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
          Validates whether the given element contains the duplicate group name.
 java.util.List validateForAddingGroup(ListingHandle element, java.lang.String groupName)
          Validates whether the group with the given name can be added into the given listing element.
 java.util.List validateForRenamingGroup(ListingHandle element, GroupHandle group, java.lang.String groupName)
          Validates whether the group can be renamed to the given name.
 
Methods inherited from class org.eclipse.birt.report.model.validators.AbstractSemanticValidator
canApplyToDesign, canApplyToLibrary, getName, isInTemplateParameterDefinitionSlot, setModules, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupNameValidator

public GroupNameValidator()
Method Detail

getInstance

public static GroupNameValidator getInstance()
Returns the singleton validator instance.

Returns:
the validator instance

validateForAddingGroup

public java.util.List validateForAddingGroup(ListingHandle element,
                                             java.lang.String groupName)
Validates whether the group with the given name can be added into the given listing element.

Parameters:
element - List/Table element
groupName - name of the group to add
Returns:
error list, each of which is the instance of SemanticException.

validateForRenamingGroup

public java.util.List validateForRenamingGroup(ListingHandle element,
                                               GroupHandle group,
                                               java.lang.String groupName)
Validates whether the group can be renamed to the given name.

Parameters:
element - List/Table element
group - the group to rename
groupName - name of the group to add
Returns:
error list, each of which is the instance of SemanticException.

validate

public java.util.List validate(org.eclipse.birt.report.model.core.Module module,
                               org.eclipse.birt.report.model.core.DesignElement element)
Validates whether the given element contains the duplicate group name. This check is applied to all listing element without data set.

Specified by:
validate in class org.eclipse.birt.report.model.validators.AbstractElementValidator
Parameters:
module - the module
element - the listing element to check
Returns:
error list, each of which is the instance of SemanticException.

validate

public java.util.List validate(ListingHandle element)
Validates whether the given element contains the duplicate group name. This check is applied to all listing element without data set.

Parameters:
element - the handle of the listing element to check
Returns:
error list, each of which is the instance of SemanticException.


Copyright © 2008 Actuate Corp. All rights reserved.