public void addElementDecl(XSElementDecl newDecl) { elems.put(newDecl.getName(), newDecl); } public Map<String,XSElementDecl> getElementDecls() {
/** * @see com.sun.xml.xsom.visitor.XSTermFunction#elementDecl(XSElementDecl) */ public String elementDecl(XSElementDecl decl) { String name = decl.getName(); if( name == null ) name = ""; return name + " " + nameGetter.elementDecl( decl ); }
/** * @see com.sun.xml.xsom.visitor.XSTermFunction#elementDecl(XSElementDecl) */ public String elementDecl(XSElementDecl decl) { String name = decl.getName(); if( name == null ) name = ""; return name + " " + nameGetter.elementDecl( decl ); }
/** * @see com.sun.xml.xsom.visitor.XSTermFunction#elementDecl(XSElementDecl) */ public String elementDecl(XSElementDecl decl) { String name = decl.getName(); if( name == null ) name = ""; return name + " " + nameGetter.elementDecl( decl ); }
/** * @see com.sun.xml.xsom.visitor.XSTermFunction#elementDecl(XSElementDecl) */ public String elementDecl(XSElementDecl decl) { String name = decl.getName(); if( name == null ) name = ""; return name + " " + nameGetter.elementDecl( decl ); }
/** * @see com.sun.xml.xsom.visitor.XSTermFunction#elementDecl(XSElementDecl) */ public String elementDecl(XSElementDecl decl) { String name = decl.getName(); if( name == null ) name = ""; return name + " " + nameGetter.elementDecl( decl ); }
public boolean substitutes(String namespaceURI, String localName) { XSElementDecl tmp = element; while ((tmp = tmp.getSubstAffiliation()) != null) { if (namespaceURI.equals(tmp.getTargetNamespace()) && localName.equals(tmp.getName())) return true; } return false; }
public void elementDecl( XSElementDecl decl ) { if(decl.isLocal()) SchemaWriter.this.elementDecl(decl,extraAtts); else { // reference println(MessageFormat.format("<element ref=\"'{'{0}'}'{1}\"{2}/>", decl.getTargetNamespace(), decl.getName(), extraAtts)); } } public void modelGroupDecl( XSModelGroupDecl decl ) {
public void elementDecl( XSElementDecl decl ) { if(decl.isLocal()) SchemaWriter.this.elementDecl(decl,extraAtts); else { // reference println(MessageFormat.format("<element ref=\"'{'{0}'}'{1}\"{2}/>", decl.getTargetNamespace(), decl.getName(), extraAtts)); } } public void modelGroupDecl( XSModelGroupDecl decl ) {
private QName getSubstitutionHead(XSElementDecl element) { XSElementDecl head = element.getSubstAffiliation(); if (head == null) { return null; } else { return new QName(head.getTargetNamespace(), head.getName()); } }
public void elementDecl( XSElementDecl decl ) { if(decl.isLocal()) SchemaWriter.this.elementDecl(decl,extraAtts); else { // reference println(MessageFormat.format("<element ref=\"'{'{0}'}'{1}\"{2}/>", decl.getTargetNamespace(), decl.getName(), extraAtts)); } } public void modelGroupDecl( XSModelGroupDecl decl ) {
public QName getRootSubsitutionGroup() { XSElementDecl tmp = element; XSElementDecl head = null; while ((tmp = tmp.getSubstAffiliation()) != null) head = tmp; return (head != null) ? new QName(head.getTargetNamespace(), head.getName()) : null; }
public void elementDecl( XSElementDecl decl ) { if(decl.isLocal()) SchemaWriter.this.elementDecl(decl,extraAtts); else { // reference println(MessageFormat.format("<element ref=\"'{'{0}'}'{1}\"{2}/>", decl.getTargetNamespace(), decl.getName(), extraAtts)); } } public void modelGroupDecl( XSModelGroupDecl decl ) {
public void elementDecl( XSElementDecl decl ) { if(decl.isLocal()) SchemaWriter.this.elementDecl(decl,extraAtts); else { // reference println(MessageFormat.format("<element ref=\"'{'{0}'}'{1}\"{2}/>", decl.getTargetNamespace(), decl.getName(), extraAtts)); } } public void modelGroupDecl( XSModelGroupDecl decl ) {
protected static String getAnonymousTypeName(XSType type, String fieldName) { if (type.isComplexType()) { XSElementDecl container = type.asComplexType().getScope(); String elName = container.getName(); return elName + ANONYMOUS_TYPE_SUFFIX; } else { return fieldName + ANONYMOUS_TYPE_SUFFIX; } }
XSOMParser parser = new XSOMParser(); parser.parse(xsdfile); XSSchemaSet schemas = parser.getResult(); Iterator<XSElementDecl> i = schemas.iterateElementDecls(); while (i.hasNext()) { XSElementDecl element = i.next(); String name = element.getName(); // Add to editor }
@Override public String elementDecl(final XSElementDecl decl) { final String customName = getCustomPropertyName(decl); return customName == null ? GroupInterfaceGenerator.this.pluginContext.outline.getModel().getNameConverter().toPropertyName(decl.getName()) : customName; }
@Override public void elementDecl(XSElementDecl decl) { if (localName.equals(decl.getName()) && schema.getTargetNamespace().equals(decl.getTargetNamespace())) elements.add(new ElementDecl(decl, Schema.this)); if (decl.getType().isLocal() && shouldWalk() && addToVisited(decl.getType())) decl.getType().visit(this); }
private void interpretElement(XSElementDecl el, XSSchemaSet sset) { XSComplexType cType; XSSimpleType xs; if (el.getType() instanceof XSComplexType && el.getType() != sset.getAnyType()) { cType = (XSComplexType) el.getType(); processComplexType(cType, el.getName(), sset); } else if (el.getType() instanceof XSSimpleType && el.getType() != sset.getAnySimpleType()) { xs = el.getType().asSimpleType(); processSimpleType(xs, el.getName()); } }