• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XSObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.xerces.xs.XSObject的典型用法代码示例。如果您正苦于以下问题:Java XSObject类的具体用法?Java XSObject怎么用?Java XSObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XSObject类属于org.apache.xerces.xs包,在下文中一共展示了XSObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getNode

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * Returns a schema element XSElementDeclaration with the given local name. (This method is not namespace aware).
 * 
 * @param localName the local name of the node to fine.
 * @return the schema element or null if there is no such named element.
 */
public XSElementDeclaration getNode(String localName) {
   if (null == localName || 0 == localName.trim().length()) {
      return null;
   }
   XSNamedMap map = schemaModel.getComponents(XSConstants.ELEMENT_DECLARATION);
   if (null != map) {
      for (int i = 0; i < map.getLength(); i++) {
         XSObject item = map.item(i);
         if (item instanceof XSElementDeclaration) {
            if (localName.equals(item.getName())) {
               return (XSElementDeclaration) item;
            }
         }
      }
   }
   return null;
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:24,代码来源:SchemaHelper.java


示例2: getSchemaElement

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * Gets an XSObject representing the named schema element.
 * 
 * @param nodeName the name of the schema element.
 * 
 * @return the named schema element.
 */
protected XSObject getSchemaElement(String nodeName) throws Exception {
   List<XSElementDeclaration> namedNodes = new ArrayList<XSElementDeclaration>();
   namedNodes.add(getNode(nodeName));
   if (0 < namedNodes.size()) {
      if (1 < namedNodes.size()) {
         log.debug("Multiple nodes of the name '" + nodeName
                  + "' found in getSchemaElement() method. Returning the last in the list.");
      }
      return namedNodes.get(namedNodes.size()-1);
   }
   else if (namedNodes.isEmpty()) {
      log.warn("No element named '" + nodeName + "' was found in the schema declaration");
   }
   return null;
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:23,代码来源:SchemaLoader.java


示例3: getNode

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * Get an XSElementDeclaration for a named element.
 * 
 * @param nodeName the name of a node.
 * 
 * @return the element XSElementDeclaration.
 */
protected XSElementDeclaration getNode(String nodeName) {
   XSNamedMap map = xsModel.getComponents(XSConstants.ELEMENT_DECLARATION);
   if (map.getLength() != 0) {
      for (int i = 0; i < map.getLength(); i++) {
         XSObject item = map.item(i);
         if (item instanceof XSElementDeclaration) {
            String nextName = item.getName();
            if (nextName.equals(nodeName)) {
               return (XSElementDeclaration) item;
            }
         }
      }
   }
   return null;
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:23,代码来源:SchemaLoader.java


示例4: expandComponents

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
private Vector expandComponents(XSObject[] components, Hashtable dependencies) {
    Vector newComponents = new Vector();
    
    for (int i=0; i<components.length; i++) {
        if (!newComponents.contains(components[i])) {
            newComponents.add(components[i]);
        }
    }
    
    for (int i=0; i<newComponents.size(); i++) {
        final XSObject component = (XSObject) newComponents.elementAt(i);
        expandRelatedComponents(component, newComponents, dependencies);
    }
    
    return newComponents;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:17,代码来源:XSDHandler.java


示例5: expandRelatedComponents

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
private void expandRelatedComponents(XSObject component, Vector componentList, Hashtable dependencies) {
    short componentType = component.getType();
    switch (componentType) {
    case XSConstants.TYPE_DEFINITION :
        expandRelatedTypeComponents((XSTypeDefinition) component, componentList, component.getNamespace(), dependencies);
        break;
    case XSConstants.ATTRIBUTE_DECLARATION :
        expandRelatedAttributeComponents((XSAttributeDeclaration) component, componentList, component.getNamespace(), dependencies);
        break;
    case XSConstants.ATTRIBUTE_GROUP :
        expandRelatedAttributeGroupComponents((XSAttributeGroupDefinition) component, componentList, component.getNamespace(), dependencies);
    case XSConstants.ELEMENT_DECLARATION :
        expandRelatedElementComponents((XSElementDeclaration) component, componentList, component.getNamespace(), dependencies);
        break;
    case XSConstants.MODEL_GROUP_DEFINITION :
        expandRelatedModelGroupDefinitionComponents((XSModelGroupDefinition) component, componentList, component.getNamespace(), dependencies);
    case XSConstants.ATTRIBUTE_USE :
        //expandRelatedAttributeUseComponents((XSAttributeUse)component, componentList, dependencies);
    case XSConstants.NOTATION_DECLARATION :
    case XSConstants.IDENTITY_CONSTRAINT :
    default :
        break;
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:25,代码来源:XSDHandler.java


示例6: getGlobalElements

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
private XSObjectListImpl getGlobalElements() {
    final SymbolHash[] tables = new SymbolHash[fGrammarCount];
    int length = 0;

    for (int i = 0; i < fGrammarCount; i++) {
        tables[i] = fGrammarList[i].fAllGlobalElemDecls;
        length += tables[i].getLength();
    }
    
    if (length == 0) {
        return XSObjectListImpl.EMPTY_LIST;
    }

    final XSObject[] components = new XSObject[length];
    
    int start = 0;
    for (int i = 0; i < fGrammarCount; i++) {
        tables[i].getValues(components, start);
        start += tables[i].getLength();
    }

    return new XSObjectListImpl(components, length);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:24,代码来源:XSModelImpl.java


示例7: XSNamedMapImpl

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * Construct an XSNamedMap implementation one namespace from an array
 * 
 * @param array     containing all components
 * @param length    number of components
 */
public XSNamedMapImpl(XSObject[] array, int length) {
    if (length == 0) {
        fNamespaces = null;
        fMaps = null;
        fNSNum = 0;
        fArray = array;
        fLength = 0;
        return;
    }
    // because all components are from the same target namesapce,
    // get the namespace from the first one.
    fNamespaces = new String[]{array[0].getNamespace()};
    fMaps = null;
    fNSNum = 1;
    // copy elements to the Vector
    fArray = array;
    fLength = length;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:25,代码来源:XSNamedMapImpl.java


示例8: itemByName

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * Retrieves an <code>XSObject</code> specified by local name and 
 * namespace URI.
 * <br>Per XML Namespaces, applications must use the value <code>null</code> as the 
 * <code>namespace</code> parameter for methods if they wish to specify 
 * no namespace.
 * @param namespace The namespace URI of the <code>XSObject</code> to 
 *   retrieve, or <code>null</code> if the <code>XSObject</code> has no 
 *   namespace. 
 * @param localName The local name of the <code>XSObject</code> to 
 *   retrieve.
 * @return A <code>XSObject</code> (of any type) with the specified local 
 *   name and namespace URI, or <code>null</code> if they do not 
 *   identify any object in this map.
 */
public XSObject itemByName(String namespace, String localName) {
    for (int i = 0; i < fNSNum; i++) {
        if (isEqual(namespace, fNamespaces[i])) {
            // when this map is created from SymbolHash's
            // get the component from SymbolHash
            if (fMaps != null) {
                return (XSObject)fMaps[i].get(localName);
            }
            // Otherwise (it's created from an array)
            // go through the array to find a matching name
            XSObject ret;
            for (int j = 0; j < fLength; j++) {
                ret = fArray[j];
                if (ret.getName().equals(localName)) {
                    return ret;
                }
            }
            return null;
        }
    }
    return null;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:38,代码来源:XSNamedMapImpl.java


示例9: item

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * Returns the <code>index</code>th item in the collection or 
 * <code>null</code> if <code>index</code> is greater than or equal to 
 * the number of objects in the list. The index starts at 0. 
 * @param index  index into the collection. 
 * @return  The <code>XSObject</code> at the <code>index</code>th 
 *   position in the <code>XSObjectList</code>, or <code>null</code> if 
 *   the index specified is not valid. 
 */
public synchronized XSObject item(int index) {
    if (fArray == null) {
        // calculate the total number of elements
        getLength();
        fArray = new XSObject[fLength];
        int pos = 0;
        // get components from all SymbolHashes
        for (int i = 0; i < fNSNum; i++) {
            pos += fMaps[i].getValues(fArray, pos);
        }
    }
    if (index < 0 || index >= fLength) {
        return null;
    }
    return fArray[index];
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:26,代码来源:XSNamedMapImpl.java


示例10: createID

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
private String createID(XSObject obj) {
    String namespace = obj.getNamespace();
    String prefix = fNamespaceContext.getPrefix(obj.getNamespace());
    String name = obj.getName();
    String type = this.translateType(obj.getType());

    // must be anonymous
    if (name == null) {
        name = "anon_" + fAnonNum++;
    }
    // no namespace
    else if (namespace == null || namespace == XMLSymbols.EMPTY_STRING) {
        name = name + "." + fAnonNum++;
    }

    if (namespace == Constants.NS_XMLSCHEMA) {
        return name;
    }
    else {
        return (prefix == null ? "" : prefix + ".") + type + "." + name;
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:23,代码来源:PSVIWriter.java


示例11: toDefXmlTagName

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
public static String toDefXmlTagName(XSObject xs) {
    String xmlName = xs.getName();
    if (xmlName.endsWith(TYPE_SUFFIX)) {
        xmlName = xmlName.substring(0, xmlName.length() - 4);
    }
    return xmlName;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:8,代码来源:Util.java


示例12: toJavaTypeName

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
public String toJavaTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap) {
    String name = xs.getName();
    if (name == null) {
        if (xs instanceof TypeInfo) {
            name = ((TypeInfo) xs).getTypeName();
            if (name != null && name.startsWith("#")) {
                name = name.substring(1);
            }
        }
    }
    return model.toJavaTypeName(name, xs.getNamespace());
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:13,代码来源:XSDModelLoader.java


示例13: initialise

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * Method to initialise the object.
 * 
 * Builds schema (children) and parent tables
 */
protected void initialise() {
   XSNamedMap map = schemaModel.getComponents(XSConstants.ELEMENT_DECLARATION);
   if (map.getLength() != 0) {
      for (int i = 0; i < map.getLength(); i++) {
         XSObject item = map.item(i);
         if (item instanceof XSElementDeclaration) {
            findReference((XSElementDeclaration) item);
         }
      }
   }
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:17,代码来源:SchemaHelper.java


示例14: findReferenceInParticle

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * Finds all the element and complexType references for a particle element and populates a map entry with element
 * names referenced by the element.
 * 
 * @param context the context.
 * @param particle the particle.
 */
private void findReferenceInParticle(String context,
                                     XSParticle particle) {
   if (null != particle) {
      XSTerm term = particle.getTerm();
      if (term instanceof XSModelGroup) {
         XSObjectList xsObjectList = ((XSModelGroup) term).getParticles();
         for (int i = 0; i < xsObjectList.getLength(); i++) {
            XSObject xsObject = xsObjectList.item(i);
            if (xsObject instanceof XSParticle) {
               findReferenceInParticle(context, (XSParticle) xsObject);
            }
         }
      }
      else if (term instanceof XSElementDeclaration) {
         String tName = term.getName();
         addToSchemaMap(context, tName);
         context = tName;
         if (currentNodeNames.contains(tName)) {
            // cyclic reference
            currentNodeNames.add(tName);
            findElementReference(context, (XSElementDeclaration) term);
         }
         else {
            currentNodeNames.add(tName);
            findElementReference(context, (XSElementDeclaration) term);
         }
      }
      // else { // XSWildcard
      // String tName = term.getName();
      // if (tName != null) {
      // addToSchemaTable(aContext, tName);
      // }
      // }
   }
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:43,代码来源:SchemaHelper.java


示例15: getRootSchemaElement

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * Return a an XSObject representing the root schema element.
 * 
 * @param SchemaModel the schema model as built from schema.
 * 
 * @return the root schema element.
 * 
 * @throws Exception if no root element can be located.
 */
protected XSObject getRootSchemaElement() throws Exception {
   if (null != this.xsModel) {
      List<XSElementDeclaration> rootNodes = null;
      if (nodeChoiceList != null) {
         if (soapEnv) {
            rootNodes = referenceNodes.getNodes("Envelope");
         }
         else {
            rootNodes = referenceNodes.getRootNodes(nodeChoiceList);
         }
      }
      else {
         rootNodes = referenceNodes.getRootNodes();
      }
      if (null == rootNodes || rootNodes.isEmpty()) {
     	 log.error("Could not identify a root element.");
      }
      if (0 < rootNodes.size()) {
         if (1 < rootNodes.size()) {
            log.debug("Warning: Multiple root nodes detected in getRootSchemaElement() method. Returning the last in the list.");
         }
         return (XSElementDeclaration) rootNodes.get(rootNodes.size()-1);
      }
   }
   return null;
}
 
开发者ID:mqsysadmin,项目名称:dpdirect,代码行数:36,代码来源:SchemaLoader.java


示例16: parseXbrlSchemaAppInfo

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
private void parseXbrlSchemaAppInfo(XSObjectList annotationList) throws IOException, SAXException{
	for(int i = 0; i < annotationList.getLength(); i++){
		XSObject object = annotationList.item(i);
		//logger.info("annotation: " + ((XSAnnotation)object).getAnnotationString());
		
		((XSAnnotation)object).writeAnnotation(loader, XSAnnotation.SAX_CONTENTHANDLER);
		//((XSAnnotation)object).writeAnnotation(doc, XSAnnotation.W3C_DOM_DOCUMENT);
		
	}
}
 
开发者ID:chen4119,项目名称:tempeh,代码行数:11,代码来源:XbrlElementHandler.java


示例17: checkElementConstraints

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
void checkElementConstraints(XSDSchema xsdSchema, XSElementDeclaration element){
    XSNamedMap constraints = element.getIdentityConstraints();
    for (int i = 0;  i < constraints.getLength();  i++) {
        XSObject constraint = constraints.item(i);
        if (logger.isDebugEnabled()) logger.debug(" *** " + constraint + " TYPE: " +constraint.getType());
        if (constraint instanceof UniqueOrKey) {
            processUniqueOrKeyConstraint(xsdSchema, (UniqueOrKey)constraint);
        }
        if (constraint instanceof KeyRef) {
            processForeignkeyConstraint(xsdSchema, (KeyRef)constraint);
        }
    }
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:14,代码来源:LoadXsdConstraints.java


示例18: analyzeModelGroup

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
private void analyzeModelGroup(IXSDNode currentNode, XSParticleDecl fatherParticle, XSModelGroupImpl currentTerm) {
    IXSDNode typeCompositor = createTypeCompositor(currentTerm);
    setCardinality(typeCompositor, fatherParticle);
    currentNode.addChild(typeCompositor);
    XSObjectList  childrenParticles = currentTerm.getParticles();
    if (logger.isDebugEnabled()) logger.debug("Particles size = " +  childrenParticles.getLength());
    for (int i = 0; i < childrenParticles.getLength(); i++) {
        XSObject xsObject = childrenParticles.item(i);
        if (logger.isDebugEnabled()) logger.debug("Particle object: " + xsObject);
        XSParticleDecl particle = (XSParticleDecl)xsObject;
        analyzeParticle(typeCompositor, fatherParticle, particle);
    }
    checkMixedContent(typeCompositor);
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:15,代码来源:GenerateXSDNodeTree.java


示例19: getSchemaDocument

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
/**
 * getSchemaDocument method uses XMLInputSource to parse a schema document.
 * @param schemaNamespace
 * @param schemaSource
 * @param mustResolve
 * @param referType
 * @param referElement
 * @return A schema Element.
 */
private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {

    SchemaGrammar[] grammars = schemaSource.getGrammars();
    short referType = desc.getContextType();
    
    if (grammars != null && grammars.length > 0) {
        Vector expandedGrammars = expandGrammars(grammars);
        // check for existing grammars in our bucket
        // and if there exist any, and namespace growth is
        // not enabled - we do nothing
        if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
            addGrammars(expandedGrammars);
            if (referType == XSDDescription.CONTEXT_PREPARSE) {
                desc.setTargetNamespace(grammars[0].getTargetNamespace());
            }
        }
    }
    else {
        XSObject[] components = schemaSource.getComponents();
        if (components != null && components.length > 0) {
            Hashtable importDependencies = new Hashtable();
            Vector expandedComponents = expandComponents(components, importDependencies);
            if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
                addGlobalComponents(expandedComponents, importDependencies);
                if (referType == XSDDescription.CONTEXT_PREPARSE) {
                    desc.setTargetNamespace(components[0].getNamespace());
                }
            }
        }
    }
    return null;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:42,代码来源:XSDHandler.java


示例20: canAddComponents

import org.apache.xerces.xs.XSObject; //导入依赖的package包/类
private boolean canAddComponents(Vector components) {
    final int size = components.size();
    final XSDDescription desc = new XSDDescription(); 
    for (int i=0; i<size; i++) {
        XSObject component = (XSObject) components.elementAt(i);
        if (!canAddComponent(component, desc)) {
            return false;
        }
    }
    return true;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:12,代码来源:XSDHandler.java



注:本文中的org.apache.xerces.xs.XSObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LongColumnVector类代码示例发布时间:2022-05-22
下一篇:
Java NMAuditLogger类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap