Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.TypeReader


public class TypeReaderRegistry extends RegistrySupport<TypeReader> implements Registry<TypeReader> {

    private TypeReader defaultTypeReader;

    public TypeReader getTypeReader(String type) {
        TypeReader typeReader = super.getEntry(type, TypeReader.class, false);
       
        if (typeReader == null) {
            if (defaultTypeReader == null) {
                throw new ConfigurationException("No type reader available for module type '" + type + "', and no default module type reader has been set");
            }
View Full Code Here


        this.siblings = siblings;
    }

    public RootModuleDefinition getModuleDefinition() {
        Properties rootModuleProperties = getPropertiesForModule(rootModuleName);
        TypeReader typeReader = getTypeReadeRegistry().getTypeReader(ModuleTypes.ROOT);
        RootModuleDefinition rootModuleDefinition = readRootModuleDefinition(rootModuleProperties, typeReader);
       
        //recursively build child definitions
        buildChildDefinitions(rootModuleDefinition, rootModuleName);
       
View Full Code Here

            if (properties == null) {
                throw new ConfigurationException("Resource '" + getResource() + "' contains no new properties for module '" + name +
                        "'. Has this module been declared in the '" + ModuleElementNames.NAMES_ELEMENT + "' element?");
            }
           
            TypeReader typeReader = typeReaderRegistry.getTypeReader(type);
            typeReader.readModuleDefinitionProperties(properties, name, definitionElement);
        }
    }
View Full Code Here

public class TypeReaderRegistry extends RegistrySupport implements Registry<TypeReader> {

    private TypeReader defaultTypeReader;

    public TypeReader getTypeReader(String type) {
        TypeReader typeReader = super.getEntry(type, TypeReader.class, false);
       
        if (typeReader == null) {
            if (defaultTypeReader == null) {
                throw new ConfigurationException("No type reader available for module type '" + type + "', and no default module type reader has been set");
            }
View Full Code Here

        for (Element definitionElement : definitionElementList) {
           
            String name = getName(definitionElement);
            String type = getType(definitionElement);
           
            TypeReader typeReader = typeReaderRegistry.getTypeReader(type);
            ModuleDefinition childDefinition = typeReader.readModuleDefinition(parentDefinition, name, definitionElement);
           
            if (parentDefinition == null) {
                //no parent definition is null, this must be the case where the siblings
                rootModuleDefinition.addSibling(childDefinition);
            }
View Full Code Here

            readChildDefinitions(childDefinition, definitionElement, ModuleElementNames.MODULES_ELEMENT);
        }
    }

    private RootModuleDefinition getRootModuleDefinition(Element root) {
        TypeReader typeReader = typeReaderRegistry.getTypeReader(ModuleTypes.ROOT);
        String name = getName(root);
        return (RootModuleDefinition) typeReader.readModuleDefinition(null, name, root);
    }
View Full Code Here

public class TypeReaderRegistry extends RegistrySupport implements Registry<TypeReader> {

  private TypeReader defaultTypeReader;

  public TypeReader getTypeReader(String type) {
    TypeReader typeReader = super.getEntry(type, TypeReader.class, false);
   
    if (typeReader == null) {
      if (defaultTypeReader == null) {
        throw new ConfigurationException("No type reader available for module type '" + type + "', and no default module type reader has been set");
      }
View Full Code Here

    for (Element definitionElement : definitionElementList) {
     
      String name = getName(definitionElement);
      String type = getType(definitionElement);
     
      TypeReader typeReader = typeReaderRegistry.getTypeReader(type);
      ModuleDefinition childDefinition = typeReader.readModuleDefinition(parentDefinition, name, definitionElement);
     
      if (parentDefinition == null) {
        //no parent definition is null, this must be the case where the siblings
        rootModuleDefinition.addSibling(childDefinition);
      }
View Full Code Here

      readChildDefinitions(childDefinition, definitionElement, ModuleElementNames.MODULES_ELEMENT);
    }
  }

  private RootModuleDefinition getRootModuleDefinition(Element root) {
    TypeReader typeReader = typeReaderRegistry.getTypeReader(ModuleTypes.ROOT);
    String name = getName(root);
    return (RootModuleDefinition) typeReader.readModuleDefinition(null, name, root);
  }
View Full Code Here

            if (properties == null) {
                throw new ConfigurationException("Resource '" + getResource() + "' contains no new properties for module '" + name +
                        "'. Has this module been declared in the '" + ModuleElementNames.NAMES_ELEMENT + "' element?");
            }
           
            TypeReader typeReader = typeReaderRegistry.getTypeReader(type);
            typeReader.readModuleDefinitionProperties(properties, name, definitionElement);
        }
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.module.spi.TypeReader

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.