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

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

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

XSDSchema.getSimpleTypeIdMap介绍

[英]Returns a map from String ID to XSDSimpleTypeDefinitionbased on the IDs in the DOM representation. For the #getSchemaForSchema(), this represents the built-in datatypes.
[中]基于DOM表示中的ID返回从字符串ID到XSDSimpletyPedeFinition的映射。对于#getSchemaForSchema(),这表示built-in datatypes

代码示例

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

/**
 * Limited to a search of simple types, no QName required.
 *
 * @param name
 * @return XSDSimpleTypeDefinition
 */
public XSDSimpleTypeDefinition xsdSimple(String name) {
  Map simpleTypes = xsd.getSimpleTypeIdMap();
  // System.out.println( simpleTypes );
  return (XSDSimpleTypeDefinition) simpleTypes.get(name);
}

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

public ElementInstance element(String text, QName original, String name) {
  try {
    File temp = File.createTempFile("name", "xsd");
    FileWriter file = new FileWriter(temp);
    BufferedWriter buff = new BufferedWriter(file);
    PrintWriter print = new PrintWriter(buff);
    print.println(
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
            + "  <xsd:schema xmlns:my=\"http://mails/refractions/net\""
            + "              xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""
            + "              targetNamespace=\"http://localhost//test\">"
            + "  <xsd:element name=\""
            + name
            + "\" type=\"xsd:"
            + original.getLocalPart()
            + "\"/>"
            + "</xsd:schema>");
    URL url = temp.toURL();
    XSDParser parser = new XSDParser();
    parser.parse(url.toString());
    XSDSchema schema = parser.getSchema();
    Map map = schema.getSimpleTypeIdMap();
    return (ElementInstance) map.get(name);
  } catch (Throwable t) {
    java.util.logging.Logger.getGlobal().log(java.util.logging.Level.INFO, "", t);
    return null;
  }
}

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

(XSDSimpleTypeDefinition)
    XSDUtil.getSchemaForSchema(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001)
        .getSimpleTypeIdMap()
        .get("string");

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

public java.util.List getBuiltInTypeNamesList2()
{
 List result = new ArrayList();
 if (xsdSchema != null)
 {
  List prefixes = getPrefixesForNamespace(xsdSchema.getSchemaForSchemaNamespace());
  XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
  for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
  {
   XSDTypeDefinition td = (XSDTypeDefinition) i.next();  
   String localName = td.getName();
   String prefix = prefixes.size() > 0 ? (String)prefixes.get(0) : null;
   String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName; 
   result.add(prefixedName);        
  }
 }
 return result;
}

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

public java.util.List getBuiltInTypeNamesList()
{
 List items = new ArrayList();
 if (xsdSchema != null)
 {
  String prefix = xsdSchema.getSchemaForSchemaQNamePrefix();
  if (xsdSchema != null)
  {
   XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
   for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
   {
    XSDTypeDefinition td = (XSDTypeDefinition) i.next();  
    String localName = td.getName(); 
    String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName; 
    items.add(prefixedName);        
   }
  }
 }
 return items;
}

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

for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)

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

.getSimpleTypeIdMap()
.get("string");

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

.getSimpleTypeIdMap()
.get("string");

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

.getSimpleTypeIdMap().get( "string" );

相关文章

微信公众号

最新文章

更多