/** * Same as convertName, except the name that comes out will * be suitable as an instance variable (first letter is lowercase). */ public static String convertNameInstance(String name) { return convertName(name, false); }
nameToFind = Common.convertName(selectorProp.dtdName); if (returnType == null) { if (selectorProp.getPropertyInterface() == null) methodName = "find"+nameToFind; if (!keyName.equals(".")) methodName = methodName+"By"+Common.convertName(keyName); String arguments; if (keyTypeInterface == null)
/** * Convert a DTD name into a bean name: * * Any - or _ character is removed. The letter following - and _ * is changed to be upper-case. * If the user mixes upper-case and lower-case, the case is not * changed. * If the Word is entirely in upper-case, the word is changed to * lower-case (except the characters following - and _) * The first letter is always upper-case. */ public static String convertName(String name) { return convertName(name, true); }
/** * Return the internal object representation of the property. This method * cannot return null. If there is no object available for the specified * property name, an exception is thrown. */ public BeanProp beanProp(String name) { BeanProp prop = (BeanProp)this.propByName.get(name); if (prop == null) { // Search using the dtd name String beanName = Common.convertName(name); prop = (BeanProp)this.propByName.get(beanName); if (prop == null) throw new IllegalArgumentException(Common. getMessage("BeanPropertyDoesntExist_msg", this.getClass().getName(), name)); } return prop; }
void initialize(boolean isRoot) { // Make up a bean name: xxx-yyy has to be XxxYyy this.beanName = Common.convertName(this.node.getName()); // // As each node ends up as a property, we have to find out the // type of the property. The default value is Common.TYPE_BEAN. // this.type = Common.TYPE_BEAN; this.isRoot = isRoot; calculateType(); }
public void dumpBeanTree(java.io.Writer out, String indent, String indentBy) throws java.io.IOException { out.write(indent); out.write(java.beans.Introspector.decapitalize(Common.convertName(beanElement.node.getName()))); out.write(" <"); out.write(beanElement.node.getName()); out.write(">"); out.write(" : "); out.write(className); if (!beanElement.node.getExtraData().isEmpty()) { out.write(" \t"); out.write(beanElement.node.getExtraData().toString()); } out.write("\n"); StringBuffer str = new StringBuffer(); int lineCount = 1; lineCount = dumpAttributes(beanElement.getGraphNode(), str, indent+indentBy, lineCount); lineCount = dumpBeanTree(beanElement, str, indent+indentBy, indentBy, lineCount); out.write(str.toString()); if (lineCount >= MAX_DUMP_TREE_LINE_COUNT) { out.write(indent); out.write("... etc ...\n"); } }
String attrName = attr.getName(); if (!propertyWriters.containsKey(attrName)) { attrName = Common.convertName(attrName); if (!propertyWriters.containsKey(attrName)) { attrName = Introspector.decapitalize(attrName); childNodeName = Common.convertName(childNodeName); if (!propertyWriters.containsKey(childNodeName)) { childNodeName = Introspector.decapitalize(childNodeName);
/** * When the bean tree is built from an XML document and an attribute * not defined in the DTD is found, the attribute is dynamically added * to the list of defined attribute with the TRANSIENT status. */ public void createTransientAttribute(String dtdName) { // Add the attribute only if we don't know about it AttrProp ap = this.getAttrProp(dtdName, true); if (ap != null) return; ap = new AttrProp(this.dtdName, dtdName, Common.convertName(dtdName), AttrProp.CDATA | AttrProp.IMPLIED | AttrProp.TRANSIENT, null, null); this.attributes.add(ap); if (DDLogFlags.debug) { TraceLogger.put(TraceLogger.DEBUG, TraceLogger.SVC_DD, DDLogFlags.DBG_BLD, 5, DDLogFlags.CREATEATTR, this.beanName + ": " + ap.toString()); } }
this.name = Common.convertName(value); this.state = NEED_TYPE; break;
String name; if (directChild) name = Common.convertName(attr.getName()); else name = Common.convertName(propertyName+"_"+attr.getName()); if (usedNames.containsKey(name)) { int uniqNum = 2;
String constName; if (l.name != null) { name = Common.convertName(l.name); dtdName = l.getSchemaName(); namespace = l.getNamespace();
jw.end(); String beanName = Common.convertName(beanElement.node.getName()); if (beanElement.isRoot) jw.writeEol("return \"/"+beanName+"\"");
String prefix; if (graphNode.getNamespace() != null) { prefix = Common.convertName(graphNode.getNamespace()); } else { prefix = UNIQUE_PREFIX;