Package javax.xml.namespace

Examples of javax.xml.namespace.QName

The value of a QName contains a namespaceURI and a localPart. The localPart provides the local part of the qualified name. The namespaceURI is a URI reference identifying the namespace.

The prefix is included in the QName class to retain lexical information where present in an XML input source. The prefix is NOT used to compute the hash code or in the equals operation. In other words, equality is defined only using the namespaceURI and the localPart. @version 1.1


        throws Exception
    {
        ArrayType type = new ArrayType();
        type.setTypeClass(int[].class);
        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:test", "ints"));

        // Test reading
        ElementReader reader = new ElementReader(getResourceAsStream("/org/codehaus/xfire/aegis/type/basic/ints1.xml"));
       
        int[] ints = (int[]) type.readObject(reader, new MessageContext());
View Full Code Here


    public void testPayloadSourceDispatch()
        throws Exception
    {
        EchoService service = new EchoService();

        Dispatch<Source> d = service.createDispatch(new QName("urn:echo:wrapped", "EchoHttpPort"),
                                                    Source.class,
                                                    Service.Mode.PAYLOAD);
        assertNotNull(d);
       
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
View Full Code Here

        tm.setEncodingStyleURI("urn:xfire:bean-nillable");

        Type type = tm.getTypeCreator().createType(MyBean.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();

        assertTrue(info.isNillable(new QName(info.getDefaultNamespace(), "prop2")));
    }
View Full Code Here

        tm.setEncodingStyleURI("urn:xfire:bean-nillable");

        Type type = tm.getTypeCreator().createType(MyBean.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();

        assertFalse(info.isNillable(new QName(info.getDefaultNamespace(), "prop2")));
    }
View Full Code Here

        tm.setEncodingStyleURI("urn:xfire:bean-minoccurs");

        Type type = tm.getTypeCreator().createType(MyBean.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();

        assertEquals(info.getMinOccurs(new QName(info.getDefaultNamespace(), "prop2")), 0);
    }
View Full Code Here

        tm.setEncodingStyleURI("urn:xfire:bean-minoccurs");

        Type type = tm.getTypeCreator().createType(MyBean.class);
        BeanTypeInfo info = ((BeanType) type).getTypeInfo();

        assertEquals(info.getMinOccurs(new QName(info.getDefaultNamespace(), "prop2")), 1);
    }
View Full Code Here

     * @param tmr
     * @return
     */
    private void registerSimpleBeanType(TypeMapping tmr)
    {
        tmr.register(SimpleBean.class, new QName("urn:SimpleBean", "SimpleBean"), new BeanType());
    }
View Full Code Here

    public void testBean()
        throws Exception
    {
        Type stringType = mapping.getTypeCreator().createType(String.class);
       
        MapType type = new MapType(new QName("urn:test", "map"), stringType, stringType);
        type.setTypeClass(Map.class);
        type.setTypeMapping(mapping);
       
        assertNotNull(type.getSchemaType());
        assertEquals("entry", type.getEntryName().getLocalPart());
View Full Code Here

    }

    private void registerArrayType(TypeMapping tmr)
    {
        tmr.register(SimpleBean[].class,
                     new QName("urn:SomeBean", "ArrayOfSimpleBean"),
                     new ArrayType());
    }
View Full Code Here

    {
        TypeCreator creator = mapping.getTypeCreator();

        BeanType beanType = (BeanType) creator.createType(MapBean.class);
       
        QName mapName = (QName) beanType.getTypeInfo().getElements().next();
       
        Type type = beanType.getTypeInfo().getType(mapName);
        assertTrue(type instanceof MapType);

        assertEquals(new QName(mapping.getEncodingStyleURI(), "string2SimpleBeanMap"), type.getSchemaType());
       
        MapType mapType = (MapType) type;
        assertEquals(SimpleBean.class, mapType.getValueType().getTypeClass());
        assertEquals(String.class, mapType.getKeyType().getTypeClass());
    }
View Full Code Here

TOP

Related Classes of javax.xml.namespace.QName

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.