Package org.codehaus.xfire.aegis.type

Examples of org.codehaus.xfire.aegis.type.Type


        return name;
    }

    private Type getParameterType(TypeMapping tm, MessagePartInfo param, int paramtype)
    {
        Type type = tm.getType(param.getName());

        if (type == null)
        {
            type = (Type) part2type.get(param);
        }

        /*
         * if (type == null && tm.isRegistered(param.getTypeClass())) { type =
         * tm.getType(param.getTypeClass()); part2type.put(param, type); }
         */

        if (type == null)
        {
            OperationInfo op = param.getContainer().getOperation();

            if (paramtype != FAULT_PARAM)
            {
                /*
                 * Note: we are not registering the type here, because it is an
                 * anonymous type. Potentially there could be many schema types
                 * with this name. For example, there could be many ns:in0
                 * paramters.
                 */
                type = tm.getTypeCreator().createType(op.getMethod(), param.getIndex());
            }
            else
            {
                type = tm.getTypeCreator().createType(param.getTypeClass());
            }

            type.setTypeMapping(tm);
            part2type.put(param, type);
        }

        return type;
    }
View Full Code Here


        if (service != null)
            tm = getTypeMapping(service);
        else
            tm = registry.getDefaultTypeMapping();

        Type type = tm.getType(name);

        if (type == null)
            return null;

        return type.getTypeClass();
    }
View Full Code Here

        if (service != null)
            tm = getTypeMapping(service);
        else
            tm = registry.getDefaultTypeMapping();

        Type type = tm.getType(name);

        if (type == null)
        {
            ObjectType ot = new ObjectType();
            ot.setTypeMapping(tm);
View Full Code Here

    }

    public Type getType(Service service, Class clazz)
    {
        TypeMapping tm = getTypeMapping(service);
        Type type = tm.getType(clazz);

        if (type == null)
        {
            type = tm.getTypeCreator().createType(clazz);
            tm.register(type);
View Full Code Here

        Collection values = createCollection();
       
        while ( reader.hasMoreElementReaders() )
        {
            MessageReader creader = reader.getNextElementReader();
            Type compType = AegisBindingProvider.getReadType(creader.getXMLStreamReader(), context, getComponentType());
           
            if (creader.isXsiNil())
            {   
                values.add(null);
                creader.readToEnd();
            }
            else
            {
                values.add( compType.readObject(creader, context) );
            }

            // check max occurs
            int size = values.size();
            if (size > maxOccurs)
View Full Code Here

        throws XFireFault
    {
        if (values == null)
            return;

        Type type = getComponentType();

        String ns = null;
        if (type.isAbstract())
            ns = getSchemaType().getNamespaceURI();
        else
            ns = type.getSchemaType().getNamespaceURI();
       
        String name = type.getSchemaType().getLocalPart();

        if ( type == null )
            throw new XFireRuntimeException( "Couldn't find type for " + type.getTypeClass() + "." );

        Class arrayType = type.getTypeClass();
       
        if (Object.class.isAssignableFrom(arrayType))
        {
            Object[] objects = (Object[]) values;
            for (int i = 0, n = objects.length; i < n; i++)
View Full Code Here

            Element element = new Element("element",
                                          SoapConstants.XSD_PREFIX,
                                          SoapConstants.XSD);
            seq.addContent(element);

            Type componentType = getComponentType();
            String prefix = NamespaceHelper.getUniquePrefix((Element) root.getParent(),
                                                            componentType.getSchemaType().getNamespaceURI());

            String typeName = prefix + ":"
                    + componentType.getSchemaType().getLocalPart();

            element.setAttribute(new Attribute("name", componentType.getSchemaType().getLocalPart()));
            element.setAttribute(new Attribute("type", typeName));
           
            if (componentType.isNillable())
            {
                element.setAttribute(new Attribute("nillable", "true"));
            }

            element.setAttribute(new Attribute("minOccurs", new Long(getMinOccurs()).toString()));
View Full Code Here

     */
    public Type getComponentType()
    {
        Class compType = getTypeClass().getComponentType();
       
        Type type;
       
        if (componentName == null)
        {
            type = getTypeMapping().getType(compType);
        }
View Full Code Here

        throws XFireFault
    {
        Map map = instantiateMap();
        try
        {
            Type keyType = getKeyType();
            Type valueType = getValueType();

            Object key = null;
            Object value = null;
           
            while (reader.hasMoreElementReaders())
            {
                MessageReader entryReader = reader.getNextElementReader();
               
                if (entryReader.getName().equals(getEntryName()))
                {
                    while (entryReader.hasMoreElementReaders())
                    {
                        MessageReader evReader = entryReader.getNextElementReader();
                      
                        if (evReader.getName().equals(getKeyName()))
                        {
                            key = keyType.readObject(evReader, context);
                        }
                        else if (evReader.getName().equals(getValueName()))
                        {
                            value = valueType.readObject(evReader, context);
                        }
                        else
                        {
                            readToEnd(evReader);
                        }
View Full Code Here

   
        try
        {
            Map map = (Map) object;

            Type keyType = getKeyType();
            Type valueType = getValueType();
           
            for (Iterator itr = map.entrySet().iterator(); itr.hasNext();)
            {
                Map.Entry entry = (Map.Entry) itr.next();
               
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.aegis.type.Type

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.