NEMOparser implements NEMOparserConstants { static final public LinkedHashMap<String,String> property() throws ParseException { Token objPropertyValueToken = null; Token objRangeLeft = null; Token objRangeRight = null; LinkedHashMap<String,String> propertyvalue= new LinkedHashMap<String,String>(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: case UNUMBER: case ID: case TEMPID: case IPV4PREF: case TIMEVAL: case FULLTIME: case ETHADDR: case IPV4ADDR: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ID: case TEMPID: case IPV4PREF: case TIMEVAL: case FULLTIME: case ETHADDR: case IPV4ADDR: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ID: objPropertyValueToken = jj_consume_token(ID); propertyvalue.put(objPropertyValueToken.image, "string"); break; case ETHADDR: objPropertyValueToken = jj_consume_token(ETHADDR); propertyvalue.put(objPropertyValueToken.image, "string"); break; case IPV4PREF: objPropertyValueToken = jj_consume_token(IPV4PREF); propertyvalue.put(objPropertyValueToken.image, "string"); break; case IPV4ADDR: objPropertyValueToken = jj_consume_token(IPV4ADDR); propertyvalue.put(objPropertyValueToken.image, "string"); break; case TIMEVAL: objPropertyValueToken = jj_consume_token(TIMEVAL); propertyvalue.put(objPropertyValueToken.image, "string"); break; case FULLTIME: objPropertyValueToken = jj_consume_token(FULLTIME); propertyvalue.put(objPropertyValueToken.image, "string"); break; case TEMPID: objPropertyValueToken = jj_consume_token(TEMPID); propertyvalue.put(objPropertyValueToken.image, "string"); break; default: jj_la1[56] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; case UNUMBER: objPropertyValueToken = jj_consume_token(UNUMBER); propertyvalue.put(objPropertyValueToken.image, "integer"); break; case LPAREN: jj_consume_token(LPAREN); objRangeLeft = jj_consume_token(UNUMBER); jj_consume_token(COMMA); objRangeRight = jj_consume_token(UNUMBER); jj_consume_token(RPAREN); propertyvalue.put(objRangeLeft.image+","+objRangeRight.image,"range"); break; default: jj_la1[57] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: jj_la1[58] = jj_gen; LinkedHashMap<String,String> multiProperty = nodeMultiProperty(); for (String value : multiProperty.keySet()) { propertyvalue.put(value, multiProperty.get(value)); } } {if (true) return propertyvalue;} throw new Error("Missing return statement in function"); } NEMOparser(java.io.InputStream stream);  NEMOparser(java.io.InputStream stream, String encoding);  NEMOparser(java.io.Reader stream);  NEMOparser(NEMOparserTokenManager tm); String parseNEMO(UserId userId,String strNEMO, DataBroker dataBroker, TenantManage tenantManage); static final String NEMO(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateIntent(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteIntent(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateNode(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateConnection(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateFlow(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateOperation(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String NodeModel(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String abstractNode(UpdateTemplateDefinitionLang definition); static final String abstractConnection(UpdateTemplateDefinitionLang definition); static final String abstractFlow(UpdateTemplateDefinitionLang definition); static final String abstractOperation(UpdateTemplateDefinitionLang definition); static final String DeleteNode(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteConnection(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteFlow(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteOperation(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String Query(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final LinkedHashMap<String,String> conditionTarget(); static final LinkedHashMap<String,String> property(); static final LinkedHashMap<String,String> nodeMultiProperty(); static void ReInit(java.io.InputStream stream); static void ReInit(java.io.InputStream stream, String encoding); static void ReInit(java.io.Reader stream); void ReInit(NEMOparserTokenManager tm); static final Token getNextToken(); static final Token getToken(int index); static ParseException generateParseException(); static final void enable_tracing(); static final void disable_tracing(); static public NEMOparserTokenManager token_source; static public Token token; static public Token jj_nt; }
@Test public void testProperty() throws Exception { Field field_jj_ntk = class1.getDeclaredField("jj_ntk"); field_jj_ntk.setAccessible(true); Field field_token = class1.getDeclaredField("token"); field_token.setAccessible(true); Token token1 = new Token(); Token token2 = new Token(); token1.next = token2; token2.kind = NEMOparserConstants.ID; token2.image = "1"; field_token.set(class1,token1); field_jj_ntk.set(class1, NEMOparserConstants.ID); Assert.assertTrue(NEMOparser.property().containsKey("1")); token2.kind = NEMOparserConstants.ETHADDR; token2.image = "2"; field_token.set(class1,token1); field_jj_ntk.set(class1, NEMOparserConstants.ETHADDR); Assert.assertTrue(NEMOparser.property().containsKey("2")); token2.kind = NEMOparserConstants.IPV4PREF; token2.image = "3"; field_token.set(class1,token1); field_jj_ntk.set(class1, NEMOparserConstants.IPV4PREF); Assert.assertTrue(NEMOparser.property().containsKey("3")); token2.kind = NEMOparserConstants.IPV4ADDR; token2.image = "4"; field_token.set(class1,token1); field_jj_ntk.set(class1, NEMOparserConstants.IPV4ADDR); Assert.assertTrue(NEMOparser.property().containsKey("4")); token2.kind = NEMOparserConstants.TIMEVAL; token2.image = "5"; field_token.set(class1,token1); field_jj_ntk.set(class1, NEMOparserConstants.TIMEVAL); Assert.assertTrue(NEMOparser.property().containsKey("5")); token2.kind = NEMOparserConstants.FULLTIME; token2.image = "6"; field_token.set(class1,token1); field_jj_ntk.set(class1, NEMOparserConstants.FULLTIME); Assert.assertTrue(NEMOparser.property().containsKey("6")); token2.kind = NEMOparserConstants.TEMPID; token2.image = "7"; field_token.set(class1,token1); field_jj_ntk.set(class1, NEMOparserConstants.TEMPID); Assert.assertTrue(NEMOparser.property().containsKey("7")); token2.kind = NEMOparserConstants.UNUMBER; token2.image = "8"; field_token.set(class1,token1); field_jj_ntk.set(class1, NEMOparserConstants.UNUMBER); Assert.assertTrue(NEMOparser.property().containsKey("8")); }