1 6 package cve.esecutori.components.specificaLV; 7 8 import java.io.*; 9 import java.util.*; 10 11 import org.jdom.*; 12 import org.jdom.input.SAXBuilder; 13 import org.jdom.output.XMLOutputter; 14 15 import org.apache.log4j.Logger; 16 17 import cve.staticLayout.*; 18 19 22 public class ElementRel extends ElementAlphabet { 23 24 27 private HashSet links; 28 29 public ElementRel(Element eleXml, String name) { 30 Cve.errLog.debug(""); 31 this.eleXml=eleXml; 32 this.name=name; 33 links=new HashSet(); 34 } 35 36 public ElementRel(Element eleXml, String name, String nameId) { 37 Cve.errLog.debug(""); 38 this.eleXml=eleXml; 39 this.name=name; 40 this.nameId=nameId; 41 links=new HashSet(); 42 } 43 44 public ElementRel(Element eleXml, String name, String nameId,Collection attribCons) { 45 Cve.errLog.debug(""); 46 this.eleXml=eleXml; 47 this.name=name; 48 this.nameId=nameId; 49 links=new HashSet(); 50 if (attribCons!=null){ 51 attributeInCons=new Vector(attribCons); 52 } 53 } 54 55 62 public LinkRelNonRel setLink (Element nonRel) { 63 Cve.errLog.debug(""); 64 String nameCercato=nonRel.getAttributeValue("name"); 66 Iterator iter=links.iterator(); 68 while (iter.hasNext()){ 69 LinkRelNonRel lST=(LinkRelNonRel)iter.next(); 70 ElementNonRel eleNonRel=lST.getNonRel(); 71 String name=((String )((Element)eleNonRel.getElementXml()).getAttributeValue("name")); 72 if ( name.equals(nameCercato) ){ 73 return lST; 74 } 75 } 76 ElementNonRel nonRelApp=new ElementNonRel(nonRel,nameCercato); 78 LinkRelNonRel linkNuovo=new LinkRelNonRel(this, nonRelApp); 80 insertLink(linkNuovo); 81 return linkNuovo; 82 } 83 84 public HashSet getLinkAll() { 85 Cve.errLog.debug(""); 86 return links; 87 } 88 89 public void insertLink(LinkRelNonRel link) { 90 Cve.errLog.debug(""); 91 links.add(link); 92 } 93 } | Popular Tags |