本文整理汇总了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;
}
示例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;
}