예제 #1
0
 // assert(!areAllProperties());
 private List createPropertiesNames() {
   StringTokenizer st = new StringTokenizer(removeTotalProperties(properties), ",;");
   List result = new ArrayList();
   while (st.hasMoreTokens()) {
     String name = st.nextToken().trim();
     if (name.endsWith("+")) {
       name = name.substring(0, name.length() - 1);
       if (sumPropertiesNames == null) sumPropertiesNames = new HashSet();
       sumPropertiesNames.add(name);
     }
     result.add(name);
   }
   return result;
 }
예제 #2
0
 public Collection getMetaPropertiesArguments() throws XavaException {
   StringTokenizer st = new StringTokenizer(getArguments(), ",");
   Collection result = new ArrayList();
   while (st.hasMoreTokens()) {
     String argument = st.nextToken();
     StringTokenizer argumentSt = new StringTokenizer(argument);
     String type = argumentSt.nextToken().trim();
     String name = argumentSt.nextToken().trim();
     MetaProperty p = new MetaProperty();
     p.setName(name);
     p.setTypeName(type);
     result.add(p);
   }
   return result;
 }
예제 #3
0
 private String transformAgregateProperty(String property) {
   StringBuffer result = new StringBuffer();
   StringTokenizer st = new StringTokenizer(property, ".");
   String member = "";
   while (st.hasMoreTokens()) {
     String token = st.nextToken();
     result.append(token);
     if (!st.hasMoreTokens()) break;
     member = member + token;
     try {
       MetaReference ref = getMetaModel().getMetaReference(member);
       if (ref.isAggregate()) result.append('_');
       else result.append('.');
     } catch (XavaException ex) {
       result.append('.');
     }
     member = member + ".";
   }
   return result.toString();
 }
예제 #4
0
 private boolean hasSome3LevelProperty(String sentence) throws XavaException {
   if (sentence == null) return false;
   int i = sentence.indexOf("${");
   int f = 0;
   while (i >= 0) {
     f = sentence.indexOf("}", i + 2);
     if (f < 0) break;
     String property = sentence.substring(i + 2, f);
     StringTokenizer st = new StringTokenizer(property, ".");
     if (st.countTokens() > 3) {
       log.warn(XavaResources.getString("property_3_level_in_ejb2_finder", property, getName()));
       return true;
     }
     if (st.countTokens() == 3) {
       if (!getMetaModel().getMetaProperty(property).isKey()) {
         log.warn(XavaResources.getString("property_3_level_in_ejb2_finder", property, getName()));
         return true;
       }
     }
     i = sentence.indexOf("${", i + 1);
   }
   return false;
 }