All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.uniroma2.art.coda.pearl.model.MetaAnnotation_old Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
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;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy