Examples of ConfigClass


Examples of net.jangaroo.exml.model.ConfigClass

    File destDir = new File(outputFolder.getRoot(), "testNamespace/config");
    destDir.mkdirs();
    FileUtils.copyFileToDirectory(new File(getConfigClassRegistry().getConfig().getSourcePath().get(0), "testNamespace/config/testComponent.as"),
            destDir);

    ConfigClass configClass = getConfigClassRegistry().getConfigClassByName("testNamespace.config.testComponent");
    Assert.assertNotNull(configClass);
    Assert.assertEquals("testNamespace.config", configClass.getPackageName());
    Assert.assertEquals("testPackage.TestComponent", configClass.getComponentClassName());
    Assert.assertEquals(5, configClass.getCfgs().size());

    // 2nd try should return the same object
    Assert.assertEquals(configClass, getConfigClassRegistry().getConfigClassByName("testNamespace.config.testComponent"));
  }
View Full Code Here

Examples of net.jangaroo.exml.model.ConfigClass

  @Test
  public void testGenerateFromLocalActionScript() throws Exception {
    setUp("somewhere.else.config", "/test-module", "/ext-as");

    ConfigClass configClass = getConfigClassRegistry().getConfigClassByName("testNamespace.config.testComponent");
    Assert.assertNotNull(configClass);
    Assert.assertEquals("testNamespace.config", configClass.getPackageName());
    Assert.assertEquals("testPackage.TestComponent", configClass.getComponentClassName());
    Assert.assertEquals(5, configClass.getCfgs().size());
  }
View Full Code Here

Examples of net.jangaroo.exml.model.ConfigClass

  @Test
  public void testGenerateFromClassPathActionScript() throws Exception {
    setUp("somewhere.else.config", "/test-module", "/ext-as");

    ConfigClass configClass = getConfigClassRegistry().getConfigClassByName("testNamespace.config.testComponent");
    Assert.assertNotNull(configClass);
    Assert.assertEquals("testNamespace.config", configClass.getPackageName());
    Assert.assertEquals("testPackage.TestComponent", configClass.getComponentClassName());
    Assert.assertEquals(5, configClass.getCfgs().size());
  }
View Full Code Here

Examples of net.jangaroo.exml.model.ConfigClass

import java.io.InputStream;

public class ExmlToConfigClassParser {

  public ConfigClass parseExmlToConfigClass(File source) throws IOException {
    ConfigClass configClass = new ConfigClass();
    //read exml data and write it into the config class
    ExmlMetadataHandler metadataHandler = new ExmlMetadataHandler(configClass);
    parseFileWithHandler(source, metadataHandler);
    return configClass;
  }
View Full Code Here

Examples of org.dcm4che3.conf.api.generic.ConfigClass

    public PreferencesGenericConfigExtension(Class<T> confClass) throws ConfigurationException {
        super();

        this.confClass = confClass;

        ConfigClass ccAnno = (ConfigClass) confClass.getAnnotation(ConfigClass.class);

        // no annotation - no configuration
        if (ccAnno == null)
            throw new ConfigurationException("The configuration class must be annotated with @ConfigClass");

        if (ccAnno.nodeName().equals(""))
            throw new ConfigurationException("To use java preferences config, specify node name for the config class in @ConfigClass annotation");

        nodename = ccAnno.nodeName();

    }
View Full Code Here

Examples of org.dcm4che3.conf.api.generic.ConfigClass

        // figure out the class of declared generic parameter
        Class clazz = (Class) ptypes[1];

        Attributes attrs = new BasicAttributes(true);
        ConfigField fieldAnno = field.getAnnotation(ConfigField.class);
        ConfigClass classAnno = (ConfigClass) clazz.getAnnotation(ConfigClass.class);

        if (classAnno != null) {
            attrs.put("objectClass", classAnno.objectClass());
        } else if (!fieldAnno.mapElementObjectClass().equals("")) {
            attrs.put("objectClass", fieldAnno.mapElementObjectClass());
        } else
            throw new ConfigurationException("objectClass for collection element cannot be resolved, key (" + keyName + " - " + keyValue
                    + ")");
View Full Code Here

Examples of org.dcm4che3.conf.api.generic.ConfigClass

    @Override
    public ConfigWriter getChildWriter(String propName, Field field) throws ConfigurationException {

        Attributes attrs = new BasicAttributes();

        ConfigClass classAnno = (ConfigClass) field.getType().getAnnotation(ConfigClass.class);
        if (classAnno != null) {
//            throw new ConfigurationException("Ldap object class for the child node is unknown");
            attrs.put("objectClass", classAnno.objectClass());
        }

        return new LdapConfigIO(attrs,new ArrayList<ModificationItem>(), getFolderDn(propName), config);
    }
View Full Code Here

Examples of org.dcm4che3.conf.api.generic.ConfigClass

    public LdapGenericConfigExtension(Class<T> confClass) throws ConfigurationException {
        super();

        this.confClass = confClass;

        ConfigClass ccAnno = (ConfigClass) confClass.getAnnotation(ConfigClass.class);

        // no annotation - no configuration
        if (ccAnno == null)
            throw new ConfigurationException("The configuration class must be annotated with @ConfigClass");

        // get common name
        if (ccAnno.commonName().equals("") || ccAnno.objectClass().equals(""))
            throw new ConfigurationException("To use LDAP config, specify common name and objectClass for the config class in @ConfigClass annotation");

        commonName = ccAnno.commonName();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.