本文整理了Java中org.apache.xerces.xs.XSObject
类的一些代码示例,展示了XSObject
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSObject
类的具体详情如下:
包路径:org.apache.xerces.xs.XSObject
类名称:XSObject
[英]The XSObject
is a base object for the XML Schema component model.
[中]XSObject
是XML模式组件模型的基本对象。
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.io.wsdl-asl
private static boolean matches(XSObject aObject, QName aQName)
{
return aObject.getName().equals(aQName.getLocalPart())
&& aObject.getNamespace().equals(aQName.getNamespaceURI());
}
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
if (component.getType() == XSConstants.TYPE_DEFINITION
&& component.getName() == null) {
resultComponents.add(component);
resultComponents.add(component);
} else {
String localPart = component.getName();
String uri = component.getNamespace();
if (uri != null && localPart != null) { // .../schemaElement::p:item
if (uri.equals(nameTest.uri)
short type = component.getType();
if (type == XSConstants.MODEL_GROUP
|| type == XSConstants.FACET
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private void expandRelatedComponents(XSObject component, Vector componentList, Hashtable 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;
}
}
代码示例来源:origin: elodina/xml-avro
private Schema.Field createField(Iterable<Schema.Field> fields, XSObject source, XSTypeDefinition type, boolean optional, boolean array) {
List<Short> supportedTypes = Arrays.asList(XSConstants.ELEMENT_DECLARATION, XSConstants.ATTRIBUTE_DECLARATION, XSConstants.WILDCARD);
if (!supportedTypes.contains(source.getType()))
throw new ConverterException("Invalid source object type " + source.getType());
boolean wildcard = source.getType() == XSConstants.WILDCARD;
if (wildcard) {
Schema map = Schema.createMap(Schema.create(Schema.Type.STRING));
return new Schema.Field(Source.WILDCARD, map, null, null);
}
Schema fieldSchema = createTypeSchema(type, optional, array);
String name = validName(source.getName());
name = uniqueFieldName(fields, name);
Schema.Field field = new Schema.Field(name, fieldSchema, null, null);
boolean attribute = source.getType() == XSConstants.ATTRIBUTE_DECLARATION;
field.addProp(Source.SOURCE, "" + new Source(source.getName(), attribute));
return field;
}
代码示例来源:origin: AlexanderBartash/hybris-integration-intellij-idea-plugin
public static String toDefXmlTagName(XSObject xs) {
String xmlName = xs.getName();
if (xmlName.endsWith(TYPE_SUFFIX)) {
xmlName = xmlName.substring(0, xmlName.length() - 4);
}
return xmlName;
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/**
* Construct an XSNamedMap implementation one namespace from an array
*
* @param array containing all components
* @param length number of components
*/
public XSNamedMapImpl(XSObject[] array, int length) {
if (length == 0) {
fNamespaces = null;
fMaps = null;
fNSNum = 0;
fArray = array;
fLength = 0;
return;
}
// because all components are from the same target namesapce,
// get the namespace from the first one.
fNamespaces = new String[]{array[0].getNamespace()};
fMaps = null;
fNSNum = 1;
// copy elements to the Vector
fArray = array;
fLength = length;
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private void addElidedComponents(XSObject sourceComponent) {
// these are the components returned from the term() accessor whose component-kind() is equal to xscd:model-group
// currentComponents.size() gets changed in each iteration
for (int i = currentComponents.size() - 1; i < currentComponents.size(); ++i) {
term((XSObject)currentComponents.get(i), XSConstants.MODEL_GROUP, SCDParser.WILDCARD, currentComponents);
}
switch (sourceComponent.getType()) {
case XSConstants.ELEMENT_DECLARATION: {
XSObject typeDef = ((XSElementDeclaration)sourceComponent).getTypeDefinition();
if (typeDef != null && !currentComponents.contains(typeDef)) {
currentComponents.add(typeDef);
}
}
break;
case XSConstants.ATTRIBUTE_DECLARATION: {
XSObject typeDef = ((XSAttributeDeclaration)sourceComponent).getTypeDefinition();
if (typeDef != null && !currentComponents.contains(typeDef)) {
currentComponents.add(typeDef);
}
}
break;
}
// TODO: we dont have type alternative for now.
} // getElidedComponents()
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
for (int j = 0; j < fLength; j++) {
ret = fArray[j];
if (ret.getName().equals(localName)) {
return ret;
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
addGlobalComponents(expandedComponents, importDependencies);
if (referType == XSDDescription.CONTEXT_PREPARSE) {
desc.setTargetNamespace(components[0].getNamespace());
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private void componentScope(XSObject sourceComponent, List targetComponents) {
switch (sourceComponent.getType()) {
case XSConstants.ATTRIBUTE_DECLARATION:
if (((XSAttributeDeclaration)sourceComponent).getScope() != XSConstants.SCOPE_GLOBAL) {
XSObject type = ((XSAttributeDeclaration)sourceComponent).getEnclosingCTDefinition();
if (type != null && !targetComponents.contains(type)) {
targetComponents.add(type);
}
}
break;
case XSConstants.ELEMENT_DECLARATION:
if (((XSElementDeclaration)sourceComponent).getScope() != XSConstants.SCOPE_GLOBAL) {
XSObject type = ((XSElementDeclaration)sourceComponent).getEnclosingCTDefinition();
if (type != null && !targetComponents.contains(type)) {
targetComponents.add(type);
}
}
break;
}
} // componentScope()
代码示例来源:origin: AlexanderBartash/hybris-integration-intellij-idea-plugin
public String toJavaQualifiedTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap, boolean isEnum) {
String typeName = toJavaTypeName(xs.getName(), xs.getNamespace());
return getNSDPrefix(xs.getNamespace(), xs.getName(), isEnum) + typeName;
}
代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator
if (term.getType() == XSConstants.ELEMENT_DECLARATION)
if (WSIConstants.NS_URI_SWA_REF.equals(xsType.getNamespace())
&& WSIConstants.SCHEMA_TYPE_SWA_REF.equals(xsType.getName()))
new QName(elem.getNamespace(), elem.getName()));
else if(term.getType() == XSConstants.MODEL_GROUP)
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
String name = enclosingParent.getName();
reportSchemaError(code, new Object[]{name, tempAttrUse.fAttrDecl.getName(), idName}, child);
String name = enclosingParent.getName();
reportSchemaError(code, new Object[]{name, tempAttrUse.fAttrDecl.getName()}, child);
String name = enclosingParent.getName();
reportSchemaError(code, new Object[]{name, oneAttrUse.fAttrDecl.getName(), idName}, child);
String name = enclosingParent.getName();
reportSchemaError(code, new Object[]{name, oneAttrUse.fAttrDecl.getName()}, child);
if (attrGrp.fAttributeWC == null) {
String code = (enclosingParent instanceof XSAttributeGroupDecl) ? "src-attribute_group.2" : "src-ct.4";
String name = enclosingParent.getName();
reportSchemaError(code, new Object[]{name}, child);
Integer count = (Integer)attrGroupCounts.get(qname);
if (count.intValue() > 1) {
reportSchemaWarning("src-ct.7", new Object[]{qname.localpart, enclosingParent.getName()}, (Element)firstAttr.getParentNode());
if (attrGrp.fAttributeWC == null) {
String code = (enclosingParent instanceof XSAttributeGroupDecl) ? "src-attribute_group.2" : "src-ct.4";
String name = enclosingParent.getName();
reportSchemaError(code, new Object[]{name}, child);
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
XSObject[] components = xsinput.getComponents();
if (components != null && components.length > 0) {
grammar = fGrammarBucket.getGrammar(components[0].getNamespace());
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private String componentVariety(XSObject component) {
short type = component.getType();
if (type == XSConstants.MODEL_GROUP) {
switch (((XSModelGroup)component).getCompositor()) {
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
/**
* Retrieves an <code>XSObject</code> specified by local name and
* namespace URI.
* <br>Per XML Namespaces, applications must use the value <code>null</code> as the
* <code>namespace</code> parameter for methods if they wish to specify
* no namespace.
* @param namespace The namespace URI of the <code>XSObject</code> to
* retrieve, or <code>null</code> if the <code>XSObject</code> has no
* namespace.
* @param localName The local name of the <code>XSObject</code> to
* retrieve.
* @return A <code>XSObject</code> (of any type) with the specified local
* name and namespace URI, or <code>null</code> if they do not
* identify any object in this map.
*/
public XSObject itemByName(String namespace, String localName)
{
XSObject xso = null;
//Since our list may contain types from xerces implementation
for(XSObject obj: list)
{
if(localName.equals(obj.getName()) &&
namespace.equals(obj.getNamespace()))
return obj;
}
return xso;
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private boolean canAddComponent(XSObject component, XSDDescription desc) {
desc.setNamespace(component.getNamespace());
short componentType = component.getType();
final String name = component.getName();
代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator
if (term.getType() == XSConstants.ELEMENT_DECLARATION)
else if(term.getType() == XSConstants.MODEL_GROUP)
代码示例来源:origin: AlexanderBartash/hybris-integration-intellij-idea-plugin
public String toJavaTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap) {
String name = xs.getName();
if (name == null) {
if (xs instanceof TypeInfo) {
name = ((TypeInfo) xs).getTypeName();
if (name != null && name.startsWith("#")) {
name = name.substring(1);
}
}
}
return model.toJavaTypeName(name, xs.getNamespace());
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private void addGlobalComponent(XSObject component, XSDDescription desc) {
final String namespace = component.getNamespace();
short componentType = component.getType();
final String name = component.getName();
内容来源于网络,如有侵权,请联系作者删除!