org.apache.axis2.jaxbri.template.JaxbRIDatabindingTemplate.xsl Maven / Gradle / Ivy
private static javax.xml.namespace.QName[] qNameArray = {
, new javax.xml.namespace.QName(" "," ")
};
private static final javax.xml.bind.JAXBContext wsContext;
static {
javax.xml.bind.JAXBContext jc;
jc = null;
try {
jc = javax.xml.bind.JAXBContext.newInstance(
.class,
);
}
catch ( javax.xml.bind.JAXBException ex ) {
System.err.println("Unable to create JAXBContext: " + ex.getMessage());
ex.printStackTrace(System.err);
Runtime.getRuntime().exit(-1);
}
finally {
wsContext = jc;
}
}
private org.apache.axiom.om.OMElement toOM( param, boolean optimizeContent, javax.xml.namespace.QName elementQName)
throws org.apache.axis2.AxisFault {
org.apache.axiom.om.OMFactory factory = org.apache.axiom.om.OMAbstractFactory.getOMFactory();
java.lang.Object object = param;
org.apache.axiom.om.ds.jaxb.JAXBOMDataSource source = new org.apache.axiom.om.ds.jaxb.JAXBOMDataSource( wsContext,
new javax.xml.bind.JAXBElement(elementQName, object.getClass(), object));
org.apache.axiom.om.OMNamespace namespace = factory.createOMNamespace(elementQName.getNamespaceURI(), null);
return factory.createOMElement(source, elementQName.getLocalPart(), namespace);
}
private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, param, boolean optimizeContent, javax.xml.namespace.QName elementQName)
throws org.apache.axis2.AxisFault {
org.apache.axiom.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
envelope.getBody().addChild(toOM(param, optimizeContent, elementQName));
return envelope;
}
private byte toByte (
org.apache.axiom.om.OMElement param) throws org.apache.axis2.AxisFault{
try {
javax.xml.bind.JAXBContext context = wsContext;
javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
java.lang.Byte ret = (java.lang.Integer)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(), byte.class).getValue();
return ret.byteValue();
} catch (javax.xml.bind.JAXBException bex){
throw org.apache.axis2.AxisFault.makeFault(bex);
}
}
private char toChar (
org.apache.axiom.om.OMElement param) throws org.apache.axis2.AxisFault{
try {
javax.xml.bind.JAXBContext context = wsContext;
javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
java.lang.Character ret = (java.lang.Character)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(), char.class).getValue();
return ret.charValue();
} catch (javax.xml.bind.JAXBException bex){
throw org.apache.axis2.AxisFault.makeFault(bex);
}
}
private double toDouble (
org.apache.axiom.om.OMElement param) throws org.apache.axis2.AxisFault{
try {
javax.xml.bind.JAXBContext context = wsContext;
javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
java.lang.Double ret = (java.lang.Double)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(), double.class).getValue();
return ret.doubleValue();
} catch (javax.xml.bind.JAXBException bex){
throw org.apache.axis2.AxisFault.makeFault(bex);
}
}
private float toFloat (
org.apache.axiom.om.OMElement param) throws org.apache.axis2.AxisFault{
try {
javax.xml.bind.JAXBContext context = wsContext;
javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
java.lang.Float ret = (java.lang.Float)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(), float.class).getValue();
return ret.floatValue();
} catch (javax.xml.bind.JAXBException bex){
throw org.apache.axis2.AxisFault.makeFault(bex);
}
}
private int toInt (
org.apache.axiom.om.OMElement param) throws org.apache.axis2.AxisFault{
try {
javax.xml.bind.JAXBContext context = wsContext;
javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
java.lang.Integer ret = (java.lang.Integer)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(), int.class).getValue();
return ret.intValue();
} catch (javax.xml.bind.JAXBException bex){
throw org.apache.axis2.AxisFault.makeFault(bex);
}
}
private long toLong (
org.apache.axiom.om.OMElement param) throws org.apache.axis2.AxisFault{
try {
javax.xml.bind.JAXBContext context = wsContext;
javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
java.lang.Long ret = (java.lang.Long)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(), long.class).getValue();
return ret.longValue();
} catch (javax.xml.bind.JAXBException bex){
throw org.apache.axis2.AxisFault.makeFault(bex);
}
}
private short toShort (
org.apache.axiom.om.OMElement param) throws org.apache.axis2.AxisFault{
try {
javax.xml.bind.JAXBContext context = wsContext;
javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
java.lang.Short ret = (java.lang.Short)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(), short.class).getValue();
return ret.shortValue();
} catch (javax.xml.bind.JAXBException bex){
throw org.apache.axis2.AxisFault.makeFault(bex);
}
}
private boolean toBoolean (
org.apache.axiom.om.OMElement param) throws org.apache.axis2.AxisFault{
try {
javax.xml.bind.JAXBContext context = wsContext;
javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
java.lang.Boolean ret = (java.lang.Boolean)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(), boolean.class).getValue();
return ret.booleanValue();
} catch (javax.xml.bind.JAXBException bex){
throw org.apache.axis2.AxisFault.makeFault(bex);
}
}
/**
* get the default envelope
*/
private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory) {
return factory.getDefaultEnvelope();
}
private java.lang.Object fromOM (
org.apache.axiom.om.OMElement param,
java.lang.Class type) throws org.apache.axis2.AxisFault{
try {
javax.xml.bind.JAXBContext context = wsContext;
javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
org.apache.axiom.util.jaxb.UnmarshallerAdapter adapter = org.apache.axiom.util.jaxb.JAXBUtils.getUnmarshallerAdapter(param.getXMLStreamReaderWithoutCaching());
unmarshaller.setAttachmentUnmarshaller(adapter.getAttachmentUnmarshaller());
return unmarshaller.unmarshal(adapter.getReader(), type).getValue();
} catch (javax.xml.bind.JAXBException bex){
throw org.apache.axis2.AxisFault.makeFault(bex);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy