|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.cdi.server.gwt.util.SimpleTranslator
public class SimpleTranslator
Copies XML file to another location. Can filter out tags with provided names and attributes. Can insert tags into a parent with a given tag name.
Nested Class Summary | |
---|---|
static class |
SimpleTranslator.AttributeEntry
An attribute key-value pair. |
static class |
SimpleTranslator.Tag
A simple xml tag with a local name and attribute key-value pairs. |
Constructor Summary | |
---|---|
SimpleTranslator()
|
Method Summary | |
---|---|
void |
addFilter(SimpleTranslator.Tag tag)
Add a description of a tag to be filtered on a subsequent call to translate(InputStream, OutputStream) . |
void |
addNewTag(String parentName,
SimpleTranslator.Tag tag)
Add a description for a new tag to be added on a subsequent call to translate(InputStream, OutputStream) . |
void |
translate(InputStream in,
OutputStream out)
Copy an xml file, removing any xml tags matching those provided with addFilter(Tag) and adding any tags to provided
with addNewTag(String, Tag) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleTranslator()
Method Detail |
---|
public void translate(InputStream in, OutputStream out) throws XMLStreamException
addFilter(Tag)
and adding any tags to provided
with addNewTag(String, Tag)
.
in
- A stream to an xml file.out
- A stream to an empty file.
XMLStreamException
public void addFilter(SimpleTranslator.Tag tag)
translate(InputStream, OutputStream)
. tagA
filters out tagB
if both tags have the same name (ignoring
namespaces) and the set of attribute key-value pairs in tagB
is a
superset of those in tagA
.
tag
- The tag description to be filtered.public void addNewTag(String parentName, SimpleTranslator.Tag tag)
translate(InputStream, OutputStream)
. This tag
will be added a child of any tag with given parent name (ignoring
namespaces).
parentName
- The name (ignoring namespaces) of a parent element, under which to
insert a new tag.tag
- The new tag to be inserted.
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |