use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class XsiTypeFilterHandler method attributesCompleted.
@Override
public void attributesCompleted() throws StreamException {
try {
if (xsiType != null) {
int idx = xsiType.indexOf(':');
String prefix = idx == -1 ? "" : xsiType.substring(0, idx);
boolean bound = false;
for (int i = 0; i < prefixCount; i++) {
if (prefixes[i] == prefix) {
bound = true;
break;
}
}
if (!bound) {
String namespaceURI = contextElement.coreLookupNamespaceURI(prefix, AxiomSemantics.INSTANCE);
if (namespaceURI != null && !namespaceURI.isEmpty()) {
processNamespaceDeclaration(prefix, namespaceURI);
}
}
}
} catch (CoreModelException ex) {
throw new StreamException(ex);
}
super.attributesCompleted();
xsiType = null;
}
use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class XMLStreamWriterHandler method endProcessingInstruction.
@Override
public void endProcessingInstruction() throws StreamException {
try {
writer.writeProcessingInstruction(piTarget + " ", stopBuffering());
piTarget = null;
} catch (XMLStreamException ex) {
throw new StreamException(ex);
}
}
use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class XOPEncodingFilterHandler method processCharacterData.
@Override
protected String processCharacterData(Object data) throws StreamException {
if (data instanceof TextContent) {
TextContent textContent = (TextContent) data;
if (textContent.isBinary()) {
Object dataHandlerObject = textContent.getDataHandlerObject();
boolean optimize;
try {
if (dataHandlerObject instanceof DataHandlerProvider) {
optimize = optimizationPolicy.isOptimized((DataHandlerProvider) dataHandlerObject, textContent.isOptimize());
} else {
optimize = optimizationPolicy.isOptimized((DataHandler) dataHandlerObject, textContent.isOptimize());
}
} catch (IOException ex) {
throw new StreamException(ex);
}
if (optimize) {
String contentID = contentIDGenerator.generateContentID(textContent.getContentID());
dataHandlerObjects.put(contentID, dataHandlerObject);
return contentID;
}
}
}
return null;
}
use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class ContentHandlerXmlHandler method endComment.
@Override
public void endComment() throws StreamException {
if (lexicalHandler != null) {
try {
lexicalHandler.comment(buffer, 0, bufferPos);
bufferPos = 0;
} catch (SAXException ex) {
throw new StreamException(ex);
}
}
characterDataMode = CharacterDataMode.PASS_THROUGH;
}
use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.
the class ContentHandlerXmlHandler method processDocumentTypeDeclaration.
public void processDocumentTypeDeclaration(String rootName, String publicId, String systemId, String internalSubset) throws StreamException {
if (lexicalHandler != null) {
try {
lexicalHandler.startDTD(rootName, publicId, systemId);
lexicalHandler.endDTD();
} catch (SAXException ex) {
throw new StreamException(ex);
}
}
}
Aggregations