本文整理了Java中org.apache.ws.commons.schema.XmlSchemaGroupRef
类的一些代码示例,展示了XmlSchemaGroupRef
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlSchemaGroupRef
类的具体详情如下:
包路径:org.apache.ws.commons.schema.XmlSchemaGroupRef
类名称:XmlSchemaGroupRef
[英]Class used within complex types that defines the reference to groups defined at the schema level. Represents the World Wide Web Consortium (W3C) group element with ref attribute.
[中]在复杂类型中使用的类,该类定义对在架构级别定义的组的引用。表示具有ref属性的万维网联盟(W3C)组元素。
代码示例来源:origin: apache/cxf
QName groupName = ((XmlSchemaGroupRef) object).getRefName();
XmlSchemaGroup group = currentSchema.getGroupByName(groupName);
if (group == null) {
代码示例来源:origin: org.apache.ws.schema/XmlSchema
private XmlSchemaGroupRef handleGroupRef(XmlSchema schema, Element groupEl,
Element schemaEl) {
XmlSchemaGroupRef group = new XmlSchemaGroupRef();
group.maxOccurs = getMaxOccurs(groupEl);
group.minOccurs = getMinOccurs(groupEl);
Element annotationEl = XDOMUtil.getFirstChildElementNS(groupEl,
XmlSchema.SCHEMA_NS, "annotation");
if (annotationEl != null) {
XmlSchemaAnnotation annotation = handleAnnotation(annotationEl);
group.setAnnotation(annotation);
}
if (groupEl.hasAttribute("ref")) {
String ref = groupEl.getAttribute("ref");
group.refName = getRefQName(ref, groupEl);
return group;
}
for (Element el = XDOMUtil.getFirstChildElementNS(groupEl,
XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
.getNextSiblingElement(el)) {
if (el.getLocalName().equals("sequence")) {
group.particle = handleSequence(schema, el, schemaEl);
} else if (el.getLocalName().equals("all")) {
group.particle = handleAll(schema, el, schemaEl);
} else if (el.getLocalName().equals("choice")) {
group.particle = handleChoice(schema, el, schemaEl);
}
}
return group;
}
代码示例来源:origin: org.apache.axis2/axis2-adb-codegen
QName groupQName = xmlSchemaGroupRef.getRefName();
if (groupQName != null) {
if (!processedGroupTypeMap.containsKey(groupQName)) {
Boolean isArray = xmlSchemaGroupRef.getMaxOccurs() > 1 ? Boolean.TRUE : Boolean.FALSE;
processedElementArrayStatusMap.put(item, isArray);
particleQNameMap.put(item, groupQName);
代码示例来源:origin: org.apache.axis2/axis2-adb-codegen
QName groupQName = xmlSchemaGroupRef.getRefName();
if (groupQName != null) {
if (!processedGroupTypeMap.containsKey(groupQName)) {
throw new SchemaCompilationException("Referenced name is null");
boolean isArray = xmlSchemaGroupRef.getMaxOccurs() > 1;
metainfHolder.addMaxOccurs(groupQName, xmlSchemaGroupRef.getMaxOccurs());
metainfHolder.addMinOccurs(groupQName, xmlSchemaGroupRef.getMinOccurs());
metainfHolder.setHasParticleType(true);
metainfHolder.setOrdered(true);
代码示例来源:origin: org.apache.axis2/axis2-adb-codegen
XmlSchemaGroupRef xmlSchemaGroupRef = (XmlSchemaGroupRef) child;
QName groupQName = particleQNameMap.get(child);
boolean isArray = xmlSchemaGroupRef.getMaxOccurs() > 1;
metainfHolder.addMaxOccurs(groupQName, xmlSchemaGroupRef.getMaxOccurs());
metainfHolder.addMinOccurs(groupQName, xmlSchemaGroupRef.getMinOccurs());
metainfHolder.setHasParticleType(true);
代码示例来源:origin: apache/axis2-java
QName groupQName = xmlSchemaGroupRef.getRefName();
if (groupQName != null) {
if (!processedGroupTypeMap.containsKey(groupQName)) {
throw new SchemaCompilationException("Referenced name is null");
boolean isArray = xmlSchemaGroupRef.getMaxOccurs() > 1;
metainfHolder.addMaxOccurs(groupQName, xmlSchemaGroupRef.getMaxOccurs());
metainfHolder.addMinOccurs(groupQName, xmlSchemaGroupRef.getMinOccurs());
metainfHolder.setHasParticleType(true);
metainfHolder.setOrdered(true);
代码示例来源:origin: apache/axis2-java
XmlSchemaGroupRef xmlSchemaGroupRef = (XmlSchemaGroupRef) child;
QName groupQName = particleQNameMap.get(child);
boolean isArray = xmlSchemaGroupRef.getMaxOccurs() > 1;
metainfHolder.addMaxOccurs(groupQName, xmlSchemaGroupRef.getMaxOccurs());
metainfHolder.addMinOccurs(groupQName, xmlSchemaGroupRef.getMinOccurs());
metainfHolder.setHasParticleType(true);
代码示例来源:origin: org.apache.ws.commons.schema/XmlSchema
private XmlSchemaGroupRef handleGroupRef(XmlSchema schema, Element groupEl,
Element schemaEl) {
XmlSchemaGroupRef group = new XmlSchemaGroupRef();
group.maxOccurs = getMaxOccurs(groupEl);
group.minOccurs = getMinOccurs(groupEl);
Element annotationEl = XDOMUtil.getFirstChildElementNS(groupEl,
XmlSchema.SCHEMA_NS, "annotation");
if (annotationEl != null) {
XmlSchemaAnnotation annotation = handleAnnotation(annotationEl);
group.setAnnotation(annotation);
}
if (groupEl.hasAttribute("ref")) {
String ref = groupEl.getAttribute("ref");
group.refName = getRefQName(ref, groupEl);
return group;
}
for (Element el = XDOMUtil.getFirstChildElementNS(groupEl,
XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
.getNextSiblingElement(el)) {
if (el.getLocalName().equals("sequence")) {
group.particle = handleSequence(schema, el, schemaEl);
} else if (el.getLocalName().equals("all")) {
group.particle = handleAll(schema, el, schemaEl);
} else if (el.getLocalName().equals("choice")) {
group.particle = handleChoice(schema, el, schemaEl);
}
}
return group;
}
代码示例来源:origin: com.legsem.legstar/legstar.avro.translator
/**
* Visit a base XSD element.
* <p/>
* Could be any of:
* <ul>
* <li>A regular element</li>
* <li>A reference to a group</li>
* <li>A choice</li>
* </ul>
*
* @param xmlSchema the input XML schema
* @param element the base element
* @param level the current level in the hierarchy
* @param avroFields an array of avro fields being populated
*/
private void visit(XmlSchema xmlSchema, XmlSchemaObjectBase element,
final int level, final ArrayNode avroFields) {
if (element instanceof XmlSchemaElement) {
visit(xmlSchema, (XmlSchemaElement) element, level, avroFields);
} else if (element instanceof XmlSchemaGroupRef) {
XmlSchemaGroupRef groupRef = (XmlSchemaGroupRef) element;
XmlSchemaGroup group = xmlSchema.getGroups().get(
groupRef.getRefName());
visit(xmlSchema, group.getParticle(), level, avroFields);
} else if (element instanceof XmlSchemaChoice) {
visit(xmlSchema, (XmlSchemaChoice) element, level, avroFields);
}
}
代码示例来源:origin: apache/axis2-java
QName groupQName = xmlSchemaGroupRef.getRefName();
if (groupQName != null) {
if (!processedGroupTypeMap.containsKey(groupQName)) {
Boolean isArray = xmlSchemaGroupRef.getMaxOccurs() > 1 ? Boolean.TRUE : Boolean.FALSE;
processedElementArrayStatusMap.put(item, isArray);
particleQNameMap.put(item, groupQName);
代码示例来源:origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema
private XmlSchemaGroupRef handleGroupRef(XmlSchema schema,
Element groupEl, Element schemaEl) {
XmlSchemaGroupRef group = new XmlSchemaGroupRef();
handleAnnotation(annotationEl);
group.setAnnotation(annotation);
代码示例来源:origin: com.legsem.legstar/legstar-xsd2cob
/**
* Take all elements from a collection and process them.
*
* @param items the parent collection
* @param level the current level in the elements hierarchy.
* @throws XsdMappingException if processing fails
*/
protected void processCollectionElements(
final XmlSchemaObjectCollection items, final int level)
throws XsdMappingException {
/* Process each element in the collection */
for (int i = 0; i < items.getCount(); i++) {
XmlSchemaObject element = items.getItem(i);
if (element instanceof XmlSchemaElement) {
processElement((XmlSchemaElement) element, level);
} else if (element instanceof XmlSchemaGroupRef) {
/* This is a reference to a group so we fetch the group */
XmlSchemaGroupRef groupRef = (XmlSchemaGroupRef) element;
XmlSchemaGroup group = (XmlSchemaGroup) _schema.getGroups()
.getItem(groupRef.getRefName());
processParticle(group.getName(), group.getParticle(), level);
}
}
}
代码示例来源:origin: com.legsem.legstar/legstar-jaxbgen
/**
* Take all elements from a collection and process them.
*
* @param schema the XML Schema
* @param jaxbNamespace the JAXB namespace
* @param jaxbNamespacePrefix the JAXB namespace prefix
* @param items the parent collection
*/
protected void processCollectionElements(final XmlSchema schema,
final String jaxbNamespace, final String jaxbNamespacePrefix,
final XmlSchemaObjectCollection items) {
for (int i = 0; i < items.getCount(); i++) {
XmlSchemaObject element = items.getItem(i);
if (element instanceof XmlSchemaElement) {
processElement(schema, jaxbNamespace, jaxbNamespacePrefix,
(XmlSchemaElement) element);
} else if (element instanceof XmlSchemaGroupRef) {
XmlSchemaGroupRef groupRef = (XmlSchemaGroupRef) element;
XmlSchemaGroup group = (XmlSchemaGroup) schema.getGroups()
.getItem(groupRef.getRefName());
processParticle(schema, jaxbNamespace, jaxbNamespacePrefix,
group.getName(), group.getParticle());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!