/** * Create an instance of {@link Relationship } * */ public Relationship createRelationship() { return new Relationship(); }
/** * Create an instance of {@link Relationship } * */ public Relationship createRelationship() { return new Relationship(); }
relationship = new Relationship(); relationship.setRelationshipType(relationshipType); artifact.getRelationship().add(relationship);
/** * Adds a new generic {@link Relationship} to the artifact. * @param artifact * @param relationshipType * @param targetUUID * @return the created {@link Relationship} */ public static Relationship addGenericRelationship(BaseArtifactType artifact, String relationshipType, String targetUUID) { Relationship relationship = null; for (Relationship r : artifact.getRelationship()) { if (r.getRelationshipType().equals(relationshipType)) { relationship = r; break; } } if (relationship == null) { relationship = new Relationship(); relationship.setRelationshipType(relationshipType); artifact.getRelationship().add(relationship); } // TODO check for duplicates first? if (targetUUID != null) { Target target = new Target(); target.setValue(targetUUID); relationship.getRelationshipTarget().add(target); } return relationship; }
private void visitGenericRelationships(BaseArtifactType srampArtifact) throws Exception { for (ArtificerRelationship artificerRelationship : artificerArtifact.getRelationships()) { if (artificerRelationship.getType() == RelationshipType.GENERIC) { Relationship srampRelationship = new Relationship(); srampRelationship.setRelationshipType(artificerRelationship.getName()); for (ArtificerTarget artificerTarget : artificerRelationship.getTargets()) { Target srampTarget = createTarget(Target.class, artificerTarget); srampRelationship.getRelationshipTarget().add(srampTarget); } setOtherAttributes(artificerRelationship.getOtherAttributes(), srampRelationship.getOtherAttributes()); srampArtifact.getRelationship().add(srampRelationship); } } }
Relationship relationship = new Relationship(); relationship.setRelationshipType(rtype); if (rNode.hasProperty("sramp:relationshipTarget")) { //$NON-NLS-1$
xsdDocument.getImportedXsds().add(importedXsdTarget); Relationship relationship = new Relationship(); relationship.setRelationshipType("similarXsds"); Target relationshipTarget = new Target();