本文整理汇总了Java中org.apache.ws.commons.schema.XmlSchemaComplexType.setContentModel方法的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaComplexType.setContentModel方法的具体用法?Java XmlSchemaComplexType.setContentModel怎么用?Java XmlSchemaComplexType.setContentModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ws.commons.schema.XmlSchemaComplexType
的用法示例。
在下文中一共展示了XmlSchemaComplexType.setContentModel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeSimpleContentExtension
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
private XmlSchemaSimpleContentExtension makeSimpleContentExtension(DatabaseObject databaseObject, XmlSchemaComplexType cType, QName typeName) {
if (typeName != null) {
XmlSchemaSimpleContent sContent = XmlSchemaUtils.makeDynamic(databaseObject, new XmlSchemaSimpleContent());
cType.setContentModel(sContent);
XmlSchemaSimpleContentExtension sContentExt = XmlSchemaUtils.makeDynamic(databaseObject, new XmlSchemaSimpleContentExtension());
sContent.setContent(sContentExt);
sContentExt.setBaseTypeName(typeName);
return sContentExt;
}
return null;
}
示例2: getXmlSchemaObject
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
@Override
public XmlSchemaElement getXmlSchemaObject(XmlSchemaCollection collection, XmlSchema schema) {
XmlSchemaElement element = XmlSchemaUtils.makeDynamic(this, new XmlSchemaElement());
element.setName(getStepNodeName());
QName qname = new QName(schema.getTargetNamespace(), "SessionSetObjectType");
if (schema.getTypeByName(qname) == null) {
XmlSchemaComplexType eType = new XmlSchemaComplexType(schema);
eType.setName("SessionSetObjectType");
XmlSchemaSimpleContent sContent = new XmlSchemaSimpleContent();
eType.setContentModel(sContent);
XmlSchemaSimpleContentExtension sContentExt = new XmlSchemaSimpleContentExtension();
sContentExt.setBaseTypeName(Constants.XSD_STRING);
sContent.setContent(sContentExt);
XmlSchemaAttribute attribute = new XmlSchemaAttribute();
attribute.setName("key");
attribute.setSchemaTypeName(Constants.XSD_STRING);
sContentExt.getAttributes().add(attribute);
schema.addType(eType);
schema.getItems().add(eType);
}
element.setSchemaTypeName(qname);
return element;
}
示例3: getXmlSchemaObject
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
@Override
public XmlSchemaElement getXmlSchemaObject(XmlSchemaCollection collection, XmlSchema schema) {
XmlSchemaElement element = XmlSchemaUtils.makeDynamic(this, new XmlSchemaElement());
element.setName(getStepNodeName());
QName qname = new QName(schema.getTargetNamespace(), "SessionRemoveObjectType");
if (schema.getTypeByName(qname) == null) {
XmlSchemaComplexType eType = new XmlSchemaComplexType(schema);
eType.setName("SessionRemoveObjectType");
XmlSchemaSimpleContent sContent = new XmlSchemaSimpleContent();
eType.setContentModel(sContent);
XmlSchemaSimpleContentExtension sContentExt = new XmlSchemaSimpleContentExtension();
sContentExt.setBaseTypeName(Constants.XSD_STRING);
sContent.setContent(sContentExt);
XmlSchemaAttribute attribute = new XmlSchemaAttribute();
attribute.setName("key");
attribute.setSchemaTypeName(Constants.XSD_STRING);
sContentExt.getAttributes().add(attribute);
schema.addType(eType);
schema.getItems().add(eType);
}
element.setSchemaTypeName(qname);
return element;
}
示例4: getXmlSchemaObject
import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
@Override
public XmlSchemaElement getXmlSchemaObject(XmlSchemaCollection collection, XmlSchema schema) {
XmlSchemaElement element = (XmlSchemaElement) super.getXmlSchemaObject(collection, schema);
XmlSchemaComplexType cType = XmlSchemaUtils.makeDynamic(this, new XmlSchemaComplexType(schema));
element.setType(cType);
XmlSchemaSequence sequence = XmlSchemaUtils.makeDynamic(this, new XmlSchemaSequence());
cType.setParticle(sequence);
XmlSchemaElement elt = XmlSchemaUtils.makeDynamic(this, new XmlSchemaElement());
sequence.getItems().add(elt);
elt.setName("file");
elt.setMinOccurs(0);
elt.setMaxOccurs(Long.MAX_VALUE);
cType = XmlSchemaUtils.makeDynamic(this, new XmlSchemaComplexType(schema));
elt.setType(cType);
XmlSchemaSimpleContent sContent = XmlSchemaUtils.makeDynamic(this, new XmlSchemaSimpleContent());
cType.setContentModel(sContent);
XmlSchemaSimpleContentExtension sContentExt = XmlSchemaUtils.makeDynamic(this, new XmlSchemaSimpleContentExtension());
sContent.setContent(sContentExt);
sContentExt.setBaseTypeName(Constants.XSD_STRING);
XmlSchemaAttribute attr = XmlSchemaUtils.makeDynamic(this, new XmlSchemaAttribute());
attr.setName("lastModified");
attr.setSchemaTypeName(Constants.XSD_NONNEGATIVEINTEGER);
sContentExt.getAttributes().add(attr);
attr = XmlSchemaUtils.makeDynamic(this, new XmlSchemaAttribute());
attr.setName("size");
attr.setSchemaTypeName(Constants.XSD_NONNEGATIVEINTEGER);
sContentExt.getAttributes().add(attr);
return element;
}