本文整理了Java中org.apache.xerces.xs.XSObject.getType()
方法的一些代码示例,展示了XSObject.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSObject.getType()
方法的具体详情如下:
包路径:org.apache.xerces.xs.XSObject
类名称:XSObject
方法名:getType
[英]The type
of this object, i.e. ELEMENT_DECLARATION
.
[中]此对象的type
,即ELEMENT_DECLARATION
。
代码示例来源: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
if (component.getType() == XSConstants.TYPE_DEFINITION
&& component.getName() == null) {
resultComponents.add(component);
short type = component.getType();
if (type == XSConstants.MODEL_GROUP
|| type == XSConstants.FACET
代码示例来源: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: 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: org.wso2.wsdl.validator/wsdl-validator
if (term.getType() == XSConstants.ELEMENT_DECLARATION)
else if(term.getType() == XSConstants.MODEL_GROUP)
代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator
if (term.getType() == XSConstants.ELEMENT_DECLARATION)
else if(term.getType() == XSConstants.MODEL_GROUP)
代码示例来源: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: com.rackspace.apache/xerces2-xsd11
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
XSObject comp = ((XSObject)currentComponents.get(i));
short type = comp.getType();
if (type == XSConstants.TYPE_DEFINITION) {
type = ((XSTypeDefinition)comp).getTypeCategory();
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
XSObject comp = (XSObject)currentComponents.get(i);
if (comp.getType() == XSConstants.ELEMENT_DECLARATION) {
addComponent(((XSElementDeclaration)comp).getSubstitutionGroupAffiliation(),
step.getNametest(), result);
case Axis.BASE_TYPE:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
if (((XSObject)currentComponents.get(i)).getType() == XSConstants.TYPE_DEFINITION) {
addComponent((((XSTypeDefinition)currentComponents.get(i))).getBaseType(),
step.getNametest(), result);
case Axis.ITEM_TYPE:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
if (((XSObject)currentComponents.get(i)).getType() == XSConstants.TYPE_DEFINITION) {
XSObject comp = (XSObject)currentComponents.get(i);
if (((XSTypeDefinition)comp).getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
case Axis.MEMBER_TYPE:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
if (((XSObject)currentComponents.get(i)).getType() == XSConstants.TYPE_DEFINITION) {
XSObject comp = (XSObject)currentComponents.get(i);
if (((XSTypeDefinition)comp).getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private void annotations(XSObject sourceComponent, List targetComponents)
throws SCDException {
XSObjectList annotations;
switch (sourceComponent.getType()) {
case XSConstants.ATTRIBUTE_DECLARATION:
annotations = ((XSAttributeDeclaration)sourceComponent).getAnnotations();
throw new SCDException(
"Error in SCD: annotations accessor is not supported for the component type "
+ sourceComponent.getType());
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private void term(XSObject sourceComponent, short filter, QName nameTest, List outputComponents) {
switch (sourceComponent.getType()) {
case XSConstants.MODEL_GROUP_DEFINITION:
if (NO_FILTER == filter || XSConstants.MODEL_GROUP == filter) {
XSObject term = ((XSParticle) particles.item(i)).getTerm();
if (NO_FILTER == filter
|| (term != null && term.getType() == filter)) {
代码示例来源: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: com.rackspace.apache/xerces2-xsd11
short componentType = component.getType();
final String name = component.getName();
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
final SchemaGrammar sg = getSchemaGrammar(desc);
short componentType = component.getType();
final String name = component.getName();
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private void componentChildren(XSObject sourceComponent, short filter, QName nameTest, List targetComponents) {
switch (sourceComponent.getType()) {
case XSConstants.ATTRIBUTE_DECLARATION: {
if (NO_FILTER == filter || XSConstants.TYPE_DEFINITION == filter) {
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
private void componentLinked(XSObject sourceComponent, short filter,
QName nameTest, List targetComponents) throws SCDException {
switch (sourceComponent.getType()) {
case XSConstants.ATTRIBUTE_DECLARATION: {
componentChildren(sourceComponent, filter, nameTest, targetComponents);
内容来源于网络,如有侵权,请联系作者删除!