use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class Serializer method startElement.
@Override
public void startElement(String namespaceURI, String localName, String prefix) throws StreamException {
closeStartTag();
try {
switchContext(TAG);
writer.write('<');
if (!prefix.isEmpty()) {
writer.write(prefix);
writer.write(':');
}
writer.write(localName);
} catch (IOException e) {
throw new StreamException(e);
}
if (2 * (depth + 1) > elementNameStack.length) {
String[] newElementNameStack = new String[elementNameStack.length * 2];
System.arraycopy(elementNameStack, 0, newElementNameStack, 0, elementNameStack.length);
elementNameStack = newElementNameStack;
}
elementNameStack[2 * depth] = prefix;
elementNameStack[2 * depth + 1] = localName;
depth++;
startTagOpen = true;
}
use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class Serializer method processEntityReference.
@Override
public void processEntityReference(String name, String replacementText) throws StreamException {
closeStartTag();
try {
writer.write('&');
writer.write(name);
writer.write(';');
} catch (IOException ex) {
throw new StreamException(ex);
}
}
use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class Serializer method writeRaw.
public void writeRaw(String s, UnmappableCharacterHandler unmappableCharacterHandler) throws StreamException {
try {
writer.setUnmappableCharacterHandler(unmappableCharacterHandler);
writer.write(s);
writer.setUnmappableCharacterHandler(unmappableCharacterHandlers[context]);
} catch (IOException ex) {
throw new StreamException(ex);
}
}
use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class Serializer method notationDecl.
public void notationDecl(String name, String pubID, String sysID) throws StreamException {
try {
DTDprolog();
writer.write("<!NOTATION ");
writer.write(name);
if (pubID != null) {
writer.write(" PUBLIC \"");
writer.write(pubID);
} else {
writer.write(" SYSTEM \"");
writer.write(sysID);
}
writer.write("\" >\n");
} catch (IOException ex) {
throw new StreamException(ex);
}
}
use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class Serializer method startProcessingInstruction.
@Override
public void startProcessingInstruction(String target) throws StreamException {
closeStartTag();
switchContext(TAG);
try {
writer.write("<?");
writer.write(target);
writer.write(' ');
} catch (IOException ex) {
throw new StreamException(ex);
}
switchContext(PROCESSING_INSTRUCTION);
}
Aggregations