java - How to handle categories inside properties file? -


there new process implement involves writing , reading excel file. this, process needs properties define sheets , cells use write/read values. there fixed number of properties use based on category. show example:

category1.sheet1=customer info category1.cell1=a10 category1.cell2=b10 category1.cell3=a20  category2.sheet1=customer data category2.cell1=a20 category2.cell2=b20 category2.cell3=a25  //more categories... 

in process, @ step, decide category i'm using , must consume properties category only. how load properties single category?

currently, have approach (code simplified better understanding):

//get category1 or category2 based on rules... string category = getcurrentcategory(); //define name of properties use string sheet1 = category + "sheet1"; string cell1 = category + "cell1"; string cell2 = category + "cell2"; string cell3 = category + "cell3"; //use properties... string sheet1value = getproperty(sheet1); string cell1value = getproperty(cell1);  //excelfilehandler custom interface work excel files //it serves facade communicate apache poi classes excelfilehandler.gotosheet(sheet1value).gotocell(cell1value).setvalue("some value"); excelfilehandler.gotocell(cell2value).setvalue("some value"); 

is there approach solve kind of problem or should keep design?

note: i'm in design phase can still change approach.

use extendedproperties filter property prefix.

see commons collections extendedproperties#subset()


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -