private Status status;
private UpdateOp op;
private Resource r;
+ private String label;
private Collection<UpdateNode> children = new ArrayList<UpdateNode>();
* @param status
* @param changes
*/
- public UpdateNode(Status status, UpdateOp op) {
+ public UpdateNode(ReadGraph g, Status status, UpdateOp op) throws DatabaseException{
this.status = status;
this.op = op;
this.r = op.getResource();
+ this.label = getLabel(g, r);
}
- public UpdateNode(Status status, Resource r) {
+ public UpdateNode(ReadGraph g, Status status, Resource r) throws DatabaseException {
this.status = status;
this.op = null;
this.r = r;
+ this.label = getLabel(g, r);
}
public Resource getResource() {
return null;
}
- public String getLabel(ReadGraph graph) throws DatabaseException {
- return getLabel(graph,r);
+ public String getLabel() {
+ return label;
+ }
+
+ @Override
+ public String toString() {
+ return label;
}
- protected String getLabel(ReadGraph graph, Resource r) throws ValidationException, ServiceException, NoSingleResultException {
+ protected String getLabel(ReadGraph graph, Resource r) throws DatabaseException {
String label = NameUtils.getSafeLabel(graph, r);
if (label.length() == 0)
label = NameUtils.getSafeName(graph, r);