Search in sources :

Example 71 with TypeMappingInfo

use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.

the class TypeMappingInfoObjectPrefixTestsCases method getTypeMappingInfos.

protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
    if (typeMappingInfos == null) {
        typeMappingInfos = new TypeMappingInfo[2];
        TypeMappingInfo tpi = new TypeMappingInfo();
        tpi.setXmlTagName(new QName("differentURI", "response"));
        tpi.setElementScope(ElementScope.Global);
        tpi.setType(Object.class);
        typeMappingInfos[0] = tpi;
        TypeMappingInfo tmi = new TypeMappingInfo();
        tmi.setType(Employee.class);
        tmi.setElementScope(ElementScope.Global);
        typeMappingInfos[1] = tmi;
    }
    return typeMappingInfos;
}
Also used : QName(javax.xml.namespace.QName) TypeMappingInfo(org.eclipse.persistence.jaxb.TypeMappingInfo)

Example 72 with TypeMappingInfo

use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.

the class StringArrayNilTestsCases method getTypeMappingInfos.

protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
    if (typeMappingInfos == null) {
        typeMappingInfos = new TypeMappingInfo[1];
        TypeMappingInfo tmi = new TypeMappingInfo();
        tmi.setXmlTagName(new QName("http://jaxb.dev.java.net/array", "testTagName"));
        tmi.setElementScope(ElementScope.Global);
        tmi.setType(getClass().getField("stringArrayField").getGenericType());
        typeMappingInfos[0] = tmi;
    }
    return typeMappingInfos;
}
Also used : QName(javax.xml.namespace.QName) TypeMappingInfo(org.eclipse.persistence.jaxb.TypeMappingInfo)

Example 73 with TypeMappingInfo

use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.

the class StringArraySingleNodeTestsCases method getTypeMappingInfos.

protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
    if (typeMappingInfos == null) {
        typeMappingInfos = new TypeMappingInfo[1];
        TypeMappingInfo tmi = new TypeMappingInfo();
        tmi.setXmlTagName(new QName("http://jaxb.dev.java.net/array", "testTagName"));
        tmi.setElementScope(ElementScope.Global);
        tmi.setAnnotations(getClass().getField("stringArrayField").getAnnotations());
        tmi.setType(getClass().getField("stringArrayField").getGenericType());
        typeMappingInfos[0] = tmi;
    }
    return typeMappingInfos;
}
Also used : QName(javax.xml.namespace.QName) TypeMappingInfo(org.eclipse.persistence.jaxb.TypeMappingInfo)

Example 74 with TypeMappingInfo

use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.

the class ListOfCustomerXsiTypeTestCases method getTypeMappingInfos.

protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
    if (typeMappingInfos == null) {
        String xa = "<oxm:xml-element xmlns:oxm='http://www.eclipse.org/eclipselink/xsds/persistence/oxm' type='org.eclipse.persistence.testing.jaxb.typemappinginfo.xsitype.Customer'/>";
        Document doc = null;
        try {
            doc = parser.parse(new ByteArrayInputStream(xa.getBytes()));
        } catch (Exception e) {
            fail("An error occured building the XmlElement");
        }
        typeMappingInfos = new TypeMappingInfo[1];
        TypeMappingInfo tpi = new TypeMappingInfo();
        tpi.setXmlTagName(new QName("someUri", "testListOfCustomer"));
        tpi.setElementScope(ElementScope.Global);
        tpi.setXmlElement(doc.getDocumentElement());
        tpi.setType(List.class);
        typeMappingInfos[0] = tpi;
    }
    return typeMappingInfos;
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) QName(javax.xml.namespace.QName) Document(org.w3c.dom.Document) TypeMappingInfo(org.eclipse.persistence.jaxb.TypeMappingInfo)

Example 75 with TypeMappingInfo

use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.

the class SingleEmployeeTestCases method getTypeMappingInfos.

protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
    if (typeMappingInfos == null) {
        typeMappingInfos = new TypeMappingInfo[2];
        TypeMappingInfo tpi = new TypeMappingInfo();
        tpi.setXmlTagName(new QName("someuri", "response"));
        tpi.setElementScope(ElementScope.Global);
        tpi.setType(Object.class);
        typeMappingInfos[1] = tpi;
        TypeMappingInfo tmi = new TypeMappingInfo();
        tmi.setType(Employee.class);
        tmi.setXmlTagName(new QName("someuri", "employee"));
        tmi.setElementScope(ElementScope.Global);
        typeMappingInfos[0] = tmi;
    }
    return typeMappingInfos;
}
Also used : QName(javax.xml.namespace.QName) TypeMappingInfo(org.eclipse.persistence.jaxb.TypeMappingInfo)

Aggregations

TypeMappingInfo (org.eclipse.persistence.jaxb.TypeMappingInfo)94 QName (javax.xml.namespace.QName)83 Annotation (java.lang.annotation.Annotation)19 Type (java.lang.reflect.Type)18 JAXBContext (org.eclipse.persistence.jaxb.JAXBContext)17 HashMap (java.util.HashMap)6 JAXBContext (jakarta.xml.bind.JAXBContext)5 JAXBElement (jakarta.xml.bind.JAXBElement)4 Map (java.util.Map)4 JavaClass (org.eclipse.persistence.jaxb.javamodel.JavaClass)4 Element (org.w3c.dom.Element)4 JAXBException (org.eclipse.persistence.exceptions.JAXBException)3 JAXBMarshaller (org.eclipse.persistence.jaxb.JAXBMarshaller)3 TypeInfo (com.sun.xml.ws.spi.db.TypeInfo)2 XmlElement (jakarta.xml.bind.annotation.XmlElement)2 XmlList (jakarta.xml.bind.annotation.XmlList)2 XmlRootElement (jakarta.xml.bind.annotation.XmlRootElement)2 StringWriter (java.io.StringWriter)2 GenericArrayType (java.lang.reflect.GenericArrayType)2 ArrayList (java.util.ArrayList)2