public class TagCustomizeWriter extends Object implements XMLEventWriter
XMLEventWriter for JAXB marshaller in mixer2Engine.
This class has only implements for script tag. For example, the template has in-line javascript below.
<script type="text/javascript"> //<![CDATA[ if (1 > 0) { alert('foo');} //]]> </script>
Normal marshaling replace <,> into reference. This javascript can not work. This EventWriter prevent it.
if (a > 0) { alert('foo');} // this javascript can't work!
Also, this class is for external javascript.
<script type="text/javascript" src="foo.js"></script>
With the template above, normal marshaling outputs it as empty element. This code can not work on firefox as java-script.
<script type="text/javascript" src="foo.js" />
This class one white space into script tag.
<script type="text/javascript" src="foo.js">(one white space)</script>
Constructor and Description |
---|
TagCustomizeWriter(XMLEventWriter writer) |
Modifier and Type | Method and Description |
---|---|
void |
add(XMLEvent event) |
void |
add(XMLEventReader reader) |
void |
close() |
void |
flush() |
NamespaceContext |
getNamespaceContext() |
String |
getPrefix(String uri) |
void |
setDefaultNamespace(String uri) |
void |
setNamespaceContext(NamespaceContext context) |
void |
setPrefix(String prefix,
String uri) |
public TagCustomizeWriter(XMLEventWriter writer)
public void add(XMLEvent event) throws XMLStreamException
add
in interface XMLEventConsumer
add
in interface XMLEventWriter
XMLStreamException
public void flush() throws XMLStreamException
flush
in interface XMLEventWriter
XMLStreamException
public void close() throws XMLStreamException
close
in interface XMLEventWriter
XMLStreamException
public void add(XMLEventReader reader) throws XMLStreamException
add
in interface XMLEventWriter
XMLStreamException
public String getPrefix(String uri) throws XMLStreamException
getPrefix
in interface XMLEventWriter
XMLStreamException
public void setPrefix(String prefix, String uri) throws XMLStreamException
setPrefix
in interface XMLEventWriter
XMLStreamException
public void setDefaultNamespace(String uri) throws XMLStreamException
setDefaultNamespace
in interface XMLEventWriter
XMLStreamException
public void setNamespaceContext(NamespaceContext context) throws XMLStreamException
setNamespaceContext
in interface XMLEventWriter
XMLStreamException
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface XMLEventWriter
Copyright © 2021 Project Mixer2. All rights reserved.