@Override public boolean isValid(AbstractMetaDataModelNode node) { if (node instanceof LevelMetaData) { LevelMetaData level = (LevelMetaData) node; boolean latFound = false; boolean lonFound = false; for (MemberPropertyMetaData member : level) { if (member.getName().equals(GeoContext.LATITUDE)) { latFound = true; } else if (member.getName().equals(GeoContext.LONGITUDE)) { lonFound = true; } } return latFound & lonFound; } else { return super.isValid(node); } }
@Override public List<String> getValidationMessages(AbstractMetaDataModelNode node) { List<String> messages = new ArrayList<String>(); if (node instanceof LevelMetaData) { LevelMetaData level = (LevelMetaData) node; boolean latFound = false; boolean lonFound = false; for (MemberPropertyMetaData member : level) { if (member.getName().equals(GeoContext.LATITUDE)) { latFound = true; } else if (member.getName().equals(GeoContext.LONGITUDE)) { lonFound = true; } } if (!latFound) { messages.add(ModelerMessagesHolder.getMessages().getString("validation.level.MISSING_LAT")); } if (!lonFound) { messages.add(ModelerMessagesHolder.getMessages().getString("validation.level.MISSING_LON")); } } return messages; }