com.webcohesion.enunciate.modules.jaxb.model.types.XmlClassType类的使用及代码示例

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

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

XmlClassType介绍

[英]Decorator for an xml class type.
[中]xml类类型的装饰器。

代码示例

代码示例来源: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 XmlType getXmlType() {
  TypeDefinition typeDefinition = context.findTypeDefinition(this.declaration);
  if (typeDefinition == null) {
   throw new IllegalStateException("Cannot find type definition for " + this.declaration);
  }
  return new XmlClassType(typeDefinition);
 }
}

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

/**
 * The qname.
 *
 * @return The qname.
 */
public QName getQname() {
 String localPart = getName();
 if (localPart == null) {
  localPart = "";
 }
 return new QName(getNamespace(), localPart);
}

代码示例来源: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

/**
 * The qname.
 *
 * @return The qname.
 */
public QName getQname() {
 String localPart = getName();
 if (localPart == null) {
  localPart = "";
 }
 return new QName(getNamespace(), localPart);
}

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

@Override
 public XmlType getXmlType() {
  TypeDefinition typeDefinition = context.findTypeDefinition(this.declaration);
  if (typeDefinition == null) {
   throw new IllegalStateException("Cannot find type definition for " + this.declaration);
  }
  return new XmlClassType(typeDefinition);
 }
}

代码示例来源: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

@Override
 public XmlType getXmlType() {
  return this.element instanceof LocalElementDeclaration ? ((LocalElementDeclaration) this.element).getElementXmlType() : new XmlClassType(((RootElementDeclaration)this.element).getTypeDefinition());
 }
}

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

@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

@Override
 public XmlType getXmlType() {
  return this.element instanceof LocalElementDeclaration ? ((LocalElementDeclaration) this.element).getElementXmlType() : new XmlClassType(((RootElementDeclaration)this.element).getTypeDefinition());
 }
}

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

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

  return null;
 }
}

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

return new XmlClassType(typeDefinition);

代码示例来源: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

return new XmlClassType(typeDefinition);

代码示例来源: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;
}

相关文章