public List<MethodInfo> getMethodInfosForGlobalVariable(final String varName) { final String type = this.getGlobalVariable( varName ); return this.methodInfos.get( type ); }
@Test public void testGlobal() throws Exception { SuggestionCompletionLoader loader = new SuggestionCompletionLoader(); SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n global org.drools.Person p", new ArrayList(), new ArrayList() ); assertNotNull( eng ); assertFalse( loader.hasErrors() ); assertEquals( 1, eng.getGlobalVariables().length ); assertEquals( "p", eng.getGlobalVariables()[0] ); assertEquals( "Person", eng.getGlobalVariable( "p" ) ); String[] flds = (String[]) eng.getModelFields( "Person" ); assertNotNull( flds ); assertEquals( 0, eng.getGlobalCollections().length ); }
public List<MethodInfo> getMethodInfosForGlobalVariable(final String varName) { final String type = this.getGlobalVariable( varName ); return this.methodInfos.get( type ); }
@Test public void testGlobalCollections() throws Exception { SuggestionCompletionLoader loader = new SuggestionCompletionLoader(); SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n global java.util.List ls", new ArrayList(), new ArrayList() ); assertNotNull( eng ); assertFalse( loader.hasErrors() ); assertEquals( 1, eng.getGlobalVariables().length ); assertEquals( "ls", eng.getGlobalVariables()[0] ); assertEquals( "List", eng.getGlobalVariable( "ls" ) ); assertNotNull( eng.getGlobalCollections() ); assertEquals( 1, eng.getGlobalCollections().length ); assertEquals( "ls", eng.getGlobalCollections()[0] ); }
public static ExpressionPart getExpressionPartForGlobalVariable(SuggestionCompletionEngine sce, String varName) { String globalVarType = sce.getGlobalVariable(varName); return new ExpressionGlobalVariable(varName, globalVarType, globalVarType); } }
public static ExpressionPart getExpressionPartForGlobalVariable(SuggestionCompletionEngine sce, String varName) { String globalVarType = sce.getGlobalVariable(varName); return new ExpressionGlobalVariable(varName, globalVarType, globalVarType); } }
public String[] getFieldCompletionsForGlobalVariable(final String varName) { final String type = this.getGlobalVariable( varName ); return this.getModelFields( type ); }
public String[] getFieldCompletionsForGlobalVariable(final String varName) { final String type = this.getGlobalVariable( varName ); return this.getModelFields( type ); }