Package org.eclipse.birt.report.model.api.validators

# Class GroupNameValidator

java.lang.Object
org.eclipse.birt.report.model.validators.AbstractSemanticValidator
org.eclipse.birt.report.model.validators.AbstractElementValidator
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

Constructors
Constructor
Description
`GroupNameValidator()`

## Method Summary

Modifier and Type
Method
Description
`static GroupNameValidator`
`getInstance()`
Returns the singleton validator instance.
`List<SemanticException>`
`validate(ListingHandle element)`
Validates whether the given element contains the duplicate group name.
`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.
`List<SemanticException>`
`validateForAddingGroup(ListingHandle element, String groupName)`
Validates whether the group with the given name can be added into the given listing element.
`List<SemanticException>`
`validateForRenamingGroup(ListingHandle element, GroupHandle group, 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 Details

### GroupNameValidator

public GroupNameValidator()

## Method Details

### getInstance

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

Returns:
  the validator instance

### validateForAddingGroup

public List<SemanticException> validateForAddingGroup(ListingHandle element, 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 List<SemanticException> validateForRenamingGroup(ListingHandle element, GroupHandle group, 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 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 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`.