Class 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static GroupNameValidator getInstance()
      Returns the singleton validator instance.
      java.util.List<SemanticException> validate​(ListingHandle element)
      Validates whether the given element contains the duplicate group name.
      java.util.List<SemanticException> 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<SemanticException> 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<SemanticException> 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<SemanticException> 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<SemanticException> 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<SemanticException> 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<SemanticException> 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.