public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getProperty()); hashCodeBuilder.append(this.getAccount()); hashCodeBuilder.append(this.getAnnotation()); hashCodeBuilder.append(this.getId()); }
public void setIdForCompactAnnotation(EmbeddedAnnotation ann, String id) { if (compactId) ann.setId(id); }
/** * Create an instance of {@link EmbeddedAnnotation } * */ public EmbeddedAnnotation createEmbeddedAnnotation() { return new EmbeddedAnnotation(); }
public void addNewAnnotations(Annotable res, List<JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation>> anns) { for (JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation> ann: anns) { EmbeddedAnnotation ea=ann.getValue(); if (ea.getId()!=null) addAnnotation(res,newEmbeddedAnnotation(ea.getId(), ea.getProperty(), ea.getAccount(), null)); } }
public void addProperty(EmbeddedAnnotation ann, List<Property> p) { ann.getProperty().addAll(p); }
public void sortAnnotations(List<JAXBElement<? extends EmbeddedAnnotation>> ll) { Collections.sort(ll, new Comparator() { public int compare(Object o1, Object o2) { JAXBElement j1=(JAXBElement) o1; JAXBElement j2=(JAXBElement) o2; EmbeddedAnnotation a1=(EmbeddedAnnotation) j1.getValue(); EmbeddedAnnotation a2=(EmbeddedAnnotation) j2.getValue(); if (a1.getId()==null) { if (a2.getId()==null) { return a1.getClass().getName().compareTo(a2.getClass().getName()); } else { return -1; } } else { if (a2.getId()==null) { return +1; } else { return a1.getId().compareTo(a2.getId()); } } }}); for (JAXBElement je: ll) { EmbeddedAnnotation a=(EmbeddedAnnotation) je.getValue(); sortProperties(a.getProperty()); sortByRef(a.getAccount()); } }
List<Property> properties=ann.getProperty(); if (properties.size()==1) { Property prop=properties.get(0); if (prop.getKey().equals(LABEL_PROPERTY)) { Label label=newLabel((String)prop.getValue()); setIdForCompactAnnotation(label,ann.getId()); return of.createLabel(label); setIdForCompactAnnotation(type,ann.getId()); return of.createType(type); setIdForCompactAnnotation(profile,ann.getId()); return of.createProfile(profile); setIdForCompactAnnotation(pname,ann.getId()); return of.createPname(pname); Value value=newValue(properties.get(0).getValue(), (String)properties.get(1).getValue()); setIdForCompactAnnotation(value,ann.getId()); return of.createValue(value); } else if ((properties.get(1).getKey().equals(VALUE_PROPERTY)) Value value=newValue(properties.get(1).getValue(), (String)properties.get(0).getValue()); setIdForCompactAnnotation(value,ann.getId()); return of.createValue(value);
public int compare(Object o1, Object o2) { EmbeddedAnnotation a1=(EmbeddedAnnotation) o1; EmbeddedAnnotation a2=(EmbeddedAnnotation) o2; if (a1.getId()==null) { if (a2.getId()==null) { return a1.getClass().getName().compareTo(a2.getClass().getName()); } else { return -1; } } else { if (a2.getId()==null) { return +1; } else { return a1.getId().compareTo(a2.getId()); } } }}); }
public boolean equals(Object object) { if (!(object instanceof EmbeddedAnnotation)) { return false; } if (this == object) { return true; } final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder(); equals(object, equalsBuilder); return equalsBuilder.isEquals(); }
public String toString() { final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this); toString(toStringBuilder); return toStringBuilder.toString(); }
public int hashCode() { final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder(); hashCode(hashCodeBuilder); return hashCodeBuilder.toHashCode(); }
public void addNewAnnotations(Annotable res, List<JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation>> anns) { for (JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation> ann: anns) { EmbeddedAnnotation ea=ann.getValue(); String label=getLabel(ea); if (label!=null) addAnnotation(res,newLabel(label)); String type=getType(ea); if (type!=null) addAnnotation(res,newType(type)); String profile=getProfile(ea); if (profile!=null) addAnnotation(res,newProfile(profile)); String pname=getPname(ea); if (pname!=null) addAnnotation(res,newPName(pname)); Object value=getValue(ea); if (value!=null) addAnnotation(res,newValue(value,getEncoding(ea))); if (ea.getId()!=null) addAnnotation(res,newEmbeddedAnnotation(ea.getId(), ea.getProperty(), newAccounts(ea.getAccount()), null)); } }
public void addProperty(EmbeddedAnnotation ann, Property p) { ann.getProperty().add(p); }
public int compare(Object o1, Object o2) { JAXBElement j1=(JAXBElement) o1; JAXBElement j2=(JAXBElement) o2; EmbeddedAnnotation a1=(EmbeddedAnnotation) j1.getValue(); EmbeddedAnnotation a2=(EmbeddedAnnotation) j2.getValue(); if (a1.getId()==null) { if (a2.getId()==null) { return a1.getClass().getName().compareTo(a2.getClass().getName()); } else { return -1; } } else { if (a2.getId()==null) { return +1; } else { return a1.getId().compareTo(a2.getId()); } } }}); for (JAXBElement je: ll) {
public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof Profile)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } super.equals(object, equalsBuilder); final Profile that = ((Profile) object); equalsBuilder.append(this.getValue(), that.getValue()); }
public void toString(ToStringBuilder toStringBuilder) { super.toString(toStringBuilder); { String theValue; theValue = this.getValue(); toStringBuilder.append("value", theValue); } }
public void hashCode(HashCodeBuilder hashCodeBuilder) { super.hashCode(hashCodeBuilder); //Luc: //Luc: //Luc: //Luc: //Luc: //Luc: hashCodeBuilder.append(this.getContent()); hashCodeBuilder.append(this.getEncoding()); }
public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof EmbeddedAnnotation)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final EmbeddedAnnotation that = ((EmbeddedAnnotation) object); equalsBuilder.append(this.getProperty(), that.getProperty()); equalsBuilder.append(this.getAccount(), that.getAccount()); equalsBuilder.append(this.getAnnotation(), that.getAnnotation()); equalsBuilder.append(this.getId(), that.getId()); }
public String getType(EmbeddedAnnotation annotation) { if (annotation instanceof Type) { Type type=(Type) annotation; return type.getValue(); } else { for (Property prop: annotation.getProperty()) { if (prop.getKey().equals(TYPE_PROPERTY)) { return (String) prop.getValue(); } } return null; } }
public void emitAnnotation(String id, EmbeddedAnnotation ann, PrintStream out) { HashMap<String,String> properties=new HashMap(); String newId=annotationId(ann.getId(),id); emitNode(newId, addAnnotationShape(ann,addAnnotationColor(ann,addAnnotationLabel(ann,properties))), out); HashMap<String,String> linkProperties=new HashMap(); emitEdge(newId,id,addAnnotationLinkProperties(ann,linkProperties),out,true); }