Package org.impalaframework.module

Examples of org.impalaframework.module.TypeReader


   */
  protected ModuleDefinition buildModuleDefinition(
      ModuleDefinition parentDefinition, String moduleName) {
    Properties properties = moduleProperties.get(moduleName);
    String type = getType(properties);
    TypeReader reader = typeReadeRegistry.getTypeReader(type);
    ModuleDefinition definition = reader.readModuleDefinition(parentDefinition, moduleName, properties);
    definition.setParentDefinition(parentDefinition);
    return definition;
  }
View Full Code Here


  public TypeReader getTypeReader(String type) {

    if (type == null) return null;
    type = type.toLowerCase();
   
    TypeReader typeReader = typeReaders.get(type);
    if (typeReader == null) {
      throw new NoServiceException("No instance of " + TypeReader.class.getName()
          + " available for type named '" + type + "'. Available types: " + typeReaders.keySet());
    }
   
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

    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

TOP

Related Classes of org.impalaframework.module.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.