use of com.sun.xml.bind.marshaller.SchemaLocationFilter in project OpenAM by OpenRock.
the class MarshallerImpl method write.
private void write(XMLSerializable obj, ContentHandler writer) throws JAXBException {
try {
if (getSchemaLocation() != null || getNoNSSchemaLocation() != null) {
// if we need to add xsi:schemaLocation or its brother,
// throw in the component to do that.
writer = new SchemaLocationFilter(getSchemaLocation(), getNoNSSchemaLocation(), writer);
}
SAXMarshaller serializer = new SAXMarshaller(writer, prefixMapper, this);
// set a DocumentLocator that doesn't provide any information
writer.setDocumentLocator(new LocatorImpl());
writer.startDocument();
serializer.childAsBody(obj, null);
writer.endDocument();
// extra check
serializer.reconcileID();
} catch (SAXException e) {
throw new MarshalException(e);
}
}
use of com.sun.xml.bind.marshaller.SchemaLocationFilter in project OpenAM by OpenRock.
the class MarshallerImpl method write.
private void write(XMLSerializable obj, ContentHandler writer) throws JAXBException {
try {
if (getSchemaLocation() != null || getNoNSSchemaLocation() != null) {
// if we need to add xsi:schemaLocation or its brother,
// throw in the component to do that.
writer = new SchemaLocationFilter(getSchemaLocation(), getNoNSSchemaLocation(), writer);
}
SAXMarshaller serializer = new SAXMarshaller(writer, prefixMapper, this);
// set a DocumentLocator that doesn't provide any information
writer.setDocumentLocator(new LocatorImpl());
writer.startDocument();
serializer.childAsBody(obj, null);
writer.endDocument();
// extra check
serializer.reconcileID();
} catch (SAXException e) {
throw new MarshalException(e);
}
}
use of com.sun.xml.bind.marshaller.SchemaLocationFilter in project OpenAM by OpenRock.
the class MarshallerImpl method write.
private void write(XMLSerializable obj, ContentHandler writer) throws JAXBException {
try {
if (getSchemaLocation() != null || getNoNSSchemaLocation() != null) {
// if we need to add xsi:schemaLocation or its brother,
// throw in the component to do that.
writer = new SchemaLocationFilter(getSchemaLocation(), getNoNSSchemaLocation(), writer);
}
SAXMarshaller serializer = new SAXMarshaller(writer, prefixMapper, this);
// set a DocumentLocator that doesn't provide any information
writer.setDocumentLocator(new LocatorImpl());
writer.startDocument();
serializer.childAsBody(obj, null);
writer.endDocument();
// extra check
serializer.reconcileID();
} catch (SAXException e) {
throw new MarshalException(e);
}
}
use of com.sun.xml.bind.marshaller.SchemaLocationFilter in project Payara by payara.
the class MarshallerImpl method write.
private void write(XMLSerializable obj, ContentHandler writer) throws JAXBException {
try {
if (getSchemaLocation() != null || getNoNSSchemaLocation() != null) {
// if we need to add xsi:schemaLocation or its brother,
// throw in the component to do that.
writer = new SchemaLocationFilter(getSchemaLocation(), getNoNSSchemaLocation(), writer);
}
SAXMarshaller serializer = new SAXMarshaller(writer, prefixMapper, this);
// set a DocumentLocator that doesn't provide any information
writer.setDocumentLocator(new LocatorImpl());
writer.startDocument();
serializer.childAsBody(obj, null);
writer.endDocument();
// extra check
serializer.reconcileID();
} catch (SAXException e) {
throw new MarshalException(e);
}
}
use of com.sun.xml.bind.marshaller.SchemaLocationFilter in project OpenAM by OpenRock.
the class MarshallerImpl method write.
private void write(XMLSerializable obj, ContentHandler writer) throws JAXBException {
try {
if (getSchemaLocation() != null || getNoNSSchemaLocation() != null) {
// if we need to add xsi:schemaLocation or its brother,
// throw in the component to do that.
writer = new SchemaLocationFilter(getSchemaLocation(), getNoNSSchemaLocation(), writer);
}
SAXMarshaller serializer = new SAXMarshaller(writer, prefixMapper, this);
// set a DocumentLocator that doesn't provide any information
writer.setDocumentLocator(new LocatorImpl());
writer.startDocument();
serializer.childAsBody(obj, null);
writer.endDocument();
// extra check
serializer.reconcileID();
} catch (SAXException e) {
throw new MarshalException(e);
}
}
Aggregations