本文整理了Java中org.apache.commons.jelly.XMLOutput.write()
方法的一些代码示例,展示了XMLOutput.write()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLOutput.write()
方法的具体详情如下:
包路径:org.apache.commons.jelly.XMLOutput
类名称:XMLOutput
方法名:write
XMLOutput.write介绍
[英]Outputs the given String as a piece of valid text in the XML event stream. Any special XML characters should come out properly escaped.
[中]将给定字符串作为XML事件流中的有效文本输出。任何特殊的XML字符都应该正确转义。
代码示例
代码示例来源:origin: maven/maven
public void error( String message )
{
try
{
this.out.write( message + "\n" );
}
catch ( SAXException e )
{
// ignore
}
}
}
代码示例来源:origin: maven/maven
public void warn( String message )
{
try
{
this.out.write( message + "\n" );
}
catch ( SAXException e )
{
// ignore
}
}
代码示例来源:origin: maven/maven
public void info( String message )
{
try
{
this.out.write( message + "\n" );
}
catch ( SAXException e )
{
// ignore
}
}
代码示例来源:origin: stapler/stapler
/**
* Generates HTML fragment from string.
*
*
* The string representation of the object is assumed to produce proper HTML.
* No further escaping is performed.
*
* @see #text(Object)
*/
public void raw(Object o) throws SAXException {
if (o!=null)
output.write(o.toString());
}
代码示例来源:origin: stapler/stapler
/**
* Generates an {@code } tag to the resource.
*/
public void img(Object base, String localName) throws SAXException {
output.write(
"");
}
代码示例来源:origin: org.hudsonci.stapler/commons-jelly
/** Evaluates the body of a tag */
public void run(JellyContext context, XMLOutput output) throws JellyTagException {
if ( text != null ) {
try {
output.write(text);
} catch (SAXException e) {
throw new JellyTagException("could not write to XMLOutput",e);
}
}
}
}
代码示例来源:origin: org.eclipse.hudson.stapler/stapler-jelly
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException {
try {
output.write("\u00A0"); // nbsp
} catch (SAXException e) {
throw new JellyTagException(e);
}
}
}
代码示例来源:origin: stapler/stapler
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException {
try {
output.write("\u00A0"); // nbsp
} catch (SAXException e) {
throw new JellyTagException(e);
}
}
}
代码示例来源:origin: org.jvnet.hudson/commons-jelly
/** Evaluates the body of a tag */
public void run(JellyContext context, XMLOutput output) throws JellyTagException {
if ( text != null ) {
try {
output.write(text);
} catch (SAXException e) {
throw new JellyTagException("could not write to XMLOutput",e);
}
}
}
}
代码示例来源:origin: commons-jelly/commons-jelly
/** Evaluates the body of a tag */
public void run(JellyContext context, XMLOutput output) throws JellyTagException {
if ( text != null ) {
try {
output.write(text);
} catch (SAXException e) {
throw new JellyTagException("could not write to XMLOutput",e);
}
}
}
}
代码示例来源:origin: org.jenkins-ci/commons-jelly
/** Evaluates the body of a tag */
public void run(JellyContext context, XMLOutput output) throws JellyTagException {
if ( text != null ) {
try {
output.write(text);
} catch (SAXException e) {
throw new JellyTagException("could not write to XMLOutput",e);
}
}
}
}
代码示例来源:origin: stapler/stapler
/**
* Writes PCDATA.
*
*
* Any HTML unsafe characters in the string representation of the given object is
* properly escaped.
*
* @see #raw(Object)
*/
public void text(Object o) throws SAXException {
if (o!=null)
output.write(escape(o.toString()));
}
代码示例来源:origin: org.jvnet.hudson/commons-jelly
public void doTag(XMLOutput output) throws JellyTagException {
if (value != null) {
String text = value.evaluateAsString(context);
if (text != null) {
try {
output.write(text);
}
catch (SAXException e) {
throw new JellyTagException("could not write the XMLOutput",e);
}
}
}
}
代码示例来源:origin: org.hudsonci.stapler/commons-jelly
public void doTag(XMLOutput output) throws JellyTagException {
if (value != null) {
String text = value.evaluateAsString(context);
if (text != null) {
try {
output.write(text);
}
catch (SAXException e) {
throw new JellyTagException("could not write the XMLOutput",e);
}
}
}
}
代码示例来源:origin: commons-jelly/commons-jelly
public void doTag(XMLOutput output) throws JellyTagException {
if (value != null) {
String text = value.evaluateAsString(context);
if (text != null) {
try {
output.write(text);
}
catch (SAXException e) {
throw new JellyTagException("could not write the XMLOutput",e);
}
}
}
}
代码示例来源:origin: org.jenkins-ci/commons-jelly
public void doTag(XMLOutput output) throws JellyTagException {
if (value != null) {
String text = value.evaluateAsString(context);
if (text != null) {
try {
output.write(text);
}
catch (SAXException e) {
throw new JellyTagException("could not write the XMLOutput",e);
}
}
}
}
代码示例来源:origin: org.eclipse.hudson.stapler/stapler-jelly
public void doTag(XMLOutput output) throws JellyTagException {
try {
arguments.clear();
invokeBody(output);
output.write(rb.format(LocaleProvider.getLocale(), key,arguments.toArray()));
} catch (SAXException e) {
throw new JellyTagException("could not write the XMLOutput",e);
} finally {
arguments.clear(); // don't keep heavy objects in memory for too long
}
}
代码示例来源:origin: stapler/stapler
public void doTag(XMLOutput output) throws JellyTagException {
try {
arguments.clear();
invokeBody(output);
output.write(rb.format(LocaleProvider.getLocale(), key,arguments.toArray()));
} catch (SAXException e) {
throw new JellyTagException("could not write the XMLOutput",e);
} finally {
arguments.clear(); // don't keep heavy objects in memory for too long
}
}
代码示例来源:origin: org.eclipse.hudson.stapler/stapler-jelly
public void write(StaplerRequest req, XMLOutput out) throws SAXException, IOException {
if(inclusionFragment!=null) {
out.write(inclusionFragment);
return;
}
if (script!=null)
try {
WebApp.getCurrent().getFacet(JellyFacet.class).scriptInvoker.invokeScript(req, Stapler.getCurrentResponse(), script, this, out);
} catch (JellyTagException e) {
throw new IOException2("Failed to execute Jelly script for adjunct "+name,e);
}
if(hasCss)
out.write("");
if(hasJavascript)
out.write("");
}
代码示例来源:origin: commons-jelly/commons-jelly
public void testDom4Xmlns() throws SAXException {
StringWriter writer = new StringWriter();
OutputFormat format = new OutputFormat();
final XMLWriter xmlWriter = new HTMLWriter(writer, format);
xmlWriter.setEscapeText(false);
XMLOutput output = new XMLOutput(xmlWriter, xmlWriter);
String golden = "\n";
golden += "";
output.startDocument();
output.write(golden);
output.endDocument();
assertEquals("output should contain the namespaces", golden, writer.toString());
}