congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
XMLWriter.write
Code IndexAdd Tabnine to your IDE (free)

How to use
write
method
in
uk.org.ponder.xml.XMLWriter

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

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

/**
 * Writes the supplied data to the wrapped stream, escaping all mandatory
 * XML/HTML entities, being &, <, >, " and '. ' is
 * escaped to ' since HTML 4.0 does not define the ' 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

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

 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.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));
}
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

 /**
  * Copies text from input to output, converting newlines into XHTML
  * &lt;br/&gt; elements. The supplied streams WILL be closed!
  */
 public void copyReader(Reader r, PrintOutputStream pos) {
  BufferedReader br = new BufferedReader(r);
  XMLWriter xmlw = new XMLWriter(pos);
  try {
   while (true) {
    String line = br.readLine();
   
    if (line == null)
     break;
    xmlw.write(line);
// TODO: make some kind of "XMLFilterWriter" architecture if necessary        
//        writeEncodeLinks(xmlw, line);
    xmlw.writeRaw("<br/>");
   }
  }
  catch (Throwable t) {
   throw UniversalRuntimeException.accumulate(t,
     "Error rendering text as HTML");
  }
  finally {
   StreamCloseUtil.closeReader(r);
   pos.close();
  }
 }
 
origin: uk.org.ponder.rsf/rsf-core

public static String handleFatalErrorStatic(Throwable t,
  PrintOutputStream pos) {
 // We may have such a fatal misconfiguration that we can't even rely on
 // IKAT to format this error message
 Logger.log.fatal("Completely fatal error populating view root", t);
 pos.println("<html><head><title>Internal Error</title></head></body><pre>");
 pos.println(ERROR_STRING);
 StringWriter todump = new StringWriter();
 t.printStackTrace(new PrintWriter(todump));
 XMLWriter xml = new XMLWriter(pos);
 xml.write(todump.toString());
 pos.println("</pre></body></html>");
 pos.close();
 return HANDLED;
}
origin: uk.org.ponder.rsf/rsf-core-ponderutilcore

xmlw.write(mappingcontext.generalLeafParser.render(child));
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-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: uk.org.ponder.rsf/rsf-core

  trc.pos.print("<br/>");
 trc.xmlw.write(value.stringAt(i));
if (value == null)
 value = Constants.NULL_STRING;
xmlw.write(value);
if (select.selected.contains(value)) {
 pos.print("\" selected=\"selected");
xmlw.write(names[i]);
pos.print("</option>\n");
lastgroup = thisgroup;
uk.org.ponder.xmlXMLWriterwrite

Javadoc

Writes the supplied data to the wrapped stream, escaping all mandatory XML/HTML entities, being &, <, >, " and '. ' is escaped to &#39; since HTML 4.0 does not define the &apos; entity and does not plan to.

Popular methods of XMLWriter

  • writeRaw
    Writes the supplied data to the wrapped stream without conversion.
  • <init>
  • close
    Closes this XMLWriter object, in effect flushing it and making it unusable for any further write ope
  • closeTag
  • flush
    Flushes the wrapped stream.
  • indent
  • writeDeclaration
    Writes a default declaration to the wrapped stream.
  • writeSlow

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • Permission (java.security)
    Legacy security code; do not use.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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