public Used newUsed(QualifiedName id, QualifiedName activity, QualifiedName entity, XMLGregorianCalendar time, Collection<Attribute> attributes) { Used res = newUsed(id, activity, null, entity); res.setTime(time); setAttributes(res, attributes); return res; }
public Used newUsed(QualifiedName id, QualifiedName activity, QualifiedName entity, XMLGregorianCalendar time, Collection<Attribute> attributes) { Used res = newUsed(id, activity, null, entity); res.setTime(time); setAttributes(res, attributes); return res; }
/** A factory method to create an instance of a usage {@link Used} from another * @param u an instance of a usage * @return an instance of {@link Used} equal (in the sense of @see Object.equals()) to the input */ public Used newUsed(Used u) { Used u1 = newUsed(u.getId(), u.getActivity(), u.getEntity()); u1.setTime(u.getTime()); u1.getType().addAll(u.getType()); u1.getLabel().addAll(u.getLabel()); u1.getRole().addAll(u.getRole()); u1.getLocation().addAll(u.getLocation()); u1.getOther().addAll(u.getOther()); return u1; }
/** A factory method to create an instance of a usage {@link Used} from another * @param u an instance of a usage * @return an instance of {@link Used} equal (in the sense of @see Object.equals()) to the input */ public Used newUsed(Used u) { Used u1 = newUsed(u.getId(), u.getActivity(), u.getEntity()); u1.setTime(u.getTime()); u1.getType().addAll(u.getType()); u1.getLabel().addAll(u.getLabel()); u1.getRole().addAll(u.getRole()); u1.getLocation().addAll(u.getLocation()); u1.getOther().addAll(u.getOther()); return u1; }
@Override public void doAction(Used s) { Used res = pf.newUsed(s.getId(), s.getActivity(), s.getEntity()); res.setTime(s.getTime()); QualifiedName id = res.getId(); boolean updated1 = setExpand(res, id, 0); QualifiedName en = res.getActivity(); boolean updated2 = setExpand(res, en, 1); QualifiedName ag = res.getEntity(); boolean updated3 = setExpand(res, ag, 2); boolean updated4 = expandAttributes(s, res); boolean updated = updated1 || updated2 || updated3 || updated4; boolean allUpdated = updated1 && updated2 && updated3; allExpanded=allExpanded && allUpdated; if (!allUpdatedRequired || allUpdated) { ll.add(res); } if (updated) addOrderAttribute(res); }
@Override public void doAction(Used s) { Used res = pf.newUsed(s.getId(), s.getActivity(), s.getEntity()); res.setTime(s.getTime()); QualifiedName id = res.getId(); boolean updated1 = setExpand(res, id, 0); QualifiedName en = res.getActivity(); boolean updated2 = setExpand(res, en, 1); QualifiedName ag = res.getEntity(); boolean updated3 = setExpand(res, ag, 2); boolean updated4 = expandAttributes(s, res); boolean updated = updated1 || updated2 || updated3 || updated4; boolean allUpdated = updated1 && updated2 && updated3; allExpanded=allExpanded && allUpdated; if (!allUpdatedRequired || allUpdated) { ll.add(res); } if (updated) addOrderAttribute(res); }
public void testUsage4() { Used use = pFactory.newUsed(q("use4"), q("a1"), "somerole", q("e1")); use.setTime(pFactory.newTimeNow()); makeDocAndTest(use, "target/usage4"); }
public void testScruffyUsage1() { Used use1 = pFactory.newUsed(q("use1"), q("a1"), null, q("e1")); use1.setTime(pFactory.newTimeNow()); Used use2 = pFactory.newUsed(q("use1"), q("a1"), null, q("e1")); use2.setTime(pFactory.newISOTime("2012-12-03T21:08:16.686Z")); Entity e1 = pFactory.newEntity(q("e1")); Activity a1 = pFactory.newActivity(q("a1")); Statement[] opt = new Statement[] { e1, a1 }; Statement[] statements = new Statement[] { use1, use2 }; makeDocAndTest(statements, opt, "target/scruffy-usage1"); }
public void testScruffyUsage2() { Used use1 = pFactory.newUsed(q("use1"), q("a1"), null, q("e1")); use1.setTime(pFactory.newTimeNow()); use1.getOther().add(pFactory.newOther(EX_NS, "tag2", EX_PREFIX, "hello", name.XSD_STRING)); Used use2 = pFactory.newUsed(q("use1"), q("a1"), null, q("e1")); use2.setTime(pFactory.newISOTime("2012-12-03T21:08:16.686Z")); use2.getOther().add(pFactory.newOther(EX_NS, "tag2", EX_PREFIX, "hi", name.XSD_STRING)); Entity e1 = pFactory.newEntity(q("e1")); Activity a1 = pFactory.newActivity(q("a1")); Statement[] opt = new Statement[] { e1, a1 }; Statement[] statements = new Statement[] { use1, use2 }; makeDocAndTest(statements, opt, "target/scruffy-usage2"); }
case 1: a.setActivity((QualifiedName)val); return; case 2: a.setEntity((QualifiedName)val); return; case 3: a.setTime((XMLGregorianCalendar)val); return; default: throw new ArrayIndexOutOfBoundsException("ProvUtilities.setter() for " + kind + " and index " + i);
case 1: a.setActivity((QualifiedName)val); return; case 2: a.setEntity((QualifiedName)val); return; case 3: a.setTime((XMLGregorianCalendar)val); return; default: throw new ArrayIndexOutOfBoundsException("ProvUtilities.setter() for " + kind + " and index " + i);
public void testUsage7() { Used use = pFactory.newUsed((QualifiedName) null, q("a1"), "somerole", q("e1")); use.setTime(pFactory.newTimeNow()); addTypes(use); addLocations(use); addLabels(use); addFurtherAttributes(use); makeDocAndTest(use, "target/usage7"); }
public Document makeDoc404() { Entity e1=pFactory.newEntity(q("e1")); Activity a1=pFactory.newActivity(q("a1")); QualifiedName uid=q("u2"); Used u1=pFactory.newUsed(uid,a1.getId(),e1.getId()); Used u2=pFactory.newUsed(uid,a1.getId(),e1.getId()); u1.getOther().add(pFactory.newOther(q("ELEMENT"), 1, pFactory.getName().XSD_INT)); u2.getOther().add(pFactory.newOther(q("ELEMENT"), 2, pFactory.getName().XSD_INT)); u1.setTime(pFactory.newTimeNow()); Document doc=pFactory.newDocument(); doc.getStatementOrBundle().add(u1); doc.getStatementOrBundle().add(u1); doc.getStatementOrBundle().add(u2); doc.getStatementOrBundle().add(u2); Namespace nss=Namespace.gatherNamespaces(doc); doc.setNamespace(nss); return doc; }
public void testUsage5() { Used use = pFactory.newUsed(q("use5"), q("a1"), "somerole", q("e1")); use.setTime(pFactory.newTimeNow()); addTypes(use); addLocations(use); addLabels(use); addFurtherAttributes(use); makeDocAndTest(use, "target/usage5"); }
wUB.setEntity(entity2); if (time != null) { wUB.setTime(time);
wUB.setEntity(entity2); if (time != null) { wUB.setTime(time);