当前位置: 首页>>代码示例>>Java>>正文


Java XStreamInclude类代码示例

本文整理汇总了Java中com.thoughtworks.xstream.annotations.XStreamInclude的典型用法代码示例。如果您正苦于以下问题:Java XStreamInclude类的具体用法?Java XStreamInclude怎么用?Java XStreamInclude使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XStreamInclude类属于com.thoughtworks.xstream.annotations包,在下文中一共展示了XStreamInclude类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: add

import com.thoughtworks.xstream.annotations.XStreamInclude; //导入依赖的package包/类
@Override
public boolean add(Class<?> type) {
    if (type == null) {
        return false;
    }
    while (type.isArray()) {
        type = type.getComponentType();
    }
    final String name = type.getName();
    if (name.startsWith("java.") || name.startsWith("javax.")) {
        return false;
    }
    final boolean ret = annotatedTypes.contains(type) ? false : super.add(type);
    if (ret) {
        final XStreamInclude inc = type.getAnnotation(XStreamInclude.class);
        if (inc != null) {
            final Class<?>[] incTypes = inc.value();
            if (incTypes != null) {
                for (final Class<?> incType : incTypes) {
                    add(incType);
                }
            }
        }
    }
    return ret;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:AnnotationMapper.java

示例2: add

import com.thoughtworks.xstream.annotations.XStreamInclude; //导入依赖的package包/类
public final boolean add(Class<?> paramClass)
{
  if (paramClass == null)
    return false;
  while (paramClass.isArray())
    paramClass = paramClass.getComponentType();
  String str = paramClass.getName();
  if ((str.startsWith("java.")) || (str.startsWith("javax.")))
    return false;
  boolean bool1;
  if (AnnotationMapper.this.annotatedTypes.contains(paramClass))
    bool1 = false;
  else
    bool1 = super.add(paramClass);
  boolean bool2 = bool1;
  if (bool1)
  {
    XStreamInclude localXStreamInclude = (XStreamInclude)paramClass.getAnnotation(XStreamInclude.class);
    if (localXStreamInclude != null)
    {
      Class[] arrayOfClass = localXStreamInclude.value();
      if (arrayOfClass != null)
      {
        int i = arrayOfClass.length;
        for (int j = 0; j < i; j++)
          add(arrayOfClass[j]);
      }
    }
  }
  return bool2;
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:32,代码来源:AnnotationMapper.java


注:本文中的com.thoughtworks.xstream.annotations.XStreamInclude类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。