1 4 package com.tonbeller.jpivot.param; 5 6 import java.util.List ; 7 8 import com.tonbeller.jpivot.olap.model.Member; 9 import com.tonbeller.jpivot.olap.model.Property; 10 import com.tonbeller.wcf.param.SessionParam; 11 12 17 public class PropertyPrefixParamProvider extends AbstractParamProvider { 18 String propertyPrefix; 19 20 32 public PropertyPrefixParamProvider(String propertyPrefix) { 33 this.propertyPrefix = propertyPrefix; 34 } 35 36 protected void addMemberParams(List list, SqlAccess sa, Member member) { 37 int prefixLength = propertyPrefix.length(); 38 Property[] p = member.getProperties(); 39 for (int i = 0; i < p.length; i++) { 40 String propertyName = p[i].getName(); 41 if (!propertyName.startsWith(propertyPrefix)) 42 continue; 43 String paramName = propertyName.substring(prefixLength); 44 SessionParam sp = sa.createParameter(member, paramName, propertyName); 45 if (sp != null) list.add(sp); 47 } 48 } 49 50 } | Popular Tags |