本文整理汇总了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;
}
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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));
}