Search in sources :

Example 1 with ImageType

use of es.bsc.compss.types.resources.jaxb.ImageType in project compss by bsc-wdc.

the class Validator method validateImages.

private void validateImages(ImagesType images) throws InvalidElementException {
    List<String> imageNames = new ArrayList<String>();
    List<ImageType> images_list = images.getImage();
    if (images_list != null) {
        for (ImageType im : images_list) {
            if (imageNames.contains(im.getName())) {
                throw new InvalidElementException("Images", "Attribute Image " + im.getName(), "Name already used");
            } else {
                imageNames.add(im.getName());
                validateImage(im);
            }
        }
    } else {
        // Empty inner elements
        throw new InvalidElementException("Images", "", "Content is empty");
    }
}
Also used : ArrayList(java.util.ArrayList) InvalidElementException(es.bsc.compss.types.resources.exceptions.InvalidElementException) ImageType(es.bsc.compss.types.resources.jaxb.ImageType)

Aggregations

InvalidElementException (es.bsc.compss.types.resources.exceptions.InvalidElementException)1 ImageType (es.bsc.compss.types.resources.jaxb.ImageType)1 ArrayList (java.util.ArrayList)1