[teiid-commits] teiid SVN: r2128 - trunk/runtime/src/main/java/org/teiid/deployers.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon May 17 16:33:01 EDT 2010


Author: shawkins
Date: 2010-05-17 16:33:01 -0400 (Mon, 17 May 2010)
New Revision: 2128

Modified:
   trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java
Log:
TEIID-1056 refining connector changes to remove capabilities interface.  also ensuring that property annotation processing is simplified

Modified: trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java	2010-05-17 20:23:50 UTC (rev 2127)
+++ trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java	2010-05-17 20:33:01 UTC (rev 2128)
@@ -37,12 +37,11 @@
 import org.teiid.translator.TranslatorProperty;
 
 public class ManagedPropertyUtil {
-	private static final String[] EMPTY_ALLOWED = new String[0];
 	private static final String TEIID_PROPERTY = "teiid-property"; //$NON-NLS-1$
 	
 	public static ManagedProperty convert(Object instance, Method method, TranslatorProperty prop) {
 		Class<?> type = method.getReturnType();
-		String[] allowedValues = EMPTY_ALLOWED;
+		String[] allowedValues = null;
 		Method getter = null;
 		boolean readOnly = false;
 		if (type == Void.TYPE) { //check for setter
@@ -71,7 +70,11 @@
 			}
 		}
 		Object defaultValue = null;
-		if (!prop.required() && getter != null) {
+		if (prop.required()) {
+			if (prop.advanced()) {
+				throw new TeiidRuntimeException("TranslatorProperty annotation should not both be advanced and required " + method); //$NON-NLS-1$
+			}
+		} else if (getter != null) {
 			try {
 				defaultValue = getter.invoke(instance, (Object[])null);
 			} catch (Exception e) {



More information about the teiid-commits mailing list