com.webcohesion.enunciate.modules.jaxb.model.types.XmlClassType.getTypeDefinition()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(85)

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

XmlClassType.getTypeDefinition介绍

[英]Get the type definition for this class type.
[中]获取此类类型的类型定义。

代码示例

代码示例来源:origin: stoicflame/enunciate

public List<Value> getAllValues() {
 ArrayList<Value> values = new ArrayList<Value>();
 com.webcohesion.enunciate.modules.jaxb.model.types.XmlType baseType = getBaseType();
 if (baseType instanceof XmlClassType) {
  values.addAll(((XmlClassType) baseType).getTypeDefinition().getAllValues());
 }
 Value value = getValue();
 if (value != null && values.isEmpty()) {
  values.add(value);
 }
 return values;
}

代码示例来源:origin: stoicflame/enunciate

@Override
public List<DataTypeReference> getSupertypes() {
 ArrayList<DataTypeReference> supertypes = null;
 XmlType supertype = this.typeDefinition.getBaseType();
 while (supertype != null) {
  if (supertypes == null) {
   supertypes = new ArrayList<DataTypeReference>();
  }
  supertypes.add(new DataTypeReferenceImpl(supertype, false, registrationContext));
  supertype = supertype instanceof XmlClassType ?
   ((XmlClassType) supertype).getTypeDefinition() instanceof ComplexTypeDefinition ?
    ((XmlClassType) supertype).getTypeDefinition().getBaseType()
    : null
   : null;
 }
 return supertypes;
}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jaxb

public List<Value> getAllValues() {
 ArrayList<Value> values = new ArrayList<Value>();
 com.webcohesion.enunciate.modules.jaxb.model.types.XmlType baseType = getBaseType();
 if (baseType instanceof XmlClassType) {
  values.addAll(((XmlClassType) baseType).getTypeDefinition().getAllValues());
 }
 Value value = getValue();
 if (value != null && values.isEmpty()) {
  values.add(value);
 }
 return values;
}

代码示例来源:origin: stoicflame/enunciate

public TypeDefinition getAnonymousTypeDefinition() {
  XmlType baseType = attribute.getBaseType();
  if ((baseType.isAnonymous()) && (baseType instanceof XmlClassType)) {
   return ((XmlClassType) baseType).getTypeDefinition();
  }

  return null;
 }
}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jaxb

public TypeDefinition getAnonymousTypeDefinition() {
  XmlType baseType = attribute.getBaseType();
  if ((baseType.isAnonymous()) && (baseType instanceof XmlClassType)) {
   return ((XmlClassType) baseType).getTypeDefinition();
  }

  return null;
 }
}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jaxb

public TypeDefinition getAnonymousTypeDefinition() {
 XmlType baseType = element.getBaseType();
 if ((baseType.isAnonymous()) && (baseType instanceof XmlClassType)) {
  return ((XmlClassType) baseType).getTypeDefinition();
 }
 return null;
}

代码示例来源:origin: stoicflame/enunciate

public TypeDefinition getAnonymousTypeDefinition() {
 XmlType baseType = element.getBaseType();
 if ((baseType.isAnonymous()) && (baseType instanceof XmlClassType)) {
  return ((XmlClassType) baseType).getTypeDefinition();
 }
 return null;
}

代码示例来源:origin: stoicflame/enunciate

public int compare(TypeDefinition t1, TypeDefinition t2) {
  int depth1 = 0;
  int depth2 = 0;
  XmlType superType = t1.getBaseType();
  while (superType instanceof XmlClassType) {
   depth1++;
   superType = ((XmlClassType) superType).getTypeDefinition().getBaseType();
  }
  superType = t2.getBaseType();
  while (superType instanceof XmlClassType) {
   depth2++;
   superType = ((XmlClassType) superType).getTypeDefinition().getBaseType();
  }
  return depth1 - depth2;
 }
}

代码示例来源:origin: stoicflame/enunciate

public List<Element> getAllElements() {
 ArrayList<Element> elements = new ArrayList<Element>();
 com.webcohesion.enunciate.modules.jaxb.model.types.XmlType baseType = getBaseType();
 if (baseType instanceof XmlClassType) {
  elements.addAll(((XmlClassType) baseType).getTypeDefinition().getAllElements());
 }
 MY_ELEMENTS : for (Element element : getElements()) {
  for (Element other : elements) {
   if (element.overrides(other)) {
    continue MY_ELEMENTS;
   }
  }
  elements.add(element);
 }
 return elements;
}

代码示例来源:origin: stoicflame/enunciate

public List<Attribute> getAllAttributes() {
 ArrayList<Attribute> attributes = new ArrayList<Attribute>();
 com.webcohesion.enunciate.modules.jaxb.model.types.XmlType baseType = getBaseType();
 if (baseType instanceof XmlClassType) {
  attributes.addAll(((XmlClassType) baseType).getTypeDefinition().getAllAttributes());
 }
 MY_ATTRIBUTES : for (Attribute attribute : getAttributes()) {
  for (Attribute other : attributes) {
   if (attribute.overrides(other)) {
    continue MY_ATTRIBUTES;
   }
  }
  attributes.add(attribute);
 }
 return attributes;
}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jaxb

public List<Attribute> getAllAttributes() {
 ArrayList<Attribute> attributes = new ArrayList<Attribute>();
 com.webcohesion.enunciate.modules.jaxb.model.types.XmlType baseType = getBaseType();
 if (baseType instanceof XmlClassType) {
  attributes.addAll(((XmlClassType) baseType).getTypeDefinition().getAllAttributes());
 }
 MY_ATTRIBUTES : for (Attribute attribute : getAttributes()) {
  for (Attribute other : attributes) {
   if (attribute.overrides(other)) {
    continue MY_ATTRIBUTES;
   }
  }
  attributes.add(attribute);
 }
 return attributes;
}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jaxb

public List<Element> getAllElements() {
 ArrayList<Element> elements = new ArrayList<Element>();
 com.webcohesion.enunciate.modules.jaxb.model.types.XmlType baseType = getBaseType();
 if (baseType instanceof XmlClassType) {
  elements.addAll(((XmlClassType) baseType).getTypeDefinition().getAllElements());
 }
 MY_ELEMENTS : for (Element element : getElements()) {
  for (Element other : elements) {
   if (element.overrides(other)) {
    continue MY_ELEMENTS;
   }
  }
  elements.add(element);
 }
 return elements;
}

代码示例来源:origin: stoicflame/enunciate

private TypeDefinition findResponseElement(Method exampleResource) {
 if (exampleResource.getResponseEntity() != null) {
  for (MediaTypeDescriptor mediaTypeDescriptor : exampleResource.getResponseEntity().getMediaTypes()) {
   if (SyntaxImpl.SYNTAX_LABEL.equals(mediaTypeDescriptor.getSyntax())) {
    DataTypeReference dataType = mediaTypeDescriptor.getDataType();
    if (dataType instanceof DataTypeReferenceImpl) {
     XmlType xmlType = ((DataTypeReferenceImpl) dataType).getXmlType();
     if (xmlType instanceof XmlClassType) {
      return ((XmlClassType) xmlType).getTypeDefinition();
     }
    }
   }
  }
 }
 return null;
}

代码示例来源:origin: stoicflame/enunciate

private TypeDefinition findRequestElement(Method exampleResource) {
 if (exampleResource.getRequestEntity() != null) {
  for (MediaTypeDescriptor mediaTypeDescriptor : exampleResource.getRequestEntity().getMediaTypes()) {
   if (SyntaxImpl.SYNTAX_LABEL.equals(mediaTypeDescriptor.getSyntax())) {
    DataTypeReference dataType = mediaTypeDescriptor.getDataType();
    if (dataType instanceof DataTypeReferenceImpl) {
     XmlType xmlType = ((DataTypeReferenceImpl) dataType).getXmlType();
     if (xmlType instanceof XmlClassType) {
      return ((XmlClassType) xmlType).getTypeDefinition();
     }
    }
   }
  }
 }
 return null;
}

代码示例来源:origin: stoicflame/enunciate

private TypeDefinition findResponseElement(Method exampleResource) {
 if (exampleResource.getResponseEntity() != null) {
  for (MediaTypeDescriptor mediaTypeDescriptor : exampleResource.getResponseEntity().getMediaTypes()) {
   if (SyntaxImpl.SYNTAX_LABEL.equals(mediaTypeDescriptor.getSyntax())) {
    DataTypeReference dataType = mediaTypeDescriptor.getDataType();
    if (dataType instanceof DataTypeReferenceImpl) {
     XmlType xmlType = ((DataTypeReferenceImpl) dataType).getXmlType();
     if (xmlType instanceof XmlClassType) {
      return ((XmlClassType) xmlType).getTypeDefinition();
     }
    }
   }
  }
 }
 return null;
}

代码示例来源:origin: stoicflame/enunciate

private TypeDefinition findRequestElement(Method exampleResource) {
 if (exampleResource.getRequestEntity() != null) {
  for (MediaTypeDescriptor mediaTypeDescriptor : exampleResource.getRequestEntity().getMediaTypes()) {
   if (SyntaxImpl.SYNTAX_LABEL.equals(mediaTypeDescriptor.getSyntax())) {
    DataTypeReference dataType = mediaTypeDescriptor.getDataType();
    if (dataType instanceof DataTypeReferenceImpl) {
     XmlType xmlType = ((DataTypeReferenceImpl) dataType).getXmlType();
     if (xmlType instanceof XmlClassType) {
      return ((XmlClassType) xmlType).getTypeDefinition();
     }
    }
   }
  }
 }
 return null;
}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-c-xml-client

private TypeDefinition findRequestElement(Method exampleResource) {
 if (exampleResource.getRequestEntity() != null) {
  for (MediaTypeDescriptor mediaTypeDescriptor : exampleResource.getRequestEntity().getMediaTypes()) {
   if (SyntaxImpl.SYNTAX_LABEL.equals(mediaTypeDescriptor.getSyntax())) {
    DataTypeReference dataType = mediaTypeDescriptor.getDataType();
    if (dataType instanceof DataTypeReferenceImpl) {
     XmlType xmlType = ((DataTypeReferenceImpl) dataType).getXmlType();
     if (xmlType instanceof XmlClassType) {
      return ((XmlClassType) xmlType).getTypeDefinition();
     }
    }
   }
  }
 }
 return null;
}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-c-xml-client

private TypeDefinition findResponseElement(Method exampleResource) {
 if (exampleResource.getResponseEntity() != null) {
  for (MediaTypeDescriptor mediaTypeDescriptor : exampleResource.getResponseEntity().getMediaTypes()) {
   if (SyntaxImpl.SYNTAX_LABEL.equals(mediaTypeDescriptor.getSyntax())) {
    DataTypeReference dataType = mediaTypeDescriptor.getDataType();
    if (dataType instanceof DataTypeReferenceImpl) {
     XmlType xmlType = ((DataTypeReferenceImpl) dataType).getXmlType();
     if (xmlType instanceof XmlClassType) {
      return ((XmlClassType) xmlType).getTypeDefinition();
     }
    }
   }
  }
 }
 return null;
}

代码示例来源:origin: stoicflame/enunciate

@Override
public String convertUnwrappedObject(Object unwrapped) throws TemplateModelException {
 if (unwrapped instanceof Entity) {
  List<? extends MediaTypeDescriptor> mediaTypes = ((Entity) unwrapped).getMediaTypes();
  for (MediaTypeDescriptor mediaType : mediaTypes) {
   if (SyntaxImpl.SYNTAX_LABEL.equals(mediaType.getSyntax())) {
    DataTypeReference dataType = mediaType.getDataType();
    if (dataType instanceof DataTypeReferenceImpl) {
     XmlType xmlType = ((DataTypeReferenceImpl) dataType).getXmlType();
     if (xmlType instanceof XmlClassType) {
      super.convertUnwrappedObject(((XmlClassType) xmlType).getTypeDefinition());
     }
    }
   }
  }
  return "byte[]";
 }
 return super.convertUnwrappedObject(unwrapped);
}

代码示例来源:origin: stoicflame/enunciate

@Override
public String convertUnwrappedObject(Object unwrapped) throws TemplateModelException {
 if (unwrapped instanceof Entity) {
  List<? extends MediaTypeDescriptor> mediaTypes = ((Entity) unwrapped).getMediaTypes();
  for (MediaTypeDescriptor mediaType : mediaTypes) {
   if (SyntaxImpl.SYNTAX_LABEL.equals(mediaType.getSyntax())) {
    DataTypeReference dataType = mediaType.getDataType();
    if (dataType instanceof DataTypeReferenceImpl) {
     XmlType xmlType = ((DataTypeReferenceImpl) dataType).getXmlType();
     if (xmlType instanceof XmlClassType) {
      super.convertUnwrappedObject(((XmlClassType) xmlType).getTypeDefinition());
     }
    }
   }
  }
  return "byte[]";
 }
 return super.convertUnwrappedObject(unwrapped);
}

相关文章