Package org.apache.cxf.aegis.type

Examples of org.apache.cxf.aegis.type.AegisType


    @Test
    public void testType() throws Exception {
        Method m = CustomTypeService.class.getMethod("doFoo", new Class[] {String.class});

        AegisType type = creator.createType(m, 0);
        tm.register(type);
        assertTrue(type instanceof CustomStringType);
        assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());

        type = creator.createType(m, -1);
        tm.register(type);
        assertTrue(type instanceof CustomStringType);
        assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());
    }
View Full Code Here


    @Test
    public void testType() throws Exception {
        Method m = CustomTypeService.class.getMethod("doFoo", new Class[] {String.class});

        AegisType type = creator.createType(m, 0);
        tm.register(type);
        assertTrue(type instanceof CustomStringType);
        assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());

        type = creator.createType(m, -1);
        tm.register(type);
        assertTrue(type instanceof CustomStringType);
        assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());
    }
View Full Code Here

    @Test
    public void testType() throws Exception {
        Method m = CustomTypeService.class.getMethod("doFoo", new Class[] {String.class});

        AegisType type = creator.createType(m, 0);
        tm.register(type);
        assertTrue(type instanceof org.apache.cxf.aegis.type.basic.BeanType);
        assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());

        type = creator.createType(m, -1);
        tm.register(type);
        assertTrue(type instanceof org.apache.cxf.aegis.type.basic.BeanType);
        assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());
    }
View Full Code Here

        if (elReader.isXsiNil()) {
            elReader.readToEnd();
            return null;
        }
       
        AegisType type = TypeUtil.getReadTypeStandalone(reader, aegisContext, desiredType);
       
        if (type == null) {
            throw new DatabindingException(new Message("NO_MAPPING", LOG));
        }

        return type.readObject(elReader, context);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void write(Object obj, QName elementName, boolean optional, XMLStreamWriter output,
                      java.lang.reflect.Type objectType) throws Exception {
        AegisType aegisType = null;
        if (objectType instanceof Class) {
            aegisType = getContext().getTypeMapping().getType((Class)objectType);
        }
        if (aegisType == null) {
            TypeCreator creator = getContext().getTypeMapping().getTypeCreator();
View Full Code Here

    @Test
    public void testType() throws Exception {
        Method m = CustomTypeService.class.getMethod("doFoo", new Class[] {String.class});

        AegisType type = creator.createType(m, 0);
        tm.register(type);
        assertTrue(type instanceof CustomStringType);
        assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());

        type = creator.createType(m, -1);
        tm.register(type);
        assertTrue(type instanceof CustomStringType);
        assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());
    }
View Full Code Here

                if (childReader.isXsiNil()) {
                    childReader.readToEnd();
                    continue;
                }
                QName qName = childReader.getName();
                AegisType defaultType = inf.getType(qName);
                AegisType type = TypeUtil.getReadType(childReader.getXMLStreamReader(),
                                                 context.getGlobalContext(), defaultType);
                if (type != null) {
                    String value = (String)type.readObject(childReader, context);
                    if ("id".equals(qName.getLocalPart())) {
                        id = value;
                    } else if ("name".equals(qName.getLocalPart())) {
                        name = value;
                    }
View Full Code Here

        }
    }

    @Override
    public Set<AegisType> getDependencies() {
        AegisType stringType = getTypeMapping().getType(String.class);
        return Collections.singleton(stringType);
    }
View Full Code Here

        Iterator elements = info.getElements().iterator();
        assertTrue(elements.hasNext());
        QName element = (QName)elements.next();
        assertTrue(elements.hasNext());

        AegisType custom = info.getType(element);

        if ("bogusProperty".equals(element.getLocalPart())) {
            assertTrue(custom instanceof StringType);
        } else if ("elementProperty".equals(element.getLocalPart())) {
            assertTrue(custom instanceof CustomStringType);
View Full Code Here

        type.setTypeClass(ByteBean.class);
        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:Bean", "bean"));

        QName name = new QName("urn:Bean", "data");
        AegisType dataType = type.getTypeInfo().getType(name);
        assertNotNull(dataType);

        assertTrue(type.getTypeInfo().isNillable(name));

        ByteBean bean = new ByteBean();
View Full Code Here

TOP

Related Classes of org.apache.cxf.aegis.type.AegisType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.