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

Java XSSimpleTypeDecl类代码示例

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

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



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

示例1: isDerivedFrom

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
/**
 * Introduced in DOM Level 2. <p>
 * Checks if a type is derived from another by restriction. See:
 * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
 * 
 * @param typeNamespaceArg 
 *        The namspace of the ancestor type declaration
 * @param typeNameArg
 *        The name of the ancestor type declaration
 * @param derivationMethod
 *        The derivation method
 * 
 * @return boolean True if the type is derived by restriciton for the
 *         reference type
 */
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, 
        int derivationMethod) {
    if(needsSyncData()) {
        synchronizeData();
    }
    if (type != null) {
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        }
    }
    return false;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:32,代码来源:ElementNSImpl.java


示例2: toString

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
@Override
public String toString()
{
	StringBuffer rtBuffer=new StringBuffer();
	if (getCoreObject()==null)
		return null;
	if (getCoreObject().getNamespace()!=null)
		rtBuffer.append(getCoreObject().getNamespace()+":");
	rtBuffer.append(getCoreObject().getName());
	if (getCoreObject() instanceof XSElementDecl)
		rtBuffer.append(" (Element)");
	else if (getCoreObject() instanceof XSComplexTypeDecl)
		rtBuffer.append(" (Complex Type)");
	else if (getCoreObject() instanceof XSSimpleTypeDecl)
		rtBuffer.append(" (Smple Type)");
	else
		rtBuffer.append(" (Unknown)");
	

	return rtBuffer.toString();
}
 
开发者ID:NCIP,项目名称:caadapter,代码行数:22,代码来源:CellRenderXSObject.java


示例3: getTypeName

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
/**
 * @see org.w3c.dom.TypeInfo#getTypeName()
 */
public String getTypeName() {
    if (type !=null){
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).getTypeName();
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).getTypeName();
        }
    }
    return null;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:14,代码来源:ElementNSImpl.java


示例4: getTypeName

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
/**
 * @see org.w3c.dom.TypeInfo#getTypeName()
 */
public String getTypeName() {
    if (type !=null){
        if (type instanceof XSSimpleTypeDecl){
            return ((XSSimpleTypeDecl)type).getName();
        }
        return (String)type;
    }
    return null;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:13,代码来源:AttrNSImpl.java


示例5: getTypeNamespace

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
/**
 * @see org.w3c.dom.TypeInfo#getTypeNamespace()
 */
public String getTypeNamespace() {
    if (type !=null) {
        if (type instanceof XSSimpleTypeDecl){
            return ((XSSimpleTypeDecl)type).getNamespace();
        }
        return DTD_URI;
    }
    return null;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:13,代码来源:AttrNSImpl.java


示例6: getSimpleTypeDecl

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
public final XSSimpleTypeDecl getSimpleTypeDecl(){
    int     chunk       = fSTDeclIndex >> CHUNK_SHIFT;
    int     index       = fSTDeclIndex &  CHUNK_MASK;
    ensureSTDeclCapacity(chunk);
    if (fSTDecl[chunk][index] == null) {
        fSTDecl[chunk][index] = dvFactory.newXSSimpleTypeDecl();
    } else {
        fSTDecl[chunk][index].reset();
    }
    fSTDeclIndex++;
    return fSTDecl[chunk][index];

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:14,代码来源:XSDeclarationPool.java


示例7: ensureSTDeclCapacity

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
private boolean ensureSTDeclCapacity(int chunk) {
    if (chunk >= fSTDecl.length) {
        fSTDecl = resize(fSTDecl, fSTDecl.length * 2);
    } else if (fSTDecl[chunk] != null) {
        return false;
    }

    fSTDecl[chunk] = new XSSimpleTypeDecl[CHUNK_SIZE];
    return true;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:11,代码来源:XSDeclarationPool.java


示例8: traverseLocal

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
XSSimpleType traverseLocal(Element elmNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {
    
    // General Attribute Checking
    Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
    String name = genAnonTypeName(elmNode);
    XSSimpleType type = getSimpleType (name, elmNode, attrValues, schemaDoc, grammar);
    if (type instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl)type).setAnonymous(true);
    }
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);
    
    return type;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:16,代码来源:XSDSimpleTypeTraverser.java


示例9: expandRelatedTypeComponents

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Hashtable dependencies) {
    if (type instanceof XSComplexTypeDecl) {
        expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
    }
    else if (type instanceof XSSimpleTypeDecl) {
        expandRelatedSimpleTypeComponents((XSSimpleTypeDefinition) type, componentList, namespace, dependencies);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:9,代码来源:XSDHandler.java


示例10: addGlobalTypeDecl

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
/**
 * register one global type
 */
public void addGlobalTypeDecl(XSTypeDefinition decl) {
    fGlobalTypeDecls.put(decl.getName(), decl);
    if (decl instanceof XSComplexTypeDecl) {
        ((XSComplexTypeDecl) decl).setNamespaceItem(this);
    }
    else if (decl instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:13,代码来源:SchemaGrammar.java


示例11: addGlobalSimpleTypeDecl

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
/**
 * register one global simple type
 */
public void addGlobalSimpleTypeDecl(XSSimpleType decl) {
    fGlobalTypeDecls.put(decl.getName(), decl);
    if (decl instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:10,代码来源:SchemaGrammar.java


示例12: compareTo

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
public int compareTo(Object arg0) {
	// TODO Auto-generated method stub
	XSObject toCompareObj=((CellRenderXSObject)arg0).getCoreObject();
	if (getCoreObject()==null|toCompareObj==null)
		return 0;
	if (getCoreObject() instanceof XSElementDecl)
	{
		if (toCompareObj instanceof XSElementDecl)
			return this.toString().compareTo(arg0.toString());
		else
			return -1;
		
	}
	else if (getCoreObject() instanceof XSComplexTypeDecl)
	{
		if (toCompareObj instanceof XSElementDecl)
			return 1;
		else if (toCompareObj instanceof XSComplexTypeDecl)
			return this.toString().compareTo(arg0.toString());
		else
			return -1;
	}
	else if (getCoreObject() instanceof XSSimpleTypeDecl)
	{
		if (toCompareObj instanceof XSSimpleTypeDecl)
			return this.toString().compareTo(arg0.toString());
		else
			return 1;
	}
	else
		return this.toString().compareTo(arg0.toString());
//	return 0;
}
 
开发者ID:NCIP,项目名称:caadapter,代码行数:34,代码来源:CellRenderXSObject.java


示例13: resize

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
private static XSSimpleTypeDecl[][] resize(XSSimpleTypeDecl array[][], int newsize) {
    XSSimpleTypeDecl newarray[][] = new XSSimpleTypeDecl[newsize][];
    System.arraycopy(array, 0, newarray, 0, array.length);
    return newarray;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:6,代码来源:XSDeclarationPool.java


示例14: isDerivedByRestriction

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
/**
 * Checks if a type is derived from another by restriction. See:
 * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
 * 
 * @param ancestorNS
 *            The namspace of the ancestor type declaration
 * @param ancestorName
 *            The name of the ancestor type declaration
 * @param derivationMethod
 *            A short indication the method of derivation *
 * @param type
 *            The reference type definition
 * 
 * @return boolean True if the type is derived by restriciton for the
 *         reference type
 */
private boolean isDerivedByRestriction(String ancestorNS,
        String ancestorName, int derivationMethod, XSTypeDefinition type) {
    
    XSTypeDefinition oldType = null;
    while (type != null && type != oldType) {
        
        // ancestor is anySimpleType, return false
        if (ancestorNS != null
                && ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
                && ancestorName.equals(SchemaSymbols.ATTVAL_ANYSIMPLETYPE)) {
            return false;
        }
        
        // if the name and namespace of this type is the same as the
        // ancestor return true
        if ((ancestorName.equals(type.getName()))
                && (ancestorNS != null && ancestorNS.equals(type.getNamespace())) 
                        || ((type.getNamespace() == null && ancestorNS == null))) {
            
            return true;
        }
        
        // If the base type is a complexType with simpleContent
        if (type instanceof XSSimpleTypeDecl) {
            if (ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
                    && ancestorName.equals(SchemaSymbols.ATTVAL_ANYTYPE)) {
                ancestorName = SchemaSymbols.ATTVAL_ANYSIMPLETYPE;
            }
            return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(ancestorNS,
                    ancestorName, derivationMethod);
        } else {
            // If the base type is a complex type
            // Every derivation step till the base type should be
            // restriction. If not return false
            if (((XSComplexTypeDecl) type).getDerivationMethod() != XSConstants.DERIVATION_RESTRICTION) {
                return false;
            }
        }
        oldType = type;
        type = type.getBaseType();
        
    }
    
    return false;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:62,代码来源:XSComplexTypeDecl.java


示例15: isDerivedByExtension

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
/**
 * Checks if a type is derived from another by extension. See:
 * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
 * 
 * @param ancestorNS
 *            The namspace of the ancestor type declaration
 * @param ancestorName
 *            The name of the ancestor type declaration
 * @param derivationMethod
 *            A short indication the method of derivation
 * @param type
 *            The reference type definition
 * 
 * @return boolean True if the type is derived by extension for the
 *         reference type
 */
private boolean isDerivedByExtension(String ancestorNS,
        String ancestorName, int derivationMethod, XSTypeDefinition type) {
    
    boolean extension = false;
    XSTypeDefinition oldType = null;
    while (type != null && type != oldType) {
        // If ancestor is anySimpleType return false.
        if (ancestorNS != null
                && ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
                && ancestorName.equals(SchemaSymbols.ATTVAL_ANYSIMPLETYPE)
                && SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(type.getNamespace())
                        && SchemaSymbols.ATTVAL_ANYTYPE.equals(type.getName())) {
            break;
        }
        
        if ((ancestorName.equals(type.getName()))
                && ((ancestorNS == null && type.getNamespace() == null) 
                    || (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) {
            // returns true if atleast one derivation step was extension
            return extension;
        }
        
        // If the base type is a complexType with simpleContent
        if (type instanceof XSSimpleTypeDecl) {
            if (ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
                    && ancestorName.equals(SchemaSymbols.ATTVAL_ANYTYPE)) {
                ancestorName = SchemaSymbols.ATTVAL_ANYSIMPLETYPE;
            }
            
            // derivationMethod extension will always return false for a
            // simpleType,
            // we treat it like a restriction
            if ((derivationMethod & DERIVATION_EXTENSION) != 0) {
                return extension
                & ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                        ancestorNS, ancestorName,
                        (derivationMethod & DERIVATION_RESTRICTION));
            } else {
                return extension
                & ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                        ancestorNS, ancestorName, derivationMethod);
            }
            
        } else {
            // If the base type is a complex type
            // At least one derivation step upto the ancestor type should be
            // extension.
            if (((XSComplexTypeDecl) type).getDerivationMethod() == XSConstants.DERIVATION_EXTENSION) {
                extension = extension | true;
            }
        }
        oldType = type;
        type = type.getBaseType();
    }
    
    return false;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:74,代码来源:XSComplexTypeDecl.java


示例16: isDerivedFrom

import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; //导入依赖的package包/类
/**
 * Introduced in DOM Level 3. <p>
 * Checks if a type is derived from another by restriction. See:
 * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
 * 
 * @param typeNamespaceArg 
 *        The namspace of the ancestor type declaration
 * @param typeNameArg
 *        The name of the ancestor type declaration
 * @param derivationMethod
 *        The derivation method
 * 
 * @return boolean True if the type is derived by restriciton for the
 *         reference type
 */
public boolean isDerivedFrom(String typeNamespaceArg, 
                             String typeNameArg, 
                             int derivationMethod) {
    if (type != null) {
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        }    
    } 
    return false;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:27,代码来源:AttrNSImpl.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ConnectorProvider类代码示例发布时间:2022-05-22
下一篇:
Java Storage类代码示例发布时间: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