当前位置: 首页>>代码示例>>Java>>正文


Java SchemaType.NOT_SIMPLE属性代码示例

本文整理汇总了Java中org.apache.xmlbeans.SchemaType.NOT_SIMPLE属性的典型用法代码示例。如果您正苦于以下问题:Java SchemaType.NOT_SIMPLE属性的具体用法?Java SchemaType.NOT_SIMPLE怎么用?Java SchemaType.NOT_SIMPLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.xmlbeans.SchemaType的用法示例。


在下文中一共展示了SchemaType.NOT_SIMPLE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBaseClass

String getBaseClass(SchemaType sType) {
  SchemaType baseType = findBaseType(sType.getBaseType());

  switch (sType.getSimpleVariety()) {
  case SchemaType.NOT_SIMPLE:
    // non-simple-content: inherit from base type impl
    if (!XmlObject.type.equals(baseType))
      return baseType.getFullJavaImplName();
    return "org.apache.xmlbeans.impl.values.XmlComplexContentImpl";

  case SchemaType.ATOMIC:
    // We should only get called for restrictions
    assert(!sType.isBuiltinType());
    return getAtomicRestrictionType(sType);

  case SchemaType.LIST:
    return "org.apache.xmlbeans.impl.values.XmlListImpl";

  case SchemaType.UNION:
    return "org.apache.xmlbeans.impl.values.XmlUnionImpl";

  default:
    throw new IllegalStateException();
  }
}
 
开发者ID:nortal,项目名称:j-road,代码行数:25,代码来源:XteeSchemaCodePrinter.java

示例2: printConstructor

void printConstructor(SchemaType sType, String shortName) throws IOException {
  emit("");
  emit("public " + shortName + "(org.apache.xmlbeans.SchemaType sType)");
  startBlock();
  emit("super(sType" + (sType.getSimpleVariety() == SchemaType.NOT_SIMPLE ? "" : ", " + !sType.isSimpleType())
      + ");");
  endBlock();

  if (sType.getSimpleVariety() != SchemaType.NOT_SIMPLE) {
    emit("");
    emit("protected " + shortName + "(org.apache.xmlbeans.SchemaType sType, boolean b)");
    startBlock();
    emit("super(sType, b);");
    endBlock();
  }
}
 
开发者ID:nortal,项目名称:j-road,代码行数:16,代码来源:XteeSchemaCodePrinter.java

示例3: printInnerTypeJavaDoc

void printInnerTypeJavaDoc(SchemaType sType) throws IOException {
  QName name = sType.getName();
  if (name == null) {
    if (sType.isDocumentType())
      name = sType.getDocumentElementName();
    else if (sType.isAttributeType())
      name = sType.getAttributeTypeAttributeName();
    else if (sType.getContainerField() != null)
      name = sType.getContainerField().getName();
  }

  emit("/**");
  if (sType.isDocumentType())
    emit(" * A document containing one " + prettyQName(name) + " element.");
  else if (sType.isAttributeType())
    emit(" * A document containing one " + prettyQName(name) + " attribute.");
  else if (name != null)
    emit(" * An XML " + prettyQName(name) + ".");
  else
    emit(" * An anonymous inner XML type.");
  emit(" *");
  switch (sType.getSimpleVariety()) {
  case SchemaType.NOT_SIMPLE:
    emit(" * This is a complex type.");
    break;
  case SchemaType.ATOMIC:
    emit(" * This is an atomic type that is a restriction of " + getFullJavaName(sType) + ".");
    break;
  case SchemaType.LIST:
    emit(" * This is a list type whose items are " + sType.getListItemType().getFullJavaName() + ".");
    break;
  case SchemaType.UNION:
    emit(" * This is a union type. Instances are of one of the following types:");
    SchemaType[] members = sType.getUnionConstituentTypes();
    for (int i = 0; i < members.length; i++)
      emit(" *     " + members[i].getFullJavaName());
    break;
  }
  emit(" */");
}
 
开发者ID:nortal,项目名称:j-road,代码行数:40,代码来源:XteeSchemaCodePrinter.java


注:本文中的org.apache.xmlbeans.SchemaType.NOT_SIMPLE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。