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

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

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

XSDAttributeDeclaration.setName介绍

暂无

代码示例

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

decl.setName(attQName.getLocalPart());
decl.setTargetNamespace(attQName.getNamespaceURI());

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

protected XSDAttributeDeclaration createUnresolvedAttributeDeclaration(String namespace, String localName)
{
 XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 if (localName != null)
 {
  xsdAttributeDeclaration.setName(localName);
 }
 if (namespace != null)
 {
  xsdAttributeDeclaration.setTargetNamespace(namespace);
 }
 xsdAttributeDeclaration.setResolvedAttributeDeclaration(xsdAttributeDeclaration);
 return xsdAttributeDeclaration;
}

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

protected XSDAttributeDeclaration createUnresolvedAttributeDeclaration(String namespace, String localName)
{
 XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 if (localName != null)
 {
  xsdAttributeDeclaration.setName(localName);
 }
 if (namespace != null)
 {
  xsdAttributeDeclaration.setTargetNamespace(namespace);
 }
 xsdAttributeDeclaration.setResolvedAttributeDeclaration(xsdAttributeDeclaration);
 return xsdAttributeDeclaration;
}

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

protected void makeReferenceAttribute(EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attrDecl.setName(getName(reference));
 setReferenceAttribType(attrDecl);
 XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attrUse.setContent(attrDecl);
 xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
 map(attrUse, reference);
}

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

protected void makeReferenceAttribute(EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attrDecl.setName(getName(reference));
 setReferenceAttribType(attrDecl);
 XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attrUse.setContent(attrDecl);
 xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
 map(attrUse, reference);
}

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

attrDecl.setName(localName);

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

protected void createAttributeDeclaration(EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attrDecl.setName(getName(attribute));
 setAttributeType(attribute, attrDecl);
 setDefaultValue(attribute, attrDecl);
 XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 setUseToRequired(attribute, attrUse);
 attrUse.setContent(attrDecl);
 xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
 map(attrUse, attribute);
}

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

protected void createAttributeDeclaration(EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attrDecl.setName(getName(attribute));
 setAttributeType(attribute, attrDecl);
 setDefaultValue(attribute, attrDecl);
 XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 setUseToRequired(attribute, attrUse);
 attrUse.setContent(attrDecl);
 xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
 map(attrUse, attribute);
}

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

attrDecl.setName(localName);

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

protected XSDAttributeUse createAttributeUse(XSDSchema schema, String name, String type, String use, String form, String fixed)
{
 XSDAttributeDeclaration attributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attributeDeclaration.setName(name);
 attributeDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type));
 if ("qualified".equals(form))
 {
  attributeDeclaration.setForm(XSDForm.QUALIFIED_LITERAL);
 }
 XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attributeUse.setContent(attributeDeclaration);
 if ("optional".equals(use))
 {
  attributeUse.setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
 }
 if ("required".equals(use))
 {
  attributeUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
 }
 if (fixed != null)
 {
  attributeUse.setConstraint(XSDConstraint.FIXED_LITERAL);
  attributeUse.setLexicalValue("2.0");
 }
 return attributeUse;
}

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

protected XSDAttributeUse createAttributeUse(XSDSchema schema, String name, String type, String use, String form, String fixed)
{
 XSDAttributeDeclaration attributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attributeDeclaration.setName(name);
 attributeDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type));
 if ("qualified".equals(form))
 {
  attributeDeclaration.setForm(XSDForm.QUALIFIED_LITERAL);
 }
 XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attributeUse.setContent(attributeDeclaration);
 if ("optional".equals(use))
 {
  attributeUse.setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
 }
 if ("required".equals(use))
 {
  attributeUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
 }
 if (fixed != null)
 {
  attributeUse.setConstraint(XSDConstraint.FIXED_LITERAL);
  attributeUse.setLexicalValue("2.0");
 }
 return attributeUse;
}

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

simpleAttributeDeclaration./*{@link XSDNamedComponent#setName */setName/*}*/("simpleAttributeDeclaration");
simpleAttributeDeclaration./*{@link XSDAttributeDeclaration#setTypeDefinition */setTypeDefinition/*}*/
 (prototypeSchema.resolveSimpleTypeDefinition(/*{@link #*/someOtherSchemaURI/*}*/, "someOtherTypeDefinition"));

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

simpleAttributeDeclaration./*{@link XSDNamedComponent#setName */setName/*}*/("simpleAttributeDeclaration");
simpleAttributeDeclaration./*{@link XSDAttributeDeclaration#setTypeDefinition */setTypeDefinition/*}*/
 (prototypeSchema.resolveSimpleTypeDefinition(/*{@link #*/someOtherSchemaURI/*}*/, "someOtherTypeDefinition"));

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

simpleAttributeDeclarationGroupMember./*{@link XSDNamedComponent#setName */setName/*}*/("simpleAttributeDeclarationGroupMember");
simpleAttributeDeclarationGroupMember./*{@link XSDAttributeDeclaration#setTypeDefinition */setTypeDefinition/*}*/
 (prototypeSchema./*{@link XSDConcreteComponent#resolveSimpleTypeDefinition(String, String) */resolveSimpleTypeDefinition/*}*/(/*{@link #*/someOtherSchemaURI/*}*/, "someOtherTypeDefinition"));

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

child.setName(name); 
if (namespace != null)

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

protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature)
{
 XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 xsdAttributeDeclaration.setName(extendedMetaData.getName(eStructuralFeature));
 XSDSimpleTypeDefinition xsdSimpleTypeDefinition = xsdSchema.resolveSimpleTypeDefinitionURI(getURI(eStructuralFeature.getEType()));
 handleImport(xsdSchema, xsdSimpleTypeDefinition);
 xsdAttributeDeclaration.setTypeDefinition(xsdSimpleTypeDefinition);
 String defaultValue = eStructuralFeature.getDefaultValueLiteral();
 if (defaultValue != null)
 {
  xsdAttributeDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL);
  xsdAttributeDeclaration.setLexicalValue(defaultValue);
 }
 xsdSchema.getContents().add(xsdAttributeDeclaration);
 map(xsdAttributeDeclaration, eStructuralFeature);
 if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))
 {
  createEcoreAnnotation(xsdAttributeDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType()));
 }
 buildAnnotations(xsdAttributeDeclaration, eStructuralFeature);
 return xsdAttributeDeclaration;
}

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

protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature)
{
 XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 xsdAttributeDeclaration.setName(extendedMetaData.getName(eStructuralFeature));
 XSDSimpleTypeDefinition xsdSimpleTypeDefinition = xsdSchema.resolveSimpleTypeDefinitionURI(getURI(eStructuralFeature.getEType()));
 handleImport(xsdSchema, xsdSimpleTypeDefinition);
 xsdAttributeDeclaration.setTypeDefinition(xsdSimpleTypeDefinition);
 String defaultValue = eStructuralFeature.getDefaultValueLiteral();
 if (defaultValue != null)
 {
  xsdAttributeDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL);
  xsdAttributeDeclaration.setLexicalValue(transformDefaultValue(xsdAttributeDeclaration.getTypeDefinition(), defaultValue));
 }
 xsdSchema.getContents().add(xsdAttributeDeclaration);
 map(xsdAttributeDeclaration, eStructuralFeature);
 if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))
 {
  createEcoreAnnotation(xsdAttributeDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType()));
 }
 buildAnnotations(xsdAttributeDeclaration, eStructuralFeature);
 return xsdAttributeDeclaration;
}

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

xsdAttributeDeclaration.setName(name);

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

xsdAttributeDeclaration.setName(name);

相关文章

微信公众号

最新文章

更多