本文整理了Java中org.eclipse.xsd.XSDSchema.getContents()
方法的一些代码示例,展示了XSDSchema.getContents()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDSchema.getContents()
方法的具体详情如下:
包路径:org.eclipse.xsd.XSDSchema
类名称:XSDSchema
方法名:getContents
[英]Returns the value of the 'Contents' containment reference list. The list contents are of type org.eclipse.xsd.XSDSchemaContent.
This concrete reference represents the contents defined within the body of a schema element.
[中]返回“Contents”包含引用列表的值。列表内容的类型为org。日食xsd。XSDSchemaContent。
这个具体的引用表示在{$0$}元素的主体中定义的内容。
代码示例来源:origin: geotools/geotools
protected Collection find(Class c) {
ArrayList found = new ArrayList();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
List content = schema.getContents();
for (Iterator itr = content.iterator(); itr.hasNext(); ) {
Object o = itr.next();
if (c.isAssignableFrom(o.getClass())) {
found.add(o);
}
}
}
return found;
}
代码示例来源:origin: geotools/geotools
schema = (XSDSchema) queue.removeFirst();
List contents = schema.getContents();
代码示例来源:origin: geotools/geotools
schema = (XSDSchema) queue.removeFirst();
List contents = schema.getContents();
代码示例来源:origin: geotools/geotools
schema.getContents().add(imprt);
代码示例来源:origin: geotools/geotools
for (XSDSchemaContent content : schema.getContents()) {
if (content instanceof XSDSchemaDirective) {
XSDSchemaDirective directive = (XSDSchemaDirective) content;
代码示例来源:origin: geotools/geotools
gml.setSchemaLocation(baseURL.toString() + "/" + gmlLocation);
gml.setResolvedSchema(gmlConfiguration.getXSD().getSchema());
xsd.getContents().add(gml);
xsd.getContents().add(element);
xsd.updateElement();
return xsd;
代码示例来源:origin: geotools/geotools
xsd.getContents().add(definition);
代码示例来源:origin: org.geotools.xsd/gt-core
protected Collection find(Class c) {
ArrayList found = new ArrayList();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
List content = schema.getContents();
for (Iterator itr = content.iterator(); itr.hasNext();) {
Object o = itr.next();
if (c.isAssignableFrom(o.getClass())) {
found.add(o);
}
}
}
return found;
}
代码示例来源:origin: org.geotools/gt2-xml-core
protected Collection find(Class c) {
ArrayList found = new ArrayList();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
List content = schema.getContents();
for (Iterator itr = content.iterator(); itr.hasNext();) {
Object o = itr.next();
if (c.isAssignableFrom(o.getClass())) {
found.add(o);
}
}
}
return found;
}
代码示例来源:origin: org.geotools/gt2-xml-xsd
protected Collection find(Class c) {
ArrayList found = new ArrayList();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
List content = schema.getContents();
for (Iterator itr = content.iterator(); itr.hasNext();) {
Object o = itr.next();
if (c.isAssignableFrom(o.getClass())) {
found.add(o);
}
}
}
return found;
}
代码示例来源:origin: org.geoserver/gs-wfs
/**
* Add include statement to schema.
*
* @param schema Output schema
* @param factory XSD factory used to produce schema
* @param schemaLocation The schema location to be included
*/
private void addInclude(XSDSchema schema, XSDFactory factory, String schemaLocation) {
XSDInclude xsdInclude = factory.createXSDInclude();
xsdInclude.setSchemaLocation(schemaLocation);
schema.getContents().add(xsdInclude);
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected void addImport(String namespace, String schemaLocation)
{
XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport();
xsdImport.setNamespace(namespace);
xsdImport.setSchemaLocation(schemaLocation);
xsdSchema.getContents().add(0, xsdImport);
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected void addImport(String namespace, String schemaLocation)
{
XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport();
xsdImport.setNamespace(namespace);
xsdImport.setSchemaLocation(schemaLocation);
xsdSchema.getContents().add(0, xsdImport);
}
代码示例来源:origin: stackoverflow.com
final XSDResourceImpl rsrc = new XSDResourceImpl(URI.createFileURI(xsdFileWithPath));
rsrc.load(new HashMap());
final XSDSchema schema = rsrc.getSchema();
for (Object content : schema.getContents())
{
if (content instanceof XSDImport)
{
XSDImport xsdImport = (XSDImport) content;
xsdImport.resolveTypeDefinition(xsdImport.getNamespace(), "");
}
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected void importXMI()
{
Map<String, String> namespaces = this.xsdSchema.getQNamePrefixToNamespaceMap();
if (namespaces.put(XMI_PREFIX, XMI_URI) == null)
{
XSDImport xmiImport = XSDFactory.eINSTANCE.createXSDImport();
xmiImport.setNamespace(XMI_URI);
xmiImport.setSchemaLocation(EcorePackage.eNS_URI.equals(xsdSchema.getTargetNamespace()) ? XMI_SCHEMA_LOCATION : "platform:/plugin/org.eclipse.emf.ecore/model/" + XMI_SCHEMA_LOCATION);
this.xsdSchema.getContents().add(0, xmiImport);
}
}
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected void importXMI()
{
Map<String, String> namespaces = this.xsdSchema.getQNamePrefixToNamespaceMap();
if (namespaces.put(XMI_PREFIX, XMI_URI) == null)
{
XSDImport xmiImport = XSDFactory.eINSTANCE.createXSDImport();
xmiImport.setNamespace(XMI_URI);
xmiImport.setSchemaLocation(EcorePackage.eNS_URI.equals(xsdSchema.getTargetNamespace()) ? XMI_SCHEMA_LOCATION : "platform:/plugin/org.eclipse.emf.ecore/model/" + XMI_SCHEMA_LOCATION);
this.xsdSchema.getContents().add(0, xmiImport);
}
}
}
代码示例来源:origin: org.geoserver/gs-wfs
protected void importGMLSchema(XSDSchema schema, XSDFactory factory, String baseUrl) {
XSDImport imprt = factory.createXSDImport();
imprt.setNamespace(gmlNamespace);
imprt.setSchemaLocation(ResponseUtils.buildSchemaURL(baseUrl, gmlSchemaLocation));
XSDSchema gmlSchema = gmlSchema();
imprt.setResolvedSchema(gmlSchema);
schema.getContents().add(imprt);
}
代码示例来源: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.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;
}
内容来源于网络,如有侵权,请联系作者删除!