本文整理了Java中org.eclipse.xsd.XSDElementDeclaration.setTypeDefinition()
方法的一些代码示例,展示了XSDElementDeclaration.setTypeDefinition()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDElementDeclaration.setTypeDefinition()
方法的具体详情如下:
包路径:org.eclipse.xsd.XSDElementDeclaration
类名称:XSDElementDeclaration
方法名:setTypeDefinition
[英]Sets the value of the ' org.eclipse.xsd.XSDElementDeclaration#getTypeDefinition' reference.
[中]设置“组织”的值。日食xsd。XSDElementDeclaration#getTypeDefinition'引用。
代码示例来源:origin: geotools/geotools
public ElementInstance element(String text, QName qname) {
// create a fake element declaration and element instance
XSDElementDeclaration declaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
declaration.setTypeDefinition(xsdSimple(qname.getLocalPart()));
ElementInstance element = new ElementImpl(declaration);
element.setText(text);
return element;
}
代码示例来源:origin: geotools/geotools
Class binding = attribute.getType().getBinding();
if (Point.class.isAssignableFrom(binding)) {
element.setTypeDefinition(
schemaIndex.getTypeDefinition(gml.qName("PointPropertyType")));
} else if (LineString.class.isAssignableFrom(binding)) {
element.setTypeDefinition(
searchType(schemaIndex, "LineStringPropertyType", "CurvePropertyType"));
} else if (Polygon.class.isAssignableFrom(binding)) {
element.setTypeDefinition(
searchType(schemaIndex, "PolygonPropertyType", "SurfacePropertyType"));
} else if (MultiPoint.class.isAssignableFrom(binding)) {
element.setTypeDefinition(
schemaIndex.getTypeDefinition(gml.qName("MultiPointPropertyType")));
} else if (MultiLineString.class.isAssignableFrom(binding)) {
element.setTypeDefinition(
searchType(
schemaIndex,
element.setTypeDefinition(
searchType(
schemaIndex,
"MultiSurfacePropertyType"));
} else {
element.setTypeDefinition(
schemaIndex.getTypeDefinition(gml.qName("GeometryPropertyType")));
代码示例来源:origin: geotools/geotools
root.setName(name.getLocalPart());
root.setTargetNamespace(name.getNamespaceURI());
root.setTypeDefinition(type);
代码示例来源:origin: geotools/geotools
element.setTypeDefinition(featureType);
xsd.getContents().add(element);
xsd.updateElement();
代码示例来源:origin: geotools/geotools
decl.setTypeDefinition(type);
} else {
decl.setTypeDefinition(type);
代码示例来源:origin: geotools/geotools
XSDParticle particle(Attribute att) {
XSDFactory factory = XSDFactory.eINSTANCE;
AttributeType attType = att.getType();
XSDTypeDefinition xsdType =
schemaIndex.getTypeDefinition(
new QName(
attType.getName().getNamespaceURI(),
attType.getName().getLocalPart()));
XSDElementDeclaration element = factory.createXSDElementDeclaration();
element.setName(att.getName().getLocalPart());
element.setTargetNamespace(att.getName().getNamespaceURI());
element.setTypeDefinition(xsdType);
XSDParticle particle = factory.createXSDParticle();
particle.setContent(element);
return particle;
}
}
代码示例来源:origin: geotools/geotools
attribute.setTypeDefinition(attributeDefinition);
代码示例来源:origin: geotools/geotools
public FeatureTypeContext(SimpleFeature f, GMLDelegate gml) {
this.featureType = f.getFeatureType();
QName featureName =
new QName(
featureType.getName().getNamespaceURI(),
featureType.getName().getLocalPart());
// look up the element in the schema
XSDElementDeclaration element =
encoder.getSchemaIndex().getElementDeclaration(featureName);
if (element == null) {
// create one
element = XSDFactory.eINSTANCE.createXSDElementDeclaration();
element.setName(featureType.getName().getLocalPart());
element.setTargetNamespace(featureType.getName().getNamespaceURI());
element.setTypeDefinition(
encoder.getSchemaIndex().getTypeDefinition(GML.AbstractFeatureType));
}
// look up all the bindings for each property
BindingLoader bindingLoader = encoder.getBindingLoader();
// get all the properties
List properties = gml.getFeatureProperties(f, element, encoder);
attributes = setupAttributeContexts(properties, featureType, bindingLoader);
featureQualifiedName = getFeatureQualifiedName(featureName);
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
protected void setElementType(XSDElementDeclaration ed)
{
ed = ed.getResolvedElementDeclaration();
if (ed != null)
{
ed.setTypeDefinition(newType);
}
}
代码示例来源:origin: geotools/geotools
element.setTypeDefinition(itemType);
代码示例来源: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.xsd/org.eclipse.xsd
@Override
protected void setReferenceElementType(EReference reference, XSDElementDeclaration xsdElementDeclaration)
{
if (reference.getEType() != null)
{
super.setReferenceElementType(reference, xsdElementDeclaration);
}
else
{
importXMI();
xsdElementDeclaration.setTypeDefinition(xsdElementDeclaration.resolveSimpleTypeDefinition(XMI_URI, "Any"));
}
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
@Override
protected void setReferenceElementType(EReference reference, XSDElementDeclaration xsdElementDeclaration)
{
if (reference.getEType() != null)
{
super.setReferenceElementType(reference, xsdElementDeclaration);
}
else
{
importXMI();
xsdElementDeclaration.setTypeDefinition(xsdElementDeclaration.resolveSimpleTypeDefinition(XMI_URI, "Any"));
}
}
代码示例来源: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 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
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EClass eClass)
{
XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
xsdElementDeclaration.setName(extendedMetaData.getName(eClass));
XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eClass));
handleImport(xsdSchema, xsdTypeDefinition);
xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition);
xsdSchema.getContents().add(xsdElementDeclaration);
map(xsdElementDeclaration, eClass);
createEcoreAnnotation(xsdElementDeclaration, "ignore", "true");
return xsdElementDeclaration;
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EClass eClass)
{
XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
xsdElementDeclaration.setName(extendedMetaData.getName(eClass));
XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eClass));
handleImport(xsdSchema, xsdTypeDefinition);
xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition);
xsdSchema.getContents().add(xsdElementDeclaration);
map(xsdElementDeclaration, eClass);
createEcoreAnnotation(xsdElementDeclaration, "ignore", "true");
return xsdElementDeclaration;
}
代码示例来源: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.geoserver/wfsv
static XSDParticle particle(XSDSchema schema, String elementName,
String typeNS, String typeName, boolean nillable, int minOccurs,
int maxOccurs) {
XSDFactory factory = XSDFactory.eINSTANCE;
XSDElementDeclaration element = factory.createXSDElementDeclaration();
element.setName(elementName);
element.setNillable(nillable);
XSDTypeDefinition type = schema.resolveTypeDefinition(typeNS, typeName);
element.setTypeDefinition(type);
XSDParticle particle = factory.createXSDParticle();
particle.setMinOccurs(minOccurs);
particle.setMaxOccurs(maxOccurs);
particle.setContent(element);
return particle;
}
代码示例来源:origin: org.geotools.xsd/gt-xsd-wfs
XSDParticle particle(Attribute att) {
XSDFactory factory = XSDFactory.eINSTANCE;
AttributeType attType = att.getType();
XSDTypeDefinition xsdType = schemaIndex.getTypeDefinition(
new QName(attType.getName().getNamespaceURI(), attType.getName().getLocalPart()));
XSDElementDeclaration element = factory.createXSDElementDeclaration();
element.setName(att.getName().getLocalPart());
element.setTargetNamespace(att.getName().getNamespaceURI());
element.setTypeDefinition(xsdType);
XSDParticle particle = factory.createXSDParticle();
particle.setContent(element);
return particle;
}
内容来源于网络,如有侵权,请联系作者删除!