Examples of Convertor


Examples of org.gocha.collection.Convertor

    @Override
    public Object getRoot()
    {
        Object obj = getRootObject();
        Convertor nWrap = getNodeWrapper();
        if( nWrap!=null )
            return nWrap.convert(obj);
       
        return obj;
    }
View Full Code Here

Examples of org.jboss.varia.deployment.convertor.Convertor

   {
      // delegate accepts to convertors
      Iterator i = converterList.iterator();
      while(i.hasNext())
      {
         Convertor converter = (Convertor)i.next();
         if(converter.accepts(di.url))
         {
            return true;
         }
      }
      return false;
View Full Code Here

Examples of org.jboss.varia.deployment.convertor.Convertor

   {
      // delegate accepts to convertors
      Iterator i = converterList.iterator();
      while(i.hasNext())
      {
         Convertor converter = (Convertor)i.next();
         if(converter.accepts(url))
         {
            return true;
         }
      }
      return false;
View Full Code Here

Examples of org.jboss.varia.deployment.convertor.Convertor

         // Look for the converter that accepts vendor specific deployment descriptors
         // and let it convert them
         Iterator i = converterList.iterator();
         while(i.hasNext())
         {
            Convertor converter = (Convertor)i.next();
            if(converter.accepts(di.url))
            {
               // Convert them to JBoss specific DDs
               converter.convert(di, inflateDest);
               // Now conversion is done and we can leave
               break;
            }
         }
View Full Code Here

Examples of org.mortbay.util.ajax.JSON.Convertor

        if(context==null)
        {
            Log.warn("No current context for Reference");
            return false;
        }
        Convertor c = context.getParser().getConvertorCache().getConvertor(ref.getClass(), true);
        return c instanceof JSONPojoConvertor && ((JSONPojoConvertor)c).setProps(ref, props)!=0;
    }
View Full Code Here

Examples of org.mortbay.util.ajax.JSON.Convertor

        return getConvertor(clazz, create, true);
    }

    public Convertor getConvertor(Class<?> clazz, boolean create, boolean addClass)
    {
        Convertor convertor = (Convertor)_convertors.get(clazz.getName());
        if(convertor==null && create)
        {
            convertor = newConvertor(clazz, addClass);
            Convertor existing = _convertors.putIfAbsent(clazz.getName(), convertor);
            if(existing != null)
                convertor = existing;
        }       
        return convertor;
    }
View Full Code Here

Examples of org.mortbay.util.ajax.JSON.Convertor

        return getConvertor(clazz)!=null;
    }
   
    protected Convertor getConvertor(String className)
    {
        Convertor convertor = (Convertor)_convertors.get(className);
        if(convertor==null)
        {
            Class<?> clazz = StandardJSON.loadClass(className);
            convertor = clazz==null ? UNRESOLVED_CONVERTOR : newConvertor(clazz);
            Convertor existing = _convertors.putIfAbsent(className, convertor);
            if(existing != null)
                convertor = existing;
        }
        return convertor;
    }
View Full Code Here

Examples of org.mortbay.util.ajax.JSON.Convertor

public class DefaultConvertorCache extends StandardConvertorCache
{
   
    public DefaultConvertorCache()
    {
        final Convertor wrapped = newConvertor(Reference.class);
        addConvertor(Reference.class, new Convertor()
        {
            public Object fromJSON(Map map)
            {
                return wrapped.fromJSON(map);
            }
            public void toJSON(Object obj, Output out)
            {
                getConvertor(obj.getClass(), true).toJSON(obj, out);               
            }           
View Full Code Here

Examples of org.mortbay.util.ajax.JSON.Convertor

    }
   
    public void toJSON(Object obj, Output out)
    {
        String clsName=obj.getClass().getName();
        Convertor convertor=_json.getConvertorFor(clsName);
        if (convertor==null)
        {
            try
            {
                Class cls=Loader.loadClass(JSON.class,clsName);
                convertor=new JSONPojoConvertor(cls,_fromJSON);
                _json.addConvertorFor(clsName, convertor);
             }
            catch (ClassNotFoundException e)
            {
                e.printStackTrace();
            }
        }
        if (convertor!=null&&obj.getClass()!=Object.class)
        {
            convertor.toJSON(obj, out);
        }
        else
        {
            out.add(obj.toString());
        }
View Full Code Here

Examples of org.mortbay.util.ajax.JSON.Convertor

    {
        Map map=object;
        String clsName=(String)map.get("class");
        if (clsName!=null)
        {
            Convertor convertor=_json.getConvertorFor(clsName);
            if (convertor==null)
            {
                try
                {
                    Class cls=Loader.loadClass(JSON.class,clsName);
                    convertor=new JSONPojoConvertor(cls);
                    _json.addConvertorFor(clsName, convertor);
                }
                catch (ClassNotFoundException e)
                {
                    e.printStackTrace();
                }
            }
            if (convertor!=null&&!clsName.equals(Object.class.getName()))
            {
                return convertor.fromJSON(object);
            }
        }
        return map;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.