From: Zenaan H. <ze...@fr...> - 2006-09-23 01:55:06
|
Hello, let's say I have a library of standard bean wrappers, which (for StringTemplate) are actually String or Date or whatever, wrappers. That is, a particular wrapper contains a Date say, and knows how to format that object in a particular way. Now, in my data source file (data.yaml), I need to place certain data, such as bean properties - hundreds of them!, eg: ==================================================== table_lang.yaml: --- table_name: lang ... columns: - name: name_en type: varchar length: 14 nulls: false comment: "English name of language." - name: lang_iso type: char length: 2 nulls: true comment: "ISO Language Code, 2 letters." ... constraints: - name: lang_pkey type: PRIMARY KEY data: name_en ===================================================== Now, since the various parameters of each column/bean need to be variables inside a java class, included in comments, but also used to construct getter and setter methods, I need to be able to, eg, uppercase the first char of each property, eg. from name_en to Name_en, so that the corresponding methods in my StringTemplate- generated .java file become getName_en and setName_en. Thus, I need to wrap all my properties in a StringUppercaser string-munging wrapper. At least, this is one solution. Now, ordinarily with Yaml data file, I have to do something like: - !test.TestJYaml$StringUppercaser string: name_en instead of simply: - name_en And I have to do this for EVERY property. Could there be an easier/ more concise way? TIA Zen -- Free Australia - www.UPMART.org Please respect the confidentiality of this email as sensibly warranted. |