" at " + ref.path() + " with target " + ref.getTargetPath()); ref.getRmTypeName(), ref.path()); errors.add(error); if (target == null) { error = new ValidationError(ErrorType.VUNP, "INVALIDPATH", ref.getTargetPath(), ref.path()); errors.add(error); } else { error = new ValidationError(ErrorType.VUNP, "UNKNOWNTARGETRM", "Unknown target rm type at path: " + ref.getTargetPath() + " of internalRef at: " + ref.path()); errors.add(error); } else if (!rmType.isAssignableFrom(targetType)) { error = new ValidationError(ErrorType.VUNP, "INVALIDTARGETRM", targetType, ref.path()); errors.add(error);
@Override public CObject copy() { return new ArchetypeInternalRef(path(), getRmTypeName(), getOccurrences(), getNodeId(), getParent(), targetPath); }
@Override public CObject copy() { return new ArchetypeInternalRef(path(), getRmTypeName(), getOccurrences(), getNodeId(), getParent(), targetPath); }
private Map<String, String> checkInternalReferences(Archetype archetype, CComplexObject ccobj, Map<String, String> errors) { for (CAttribute cattribute : ccobj.getAttributes()) { for (CObject cobj : cattribute.getChildren()) { if (cobj instanceof ArchetypeInternalRef) { ArchetypeInternalRef ref = (ArchetypeInternalRef) cobj; ArchetypeConstraint target = archetype.node(ref.getTargetPath()); if (target == null || (! (target instanceof CObject)) || (!((CObject) target).getRmTypeName().equals( cobj.getRmTypeName()))) { // either target unknown or wrong type errors.put(ref.path(), ref.getTargetPath()); } } if (cobj instanceof CComplexObject) { checkInternalReferences(archetype, (CComplexObject) cobj, errors); } } } return errors; }
private Map<String, String> checkInternalReferences(Archetype archetype, CComplexObject ccobj, Map<String, String> errors) { for (CAttribute cattribute : ccobj.getAttributes()) { for (CObject cobj : cattribute.getChildren()) { if (cobj instanceof ArchetypeInternalRef) { ArchetypeInternalRef ref = (ArchetypeInternalRef) cobj; CObject target = (CObject) archetype.node(ref.getTargetPath()); if (target == null || !target.getRmTypeName().equals( cobj.getRmTypeName())) { // either target unknown or wrong type errors.put(ref.path(), ref.getTargetPath()); } } if (cobj instanceof CComplexObject) { checkInternalReferences(archetype, (CComplexObject) cobj, errors); } } } return errors; }
private Map<String, String> checkInternalReferences(Archetype archetype, CComplexObject ccobj, Map<String, String> errors) { for (CAttribute cattribute : ccobj.getAttributes()) { for (CObject cobj : cattribute.getChildren()) { if (cobj instanceof ArchetypeInternalRef) { ArchetypeInternalRef ref = (ArchetypeInternalRef) cobj; ArchetypeConstraint target = archetype.node(ref.getTargetPath()); if (target == null || (! (target instanceof CObject)) || (!((CObject) target).getRmTypeName().equals( cobj.getRmTypeName()))) { // either target unknown or wrong type errors.put(ref.path(), ref.getTargetPath()); } } if (cobj instanceof CComplexObject) { checkInternalReferences(archetype, (CComplexObject) cobj, errors); } } } return errors; }