本文整理汇总了Java中org.apache.ws.commons.schema.XmlSchemaObject类的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaObject类的具体用法?Java XmlSchemaObject怎么用?Java XmlSchemaObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlSchemaObject类属于org.apache.ws.commons.schema包,在下文中一共展示了XmlSchemaObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKey
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public static String getKey(Object element) {
String key = element.getClass().getSimpleName();
if (element instanceof NamedList) {
key = ((NamedList) element).getName().toLowerCase() + "_folder";
} else if (element instanceof XmlSchema) {
key = "schema";
} else if (element instanceof XmlSchemaDocumentation || element instanceof XmlSchemaAppInfo) {
key = "notation";
} else if (element instanceof XmlSchemaObject) {
key = key.contains("Extension") ?
"extension" :
key.substring(9).replaceAll("(\\p{Upper})", "_$1").toLowerCase().substring(1);
if (element instanceof XmlSchemaElement) {
key += ((XmlSchemaElement)element).getRefName() != null ? "_ref":"";
}
else if (element instanceof XmlSchemaAttribute) {
key += ((XmlSchemaAttribute)element).getRefName() != null ? "_ref":"";
}
} else {
key = "unresolved";
}
return key;
}
示例2: add
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public static void add(XmlSchema schema, XmlSchemaObject object) {
if (object instanceof XmlSchemaImport) {
add(schema, (XmlSchemaImport) object);
} else if (object instanceof XmlSchemaInclude) {
add(schema, (XmlSchemaInclude) object);
} else if (object instanceof XmlSchemaElement) {
add(schema, (XmlSchemaElement) object);
} else if (object instanceof XmlSchemaType) {
add(schema, (XmlSchemaType) object);
} else if (object instanceof XmlSchemaGroup) {
add(schema, (XmlSchemaGroup) object);
} else if (object instanceof XmlSchemaAttributeGroup) {
add(schema, (XmlSchemaAttributeGroup) object);
} else if (object instanceof XmlSchemaAttribute) {
add(schema, (XmlSchemaAttribute) object);
} else {
schema.getItems().add(object);
}
}
示例3: remove
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public static void remove(XmlSchema schema, XmlSchemaObject object) {
if (object instanceof XmlSchemaImport) {
remove(schema, (XmlSchemaImport) object);
} else if (object instanceof XmlSchemaInclude) {
remove(schema, (XmlSchemaInclude) object);
} else if (object instanceof XmlSchemaElement) {
remove(schema, (XmlSchemaElement) object);
} else if (object instanceof XmlSchemaType) {
remove(schema, (XmlSchemaType) object);
} else if (object instanceof XmlSchemaGroup) {
remove(schema, (XmlSchemaGroup) object);
} else if (object instanceof XmlSchemaAttributeGroup) {
remove(schema, (XmlSchemaAttributeGroup) object);
} else if (object instanceof XmlSchemaAttribute) {
remove(schema, (XmlSchemaAttribute) object);
} else {
schema.getItems().remove(object);
}
}
示例4: walkChoice
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
protected void walkChoice(XmlSchema xmlSchema, XmlSchemaChoice obj) {
walkAnnotated(xmlSchema, obj);
XmlSchemaObjectCollection children = obj.getItems();
for (int i = 0; i < children.getCount(); i++) {
XmlSchemaObject child = children.getItem(i);
if (child instanceof XmlSchemaElement) {
walkElement(xmlSchema, (XmlSchemaElement)child);
} else if (child instanceof XmlSchemaGroupRef) {
walkGroupRef(xmlSchema, (XmlSchemaGroupRef)child);
} else if (child instanceof XmlSchemaChoice) {
walkChoice(xmlSchema, (XmlSchemaChoice)child);
} else if (child instanceof XmlSchemaSequence) {
walkSequence(xmlSchema, (XmlSchemaSequence)child);
} else if (child instanceof XmlSchemaAny) {
walkAny(xmlSchema, (XmlSchemaAny)child);
}
}
}
示例5: walkSequence
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
protected void walkSequence(XmlSchema xmlSchema, XmlSchemaSequence obj) {
walkAnnotated(xmlSchema, obj);
XmlSchemaObjectCollection children = obj.getItems();
for (int i = 0; i < children.getCount(); i++) {
XmlSchemaObject child = children.getItem(i);
if (child instanceof XmlSchemaElement) {
walkElement(xmlSchema, (XmlSchemaElement)child);
} else if (child instanceof XmlSchemaGroupRef) {
walkGroupRef(xmlSchema, (XmlSchemaGroupRef)child);
} else if (child instanceof XmlSchemaChoice) {
walkChoice(xmlSchema, (XmlSchemaChoice)child);
} else if (child instanceof XmlSchemaSequence) {
walkSequence(xmlSchema, (XmlSchemaSequence)child);
} else if (child instanceof XmlSchemaAny) {
walkAny(xmlSchema, (XmlSchemaAny)child);
}
}
}
示例6: walkSimpleContentExtension
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
protected void walkSimpleContentExtension(XmlSchema xmlSchema, XmlSchemaSimpleContentExtension obj) {
walkAnnotated(xmlSchema, obj);
QName baseTypeName = obj.getBaseTypeName();
if ((baseTypeName != null) && deep) {
walkByTypeName(xmlSchema, baseTypeName);
}
XmlSchemaObjectCollection attributes = obj.getAttributes();
for (int i = 0; i < attributes.getCount(); i++) {
XmlSchemaObject attribute = attributes.getItem(i);
if (attribute instanceof XmlSchemaAttribute) {
walkAttribute(xmlSchema, (XmlSchemaAttribute)attribute);
} else if (attribute instanceof XmlSchemaAttributeGroupRef) {
walkAttributeGroupRef(xmlSchema, (XmlSchemaAttributeGroupRef)attribute);
}
}
XmlSchemaAnyAttribute xmlSchemaAnyAttribute = obj.getAnyAttribute();
if (xmlSchemaAnyAttribute != null) {
walkAnyAttribute(xmlSchema, xmlSchemaAnyAttribute);
}
}
示例7: walkAttributeGroup
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
protected void walkAttributeGroup(XmlSchema xmlSchema, XmlSchemaAttributeGroup obj) {
walkAnnotated(xmlSchema, obj);
XmlSchemaObjectCollection attributes = obj.getAttributes();
for (int i = 0; i < attributes.getCount(); i++) {
XmlSchemaObject attribute = attributes.getItem(i);
if (attribute instanceof XmlSchemaAttribute) {
walkAttribute(xmlSchema, (XmlSchemaAttribute)attribute);
} else if (attribute instanceof XmlSchemaAttributeGroupRef) {
walkAttributeGroupRef(xmlSchema, (XmlSchemaAttributeGroupRef)attribute);
}
}
XmlSchemaAnyAttribute xmlSchemaAnyAttribute = obj.getAnyAttribute();
if (xmlSchemaAnyAttribute != null) {
walkAnyAttribute(xmlSchema, xmlSchemaAnyAttribute);
}
}
示例8: getOperationQname
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
public QName getOperationQname(String operationName)
throws UnknownOperationException {
if ("rpc".equals(parser.getOperationStyle(null, operationName))) {
QName rpcMethodName = parser.getRPCRequestMethodName(null, operationName);
if (rpcMethodName == null) {
parser.getRPCResponseMethodName(null, operationName);
}
return rpcMethodName;
}
// all these things are odd... there is no any wrapper for the 'document' style
LinkedHashMap<String, XmlSchemaObject> parameters = parser.getInputParameters(null, operationName);
if (parameters.size() > 0) {
XmlSchemaObject xmlSchemaObject = parameters.values().iterator().next();
if (xmlSchemaObject instanceof XmlSchemaElement) {
XmlSchemaElement element = (XmlSchemaElement)xmlSchemaObject;
return element.getQName();
}
}
return null;
}
示例9: getParameter
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
private XmlSchemaObject getParameter(Part part) {
XmlSchemaObject parameter;
QName elementName = part.getElementName();
if (elementName != null) {
parameter = schemas.getElementByQName(elementName);
if (parameter == null) {
logger.log(Level.WARNING, "can't find a global element: {0} trying with type...", elementName);
parameter = schemas.getTypeByQName(elementName);
}
} else {
QName typeName = part.getTypeName();
if (typeName != null) {
parameter = schemas.getTypeByQName(typeName);
} else {
return null;
}
}
return parameter;
}
示例10: getInputParameters
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
@Override
public LinkedHashMap<String, XmlSchemaObject> getInputParameters(String portName, String operationName) throws UnknownOperationException {
LinkedHashMap<String, XmlSchemaObject> parameters = new LinkedHashMap<String, XmlSchemaObject>();
BindingOperation bindingOperation = getBindingOperation(portName, operationName);
InterfaceOperation interfaceOperation = bindingOperation.getInterfaceOperation();
// NOTE THAT THIS CODE IS NOT VALID FOR "RPC" STYLE
for (InterfaceMessageReference input : interfaceOperation.getInterfaceMessageReferences()) {
if (Direction.IN == input.getDirection()) {
ElementDeclaration element = input.getElementDeclaration();
parameters.put(element.getName().getLocalPart(), (XmlSchemaObject)element.getContent());
}
}
return parameters;
}
示例11: getOutputParameters
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
@Override
public LinkedHashMap<String, XmlSchemaObject> getOutputParameters(String portName, String operationName) throws UnknownOperationException {
LinkedHashMap<String, XmlSchemaObject> parameters = new LinkedHashMap<String, XmlSchemaObject>();
BindingOperation bindingOperation = getBindingOperation(portName, operationName);
InterfaceOperation interfaceOperation = bindingOperation.getInterfaceOperation();
// NOTE THAT THIS CODE IS NOT VALID FOR "RPC" STYLE
for (InterfaceMessageReference output : interfaceOperation.getInterfaceMessageReferences()) {
if (Direction.OUT == output.getDirection()) {
ElementDeclaration element = output.getElementDeclaration();
parameters.put(element.getName().getLocalPart(), (XmlSchemaObject)element.getContent());
}
}
return parameters;
}
示例12: cacheComplexTypes
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
/**
* extract all complex types from a schema and cache into a map
*/
private void cacheComplexTypes(XmlSchema schema) {
XmlSchemaObjectCollection schemaItems = schema.getItems();
int numElements = schemaItems.getCount();
// Iterate XML Schema items
for (int i = 0; i < numElements; i++) {
XmlSchemaObject schemaObject = schemaItems.getItem(i);
if (schemaObject instanceof XmlSchemaComplexType) {
XmlSchemaComplexType complexType = (XmlSchemaComplexType) schemaObject;
String elementTypeName = complexType.getName();
complexTypes.put(elementTypeName, complexType);
}
}
}
示例13: parseParticleForIdentityType
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
/**
* Recursively parse through an XmlSchemaPatricle to the elements
* collecting all DidRefSources
*/
private XmlSchemaElement parseParticleForIdentityType(XmlSchemaParticle particle) {
XmlSchemaElement identityType = null;
if (particle != null) {
if (particle instanceof XmlSchemaElement) {
XmlSchemaElement element = (XmlSchemaElement) particle;
String elementName = element.getSchemaTypeName().getLocalPart();
if (elementName.contains(IDENTITY_TYPE)) {
identityType = element;
}
} else if (particle instanceof XmlSchemaSequence) {
XmlSchemaSequence schemaSequence = (XmlSchemaSequence) particle;
for (int i = 0; i < schemaSequence.getItems().getCount(); i++) {
XmlSchemaObject item = schemaSequence.getItems().getItem(i);
if (item instanceof XmlSchemaParticle) {
identityType = parseParticleForIdentityType((XmlSchemaParticle) item);
}
}
}
}
return identityType;
}
示例14: parseFields
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
private static final List<Attribute> parseFields(final XmlSchemaComplexType schemaComplexType,
final XmlSchema schema, final Xsd2UmlConfig context) {
final List<Attribute> attributes = new LinkedList<Attribute>();
final XmlSchemaObjectCollection schemaItems = schemaComplexType.getAttributes();
for (int i = 0, count = schemaItems.getCount(); i < count; i++) {
final XmlSchemaObject schemaObject = schemaItems.getItem(i);
if (schemaObject instanceof XmlSchemaAttribute) {
final XmlSchemaAttribute schemaAttribute = (XmlSchemaAttribute) schemaObject;
attributes.add(parseAttribute(schemaAttribute, schema, context));
} else {
throw new AssertionError(schemaObject);
}
}
// parseAttributes(schemaComplexType.getAttributes(), schema);
attributes.addAll(parseParticle(schemaComplexType.getParticle(), schema, context));
return Collections.unmodifiableList(attributes);
}
示例15: loadSchema
import org.apache.ws.commons.schema.XmlSchemaObject; //导入依赖的package包/类
void loadSchema(XmlSchema schema) {
XmlSchemaObjectCollection schemaItems = schema.getItems();
// Iterate XML Schema items
for (int i = 0; i < schemaItems.getCount(); i++) {
XmlSchemaObject schemaObject = schemaItems.getItem(i);
NeutralSchema neutralSchema;
if (schemaObject instanceof XmlSchemaType) {
neutralSchema = parse((XmlSchemaType) schemaObject, schema);
} else if (schemaObject instanceof XmlSchemaElement) {
neutralSchema = parseElement((XmlSchemaElement) schemaObject, schema);
} else if (schemaObject instanceof XmlSchemaInclude) {
continue; // nothing to do for includes
} else {
throw new RuntimeException("Unhandled XmlSchemaObject: " + schemaObject.getClass().getCanonicalName());
}
schemas.put(neutralSchema.getType(), neutralSchema);
partialSchemas.clear();
}
}