org.eclipse.jetty.util.ajax.JSON.getConvertorFor()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.eclipse.jetty.util.ajax.JSON.getConvertorFor()方法的一些代码示例,展示了JSON.getConvertorFor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSON.getConvertorFor()方法的具体详情如下:
包路径:org.eclipse.jetty.util.ajax.JSON
类名称:JSON
方法名:getConvertorFor

JSON.getConvertorFor介绍

[英]Lookup a convertor for a named class.
[中]查找命名类的转换器。

代码示例

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

/**
 * Lookup a convertor for a named class.
 *
 * @param name
 *            name of the class
 * @return a {@link JSON.Convertor} or null if none were found.
 */
public Convertor getConvertorFor(String name)
{
  Convertor convertor = _convertors.get(name);
  if (convertor == null && this != DEFAULT)
    convertor = DEFAULT.getConvertorFor(name);
  return convertor;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

/**
 * Lookup a convertor for a named class.
 *
 * @param name
 *            name of the class
 * @return a {@link JSON.Convertor} or null if none were found.
 */
public Convertor getConvertorFor(String name)
{
  Convertor convertor = _convertors.get(name);
  if (convertor == null && this != DEFAULT)
    convertor = DEFAULT.getConvertorFor(name);
  return convertor;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

/**
 * Lookup a convertor for a named class.
 *
 * @param name
 *            name of the class
 * @return a {@link JSON.Convertor} or null if none were found.
 */
public Convertor getConvertorFor(String name)
{
  Convertor convertor = _convertors.get(name);
  if (convertor == null && this != DEFAULT)
    convertor = DEFAULT.getConvertorFor(name);
  return convertor;
}

代码示例来源:origin: org.eclipse.jetty/jetty-util-ajax

/**
 * Lookup a convertor for a named class.
 *
 * @param name
 *            name of the class
 * @return a {@link JSON.Convertor} or null if none were found.
 */
public Convertor getConvertorFor(String name)
{
  Convertor convertor = _convertors.get(name);
  if (convertor == null && this != DEFAULT)
    convertor = DEFAULT.getConvertorFor(name);
  return convertor;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

/**
 * Lookup a convertor for a named class.
 *
 * @param name
 *            name of the class
 * @return a {@link JSON.Convertor} or null if none were found.
 */
public Convertor getConvertorFor(String name)
{
  Convertor convertor = _convertors.get(name);
  if (convertor == null && this != DEFAULT)
    convertor = DEFAULT.getConvertorFor(name);
  return convertor;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

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)
    {
      JSON.LOG.warn(e);
    }
  }
  if (convertor!=null)
  {
    convertor.toJSON(obj, out);
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

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)
    {
      JSON.LOG.warn(e);
    }
  }
  if (convertor!=null)
  {
    convertor.toJSON(obj, out);
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

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)
    {
      JSON.LOG.warn(e);
    }
  }
  if (convertor!=null)
  {
    convertor.toJSON(obj, out);
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

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)
    {
      JSON.LOG.warn(e);
    }
  }
  if (convertor!=null)
  {
    convertor.toJSON(obj, out);
  }
}

代码示例来源:origin: org.eclipse.jetty/jetty-util-ajax

@Override
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(clsName);
      convertor=new JSONPojoConvertor(cls,_fromJson);
      _json.addConvertorFor(clsName, convertor);
     }
    catch (ClassNotFoundException e)
    {
      JSON.LOG.warn(e);
    }
  }
  if (convertor!=null)
  {
    convertor.toJSON(obj, out);
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public Object fromJSON(Map object)
  {
    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,_fromJson);
          _json.addConvertorFor(clsName, convertor);
        }
        catch (ClassNotFoundException e)
        {
          JSON.LOG.warn(e);
        }
      }
      if (convertor!=null)
      {
        return convertor.fromJSON(object);
      }
    }
    return map;
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public Object fromJSON(Map object)
  {
    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,_fromJson);
          _json.addConvertorFor(clsName, convertor);
        }
        catch (ClassNotFoundException e)
        {
          JSON.LOG.warn(e);
        }
      }
      if (convertor!=null)
      {
        return convertor.fromJSON(object);
      }
    }
    return map;
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

public Object fromJSON(Map object)
  {
    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,_fromJson);
          _json.addConvertorFor(clsName, convertor);
        }
        catch (ClassNotFoundException e)
        {
          JSON.LOG.warn(e);
        }
      }
      if (convertor!=null)
      {
        return convertor.fromJSON(object);
      }
    }
    return map;
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public Object fromJSON(Map object)
  {
    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,_fromJson);
          _json.addConvertorFor(clsName, convertor);
        }
        catch (ClassNotFoundException e)
        {
          JSON.LOG.warn(e);
        }
      }
      if (convertor!=null)
      {
        return convertor.fromJSON(object);
      }
    }
    return map;
  }
}

代码示例来源:origin: org.eclipse.jetty/jetty-util-ajax

@Override
  public Object fromJSON(Map object)
  {
    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(clsName);
          convertor=new JSONPojoConvertor(cls,_fromJson);
          _json.addConvertorFor(clsName, convertor);
        }
        catch (ClassNotFoundException e)
        {
          JSON.LOG.warn(e);
        }
      }
      if (convertor!=null)
      {
        return convertor.fromJSON(object);
      }
    }
    return map;
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

if (xclassname != null)
  Convertor c = getConvertorFor(xclassname);
  if (c != null)
    return c.fromJSON(map);

代码示例来源:origin: org.eclipse.jetty/jetty-util-ajax

if (xclassname != null)
  Convertor c = getConvertorFor(xclassname);
  if (c != null)
    return c.fromJSON(map);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

if (xclassname != null)
  Convertor c = getConvertorFor(xclassname);
  if (c != null)
    return c.fromJSON(map);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

if (xclassname != null)
  Convertor c = getConvertorFor(xclassname);
  if (c != null)
    return c.fromJSON(map);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

if (xclassname != null)
  Convertor c = getConvertorFor(xclassname);
  if (c != null)
    return c.fromJSON(map);

相关文章