Examples of IllegalTypeException


Examples of jp.ac.kobe_u.cs.prolog.lang.IllegalTypeException

        }
        //END inline expansion
        //START inline expansion of $cut(a(2))
        a2 = a2.dereference();
        if (! a2.isInteger()) {
            throw new IllegalTypeException("integer", a2);
        } else {
            engine.cut(((IntegerTerm) a2).intValue());
        }
        //END inline expansion
        //START inline expansion of fail
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.IllegalTypeException

    Object value = null;

    // 3rd. argument (unbound variable)
    a3 = a3.dereference();
    if (!a3.isVariable()) {
      throw new IllegalTypeException(this, 3, "variable", a3);
    }
    try {
      // 1st. argument (atom or java term)
      a1 = a1.dereference();
      if (a1.isVariable()) {
        throw new PInstantiationException(this, 1);
      } else if (a1.isSymbol()) { // class
        clazz = Class.forName(((SymbolTerm) a1).name());
      } else if (a1.isJavaObject()) { // instance
        instance = ((JavaObjectTerm) a1).object();
        clazz = ((JavaObjectTerm) a1).getClazz();
      } else {
        throw new IllegalTypeException(this, 1, "atom_or_java", a1);
      }
      // 2nd. argument (atom)
      a2 = a2.dereference();
      if (a2.isVariable()) {
        throw new PInstantiationException(this, 2);
      } else if (!a2.isSymbol()) {
        throw new IllegalTypeException(this, 2, "atom", a2);
      }
      field = clazz.getDeclaredField(((SymbolTerm) a2).name());
      field.setAccessible(true);
      value = field.get(instance);
      // 3rd. argument
View Full Code Here

Examples of org.restlet.ext.jaxrs.internal.exceptions.IllegalTypeException

        if (declaringClass.equals(Providers.class)) {
            return providers;
        }
        if (declaringClass.equals(ContextResolver.class)) {
            // NICE also throw, where the error occurs.
            throw new IllegalTypeException(
                    "The ContextResolver is not allowed for @Context annotated fields yet. Use javax.ws.rs.ext.Providers#getContextResolver(...)");
        }
        if (declaringClass.equals(ExtensionBackwardMapping.class)) {
            return extensionBackwardMapping;
        }
        if (declaringClass.equals(PathSegment.class)) {
            String msg = "The use of PathSegment annotated with @Context is not standard.";
            logger.config(msg);
            return new GetLastPathSegment(tlContext);
        }
        if (declaringClass.equals(SecurityContext.class)
                || declaringClass.equals(HttpHeaders.class)
                || declaringClass.equals(Request.class)) {
            return tlContext;
        }
        if (declaringClass.equals(UriInfo.class)) {
            throw new ImplementationException(
                    "You must not call the method ContextInjector.getInjectObject(.......) with class UriInfo");
        }
        String declaringClassName = declaringClass.getName();
        // compare names to avoid ClassNotFoundExceptions, if the Servlet-API is
        // not in the classpath
        if (declaringClassName.equals("javax.servlet.http.HttpServletRequest")
                || declaringClassName
                        .equals("javax.servlet.http.HttpServletResponse")) {
            throw new NotYetImplementedException(
                    "The returnin of Servlet depending Context is not implemented for now.");
        }
        // NICE also allow injection of ClientInfo and Conditions. Proxies are
        // required, because the injected objects must be thread local.
        throw new IllegalTypeException(declaringClass
                + " must not be annotated with @Context");
    }
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.