use of es.bsc.compss.types.resources.jaxb.InstanceTypeType in project compss by bsc-wdc.
the class Validator method validateInstanceTypes.
private void validateInstanceTypes(InstanceTypesType instances) throws InvalidElementException {
List<String> instanceNames = new ArrayList<String>();
List<InstanceTypeType> instances_list = instances.getInstanceType();
if (instances_list != null) {
for (InstanceTypeType i : instances.getInstanceType()) {
if (instanceNames.contains(i.getName())) {
throw new InvalidElementException("Instances", "Attribute Instance " + i.getName(), "Name already used");
} else {
instanceNames.add(i.getName());
validateInstance(i);
}
}
} else {
// Empty inner elements
throw new InvalidElementException("InstanceTypes", "", "Content is empty");
}
}
Aggregations