Package br.net.woodstock.rockframework.domain

Examples of br.net.woodstock.rockframework.domain.DomainException


  public <T> T getObject(final Class<T> clazz) {
    Assert.notNull(clazz, "clazz");

    if (this.context == null) {
      throw new DomainException("Context not initialized");
    }

    Map<String, T> map = this.context.getBeansOfType(clazz);
    if (map.size() == 0) {
      throw new DomainException("Object not found for type " + clazz.getCanonicalName());
    }
    if (map.size() > 1) {
      throw new DomainException("To many objects found for type " + clazz.getCanonicalName());
    }

    return map.values().iterator().next();
  }
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.domain.DomainException

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.