public void specificArc(CommandXPathPlus command) throws ParserConfigurationException, SAXException, IOException, SQLException, ClassNotFoundException { if (this.filePrint) { this.context.addResult("Using file " + command.getFile()); this.context.addResult(""); } Expansor expansor = this.getDTS(command); Vector<Arc> documentArcs = new Vector<Arc>(); Vector<Arc> filteredArcs = new Vector<Arc>(); for (int i = 0; documentSet.size() > i; i++) { documentArcs.clear(); filteredArcs.clear(); if (this.filePrint) this.context.addResult( "Arcs from " + ((XmlDocument) documentSet.get(i)).getDocumentName() + ": "); documentArcs = ((XmlDocument) documentSet.get(i)) .getArcs( expansor.getInicialDocument( this.startpoint == null ? StartPoint.INSTANCE : this.startpoint.getBase())); filteredArcs = expansor.getFilteredArcs(documentArcs, this.arcsFilter); for (int j = 0; filteredArcs.size() > j; j++) { Arc arc = filteredArcs.get(j); if (arc.getLabelFrom().equalsIgnoreCase(command.getElement()) || (arc.getLabelTo().equalsIgnoreCase(command.getElement()))) { if (this.filePrint) this.context.addResult( "Exist arc between " + arc.getLabelFrom() + " (" + arc.getNodesFrom().size() + ") and " + arc.getLabelTo() + " (" + arc.getNodesTo().size() + ")"); } } if (this.filePrint) this.context.addResult(""); addArcs(filteredArcs); } }
// Arcos de um elemento especifico public void execute(CommandXPathPlus command) throws ParserConfigurationException, SAXException, IOException, SQLException, ClassNotFoundException { if (this.filePrint) { this.context.addResult("Using file: " + command.getFile()); this.context.addResult("Using element: " + command.getElement()); this.context.addResult("Using type: " + command.getType()); } if ("specificArc".equalsIgnoreCase(command.getType())) { this.specificArc(command); } else if ("sourceArc".equalsIgnoreCase(command.getType())) { this.sourceArc(command); } else if ("destinationArc".equalsIgnoreCase(command.getType())) { this.destinationArc(command); } }