static public void addDefaultNestedComponentRegistryRules(DefaultNestedComponentRegistry registry) { registry.add(AppenderBase.class, "layout", PatternLayout.class); registry.add(UnsynchronizedAppenderBase.class, "layout", PatternLayout.class); registry.add(AppenderBase.class, "encoder", PatternLayoutEncoder.class); registry.add(UnsynchronizedAppenderBase.class, "encoder", PatternLayoutEncoder.class); registry.add(EvaluatorFilter.class, "evaluator", JaninoEventEvaluator.class); SSLNestedComponentRegistryRules.addDefaultNestedComponentRegistryRules(registry); }
public Class<?> findDefaultComponentType(Class<?> hostClass, String propertyName) { propertyName = propertyName.toLowerCase(); while (hostClass != null) { Class<?> componentClass = oneShotFind(hostClass, propertyName); if (componentClass != null) { return componentClass; } hostClass = hostClass.getSuperclass(); } return null; }
public Class<?> getClassNameViaImplicitRules(String name, AggregationType aggregationType, DefaultNestedComponentRegistry registry) { Class<?> registryResult = registry.findDefaultComponentType(obj.getClass(), name); if (registryResult != null) { return registryResult; } // find the relevant method for the given property name and aggregationType Method relevantMethod = getRelevantMethod(name, aggregationType); if (relevantMethod == null) { return null; } Class<?> byAnnotation = getDefaultClassNameByAnnonation(name, relevantMethod); if (byAnnotation != null) { return byAnnotation; } return getByConcreteType(name, relevantMethod); }
@Test public void smoke() { String propertyName = "window"; registry.add(House.class, propertyName, Window.class); Class<?> result = registry.findDefaultComponentType(House.class, propertyName); assertEquals(Window.class, result); }
public Class<?> getClassNameViaImplicitRules(String name, AggregationType aggregationType, DefaultNestedComponentRegistry registry) { Class<?> registryResult = registry.findDefaultComponentType(obj.getClass(), name); if (registryResult != null) { return registryResult; } // find the relevant method for the given property name and aggregationType Method relevantMethod = getRelevantMethod(name, aggregationType); if (relevantMethod == null) { return null; } Class<?> byAnnotation = getDefaultClassNameByAnnonation(name, relevantMethod); if (byAnnotation != null) { return byAnnotation; } return getByConcreteType(name, relevantMethod); }
@Test public void absent() { registry.add(House.class, "a", Window.class); Class<?> result = registry.findDefaultComponentType(House.class, "other"); assertNull(result); } }
static public void addDefaultNestedComponentRegistryRules( DefaultNestedComponentRegistry registry) { registry.add(SSLComponent.class, "ssl", SSLConfiguration.class); registry.add(SSLConfiguration.class, "parameters", SSLParametersConfiguration.class); registry.add(SSLConfiguration.class, "keyStore", KeyStoreFactoryBean.class); registry.add(SSLConfiguration.class, "trustStore", KeyStoreFactoryBean.class); registry.add(SSLConfiguration.class, "keyManagerFactory", KeyManagerFactoryFactoryBean.class); registry.add(SSLConfiguration.class, "trustManagerFactory", TrustManagerFactoryFactoryBean.class); registry.add(SSLConfiguration.class, "secureRandom", SecureRandomFactoryBean.class); }
public Class<?> getClassNameViaImplicitRules(String name, AggregationType aggregationType, DefaultNestedComponentRegistry registry) { Class<?> registryResult = registry.findDefaultComponentType(obj.getClass(), name); if (registryResult != null) { return registryResult; } // find the relevant method for the given property name and aggregationType Method relevantMethod = getRelevantMethod(name, aggregationType); if (relevantMethod == null) { return null; } Class<?> byAnnotation = getDefaultClassNameByAnnonation(name, relevantMethod); if (byAnnotation != null) { return byAnnotation; } return getByConcreteType(name, relevantMethod); }
public Class findDefaultComponentType(Class hostClass, String propertyName) { propertyName = propertyName.toLowerCase(); while (hostClass != null) { Class componentClass = oneShotFind(hostClass, propertyName); if (componentClass != null) { return componentClass; } hostClass = hostClass.getSuperclass(); } return null; }
static public void addDefaultNestedComponentRegistryRules( DefaultNestedComponentRegistry registry) { registry.add(AppenderBase.class, "layout", PatternLayout.class); registry.add(UnsynchronizedAppenderBase.class, "layout", PatternLayout.class); registry.add(AppenderBase.class, "encoder", PatternLayoutEncoder.class); registry.add(UnsynchronizedAppenderBase.class, "encoder", PatternLayoutEncoder.class); registry .add(EvaluatorFilter.class, "evaluator", JaninoEventEvaluator.class); SSLNestedComponentRegistryRules.addDefaultNestedComponentRegistryRules(registry); }
public Class<?> getClassNameViaImplicitRules(String name, AggregationType aggregationType, DefaultNestedComponentRegistry registry) { Class<?> registryResult = registry.findDefaultComponentType(obj.getClass(), name); if (registryResult != null) { return registryResult; } // find the relevant method for the given property name and aggregationType Method relevantMethod = getRelevantMethod(name, aggregationType); if (relevantMethod == null) { return null; } Class<?> byAnnotation = getDefaultClassNameByAnnonation(name, relevantMethod); if (byAnnotation != null) { return byAnnotation; } return getByConcreteType(name, relevantMethod); }
public Class findDefaultComponentType(Class hostClass, String propertyName) { propertyName = propertyName.toLowerCase(); while (hostClass != null) { Class componentClass = oneShotFind(hostClass, propertyName); if (componentClass != null) { return componentClass; } hostClass = hostClass.getSuperclass(); } return null; }
static public void addDefaultNestedComponentRegistryRules( DefaultNestedComponentRegistry registry) { registry.add(AppenderBase.class, "layout", PatternLayout.class); registry.add(UnsynchronizedAppenderBase.class, "layout", PatternLayout.class); registry.add(AppenderBase.class, "encoder", PatternLayoutEncoder.class); registry.add(UnsynchronizedAppenderBase.class, "encoder", PatternLayoutEncoder.class); registry .add(EvaluatorFilter.class, "evaluator", JaninoEventEvaluator.class); }
public Class getClassNameViaImplicitRules(String name, AggregationType aggregationType, DefaultNestedComponentRegistry registry) { Class registryResult = registry.findDefaultComponentType(obj.getClass(), name); if (registryResult != null) { return registryResult; } // find the relevant method for the given property name and aggregationType Method relevantMethod = getRelevantMethod(name, aggregationType); if (relevantMethod == null) { return null; } Class byAnnotation = getDefaultClassNameByAnnonation(name, relevantMethod); if (byAnnotation != null) { return byAnnotation; } return getByConcreteType(name, relevantMethod); }
public Class<?> findDefaultComponentType(Class<?> hostClass, String propertyName) { propertyName = propertyName.toLowerCase(Locale.US); while (hostClass != null) { Class<?> componentClass = oneShotFind(hostClass, propertyName); if (componentClass != null) { return componentClass; } hostClass = hostClass.getSuperclass(); } return null; }
static public void addDefaultNestedComponentRegistryRules(DefaultNestedComponentRegistry registry) { registry.add(SSLComponent.class, "ssl", SSLConfiguration.class); registry.add(SSLConfiguration.class, "parameters", SSLParametersConfiguration.class); registry.add(SSLConfiguration.class, "keyStore", KeyStoreFactoryBean.class); registry.add(SSLConfiguration.class, "trustStore", KeyStoreFactoryBean.class); registry.add(SSLConfiguration.class, "keyManagerFactory", KeyManagerFactoryFactoryBean.class); registry.add(SSLConfiguration.class, "trustManagerFactory", TrustManagerFactoryFactoryBean.class); registry.add(SSLConfiguration.class, "secureRandom", SecureRandomFactoryBean.class); }
public Class<?> getClassNameViaImplicitRules(String name, AggregationType aggregationType, DefaultNestedComponentRegistry registry) { Class<?> registryResult = registry.findDefaultComponentType(obj.getClass(), name); if (registryResult != null) { return registryResult; } // find the relevant method for the given property name and aggregationType Method relevantMethod = getRelevantMethod(name, aggregationType); if (relevantMethod == null) { return null; } Class<?> byAnnotation = getDefaultClassNameByAnnonation(name, relevantMethod); if (byAnnotation != null) { return byAnnotation; } return getByConcreteType(name, relevantMethod); }
public Class findDefaultComponentType(Class hostClass, String propertyName) { propertyName = propertyName.toLowerCase(); while (hostClass != null) { Class componentClass = oneShotFind(hostClass, propertyName); if (componentClass != null) { return componentClass; } hostClass = hostClass.getSuperclass(); } return null; }
static public void addDefaultNestedComponentRegistryRules( DefaultNestedComponentRegistry registry) { registry.add(AppenderBase.class, "layout", PatternLayout.class); registry.add(UnsynchronizedAppenderBase.class, "layout", PatternLayout.class); registry .add(EvaluatorFilter.class, "evaluator", JaninoEventEvaluator.class); }
public Class<?> getClassNameViaImplicitRules(String name, AggregationType aggregationType, DefaultNestedComponentRegistry registry) { Class<?> registryResult = registry.findDefaultComponentType(obj.getClass(), name); if (registryResult != null) { return registryResult; } // find the relevant method for the given property name and aggregationType Method relevantMethod = getRelevantMethod(name, aggregationType); if (relevantMethod == null) { return null; } Class<?> byAnnotation = getDefaultClassNameByAnnonation(name, relevantMethod); if (byAnnotation != null) { return byAnnotation; } return getByConcreteType(name, relevantMethod); }