本文整理汇总了Java中org.apache.xerces.xs.XSTypeDefinition.getName方法的典型用法代码示例。如果您正苦于以下问题:Java XSTypeDefinition.getName方法的具体用法?Java XSTypeDefinition.getName怎么用?Java XSTypeDefinition.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.xerces.xs.XSTypeDefinition
的用法示例。
在下文中一共展示了XSTypeDefinition.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findReference
import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
/**
* Finds all the element and complexType references for the specified root element and populates a map entry with
* element names referenced by the element.
*
* @param elementDeclaration XSElementDeclaration : the root element
*/
private void findReference(XSElementDeclaration elementDeclaration) {
String elemName = elementDeclaration.getName();
String thisContext = elemName;
XSTypeDefinition typeDefinition = elementDeclaration.getTypeDefinition();
if (null != typeDefinition) {
String typeDefName = typeDefinition.getName();
currentNodeNames.clear();
currentNodeNames.add(elementDeclaration.getName());
if (typeDefinition instanceof XSComplexTypeDefinition) {
addToSchemaMap(elemName, typeDefName);
if (null != typeDefName) {
thisContext = typeDefName;
}
XSParticle particle = ((XSComplexTypeDefinition) typeDefinition).getParticle();
findReferenceInParticle(thisContext, particle);
}
else {
addToSchemaMap(elemName, typeDefName);
if (null != typeDefName) {
thisContext = typeDefName;
}
}
}
}
示例2: processEnumType
import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
public void processEnumType(
XSTypeDefinition def,
Map<String, TypeDesc> jtMap,
Map<String, NamespaceDesc> nsdMap
) throws Exception {
boolean complexType = def instanceof XSComplexTypeDefinition;
if (!nsdMap.containsKey(def.getNamespace())) {
Util.log("Namespace desc not found for: " + def);
}
final String typeName = toJavaTypeName(def, nsdMap);
final TypeDesc td = new TypeDesc(def.getName(), def.getNamespace(), typeName, TypeDesc.TypeEnum.ENUM);
final XSComplexTypeDefinition ct = complexType ? (XSComplexTypeDefinition) def : null;
final XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) (complexType
? ((XSComplexTypeDefinition) def).getSimpleType()
: def);
for (int i = 0; i < st.getLexicalEnumeration().getLength(); i++) {
final String s = st.getLexicalEnumeration().item(i);
td.fdMap.put(s, new FieldDesc(Util.computeEnumConstantName(s, td.name), s));
}
final XSObjectList anns = complexType ? ct.getAnnotations() : st.getAnnotations();
td.documentation = parseAnnotationString(
"Enumeration " + def.getNamespace() + ":" + def.getName() + " documentation",
anns != null && anns.getLength() > 0
? ((XSAnnotation) anns.item(0)).getAnnotationString()
: null
);
jtMap.put(model.toJavaQualifiedTypeName(def, nsdMap, true), td);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:31,代码来源:XSDModelLoader.java
示例3: findElementReference
import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
/**
* Finds all the element and complexType references for the specified element and populates a map entry with element
* names referenced by the element.
*
* @param context the context.
* @param elementDeclaration the element declaration.
*/
private void findElementReference(String context,
XSElementDeclaration elementDeclaration) {
XSTypeDefinition typeDefinition = elementDeclaration.getTypeDefinition();
if (null != typeDefinition) {
String typeDefName = typeDefinition.getName();
if (typeDefinition instanceof XSComplexTypeDefinition) {
addToSchemaMap(context, typeDefName);
if (null != typeDefName) {
context = typeDefName;
}
XSParticle particle = ((XSComplexTypeDefinition) typeDefinition).getParticle();
if (currentNodeNames.contains(typeDefName)) {
/* circular reference */
// currentNodeNames.add(typeDefName);
// findReferenceInParticle(context, particle);
}
else {
currentNodeNames.add(typeDefName);
findReferenceInParticle(context, particle);
}
}
else {
addToSchemaMap(context, typeDefName);
if (null != typeDefName) {
context = typeDefName;
}
currentNodeNames.add(typeDefName);
}
}
}
示例4: getBaseType
import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
private int getBaseType(XSTypeDefinition std) {
if (std == null) {
return XQItemType.XQBASETYPE_ANYSIMPLETYPE;
}
if (xs_ns.equals(std.getNamespace())) {
QName qn = new QName(std.getNamespace(), std.getName());
int type = getBaseTypeForTypeName(qn);
logger.trace("getBaseType; returning {} for type {}", type, std.getName());
return type;
}
return getBaseType(std.getBaseType());
}
示例5: addGlobalTypeDecl
import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
void addGlobalTypeDecl(XSTypeDefinition decl) {
final String namespace = decl.getNamespace();
final String declKey = (namespace == null || namespace.length() == 0)
? "," + decl.getName() : namespace + "," + decl.getName();
if (fGlobalTypeDecls.get(declKey) == null) {
fGlobalTypeDecls.put(declKey, decl);
}
}
示例6: parseXSObject
import org.apache.xerces.xs.XSTypeDefinition; //导入方法依赖的package包/类
/**
* Parse a schema element and attach the result to the given node.
*
* @param schemaElem the schema element.
* @param nodeContext the Node where the xml instance is generated.
* @return the generated DOM node.
*/
protected Node parseXSObject(XSObject schemaElem,
Node nodeContext) throws Exception {
Element contentElem = null;
if (!(schemaElem instanceof XSSimpleTypeDefinition)) {
// create the element
contentElem = DocumentHelper.createElement(generatedDoc, schemaElem.getNamespace(), schemaElem.getName());
}
XSTypeDefinition tDefinition = null;
if (schemaElem instanceof XSElementDeclaration) {
tDefinition = ((XSElementDeclaration) schemaElem).getTypeDefinition();
nodeContext.appendChild(contentElem);
}
else if (schemaElem instanceof XSTypeDefinition) {
tDefinition = ((XSTypeDefinition) schemaElem);
}
else {
tDefinition = ((XSTypeDefinition) schemaElem);
}
if (tDefinition instanceof XSComplexTypeDefinition) {
XSComplexTypeDefinition ctDef = (XSComplexTypeDefinition) tDefinition;
XSObjectList attList = ctDef.getAttributeUses();
for (int i = 0; i < attList.getLength(); i++) {
XSAttributeUse attrUseObject = (XSAttributeUse) attList.item(i);
String attribname = attrUseObject.getAttrDeclaration().getName();
if (sampleXML) {
parseXSObject(attrUseObject.getAttrDeclaration().getTypeDefinition(),
DocumentHelper.createElement(generatedDoc, null, attribname));
}
assignAttributeValue(attribname, contentElem);
}
XSParticle particle = ((XSComplexTypeDefinition) tDefinition).getParticle();
String typeDefName = tDefinition.getName();
if (null != typeDefName) {
processXSParticle(particle, contentElem);
}
else {
processXSParticle(particle, contentElem);
}
}
else {
if (sampleXML) {
StringList enumeration = ((XSSimpleTypeDefinition) tDefinition).getLexicalEnumeration();
if (0 < enumeration.getLength()) {
String name;
if (null == nodeContext.getParentNode()) {
name = "'" + nodeContext.getNodeName() + "' attribute";
}
else {
name = "'" + schemaElem.getName() + "' node";
}
ArrayList<String> enumList = enumerationMap.get(name);
if (null == enumList) {
enumList = new ArrayList<String>();
enumerationMap.put(name, enumList);
}
for (int i = 0; i < enumeration.getLength(); i++) {
enumList.add(enumeration.item(i));
}
}
}
}
if (!(schemaElem instanceof XSSimpleTypeDefinition)) {
assignNodeValue(contentElem);
}
return contentElem;
}