本文整理汇总了Java中com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition类的典型用法代码示例。如果您正苦于以下问题:Java XSModelGroupDefinition类的具体用法?Java XSModelGroupDefinition怎么用?Java XSModelGroupDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XSModelGroupDefinition类属于com.sun.org.apache.xerces.internal.xs包,在下文中一共展示了XSModelGroupDefinition类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: expandRelatedComponents
import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition; //导入依赖的package包/类
private void expandRelatedComponents(XSObject component, Vector componentList, Map<String, Vector> 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:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:XSDHandler.java
示例2: iterateParticle
import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition; //导入依赖的package包/类
private Collection<JSElement> iterateParticle(final XSParticle particle) {
final XSTerm term = particle.getTerm();
if (term instanceof XSModelGroup) {
final XSModelGroup modelGroup = (XSModelGroup) term;
return iterateModelGroup(modelGroup);
}
else if (term instanceof XSModelGroupDefinition) {
final XSModelGroupDefinition xsModelGroupDefinition = (XSModelGroupDefinition) term;
return iterateModelGroup(xsModelGroupDefinition.getModelGroup());
}
final Collection<JSElement> jsElements = new ArrayList<>(1);
final Optional<JSElement> optionalJSElement = iterateSingleParticle(particle);
if (optionalJSElement.isPresent()) {
jsElements.add(optionalJSElement.get());
}
return jsElements;
}
开发者ID:dswarm,项目名称:dswarm-xsd2jsonschema,代码行数:25,代码来源:JsonSchemaParser.java
示例3: getModelGroupDefinition
import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition; //导入依赖的package包/类
/**
* Convenience method. Returns a top-level model group definition.
*
* @param name The name of the definition.
* @param namespace The namespace of the definition, otherwise null.
* @return A top-level model group definition definition or null if such
* definition does not exist.
*/
public XSModelGroupDefinition getModelGroupDefinition(String name,
String namespace) {
SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
if (sg == null) {
return null;
}
return (XSModelGroupDefinition)sg.fGlobalGroupDecls.get(name);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:XSModelImpl.java
示例4: iterateModelGroup
import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition; //导入依赖的package包/类
private List<JSElement> iterateModelGroup(final XSModelGroup modelGroup) {
final List<JSElement> list = new ArrayList<>();
final XSObjectList particles = modelGroup.getParticles();
for (int i = 0, l = particles.getLength(); i < l; i++) {
final XSParticle xsParticle = (XSParticle) particles.item(i);
final XSTerm term = xsParticle.getTerm();
if (term instanceof XSModelGroup) {
list.addAll(iterateParticle(xsParticle));
}
else if (term instanceof XSModelGroupDefinition) {
final XSModelGroupDefinition xsModelGroupDefinition = (XSModelGroupDefinition) term;
list.addAll(iterateModelGroup(xsModelGroupDefinition.getModelGroup()));
}
else {
final Optional<JSElement> optionalJSElement = iterateSingleParticle(xsParticle);
optionalJSElement.ifPresent(list::add);
}
}
return list;
}
开发者ID:dswarm,项目名称:dswarm-xsd2jsonschema,代码行数:30,代码来源:JsonSchemaParser.java
示例5: expandRelatedModelGroupDefinitionComponents
import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition; //导入依赖的package包/类
private void expandRelatedModelGroupDefinitionComponents(XSModelGroupDefinition modelGroupDef, Vector componentList,
String namespace, Map<String, Vector> dependencies) {
expandRelatedModelGroupComponents(modelGroupDef.getModelGroup(), componentList, namespace, dependencies);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:XSDHandler.java
示例6: getModelGroupDefinition
import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition; //导入依赖的package包/类
/**
* Convenience method. Returns a top-level model group definition.
*
* @param name The name of the definition.
* @return A top-level model group definition definition or null if such
* definition does not exist.
*/
public XSModelGroupDefinition getModelGroupDefinition(String name) {
return getGlobalGroupDecl(name);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:SchemaGrammar.java
示例7: iterateSingleParticle
import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition; //导入依赖的package包/类
private Optional<JSElement> iterateSingleParticle(final XSParticle particle) {
final XSTerm term = particle.getTerm();
if (term instanceof XSElementDeclaration) {
final XSElementDeclaration xsElementDecl = (XSElementDeclaration) term;
final Optional<JSElement> optionalElement = iterateElement(xsElementDecl);
return optionalElement.map(el -> isRepeated(particle) ? new JSArray(el) : el);
}
else if (term instanceof XSModelGroupDefinition) {
final XSModelGroupDefinition xsModelGroupDefinition = (XSModelGroupDefinition) term;
final String name = getDeclarationName(xsModelGroupDefinition);
final List<JSElement> elements = iterateModelGroup(xsModelGroupDefinition.getModelGroup());
return Optional.of(new JSObject(name, elements));
}
else if (term instanceof XSWildcard) {
final XSWildcard wildcard = (XSWildcard) term;
// TODO: what should we do with other XS wildcard types, i.e., 'any' and 'union'
// is this XSOM XSWildCard.Other ??
if (XSWildcard.NSCONSTRAINT_NOT == wildcard.getConstraintType()) {
// wo do not have "other namespace" available here
return Optional.of(new JSOther(WILDCARD, null));
} else if (XSWildcard.NSCONSTRAINT_ANY == wildcard.getConstraintType()) {
// TODO: shall we do something else here??
return Optional.empty();
}
}
return Optional.of(new JSNull(NULL));
}
开发者ID:dswarm,项目名称:dswarm-xsd2jsonschema,代码行数:43,代码来源:JsonSchemaParser.java
注:本文中的com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论