org.codehaus.enunciate.contract.jaxb.Accessor.isCollectionType()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(134)

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

Accessor.isCollectionType介绍

[英]Whether the accessor type is a collection type.
[中]访问器类型是否为集合类型。

代码示例

代码示例来源:origin: org.codehaus.enunciate/enunciate-core

/**
 * The bare (i.e. unwrapped) type of the accessor.
 *
 * @return The bare type of the accessor.
 */
public TypeMirror getBareAccessorType() {
 return isCollectionType() ? getCollectionItemType() : getAccessorType();
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

/**
 * The bare (i.e. unwrapped) type of the accessor.
 *
 * @return The bare type of the accessor.
 */
public TypeMirror getBareAccessorType() {
 return isCollectionType() ? getCollectionItemType() : getAccessorType();
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-gwt

@Override
public String convert(Accessor accessor) throws TemplateModelException {
 if (accessor.isCollectionType() && accessor instanceof Element) {
  Element element = (Element) accessor;
  //@XmlElementRefs and @XmlElements can't
  if (element instanceof ElementRef && ((ElementRef) element).isElementRefs()) {
   return "com.google.gwt.core.client.JsArray";
  }
  else if (element.getAnnotation(XmlElements.class) != null) {
   return "com.google.gwt.core.client.JsArray";
  }
 }
 return super.convert(accessor);
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-java-client

@Override
public String convert(Accessor accessor) throws TemplateModelException {
 if (!accessor.isXmlList() && !accessor.isAdapted() && accessor.getBareAccessorType() instanceof InterfaceType) {
  if (accessor.isCollectionType()) {
   return "java.util.List<Object>";
  }
  else {
   return "Object";
  }
 }
 return super.convert(accessor);
}

相关文章