本文整理汇总了Java中com.sun.org.apache.xerces.internal.impl.xs.XSGrammarBucket类的典型用法代码示例。如果您正苦于以下问题:Java XSGrammarBucket类的具体用法?Java XSGrammarBucket怎么用?Java XSGrammarBucket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XSGrammarBucket类属于com.sun.org.apache.xerces.internal.impl.xs包,在下文中一共展示了XSGrammarBucket类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: XSDHandler
import com.sun.org.apache.xerces.internal.impl.xs.XSGrammarBucket; //导入依赖的package包/类
public XSDHandler (XSGrammarBucket gBucket) {
this();
fGrammarBucket = gBucket;
// Note: don't use SchemaConfiguration internally
// we will get stack overflaw because
// XMLSchemaValidator will be instantiating XSDHandler...
fSchemaGrammarDescription = new XSDDescription();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:XSDHandler.java
示例2: refreshGrammars
import com.sun.org.apache.xerces.internal.impl.xs.XSGrammarBucket; //导入依赖的package包/类
public void refreshGrammars(XSGrammarBucket gBucket) {
fGrammarBucket = gBucket;
fInitialGrammarSet = null;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:XSDHandler.java
示例3: checkNonSchemaAttributes
import com.sun.org.apache.xerces.internal.impl.xs.XSGrammarBucket; //导入依赖的package包/类
public void checkNonSchemaAttributes(XSGrammarBucket grammarBucket) {
// for all attributes
Iterator entries = fNonSchemaAttrs.entrySet().iterator();
XSAttributeDecl attrDecl;
while (entries.hasNext()) {
Map.Entry entry = (Map.Entry) entries.next();
// get name, uri, localpart
String attrRName = (String) entry.getKey();
String attrURI = attrRName.substring(0,attrRName.indexOf(','));
String attrLocal = attrRName.substring(attrRName.indexOf(',')+1);
// find associated grammar
SchemaGrammar sGrammar = grammarBucket.getGrammar(attrURI);
if (sGrammar == null) {
continue;
}
// and get the datatype validator, if there is one
attrDecl = sGrammar.getGlobalAttributeDecl(attrLocal);
if (attrDecl == null) {
continue;
}
XSSimpleType dv = (XSSimpleType)attrDecl.getTypeDefinition();
if (dv == null) {
continue;
}
// get all values appeared with this attribute name
Vector values = (Vector) entry.getValue();
String elName;
String attrName = (String)values.elementAt(0);
// for each of the values
int count = values.size();
for (int i = 1; i < count; i += 2) {
elName = (String)values.elementAt(i);
try {
// and validate it using the XSSimpleType
// REVISIT: what would be the proper validation context?
// guess we need to save that in the vectors too.
dv.validate((String)values.elementAt(i+1), null, null);
} catch(InvalidDatatypeValueException ide) {
reportSchemaError ("s4s-att-invalid-value",
new Object[] {elName, attrName, ide.getMessage()},
null);
}
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:47,代码来源:XSAttributeChecker.java
注:本文中的com.sun.org.apache.xerces.internal.impl.xs.XSGrammarBucket类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论