}
public void validate() throws ValidationException {
if (isAttributeNameEnabled()) {
if (_attributeName.get().equals("")) {
throw new ValidationException(
"Attribute name must not be empty.");
}
try {
_attributeName.getPattern();
} catch (PatternSyntaxException e) {
throw new ValidationException("Regular expression \""
+ _attributeName + "\" cannot be compiled.", e);
}
}
if (isAttributeTypeEnabled()) {
if (_attributeType.get().equals("")) {
throw new ValidationException("Port type must not be empty.");
}
try {
_attributeType.getToken().getType();
} catch (IllegalActionException e) {
throw new ValidationException("Type expression \""
+ _attributeType + "\" cannot be parsed.", e);
}
}
if (isAttributeValueEnabled()) {
try {
_attributeValue.getToken();
} catch (IllegalActionException e) {
throw new ValidationException("Value expression \""
+ _attributeValue + "\" cannot be parsed.", e);
}
}
}