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

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

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

XSDSchema.updateElement介绍

暂无

代码示例

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

xsd.updateElement();
return xsd;

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

schemaElement.setAttribute("xmlns", namespaceText.getText());
xsdSchema.updateElement();
setErrorMessage(null);
oldPrefixValue = newPrefix;

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

protected static void ensureSchemaElement(XSDSchema schema)
{
 Document document = schema.getDocument();
 
 Element schemaElement = document.getDocumentElement();
 if (schemaElement == null)
 {
  String targetNamespace = getDefaultNamespace(schema);
  schema.setTargetNamespace(targetNamespace);
  Map qNamePrefixToNamespaceMap = schema.getQNamePrefixToNamespaceMap();
  qNamePrefixToNamespaceMap.put("tns", targetNamespace);      
  if (XSDEditorPlugin.getDefault().isQualifyXMLSchemaLanguage())
  {
   String prefix = XSDEditorPlugin.getDefault().getXMLSchemaPrefix();
   schema.setSchemaForSchemaQNamePrefix(prefix);
   qNamePrefixToNamespaceMap.put(prefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);      
  }
  else
  {
   qNamePrefixToNamespaceMap.put(null, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);      
  }
  
  schema.updateElement();
  ensureXMLDirective(document);
 }
}

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

protected void doSave(Writer writer, Map<?, ?> options) throws IOException
{
 XSDSchema xsdSchema = getSchema();
 if (xsdSchema != null)
 {
  Document document = xsdSchema.getDocument();
  if (document == null)
  {
   xsdSchema.updateDocument();
   document = xsdSchema.getDocument();
  }
  if (xsdSchema.getElement() == null)
  {
   xsdSchema.updateElement();
  }
  doSerialize(writer, document, options);
 }
}

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

protected void doSave(Writer writer, Map<?, ?> options) throws IOException
{
 XSDSchema xsdSchema = getSchema();
 if (xsdSchema != null)
 {
  Document document = xsdSchema.getDocument();
  if (document == null)
  {
   xsdSchema.updateDocument();
   document = xsdSchema.getDocument();
  }
  if (xsdSchema.getElement() == null)
  {
   xsdSchema.updateElement();
  }
  doSerialize(writer, document, options);
 }
}

代码示例来源:origin: org.geoserver/gs-wfs

protected void doWrite(
    FeatureTypeInfo[] featureTypeInfos, OutputStream output, Operation describeFeatureType)
    throws IOException {
  // create the schema
  Object request = describeFeatureType.getParameters()[0];
  DescribeFeatureTypeRequest req = DescribeFeatureTypeRequest.adapt(request);
  XSDSchema schema = schemaBuilder.build(featureTypeInfos, req.getBaseURL());
  // serialize
  schema.updateElement();
  final String encoding = gs.getSettings().getCharset();
  XSDResourceImpl.serialize(output, schema.getElement(), encoding);
}

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

public void run(){
  if(fSelectedComponent == null){
    return;
  }
  
  if(fSelectedComponent.getSchema() == null){
    getSchema().updateElement(true);
  }
  DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement().getOwnerDocument();
  doc.getModel().beginRecording(
          this,
          RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text);
  MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(
      fSelectedComponent, getNewDefaultName());
  command.run();
  doc.getModel().endRecording(this);
}

代码示例来源:origin: org.geoserver/gs-wfs

private void buildSchemaContent(
    FeatureTypeInfo featureTypeMeta, XSDSchema schema, XSDFactory factory, String baseUrl)
    throws IOException {
  if (!findTypeInSchema(featureTypeMeta, schema, factory)) {
    // build the type manually
    FeatureType featureType = featureTypeMeta.getFeatureType();
    if (featureTypeMeta.isCircularArcPresent() && this.getClass().equals(GML3.class)) {
      featureType = new CurveTypeWrapper(featureType);
    }
    XSDComplexTypeDefinition xsdComplexType =
        buildComplexSchemaContent(featureType, schema, factory);
    XSDElementDeclaration element = factory.createXSDElementDeclaration();
    element.setName(featureTypeMeta.getName());
    element.setTargetNamespace(featureTypeMeta.getNamespace().getURI());
    synchronized (Schemas.class) {
      // this call changes the global schemas too, need to be synchronized
      element.setSubstitutionGroupAffiliation(getFeatureElement());
    }
    element.setTypeDefinition(xsdComplexType);
    schema.getContents().add(element);
    schema.updateElement();
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

schema.updateElement();

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

@Override
protected void doSave(OutputStream os, Map<?, ?> options) throws IOException
{
 if (os instanceof URIConverter.WriteableOutputStream)
 {
  doSave(((URIConverter.WriteableOutputStream)os).asWriter(), options);
 }
 else
 {
  XSDSchema xsdSchema = getSchema();
  if (xsdSchema != null)
  {
   Document document = xsdSchema.getDocument();
   if (document == null)
   {
    xsdSchema.updateDocument();
    document = xsdSchema.getDocument();
   }

   if (xsdSchema.getElement() == null)
   {
    xsdSchema.updateElement();
   }

   doSerialize(os, document, options);
  }
 }
}

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

@Override
protected void doSave(OutputStream os, Map<?, ?> options) throws IOException
{
 if (os instanceof URIConverter.WriteableOutputStream)
 {
  doSave(((URIConverter.WriteableOutputStream)os).asWriter(), options);
 }
 else
 {
  XSDSchema xsdSchema = getSchema();
  if (xsdSchema != null)
  {
   Document document = xsdSchema.getDocument();
   if (document == null)
   {
    xsdSchema.updateDocument();
    document = xsdSchema.getDocument();
   }

   if (xsdSchema.getElement() == null)
   {
    xsdSchema.updateElement();
   }

   doSerialize(os, document, options);
  }
 }
}

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

public void run1() {
  
  if(fSelectedComponent == null){
    return;
  }
  
  if(fSelectedComponent.getSchema() == null){
    getSchema().updateElement(true);
  }
  MakeTypeGlobalProcessor processor = new MakeTypeGlobalProcessor(fSelectedComponent, getNewDefaultName());
  RenameRefactoring refactoring = new RenameRefactoring(processor);
  try {
    RefactoringWizard wizard = new RenameRefactoringWizard(
        refactoring,
        RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle, // TODO: provide correct strings
        RefactoringWizardMessages.RenameComponentWizard_inputPage_description, null);
    RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
    op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
    //triggerBuild();
  } catch (InterruptedException e) {
    // do nothing. User action got cancelled
  }
  
}

代码示例来源:origin: org.geoserver/gs-wfs

schema.updateElement();
schema.updateElement();

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

xsdSchema.updateElement();

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

xsdSchema.updateElement();

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

getSchema().updateElement(true);

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

container.getSchema().updateElement(true);
formatChild(elementDecl.getElement());

相关文章

微信公众号

最新文章

更多