Thread: [Ejtools-cvs] CVS: build beaninfo.j,1.1,1.2 build.sh,1.3,1.4 build_application.xml,1.7,1.8
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-05-15 07:30:32
|
Update of /cvsroot/ejtools/build In directory usw-pr-cvs1:/tmp/cvs-serv10514 Modified Files: beaninfo.j build.sh build_application.xml Log Message: Return to the xmlbeans generation for BeanInfo Index: beaninfo.j =================================================================== RCS file: /cvsroot/ejtools/build/beaninfo.j,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** beaninfo.j 13 May 2002 20:30:47 -0000 1.1 --- beaninfo.j 15 May 2002 07:30:29 -0000 1.2 *************** *** 7,17 **** import java.beans.BeanDescriptor; import java.beans.BeanInfo; - import java.beans.IntrospectionException; import java.beans.Introspector; ! import java.beans.MethodDescriptor; ! import java.beans.ParameterDescriptor; import java.beans.PropertyDescriptor; import java.beans.SimpleBeanInfo; - import java.beans.beancontext.BeanContextSupport; import java.lang.reflect.Method; import java.util.ResourceBundle; --- 7,15 ---- import java.beans.BeanDescriptor; import java.beans.BeanInfo; import java.beans.Introspector; ! import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; + import java.beans.MethodDescriptor; import java.beans.SimpleBeanInfo; import java.lang.reflect.Method; import java.util.ResourceBundle; *************** *** 62,66 **** /** ! * Gets the additionalBeanInfo ... * * @return The additionalBeanInfo value --- 60,64 ---- /** ! * Gets the additionalBeanInfo attribute ... * * @return The additionalBeanInfo value *************** *** 82,86 **** catch (Exception e) { ! System.err.println(e); } return biarr; --- 80,84 ---- catch (Exception e) { ! // Ignore it } return biarr; *************** *** 111,135 **** /** ! * Gets the defaultPropertyIndex attribute ... * * @return The defaultPropertyIndex value */ ! public int getDefaultPropertyIndex() { String defName = "<XDtClass:classTagValue tagName="beaninfo:class" paramName="defaultProperty" default=""/>"; ! if (defName.equals("")) return -1; ! PropertyDescriptor[] pd = getPropertyDescriptors(); ! for (int i = 0; i < pd.length; i++) { ! if (pd[i].getName().equals(defName)) { return i; } } - return -1; ! } /** ! * Gets the icon attribute of the ... * * @param type Description of the Parameter --- 109,137 ---- /** ! * Gets the defaultPropertyIndex attribute of the JNDIEntryBeanInfo object * * @return The defaultPropertyIndex value */ ! public int getDefaultPropertyIndex() ! { String defName = "<XDtClass:classTagValue tagName="beaninfo:class" paramName="defaultProperty" default=""/>"; ! if (defName.equals("")) ! { ! return -1; ! } PropertyDescriptor[] pd = getPropertyDescriptors(); ! for (int i = 0; i < pd.length; i++) ! { ! if (pd[i].getName().equals(defName)) ! { return i; } } return -1; ! } /** ! * Gets the icon attribute ... * * @param type Description of the Parameter *************** *** 159,225 **** /** ! * Gets the methodDescriptors attribute ... ! * ! * @return The methodDescriptors value ! */ ! public MethodDescriptor[] getMethodDescriptors() ! { ! // MethodDescriptor[] methods = new MethodDescriptor[<methodCount/>]; ! int i = 0; ! Method[] m; ! Method method; ! // <method> ! try ! { ! m = Class.forName("<beanClass/>").getMethods(); ! } ! catch (ClassNotFoundException e) ! { ! System.err.println(e); ! return new MethodDescriptor[0]; ! } ! method = null; ! for (int j = 0; j != m.length; j++) ! { ! if (m[j].getName().equals("<methodName/>")) ! { ! method = m[j]; ! break; ! } ! } ! if (method != null) ! { ! ParameterDescriptor[] pd = new ParameterDescriptor[method.getParameterTypes().length]; ! int pidx = 0; ! // <parameter> ! pd[pidx] = new ParameterDescriptor(); ! // <hasPropertyEditor>pd[pidx].setValue("propertyeditor","<propertyEditor/>");</hasPropertyEditor> ! pd[pidx++].setDisplayName(res.getString("parameter.<methodName/>." + pidx + ".displayname")); ! // </parameter> ! if (pidx == 0) ! { ! methods[i] = new MethodDescriptor(method); ! } ! else ! { ! methods[i] = new MethodDescriptor(method, pd); ! } ! methods[i].setName("<methodName/>"); ! // <hasDisplayName>methods[i].setDisplayName(res.getString("method.<methodName/>.displayname"));</hasDisplayName> ! // <hasShortDescription>methods[i].setShortDescription(res.getString("method.<methodName/>.shortdescription"));</hasShortDescription> ! // <isExpert>methods[i].setExpert(true);</isExpert> ! // <isHidden>methods[i].setHidden(true);</isHidden> ! // <attribute> ! methods[i].setValue("<attributeName/>", "<attributeValue/>"); ! // </attribute> ! i++; ! } ! // </method> ! return methods; ! } ! ! ! /** ! * Gets the propertyDescriptors attribute ... * * @return The propertyDescriptors value --- 161,165 ---- /** ! * Gets the propertyDescriptors attribute of the JNDIEntryBeanInfo object * * @return The propertyDescriptors value *************** *** 229,266 **** try { ! // PropertyDescriptor[] properties = new PropertyDescriptor[<propertyCount/>]; ! int i = 0; ! // <property> try { ! // <isReadOnly>if (false)</isReadOnly> ! // properties[i] = new PropertyDescriptor("<propertyName/>",<beanClass/>.class); ! // <isReadOnly>else ! // properties[i] = new PropertyDescriptor("<propertyName/>",<beanClass/>.class, "<getter/>",null); ! // </isReadOnly> } catch (IntrospectionException e) { ! // properties[i] = new PropertyDescriptor("<propertyName/>",<beanClass/>.class, "<getter/>",null); } ! // <isBound>properties[i].setBound(true);</isBound> ! // <isConstrained>properties[i].setConstrained(true);</isConstrained> ! // <hasPropertyEditor>properties[i].setPropertyEditorClass(Class.forName("<propertyEditor/>"));</hasPropertyEditor> ! // <hasDisplayName>properties[i].setDisplayName(res.getString("property.<propertyName/>.displayname"));</hasDisplayName> ! // <hasShortDescription>properties[i].setShortDescription(res.getString("property.<propertyName/>.shortdescription"));</hasShortDescription> ! // <isExpert>properties[i].setExpert(true);</isExpert> ! // <isHidden>properties[i].setHidden(true);</isHidden> ! // <attribute> ! properties[i].setValue("<attributeName/>", "<attributeValue/>"); ! // </attribute> ! i++; ! // </property> ! return properties; } catch (Exception e) { ! System.err.println(e); ! return null; } } } --- 169,212 ---- try { ! Vector properties = new Vector(); ! PropertyDescriptor property = null; ! ! <XDtClass:forAllClassTags tagName="beaninfo:property"> ! try { ! <XDtClass:ifDoesntHaveClassTag tagName="beaninfo:property" paramName="readOnly"> ! property = new PropertyDescriptor("<XDtClass:classTagValue tagName="beaninfo:property" paramName="name"/>",<XDtClass:fullClassName/>.class); ! </XDtClass:ifDoesntHaveClassTag> ! <XDtClass:ifHasClassTag tagName="beaninfo:property" paramName="readOnly"> ! property = new PropertyDescriptor("<XDtClass:classTagValue tagName="beaninfo:property" paramName="name"/>",<XDtClass:fullClassName/>.class, "getter", null); ! </XDtClass:ifHasClassTag> } catch (IntrospectionException e) { ! property = new PropertyDescriptor("<XDtClass:classTagValue tagName="beaninfo:property" paramName="name"/>",<XDtClass:fullClassName/>.class, "getter", null); } ! ! <XDtClass:ifHasClassTag tagName="beaninfo:property" paramName="displayName">property.setDisplayName("<XDtClass:classTagValue tagName="beaninfo:property" paramName="displayName"/>");</XDtClass:ifHasClassTag> ! <XDtClass:ifHasClassTag tagName="beaninfo:property" paramName="shortDescription">property.setShortDescription("<XDtClass:classTagValue tagName="beaninfo:property" paramName="shortDescription"/>");</XDtClass:ifHasClassTag> ! <XDtClass:ifHasClassTag tagName="beaninfo:property" paramName="expert">property.setExpert(<XDtClass:classTagValue tagName="beaninfo:property" paramName="expert" values="true,false"/>);</XDtClass:ifHasClassTag> ! <XDtClass:ifHasClassTag tagName="beaninfo:property" paramName="hidden">property.setHidden(<XDtClass:classTagValue tagName="beaninfo:property" paramName="hidden" values="true,false"/>);</XDtClass:ifHasClassTag> ! <XDtClass:ifHasClassTag tagName="beaninfo:property" paramName="preferred">property.setPreferred(<XDtClass:classTagValue tagName="beaninfo:property" paramName="preferred" values="true,false"/>);</XDtClass:ifHasClassTag> ! ! <XDtClass:ifHasClassTag tagName="beaninfo:property" paramName="bound">property.setBound("<XDtClass:classTagValue tagName="beaninfo:property" paramName="bound" values="true,false"/>");</XDtClass:ifHasClassTag> ! <XDtClass:ifHasClassTag tagName="beaninfo:property" paramName="constrained">property.setConstrained("<XDtClass:classTagValue tagName="beaninfo:property" paramName="constrained" values="true,false"/>");</XDtClass:ifHasClassTag> ! <XDtClass:ifHasClassTag tagName="beaninfo:property" paramName="propertyEditor">property.setPropertyEditorClass(Class.forName("<XDtClass:classTagValue tagName="beaninfo:property" paramName="propertyEditor"/>"));</XDtClass:ifHasClassTag> ! ! properties.add(property); ! ! </XDtClass:forAllClassTags> ! ! return properties.toArray(new PropertyDescriptor[properties.size()]); } catch (Exception e) { ! // Ignore it } + return null; } } Index: build.sh =================================================================== RCS file: /cvsroot/ejtools/build/build.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.sh 6 May 2002 20:36:15 -0000 1.3 --- build.sh 15 May 2002 07:30:29 -0000 1.4 *************** *** 28,31 **** --- 28,32 ---- CP=$CP:$THIRDPARTY/dreambean/codegen/ CP=$CP:$THIRDPARTY/dreambean/codegen/codegen.jar + CP=$CP:$THIRDPARTY/dreambean/xmlbeans/ CP=$CP:$THIRDPARTY/dreambean/xmlbeans/xmlbeans.jar Index: build_application.xml =================================================================== RCS file: /cvsroot/ejtools/build/build_application.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** build_application.xml 13 May 2002 20:30:47 -0000 1.7 --- build_application.xml 15 May 2002 07:30:29 -0000 1.8 *************** *** 132,135 **** --- 132,136 ---- <target name="xmlbeans" depends="compile" if="has.dir.etc.beaninfo"> <mkdir dir="${build.src}"/> + <!-- <xdoclet sourcepath="${src.main}" destdir="${build.src}" classpathref="compile.classpath"> <fileset dir="${src.main}"> *************** *** 139,148 **** <template templateFile="build/beaninfo.j" destinationFile="{0}BeanInfo.java" havingClassTag="beaninfo:class"/> </xdoclet> ! <!-- <xmlbean destdir="${build.src}" srcdir="../${src.etc}/beaninfo" includes="**" excludes="**/CVS/**"/> <javac srcdir="${build.src}" destdir="${build.classes}" classpath="${classpath}" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}" includes="**/*BeanInfo.java" excludes="**/CVS/**"> <classpath refid="compile.classpath"/> </javac> - --> </target> <!-- ==================== Build Target ===================================== --> --- 140,148 ---- <template templateFile="build/beaninfo.j" destinationFile="{0}BeanInfo.java" havingClassTag="beaninfo:class"/> </xdoclet> ! --> <xmlbean destdir="${build.src}" srcdir="../${src.etc}/beaninfo" includes="**" excludes="**/CVS/**"/> <javac srcdir="${build.src}" destdir="${build.classes}" classpath="${classpath}" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}" includes="**/*BeanInfo.java" excludes="**/CVS/**"> <classpath refid="compile.classpath"/> </javac> </target> <!-- ==================== Build Target ===================================== --> |