org.eclipse.xsd.XSDSchema.getSchemaForSchema()方法的使用及代码示例

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

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

XSDSchema.getSchemaForSchema介绍

[英]Returns the value of the 'Schema For Schema' reference.

This represents the 'schema for schemas'. It is computed from the #getSchemaForSchemaNamespaceand should typically not be set directly.
[中]返回“Schema For Schema”引用的值。
这表示“{$0$}”。它是根据#GetSchemaForSchemaNamespace计算的,通常不应直接设置。

代码示例

代码示例来源:origin: geotools/geotools

public SchemaIndexImpl(XSDSchema[] schemas) {
  this.schemas = new XSDSchema[schemas.length + 1];
  adapter = new SchemaAdapter();
  // set the schemas passed in
  for (int i = 0; i < schemas.length; i++) {
    this.schemas[i] = schemas[i];
    synchronized (this.schemas[i].eAdapters()) {
      this.schemas[i].eAdapters().add(adapter);
    }
  }
  // add the schema for xml schema itself
  this.schemas[schemas.length] = schemas[0].getSchemaForSchema();
}

代码示例来源:origin: org.geotools/gt2-xml-core

public SchemaIndexImpl(XSDSchema[] schemas) {
  this.schemas = new XSDSchema[schemas.length + 1];
  //set the schemas passed in
  for (int i = 0; i < schemas.length; i++) {
    this.schemas[i] = schemas[i];
    this.schemas[i].eAdapters().add(new SchemaAdapter());
  }
  //add the schema for xml schema itself
  this.schemas[schemas.length] = schemas[0].getSchemaForSchema();
}

代码示例来源:origin: org.geotools/gt2-xml-xsd

public SchemaIndexImpl(XSDSchema[] schemas) {
  this.schemas = new XSDSchema[ schemas.length + 1 ];
  
  //set the schemas passed in
  for ( int i = 0; i < schemas.length; i++ ) {
    this.schemas[ i ] = schemas[ i ];
    this.schemas[i].eAdapters().add( new SchemaAdapter());
  }
  
  //add the schema for xml schema itself
  this.schemas[schemas.length] = schemas[0].getSchemaForSchema();
}

代码示例来源:origin: org.geotools.xsd/gt-core

public SchemaIndexImpl(XSDSchema[] schemas) {
  this.schemas = new XSDSchema[schemas.length + 1];
  //set the schemas passed in
  for (int i = 0; i < schemas.length; i++) {
    this.schemas[i] = schemas[i];
    this.schemas[i].eAdapters().add(new SchemaAdapter());
  }
  //add the schema for xml schema itself
  this.schemas[schemas.length] = schemas[0].getSchemaForSchema();
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

protected XSDDiagnostic checkComplexContent
 (XSDComplexTypeDefinition xsdComplexTypeDefinition,
  String part, 
  String anchor, 
  Element element)
{
 List<XSDDiagnostic> xsdDiagnostics = XSDUtil.checkComplexContent(xsdComplexTypeDefinition, part, anchor, element);
 for (XSDDiagnostic xsdDiagnostic : xsdDiagnostics)
 {
  xsdDiagnostic.setPrimaryComponent(this);
 }
 getDiagnostics().addAll(xsdDiagnostics);
 return xsdDiagnostics.isEmpty() ? null : xsdDiagnostics.get(xsdDiagnostics.size() - 1);
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

protected XSDDiagnostic checkBuiltInTypeConstraint
 (String builtInTypeName, String value, String part, String anchor, Element element, String attributeName, boolean isRequired)
{
 XSDSimpleTypeDefinition builtInType = getSchema().getSchemaForSchema().resolveSimpleTypeDefinition(builtInTypeName);
 return checkSimpleTypeConstraint(builtInType, value, part, anchor, element, attributeName, isRequired);
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

protected void setReferenceAttribType(XSDAttributeDeclaration xsdAttributeDeclaration)
{
 addEMFSchema();
 xsdAttributeDeclaration.setTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition(REFERENCE_TYPE_NAME));
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

protected XSDDiagnostic checkBuiltInTypeConstraint
 (String builtInTypeName, String value, String part, String anchor, Element element, String attributeName, boolean isRequired)
{
 XSDSimpleTypeDefinition builtInType = getSchema().getSchemaForSchema().resolveSimpleTypeDefinition(builtInTypeName);
 return checkSimpleTypeConstraint(builtInType, value, part, anchor, element, attributeName, isRequired);
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

protected void setReferenceAttribType(XSDAttributeDeclaration xsdAttributeDeclaration)
{
 addEMFSchema();
 xsdAttributeDeclaration.setTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition(REFERENCE_TYPE_NAME));
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

protected XSDDiagnostic checkElementComplexContent
 (String elementName, 
  String part, 
  String anchor, 
  Element element)
{
 XSDElementDeclaration xsdElementDeclaration = getSchema().getSchemaForSchema().resolveElementDeclaration(elementName);
 return checkComplexContent((XSDComplexTypeDefinition)xsdElementDeclaration.getTypeDefinition(), part, anchor, element);
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

protected XSDDiagnostic checkElementComplexContent
 (String elementName, 
  String part, 
  String anchor, 
  Element element)
{
 XSDElementDeclaration xsdElementDeclaration = getSchema().getSchemaForSchema().resolveElementDeclaration(elementName);
 return checkComplexContent((XSDComplexTypeDefinition)xsdElementDeclaration.getTypeDefinition(), part, anchor, element);
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

protected XSDAttributeDeclaration createGlobalXSDAttributeDeclaration(XSDSchema xsdSchema)
{
 ensureSchemaElement(xsdSchema);
 XSDAttributeDeclaration attribute = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attribute.setTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("string")); //$NON-NLS-1$
 attribute.setName(XSDCommonUIUtils.createUniqueElementName("NewAttribute", xsdSchema.getAttributeDeclarations())); //$NON-NLS-1$
 Text textNode = xsdSchema.getDocument().createTextNode("\n"); //$NON-NLS-1$
 xsdSchema.getElement().appendChild(textNode);
 xsdSchema.getContents().add(attribute);
 return attribute;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void visitElementDeclaration(org.eclipse.xsd.XSDElementDeclaration element)
 {
  if (element.getTypeDefinition() == target)
  {
   XSDSimpleTypeDefinition type = target.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
   element.setTypeDefinition(type);
  }
  super.visitElementDeclaration(element);
 }
};

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

protected XSDParticle createXSDElementDeclarationForComplexType()
{
 XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
 XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
 ArrayList usedAttributeNames = new ArrayList();
 usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes(xsdComplexTypeDefinition));
 usedAttributeNames.addAll(XSDCommonUIUtils.getInheritedAttributes(xsdComplexTypeDefinition));
 element.setName(XSDCommonUIUtils.createUniqueElementName(
     nameToAdd == null ? "NewElement" : nameToAdd , usedAttributeNames)); //$NON-NLS-1$
 element.setTypeDefinition(type);
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setContent(element);
 addedXSDConcreteComponent = element;
 return particle;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

protected XSDParticle createXSDElementDeclarationForModelGroupDefinitions()
{
 XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
 XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
 ArrayList usedAttributeNames = new ArrayList();
 usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes(xsdModelGroupDefinition));
 element.setName(XSDCommonUIUtils.createUniqueElementName(
   nameToAdd == null ? "NewElement" : nameToAdd , usedAttributeNames)); //$NON-NLS-1$
 element.setTypeDefinition(type);
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setContent(element);
 addedXSDConcreteComponent = element;
 return particle;
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

public static class FeatureIteratorImpl extends EContentsEList.FeatureIteratorImpl<XSDConcreteComponent>
 {
  public FeatureIteratorImpl(EObject eObject)
  {
   super(eObject, (EStructuralFeature [])((BasicEList<?>)eObject.eClass().getEAllReferences()).data());
  }
  public FeatureIteratorImpl(EObject eObject, EStructuralFeature [] eStructuralFeatures)
  {
   super(eObject, eStructuralFeatures);
  }
  @Override
  protected boolean isIncluded(EStructuralFeature eStructuralFeature)
  {
   EReference eReference = (EReference)eStructuralFeature;
   return !eReference.isTransient();
  }
 }
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

protected XSDElementDeclaration createElementDeclaration(XSDSchema schema, String name, String type, boolean schemaType)
{
 XSDElementDeclaration elementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
 elementDeclaration.setName(name);
 if (schemaType)
 {
  elementDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type));
 }
 else
 {
  elementDeclaration.setTypeDefinition(schema.resolveSimpleTypeDefinition(type));
 }
 return elementDeclaration;
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

protected XSDElementDeclaration createElementDeclaration(XSDSchema schema, String name, String type, boolean schemaType)
{
 XSDElementDeclaration elementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
 elementDeclaration.setName(name);
 if (schemaType)
 {
  elementDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type));
 }
 else
 {
  elementDeclaration.setTypeDefinition(schema.resolveSimpleTypeDefinition(type));
 }
 return elementDeclaration;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

protected XSDElementDeclaration createGlobalXSDElementDeclaration()
{
 ensureSchemaElement(xsdSchema);
 XSDSimpleTypeDefinition type = xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$
 XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
 XSDElementDeclaration element = factory.createXSDElementDeclaration();
 element.setName(XSDCommonUIUtils.createUniqueElementName(
     nameToAdd == null ? "NewElement" : nameToAdd , xsdSchema.getElementDeclarations())); //$NON-NLS-1$
 element.setTypeDefinition(type);
 return element;
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

/**
 * Each EEnum is mapped to a schema simple type that restricts the string simple type;
 * the schema type has an enumeration facet for each EEnumLiteral.
 */
protected void processEnum(EEnum eEnum)
{
 XSDSimpleTypeDefinition enumType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
 enumType.setName(getName(eEnum));
 enumType.setBaseTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("NCName"));
 xsdSchema.getContents().add(enumType);
 map(enumType, eEnum);
 for (EEnumLiteral literal : eEnum.getELiterals())
 {
  XSDEnumerationFacet facet = XSDFactory.eINSTANCE.createXSDEnumerationFacet();
  facet.setLexicalValue(getName(literal));
  enumType.getFacetContents().add(facet);
  map(facet, literal);
 }
}

相关文章

微信公众号

最新文章

更多