it.uniroma2.art.coda.pearl.model.MetaAnnotation_old Maven / Gradle / Ivy
package it.uniroma2.art.coda.pearl.model;
import java.util.List;
public class MetaAnnotation {
private String name;
private List parameters;
public MetaAnnotation(String name, List parameters) {
this.setName(name);
this.setParameters(parameters);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean hasParameters() {
if (parameters == null)
return false;
if (parameters.isEmpty())
return false;
return true;
}
public List getParameters() {
return parameters;
}
public void setParameters(List parameters) {
this.parameters = parameters;
}
public boolean verifyTargetCompatibility(String target) {
// No parameters means full compatibility
if (!hasParameters())
return true;
for (String parameter : parameters) {
// Target in the set of allowed targets.
if (target.toLowerCase().equals(parameter.toLowerCase()))
return true;
}
// If the target is not in the possible defined targets,
// the annotation has a Target incompatibility.
return false;
}
}