Package com.inspiresoftware.lib.dto.geda.assembler.extension

Examples of com.inspiresoftware.lib.dto.geda.assembler.extension.MethodSynthesizer


   */
  @Test
  public void testUndefinedConfigCreatesDefaultInstance() throws GeDAException {
    final MethodSynthesizerProxy proxy = new MethodSynthesizerProxy(this.getClass().getClassLoader());
    proxy.configure(null, null);
    final MethodSynthesizer syn = proxy.getSynthesizer();
    assertEquals(syn.getClass().getCanonicalName(), MethodSynthesizerProxy.getDefaultImpl());
  }
View Full Code Here


   */
  @Test
  public void testJavassistConfig() throws GeDAException {
    final MethodSynthesizerProxy proxy = new MethodSynthesizerProxy(this.getClass().getClassLoader());
    proxy.configure("synthesizerImpl", "javassist");
    final MethodSynthesizer syn = proxy.getSynthesizer();
    assertTrue(syn instanceof JavassistMethodSynthesizer);
  }
View Full Code Here

   * @throws GeDAException exception
   */
  @Test
  public void testJavassistConfigConstructor() throws GeDAException {
    final MethodSynthesizerProxy proxy = new MethodSynthesizerProxy(this.getClass().getClassLoader(), "javassist");
    final MethodSynthesizer syn = proxy.getSynthesizer();
    assertTrue(syn instanceof JavassistMethodSynthesizer);
  }
View Full Code Here

   */
  @Test
  public void testSunToolsConfig() throws GeDAException {
    final MethodSynthesizerProxy proxy = new MethodSynthesizerProxy(this.getClass().getClassLoader());
    proxy.configure("synthesizerImpl", "suntools");
    final MethodSynthesizer syn = proxy.getSynthesizer();
    assertTrue(syn instanceof SunJavaToolsMethodSynthesizer);
  }
View Full Code Here

   * @throws GeDAException exception
   */
  @Test
  public void testSunToolsConfigConstructor() throws GeDAException {
    final MethodSynthesizerProxy proxy = new MethodSynthesizerProxy(this.getClass().getClassLoader(), "suntools");
    final MethodSynthesizer syn = proxy.getSynthesizer();
    assertTrue(syn instanceof SunJavaToolsMethodSynthesizer);
  }
View Full Code Here

   */
  @Test
  public void testReflectionConfig() throws GeDAException {
    final MethodSynthesizerProxy proxy = new MethodSynthesizerProxy(this.getClass().getClassLoader());
    proxy.configure("synthesizerImpl", "reflection");
    final MethodSynthesizer syn = proxy.getSynthesizer();
    assertTrue(syn instanceof ReflectionMethodSynthesizer);
  }
View Full Code Here

   * @throws GeDAException exception
   */
  @Test
  public void testReflectionConfigConstructor() throws GeDAException {
    final MethodSynthesizerProxy proxy = new MethodSynthesizerProxy(this.getClass().getClassLoader(), "reflection");
    final MethodSynthesizer syn = proxy.getSynthesizer();
    assertTrue(syn instanceof ReflectionMethodSynthesizer);
  }
View Full Code Here

   */
  @Test
  public void testCGLibConfig() throws GeDAException {
    final MethodSynthesizerProxy proxy = new MethodSynthesizerProxy(this.getClass().getClassLoader());
    proxy.configure("synthesizerImpl", "bcel");
    final MethodSynthesizer syn = proxy.getSynthesizer();
    assertTrue(syn instanceof BCELMethodSynthesizer);
  }
View Full Code Here

           UnableToCreateInstanceException, AnnotationMissingBindingException, AnnotationValidatingBindingException, GeDARuntimeException {
   
    final PropertyDescriptor dtoFieldDesc = PropertyInspector.getDtoPropertyDescriptorForField(
        dtoClass, meta.getDtoFieldName(), dtoPropertyDescriptors);

        final MethodSynthesizer synthesizer = context.getMethodSynthesizer();

    return new DataVirtualPipe(
                meta.isReadOnly() ? null : synthesizer.synthesizeReader(dtoFieldDesc),
        synthesizer.synthesizeWriter(dtoFieldDesc),
        meta
    );
  }
View Full Code Here

  public MethodSynthesizerProxy(final ClassLoader classLoader, final Object value) throws UnableToCreateInstanceException {
    this(classLoader);
    if (value instanceof String) {
      final String[] configs = ((String) value).split(";");
      final String syn = configs[0];
      final MethodSynthesizer synth = lazyGet(classLoader, syn);
      for (int i = 1; i < configs.length; i++) {
        final String config = configs[i];
        final String name = config.substring(0, config.indexOf('='));
        final String val = config.substring(name.length() + 1);
        try {
          synth.configure(name, val);
        } catch (GeDAException geda) {
          throw new UnableToCreateInstanceException(synth.getClass().getCanonicalName(),
              "Unable to configure with: " + value, geda);
        }
      }
    } else {
      lazyGet(classLoader, value);
View Full Code Here

TOP

Related Classes of com.inspiresoftware.lib.dto.geda.assembler.extension.MethodSynthesizer

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.