Search in sources :

Example 26 with BeanType

use of org.apache.cxf.aegis.type.basic.BeanType in project cxf by apache.

the class CustomMappingTest method testInheritedMapping.

@Test
public void testInheritedMapping() throws Exception {
    BeanTypeInfo bti = new BeanTypeInfo(GregorianCalendar.class, "http://util.java");
    BeanType beanType = new BeanType(bti);
    beanType.setSchemaType(new QName("http://util.java{GregorianCalendar}"));
    AegisContext context = new AegisContext();
    context.initialize();
    TypeMapping mapping = context.getTypeMapping();
    // we are replacing the default mapping.
    mapping.register(beanType);
    XmlSchema schema = newXmlSchema("http://util.java");
    beanType.writeSchema(schema);
// well, test?
}
Also used : BeanTypeInfo(org.apache.cxf.aegis.type.basic.BeanTypeInfo) BeanType(org.apache.cxf.aegis.type.basic.BeanType) XmlSchema(org.apache.ws.commons.schema.XmlSchema) QName(javax.xml.namespace.QName) AegisContext(org.apache.cxf.aegis.AegisContext) TypeMapping(org.apache.cxf.aegis.type.TypeMapping) Test(org.junit.Test) AbstractAegisTest(org.apache.cxf.aegis.AbstractAegisTest)

Aggregations

BeanType (org.apache.cxf.aegis.type.basic.BeanType)26 AbstractAegisTest (org.apache.cxf.aegis.AbstractAegisTest)19 Test (org.junit.Test)19 QName (javax.xml.namespace.QName)17 AegisType (org.apache.cxf.aegis.type.AegisType)8 BeanTypeInfo (org.apache.cxf.aegis.type.basic.BeanTypeInfo)8 TypeCreationOptions (org.apache.cxf.aegis.type.TypeCreationOptions)3 MessageWriter (org.apache.cxf.aegis.xml.MessageWriter)2 GenericArrayType (java.lang.reflect.GenericArrayType)1 ParameterizedType (java.lang.reflect.ParameterizedType)1 AegisContext (org.apache.cxf.aegis.AegisContext)1 DatabindingException (org.apache.cxf.aegis.DatabindingException)1 TypeMapping (org.apache.cxf.aegis.type.TypeMapping)1 TypeUtil (org.apache.cxf.aegis.type.TypeUtil)1 XMLBeanTypeInfo (org.apache.cxf.aegis.type.basic.XMLBeanTypeInfo)1 XmlSchema (org.apache.ws.commons.schema.XmlSchema)1 Element (org.w3c.dom.Element)1