Search in sources :

Example 86 with TypeMappingInfo

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

the class ConflictingStringArrayClassesTestCases method getTypeMappingInfos.

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

Example 87 with TypeMappingInfo

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

the class ConflictingStringClassTestCases method getTypeMappingInfos.

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

Example 88 with TypeMappingInfo

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

the class ConflictingByteArrayTestCases method getTypeMappingInfos.

protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
    if (typeMappingInfos == null) {
        typeMappingInfos = new TypeMappingInfo[3];
        TypeMappingInfo tmi = new TypeMappingInfo();
        tmi.setXmlTagName(new QName("someUri", "testTagName1"));
        tmi.setElementScope(ElementScope.Global);
        tmi.setType(byte[].class);
        typeMappingInfos[0] = tmi;
        TypeMappingInfo tmi2 = new TypeMappingInfo();
        tmi2.setXmlTagName(new QName("someUri", "testTagName2"));
        tmi2.setElementScope(ElementScope.Global);
        tmi2.setType(byte[].class);
        typeMappingInfos[1] = tmi2;
        TypeMappingInfo tmi3 = new TypeMappingInfo();
        tmi3.setXmlTagName(new QName("someUri", "testTagName2"));
        tmi3.setElementScope(ElementScope.Global);
        tmi3.setType(getClass().getField("theByteArrayField").getGenericType());
        typeMappingInfos[2] = tmi3;
    }
    return typeMappingInfos;
}
Also used : QName(javax.xml.namespace.QName) TypeMappingInfo(org.eclipse.persistence.jaxb.TypeMappingInfo)

Example 89 with TypeMappingInfo

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

the class ConflictingClassAndTypeTestCases method getTypeMappingInfos.

protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
    if (typeMappingInfos == null) {
        typeMappingInfos = new TypeMappingInfo[2];
        TypeMappingInfo tmi = new TypeMappingInfo();
        tmi.setXmlTagName(new QName("someUri", "testTagName1"));
        tmi.setElementScope(ElementScope.Global);
        tmi.setType(Employee.class);
        typeMappingInfos[0] = tmi;
        TypeMappingInfo tmi2 = new TypeMappingInfo();
        tmi2.setXmlTagName(new QName("someUri", "testTagName2"));
        tmi2.setElementScope(ElementScope.Global);
        tmi2.setType(getClass().getField("testField").getGenericType());
        typeMappingInfos[1] = tmi2;
    }
    return typeMappingInfos;
}
Also used : QName(javax.xml.namespace.QName) TypeMappingInfo(org.eclipse.persistence.jaxb.TypeMappingInfo)

Example 90 with TypeMappingInfo

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

the class ConflictingListObjectsTypeTestCases method getTypeMappingInfos.

protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
    if (typeMappingInfos == null) {
        typeMappingInfos = new TypeMappingInfo[3];
        TypeMappingInfo tmi = new TypeMappingInfo();
        tmi.setXmlTagName(new QName("", "testTagName1"));
        tmi.setElementScope(ElementScope.Global);
        tmi.setType(getClass().getField("testField").getGenericType());
        typeMappingInfos[0] = tmi;
        TypeMappingInfo tmi2 = new TypeMappingInfo();
        tmi2.setXmlTagName(new QName("", "testTagName2"));
        tmi2.setElementScope(ElementScope.Global);
        tmi2.setType(getClass().getField("testField").getGenericType());
        typeMappingInfos[1] = tmi2;
        TypeMappingInfo tmi3 = new TypeMappingInfo();
        tmi3.setElementScope(ElementScope.Global);
        tmi3.setType(Employee.class);
        typeMappingInfos[2] = tmi3;
    }
    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