Package br.com.caelum.iogi.exceptions

Examples of br.com.caelum.iogi.exceptions.InvalidTypeException


public class Assert {

  public static void isNotARawType(final Target<?> target) {
    if (!target.isParameterized())
      throw new InvalidTypeException("Expecting a parameterized list type, got raw type \"%s\" instead", target.getType());
  }
View Full Code Here


                .valueWithPropertiesSet();
  }

    private <T> void expectingAConcreteTarget(final Target<T> target) {
        if (!target.isInstantiable())
            throw new InvalidTypeException("Cannot instantiate abstract type %s", target.getClassType());
    }
View Full Code Here

  public Object instantiate(final Target<?> target, final Parameters parameters) {
    for (final Instantiator<?> instantiator : instantiators) {
      if (instantiator.isAbleToInstantiate(target))
        return instantiator.instantiate(target, parameters);
    }
    throw new InvalidTypeException("Cannot instantiate " + target);
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.iogi.exceptions.InvalidTypeException

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.