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

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

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

Accessor.getDelegate介绍

暂无

代码示例

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

/**
 * The type of the accessor.
 *
 * @return The type of the accessor.
 */
public TypeMirror getAccessorType() {
 TypeMirror accessorType;
 Declaration delegate = getDelegate();
 if (delegate instanceof FieldDeclaration) {
  accessorType = ((FieldDeclaration) delegate).getType();
 }
 else {
  accessorType = ((PropertyDeclaration) delegate).getPropertyType();
 }
 MapType mapType = MapTypeUtil.findMapType(accessorType);
 if (mapType != null) {
  accessorType = mapType;
 }
 
 return accessorType;
}

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

public ValidationResult validateAccessor(Accessor accessor) {
 ValidationResult result = new ValidationResult();
 if (accessor.getDelegate() instanceof PropertyDeclaration) {
  PropertyDeclaration property = (PropertyDeclaration) accessor.getDelegate();
  DecoratedMethodDeclaration getter = property.getGetter();
  DecoratedMethodDeclaration setter = property.getSetter();
  if ((getter != null) && (setter != null)) {
   //find all JAXB annotations that are on both the setter and the getter...
   Map<String, AnnotationMirror> getterAnnotations = getter.getAnnotations();
   Map<String, AnnotationMirror> setterAnnotations = setter.getAnnotations();
   for (String annotation : getterAnnotations.keySet()) {
    if ((annotation.startsWith(XmlElement.class.getPackage().getName())) && (setterAnnotations.containsKey(annotation))) {
     result.addError(setter.getPosition(), "'" + annotation + "' is on both the getter and setter.");
    }
   }
  }
  else {
   result.addError(accessor.getPosition(), "A property accessor needs both a setter and a getter.");
  }
 }
 if ((accessor.isXmlIDREF()) && (accessor.getAccessorForXmlID() == null)) {
  result.addError(accessor.getPosition(), "An XML IDREF must have a base type that references another type that has an XML ID.");
 }
 return result;
}

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

/**
 * The type of the accessor.
 *
 * @return The type of the accessor.
 */
public TypeMirror getAccessorType() {
 TypeMirror accessorType;
 Declaration delegate = getDelegate();
 if (delegate instanceof FieldDeclaration) {
  accessorType = ((FieldDeclaration) delegate).getType();
 }
 else {
  accessorType = ((PropertyDeclaration) delegate).getPropertyType();
 }
 TypeMirror bareCollection = JAXBUtil.getNormalizedCollection(accessorType);
 if (bareCollection != null) {
  accessorType = bareCollection;
 }
 else {
  MapType mapType = MapTypeUtil.findMapType(accessorType);
  if (mapType != null) {
   accessorType = mapType;
  }
 }
 return accessorType;
}

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

public ValidationResult validateAccessor(Accessor accessor) {
 ValidationResult result = new ValidationResult();
 if (accessor.getDelegate() instanceof PropertyDeclaration) {
  PropertyDeclaration property = (PropertyDeclaration) accessor.getDelegate();
  DecoratedMethodDeclaration getter = property.getGetter();
  DecoratedMethodDeclaration setter = property.getSetter();

相关文章