congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
uk.org.ponder.xml
Code IndexAdd Tabnine to your IDE (free)

How to use uk.org.ponder.xml

Best Java code snippets using uk.org.ponder.xml (Showing top 20 results out of 315)

origin: uk.org.ponder.rsf/rsf-core

public static void dumpHiddenField(UIParameter todump, XMLWriter xmlw) {
 xmlw.writeRaw("<input type=\"hidden\" ");
 boolean isvirtual = todump instanceof UIBinding && ((UIBinding)todump).virtual;
 XMLUtil.dumpAttribute(isvirtual? "id" : "name", todump.name, xmlw);
 XMLUtil.dumpAttribute("value", todump.value, xmlw);
 xmlw.writeRaw(" />\n");
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

public static void dumpAttribute(String name, String value, XMLWriter xmlw) {
 xmlw.writeRaw(" ").writeRaw(name).writeRaw("=\"");
 xmlw.write(value);
 xmlw.writeRaw("\"");
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

 public Object copy(Object tocopy) {
  RandomAccessPointer togo = new RandomAccessPointer(
    ((RandomAccessPointer) tocopy).offset);
  return togo;
 }
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

 public static void dumpStackTraceXML(Throwable t, PrintOutputStream pos) {
  XMLWriter xmlw = new XMLWriter(pos);
  xmlw.write(t.getMessage() + "\n");
  StackTraceElement[] elements = t.getStackTrace();
  for (int i = 0; i < elements.length; ++ i) {
   xmlw.write(elements[i] + "\n");
  }
 }
}
origin: uk.org.ponder.sakairsf/sakairsf

public int render(TagRenderContext trc) {
 if (headmatter == null) {
  return NullRewriteSCR.instance.render(trc);
 }
 else {
  if (RenderUtil.isFirstSCR(trc.uselump, getName())) {
   trc.xmlw.writeRaw(headmatter);
  }
  return ComponentRenderer.LEAF_TAG;
 }
}
origin: uk.org.ponder.rsf/rsf-core

public void replaceBody(String value) {
 XMLUtil.dumpAttributes(attrcopy, xmlw);
 if (!iselide) {
  pos.print(">");
 }
 xmlw.write(value);
 closeTag();
}
origin: uk.org.ponder.rsf/rsf-core

/** A method for deserialisation */
public Iterator getNameValue() {
 ArrayList values = new ArrayList();
 for (Iterator vit = attributemap.keySet().iterator(); vit.hasNext();) {
  String key = (String) vit.next();
  values.add(new NameValue(key, (String) attributemap.get(key)));
 }
 return values.iterator();
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

/**
 * Writes the supplied data to the wrapped stream, escaping all mandatory
 * XML/HTML entities, being &amp;, &lt;, &gt;, &quot; and &#39;. &#39; is
 * escaped to &amp;#39; since HTML 4.0 does not define the &amp;apos; entity
 * and does not plan to.
 * 
 * @param towrite
 *          The string to be written.
 */
public void write(String towrite) {
 char[] array = (towrite == null ? "null" : towrite).toCharArray();
 write(array, 0, array.length);
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

public static void dumpAttributes(Map attrs, XMLWriter xmlw) {
 for (Iterator keyit = attrs.keySet().iterator(); keyit.hasNext();) {
  String key = (String) keyit.next();
  String attrvalue = (String) attrs.get(key);
  dumpAttribute(key, attrvalue, xmlw);
 }
}
origin: uk.org.ponder.rsf/rsf-core

public void replaceAttributes() {
 if (!iselide) {
  XMLUtil.dumpAttributes(attrcopy, xmlw);
 }
 dumpTemplateBody();
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

/**
 * Writes the supplied string to the wrapped stream with the specified indent
 * level.
 * 
 * @param tag
 *          The string to be written.
 * @param nestinglevel
 *          The multiplier for the <code>INDENT_WIDTH</code>, giving the
 *          number of spaces to be written before the supplied string.
 */
public void writeRaw(String tag, int nestinglevel) {
 indent(nestinglevel, internalwriter);
 internalwriter.print(tag);
 // Logger.println(tag, Logger.DEBUG_SUBATOMIC);
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

 /**
  * Closes this XMLWriter object, in effect flushing it and making it unusable
  * for any further write operations.
  * <p>
  * Closing this does not close the underlying input stream!
  */
 public void close() {
  if (internalwriter != null) {
   try {
    flush();
   }
   catch (Throwable t) {
    Logger.println("Unhandled exception closing XML Writer: " + t,
      Logger.DEBUG_SEVERE);
    // internalwriter.close();
    internalwriter = null;
   }
  }
 }
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

private void appendAttr(String attrname, Object attrvalue) {
 xmlw.writeRaw(" ");
 xmlw.writeRaw(attrname); // attribute names may not contain escapes
 xmlw.writeRaw("=\"");
 xmlw.write(mappingcontext.generalLeafParser.render(attrvalue));
 xmlw.writeRaw("\"");
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

/** A slow method for XML-encoding text
 * 
 * @param toencode text to encode
 * @return encoded text
 */
public static String encode(String toencode) {
 StringPOS pos = new StringPOS();
 XMLWriter xmlw = new XMLWriter(pos);
 xmlw.write(toencode);
 return pos.toString();
}

origin: sakaiproject/sakai

public int render(TagRenderContext trc) {
  if (headmatter == null) {
    return NullRewriteSCR.instance.render(trc);
  } else {
    if (RenderUtil.isFirstSCR(trc.uselump, getName())) {
      trc.xmlw.writeRaw(headmatter);
    }
    return ComponentRenderer.LEAF_TAG;
  }
}
origin: uk.org.ponder.rsf/rsf-core

public void renderDebugMessage(RenderSystemContext rsc, String string) {
 rsc.pos.print("<span style=\"background-color:#FF466B;color:white;padding:1px;\">");
 rsc.xmlw.write(string);
 rsc.pos.print("</span><br/>");
}

origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

public Object parse(String toparse) {
 // all this will go away with the new parser
 int length = toparse.length();
 System.out.println("Parsing randomaccesspointer with length " + length);
 char[] unnecessarybuffer = new char[length];
 toparse.getChars(0, length, unnecessarybuffer, 0);
 byte[] bytes = CharToByteBase64.decode(unnecessarybuffer, 0, length);
 ByteWrap wrap = new ByteWrap(bytes, bytes.length - 8, 8);
 return new RandomAccessPointer(wrap.read_at8(0));
}
origin: uk.org.ponder.rsf/rsf-core

public void replaceAttributesOpen() {
 if (iselide) {
  replaceAttributes();
 }
 else {
  XMLUtil.dumpAttributes(attrcopy, xmlw);
  pos.print(isEmpty() ? "/>" : ">");
  nextpos = endopen.lumpindex + 1;
 }
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

public void closeTag(String tag, int nestinglevel, boolean writtenchildren) {
 if (writtenchildren) {
  indent(nestinglevel, internalwriter);
  internalwriter.print("</");
  internalwriter.print(tag);
  internalwriter.print(">");
 }
 else {
  internalwriter.print("/>");
 }
 if (nestinglevel >= 0) {
  internalwriter.print("\n");
 }
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

public static void writeEncodeLinks(XMLWriter xmlw, String line) {
 int linkpos = line.indexOf("://");
 if (linkpos == -1) {
  xmlw.write(line);
  return;
 }
 int backpos = linkpos - 1;
 for (; backpos >= 0; --backpos) {
  if (Character.isWhitespace(line.charAt(backpos))) break;
 }
 ++ backpos;
 if (backpos == linkpos - 1) { // require non-empty protocol
  xmlw.write(line);
  return;
 }
 
 int frontpos = linkpos + 3;
 for (; frontpos < line.length(); ++ frontpos) {
  if (Character.isWhitespace(line.charAt(backpos))) break;
 }
 String url = line.substring(backpos, frontpos);
 xmlw.write(line.substring(0, backpos));
 xmlw.writeRaw("<a target=\"_top\" href=\"");
 xmlw.write(url);
 xmlw.writeRaw("\">");
 xmlw.write(url);
 xmlw.writeRaw("</a>");
 xmlw.write(line.substring(frontpos));
}
uk.org.ponder.xml

Most used classes

  • XMLWriter
    A utility class to write XML data either raw or with XML/HTML entity escaping. An XMLWriter wraps ei
  • NameValue
  • XMLUtil
  • RandomAccessPointer
    RandomAccessPointer represents an 8-byte pointer into an XMLAccessFile. Since it implements SAXLeafT
  • XMLDecoderReturn
    A simple structure which serves as the return value from the XMLDecoder class. It encapsulates the s
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now