public static String convertTagToArroba(String containment){ String nstring=replace(containment,"<",SUBTAGCHAR); nstring=replace(nstring,">",SUBTAGCHAR); return restoreInvalidChar(nstring); }
public String toString(){ String value="<v id=\""+id+"\" entityID=\""+ingenias.generator.util.Conversor.replaceInvalidCharsForID(this.entityID)+"\" attID=\""+attID +"\" >"+ ingenias.generator.util.Conversor.replaceInvalidChar(this.value)+"</v>\n"; return value; } }
private static String string2GXL(String value, String key) { String gxl = "\t\t<attr name=\"" + key + "\">" + "\n\t\t\t<string>" + ingenias.generator.util.Conversor.replaceInvalidChar(value)+ "</string>\n" + "\t\t</attr>\n"; return gxl; }
public static String convertArrobaFormat(String containment) throws ingenias.exception.NotWellFormed { String result = convertArrobaToTag(replaceInvalidChar(containment)); return convertTaggedFormat(result); }
public static void main(String[] args) throws Exception { ingenias.editor.Log.initInstance(new PrintWriter(System.err)); ObtainInstantiationStructure obtainInstantiationStructure1 = new ObtainInstantiationStructure(); if (args.length != 1) { System.err.println( "Wrong format!!!!\n ObtainInstantiationStructure filename"); } else { FileInputStream fis = new FileInputStream(args[0]); int read = fis.read(); StringBuffer sb = new StringBuffer(); while (read != -1) { sb.append( (char) read); read = fis.read(); } fis.close(); System.out.println(getStructure(Conversor.convertArrobaFormat(sb.toString()))); } }
public static String decodeSpecialSymbols(String text){ try { String s=text; s=ingenias.generator.util.Conversor.restoreInvalidChar(text); return s; } catch (Exception uee){ uee.printStackTrace(); } return ""; }
public String toString(){ String result="<repeat id=\""+ingenias.generator.util.Conversor.replaceInvalidCharsForID(id)+"\">\n"; Enumeration enumeration=this.body.elements(); while (enumeration.hasMoreElements()){ Object elem=enumeration.nextElement(); result=result+elem.toString(); } result=result+"</repeat>\n"; return result; }
public static void main(String args[]) throws Exception { ingenias.editor.Log.initInstance(new PrintWriter(System.err)); if (args.length<2) System.err.println("Wrong format!!!!\n Conversor (-a2t|-t2a) filename"); else{ FileInputStream fis = new FileInputStream(args[1]); int read = fis.read(); StringBuffer sb = new StringBuffer(); while (read != -1) { sb.append( (char) read); read = fis.read(); } fis.close(); if (args[0].equals("-a2t")) System.out.println(convertArrobaFormat(sb.toString())); else if (args[0].equals("-t2a")) System.out.println(convertTagToArroba(sb.toString())); } } }
public static void main(String[] args) { ingenias.editor.Log.initInstance(new PrintWriter(System.err)); verify(args[0]); System.exit(0); } }
public static String getNodes(int depth, Node n) { StringBuffer result = new StringBuffer(); NodeList nl = n.getChildNodes(); for (int k = 0; k < nl.getLength(); k++) { if (nl.item(k).getNodeName().toLowerCase().equals("repeat")) { String indentation = " "; for (int j = 0; j < depth; j++) { indentation = indentation + " "; } result.append(indentation + nl.item(k).getNodeName() + " id = " + nl.item(k).getAttributes().getNamedItem("id"). getNodeValue()+"\n"); } if (nl.item(k).getNodeName().toLowerCase().equals("v")) { String indentation = " "; for (int j = 0; j < depth; j++) { indentation = indentation + " "; } result.append(indentation + " v " + nl.item(k).getChildNodes().item(0).getNodeValue()+"\n"); } if (nl.item(k).hasChildNodes()) result.append(getNodes(depth + 1, nl.item(k))); } return result.toString(); }
public TemplateDataVar(String id, String value, String entityID, String attID) { this.id = id; this.entityID=entityID; this.attID=attID; //this.fts=fts; try { value=ingenias.generator.util.Conversor.replaceInvalidChar(value); this.value = value; } catch (Exception e){ e.printStackTrace(); } }
public static String decodeSpecialSymbols(String text){ try { String s=text; s=ingenias.generator.util.Conversor.restoreInvalidChar(text); return s; } catch (Exception uee){ uee.printStackTrace(); } return ""; }
ingenias.editor.Log.getInstance().logERROR("Error interpreting a INGENIAS file"); ingenias.editor.Log.getInstance().logERROR("The text contained in "+xmlFile+" contains non UTF-8 characters"); ingenias.generator.util.FormatVerifier.verify(xmlFile); throw formatEx;
public static String getStructure(String program) throws Exception { DOMParser parser = new DOMParser(); // Parse the Document // and traverse the DOM parser.parse(new InputSource(new java.io.StringBufferInputStream(program))); Document doc = parser.getDocument(); NodeList nl = doc.getElementsByTagName("program"); if (nl.getLength() == 0) { throw new RuntimeException("There is no <program> tag"); } Node programNode = nl.item(0); return getNodes(0, programNode); }
/** * Constructor for the TemplateDataVar object * *@param id Description of Parameter *@param value Description of Parameter */ public TemplateDataVar(String id, String value) { this.id = id; try { value=ingenias.generator.util.Conversor.replaceInvalidChar(value); this.value = value; } catch (Exception e){ e.printStackTrace(); } }
public static void saveMap(Hashtable ht, OutputStreamWriter fos) throws IOException { fos.write("<mapproperties>\n"); Enumeration keys = ht.keys(); while (keys.hasMoreElements()) { String key = keys.nextElement().toString(); fos.write( ("<key id=\"" + key + "\">" + ingenias.generator.util.Conversor.replaceInvalidChar(ht.get(key).toString()) + "</key>\n")); } fos.write("</mapproperties>\n"); }
s=ingenias.generator.util.Conversor.replaceInvalidChar(s);
s=ingenias.generator.util.Conversor.replaceInvalidChar(s);
/** * Description of the Method * * @param prop * Description of Parameter * @param fos * Description of Parameter * @exception java.io.IOException * Description of Exception */ private void saveProjectProperties(IDEState ids, OutputStreamWriter fos) throws java.io.IOException { fos.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project cid=\"" + Editor.idCounter + "\" version=\"1.2\">\n"); Enumeration ppenumeration = ids.prop.elements(); fos.write(("<projectproperties>\n")); while (ppenumeration.hasMoreElements()) { ProjectProperty pp = (ProjectProperty) ppenumeration.nextElement(); fos.write(pp.toXML()); } Vector<String> diagrams = ids.editor.getOpenedDiagrams(); for (String diagram : diagrams) { fos.write(" <openeddiagram>" + ingenias.generator.util.Conversor .replaceInvalidChar(diagram) + "</openeddiagram>"); } fos.write(("</projectproperties>\n")); }
File current = (File) v.elementAt(k); if (current!=null) fos.write(("<lastfile>" + ingenias.generator.util.Conversor.replaceInvalidChar(current.getPath()) + "</lastfile>\n").getBytes()); .replaceInvalidChar(ids.getCurrentImageFolder() .getPath()) + "</lastimage>\n") .getBytes());