/** * Gets the conversion method for this attribute, if any. * * @return * If the convert attribute is not specified, this * method returns null. */ public BIConversion getConversion() { if (element.getAttributeNode("convert") == null) return null; String cnv = element.getAttribute("convert"); return parent.conversion(cnv); }
/** * Creates constructor declarations as specified in the * binding information. * * <p> * Also checks that the binding file does not contain * declarations for non-existent elements. */ private void processConstructorDeclarations() { for( BIElement decl: bindInfo.elements() ) { Element e = elements.get(decl.name()); if(e==null) { error(decl.getSourceLocation(), Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name()); continue; // continue to process next declaration } if(!decl.isClass()) // only element-class declaration has constructor definitions continue; decl.declareConstructors(e.getClassInfo()); } }
if(isClass()) { className = NameConverter.standard.toClassName(name()); this.className = className; } else { String name = name(); QName tagName = new QName("",name); this.clazz = new CClassInfo(parent.model,parent.getTargetPackage(),className,getLocation(),null,tagName,null,null/*TODO*/);
/** * When this element is an PCDATA-only content model, * returns the conversion for it. Otherwise the behavior is undefined. */ private TypeUse getConversion() { assert contentModel == Term.EMPTY; // this is PCDATA-only element BIElement e = owner.bindInfo.element(name); if(e!=null) { BIConversion conv = e.getConversion(); if(conv!=null) return conv.getTransducer(); } return CBuiltinLeafInfo.STRING; }
protected CPropertyInfo createAttribute( String elementName, String attributeName, String attributeType, String[] enums, short attributeUse, String defaultValue ) throws SAXException { boolean required = attributeUse==USE_REQUIRED; // get the attribute-property declaration BIElement edecl = bindInfo.element(elementName); BIAttribute decl=null; if(edecl!=null) decl=edecl.attribute(attributeName); String propName; if(decl==null) propName = model.getNameConverter().toPropertyName(attributeName); else propName = decl.getPropertyName(); QName qname = new QName("",attributeName); // if no declaration is specified, just wrap it by // a FieldItem and let the normalizer handle its content. TypeUse use; if(decl!=null && decl.getConversion()!=null) use = decl.getConversion().getTransducer(); else use = builtinConversions.get(attributeType); CPropertyInfo r = new CAttributePropertyInfo( propName, null,null/*TODO*/, copyLocator(), qname, use, null, required ); if(defaultValue!=null) r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) ); return r; }
if(isClass()) { className = NameConverter.standard.toClassName(name()); this.className = className; } else { String name = name(); QName tagName = new QName("",name); this.clazz = new CClassInfo(parent.model,parent.getTargetPackage(),className,getLocation(),null,tagName,null,null/*TODO*/);
/** * When this element is an PCDATA-only content model, * returns the conversion for it. Otherwise the behavior is undefined. */ private TypeUse getConversion() { assert contentModel == Term.EMPTY; // this is PCDATA-only element BIElement e = owner.bindInfo.element(name); if(e!=null) { BIConversion conv = e.getConversion(); if(conv!=null) return conv.getTransducer(); } return CBuiltinLeafInfo.STRING; }
protected CPropertyInfo createAttribute( String elementName, String attributeName, String attributeType, String[] enums, short attributeUse, String defaultValue ) throws SAXException { boolean required = attributeUse==USE_REQUIRED; // get the attribute-property declaration BIElement edecl = bindInfo.element(elementName); BIAttribute decl=null; if(edecl!=null) decl=edecl.attribute(attributeName); String propName; if(decl==null) propName = model.getNameConverter().toPropertyName(attributeName); else propName = decl.getPropertyName(); QName qname = new QName("",attributeName); // if no declaration is specified, just wrap it by // a FieldItem and let the normalizer handle its content. TypeUse use; if(decl!=null && decl.getConversion()!=null) use = decl.getConversion().getTransducer(); else use = builtinConversions.get(attributeType); CPropertyInfo r = new CAttributePropertyInfo( propName, null,null/*TODO*/, copyLocator(), qname, use, null, required ); if(defaultValue!=null) r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) ); return r; }
/** * Creates constructor declarations as specified in the * binding information. * * <p> * Also checks that the binding file does not contain * declarations for non-existent elements. */ private void processConstructorDeclarations() { for( BIElement decl: bindInfo.elements() ) { Element e = elements.get(decl.name()); if(e==null) { error(decl.getSourceLocation(), Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name()); continue; // continue to process next declaration } if(!decl.isClass()) // only element-class declaration has constructor definitions continue; decl.declareConstructors(e.getClassInfo()); } }
if(isClass()) { className = NameConverter.standard.toClassName(name()); this.className = className; } else { String name = name(); QName tagName = new QName("",name); this.clazz = new CClassInfo(parent.model,parent.getTargetPackage(),className,getLocation(),null,tagName,null,null/*TODO*/);
/** * Gets the conversion method for this attribute, if any. * * @return * If the convert attribute is not specified, this * method returns null. */ public BIConversion getConversion() { if (element.getAttributeNode("convert") == null) return null; String cnv = element.getAttribute("convert"); return parent.conversion(cnv); }
/** * When this element is an PCDATA-only content model, * returns the conversion for it. Otherwise the behavior is undefined. */ private TypeUse getConversion() { assert contentModel == Term.EMPTY; // this is PCDATA-only element BIElement e = owner.bindInfo.element(name); if(e!=null) { BIConversion conv = e.getConversion(); if(conv!=null) return conv.getTransducer(); } return CBuiltinLeafInfo.STRING; }
protected CPropertyInfo createAttribute( String elementName, String attributeName, String attributeType, String[] enums, short attributeUse, String defaultValue ) throws SAXException { boolean required = attributeUse==USE_REQUIRED; // get the attribute-property declaration BIElement edecl = bindInfo.element(elementName); BIAttribute decl=null; if(edecl!=null) decl=edecl.attribute(attributeName); String propName; if(decl==null) propName = model.getNameConverter().toPropertyName(attributeName); else propName = decl.getPropertyName(); QName qname = new QName("",attributeName); // if no declaration is specified, just wrap it by // a FieldItem and let the normalizer handle its content. TypeUse use; if(decl!=null && decl.getConversion()!=null) use = decl.getConversion().getTransducer(); else use = builtinConversions.get(attributeType); CPropertyInfo r = new CAttributePropertyInfo( propName, null,null/*TODO*/, copyLocator(), qname, use, null, required ); if(defaultValue!=null) r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) ); return r; }
/** * Creates constructor declarations as specified in the * binding information. * * <p> * Also checks that the binding file does not contain * declarations for non-existent elements. */ private void processConstructorDeclarations() { for( BIElement decl: bindInfo.elements() ) { Element e = elements.get(decl.name()); if(e==null) { error(decl.getSourceLocation(), Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name()); continue; // continue to process next declaration } if(!decl.isClass()) // only element-class declaration has constructor definitions continue; decl.declareConstructors(e.getClassInfo()); } }
if(isClass()) { className = NameConverter.standard.toClassName(name()); this.className = className; } else { String name = name(); QName tagName = new QName("",name); this.clazz = new CClassInfo(parent.model,parent.getTargetPackage(),className,getLocation(),null,tagName,null,null/*TODO*/);
/** * Gets the conversion method for this attribute, if any. * * @return * If the convert attribute is not specified, this * method returns null. */ public BIConversion getConversion() { if (element.getAttributeNode("convert") == null) return null; String cnv = element.getAttribute("convert"); return parent.conversion(cnv); }