/** * @param propertyName * of the type class.field * @return */ public String getFieldClassName(String propertyName) { String[] split = propertyName.split( "\\." ); if ( split.length != 2 ) { throw new IllegalArgumentException( "Invalid format '" + propertyName + "'. It must be of type className.propertyName" ); } return this.getFieldClassName( split[0], split[1] ); }
/** * @param propertyName * of the type class.field * @return */ public String getFieldClassName(String propertyName) { String[] split = propertyName.split( "\\." ); if ( split.length != 2 ) { throw new IllegalArgumentException( "Invalid format '" + propertyName + "'. It must be of type className.propertyName" ); } return this.getFieldClassName( split[0], split[1] ); }
public static ExpressionPart getExpressionPartForField(SuggestionCompletionEngine sce, String factName, String fieldName) { String fieldClassName = sce.getFieldClassName(factName, fieldName); String fieldGenericType = sce.getFieldType(factName, fieldName); if (SuggestionCompletionEngine.TYPE_COLLECTION.equals(fieldGenericType)) { String fieldParametricType = sce.getParametricFieldType(factName, fieldName); return new ExpressionCollection(fieldName, fieldClassName, fieldGenericType, fieldParametricType); } return new ExpressionField(fieldName, fieldClassName, fieldGenericType); }
public static ExpressionPart getExpressionPartForField(SuggestionCompletionEngine sce, String factName, String fieldName) { String fieldClassName = sce.getFieldClassName(factName, fieldName); String fieldGenericType = sce.getFieldType(factName, fieldName); if (SuggestionCompletionEngine.TYPE_COLLECTION.equals(fieldGenericType)) { String fieldParametricType = sce.getParametricFieldType(factName, fieldName); return new ExpressionCollection(fieldName, fieldClassName, fieldGenericType, fieldParametricType); } return new ExpressionField(fieldName, fieldClassName, fieldGenericType); }
suggestionCompletionEngine.getFieldClassName( "Person", "bananas" ) ); assertEquals( SuggestionCompletionEngine.TYPE_COLLECTION,
"creditRating" ) ); assertEquals( "java.lang.String", eng.getFieldClassName( "Applicant", "creditRating" ) ); assertEquals( FIELD_CLASS_TYPE.TYPE_DECLARATION_CLASS, "deposit" ) ); assertEquals( "java.lang.Integer", eng.getFieldClassName( "LoanApplication", "deposit" ) ); assertEquals( FIELD_CLASS_TYPE.TYPE_DECLARATION_CLASS, "applicant" ) ); assertEquals( "Applicant", eng.getFieldClassName( "LoanApplication", "applicant" ) ); assertEquals( FIELD_CLASS_TYPE.TYPE_DECLARATION_CLASS,