private boolean isNumericKey(KeyedObject obj) { try { Integer.parseInt(obj.getKey().getValue().toString()); return true; } catch (Exception ex) { return false; } } }
Object bindComplexBlock(ComplexObjectBlock block) throws DADLBindingException, RMObjectBuildingException { if (block instanceof SingleAttributeObjectBlock) { SingleAttributeObjectBlock singleBlock = (SingleAttributeObjectBlock) block; // a special case to deal with empty attribute list if("LIST".equalsIgnoreCase(singleBlock.getTypeIdentifier()) && singleBlock.getAttributeValues().isEmpty()) { return new ArrayList(); } return bindAttributes(singleBlock.getTypeIdentifier(), singleBlock .getAttributeValues()); } else { MultipleAttributeObjectBlock multiBlock = (MultipleAttributeObjectBlock) block; List<KeyedObject> list = multiBlock.getKeyObjects(); // TODO assume list? List<Object> valueList = new ArrayList<Object>(); for(KeyedObject ko : list) { Object key = ko.getKey().getValue(); Object value = bindObjectBlock(ko.getObject()); valueList.add(value); } return valueList; } }
final public KeyedObject keyed_object() throws ParseException { SimpleValue key; ObjectBlock object; key = object_key(); jj_consume_token(SYM_EQ); object = object_block(); {if (true) return new KeyedObject(key, object);} throw new Error("Missing return statement in function"); }
Object bindComplexBlock(ComplexObjectBlock block) throws DADLBindingException, RMObjectBuildingException { if (block instanceof SingleAttributeObjectBlock) { SingleAttributeObjectBlock singleBlock = (SingleAttributeObjectBlock) block; // a special case to deal with empty attribute list if("LIST".equalsIgnoreCase(singleBlock.getTypeIdentifier()) && singleBlock.getAttributeValues().isEmpty()) { return new ArrayList(); } return bindAttributes(singleBlock.getTypeIdentifier(), singleBlock .getAttributeValues()); } else { MultipleAttributeObjectBlock multiBlock = (MultipleAttributeObjectBlock) block; List<KeyedObject> list = multiBlock.getKeyObjects(); // TODO assume list? List<Object> valueList = new ArrayList<Object>(); for(KeyedObject ko : list) { Object key = ko.getKey().getValue(); Object value = bindObjectBlock(ko.getObject()); valueList.add(value); } return valueList; } }
final public KeyedObject keyed_object() throws ParseException { SimpleValue key; ObjectBlock object; key = object_key(); jj_consume_token(SYM_EQ); object = object_block(); {if (true) return new KeyedObject(key, object);} throw new Error("Missing return statement in function"); }