Package org.teiid.translator

Examples of org.teiid.translator.TranslatorProperty


  }
 
  private static void buildTranslatorProperties(Class<?> attachmentClass, Map<Method, TranslatorProperty> props){
    Method[] methods = attachmentClass.getMethods();
    for (Method m:methods) {
      TranslatorProperty tp = m.getAnnotation(TranslatorProperty.class);
      if (tp != null) {
        props.put(m, tp);
      }
    }
    // Now look at the base interfaces
View Full Code Here


    Map<Method, TranslatorProperty> props = TranslatorUtil.getTranslatorProperties(ef.getClass());
    Map p = data.getProperties();
    TreeMap<String, String> caseInsensitivProps = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
    caseInsensitivProps.putAll(p);
    for (Method method:props.keySet()) {
      TranslatorProperty tp = props.get(method);
      String propertyName = getPropertyName(method);
      String value = caseInsensitivProps.remove(propertyName);
     
      if (value != null) {
        Method setterMethod = getSetter(ef.getClass(), method);
        setterMethod.invoke(ef, convert(value, method.getReturnType()));
      } else if (tp.required()) {
        throw new DeploymentException(RuntimePlugin.Util.getString("required_property_not_exists", tp.display())); //$NON-NLS-1$
      }
    }
    caseInsensitivProps.remove(Translator.EXECUTION_FACTORY_CLASS);
    if (!caseInsensitivProps.isEmpty()) {
      LogManager.logWarning(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("undefined_translator_props", caseInsensitivProps.keySet(), data.getName())); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.teiid.translator.TranslatorProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.