Tabnine Logo
Util
Code IndexAdd Tabnine to your IDE (free)

How to use
Util
in
javax.el

Best Java code snippets using javax.el.Util (Showing top 20 results out of 315)

origin: weld/core

static Method findMethod(Class<?> klass,
             String method,
             Class<?>[] paramTypes,
             Object[] params,
             boolean staticOnly) {
  return Util.findMethod(klass, method, paramTypes, params);
}
origin: org.apache.tomcat.embed/tomcat-embed-el

static Method findMethod(Class<?> clazz, String methodName,
    Class<?>[] paramTypes, Object[] paramValues) {
  if (clazz == null || methodName == null) {
    throw new MethodNotFoundException(
        message(null, "util.method.notfound", clazz, methodName,
        paramString(paramTypes)));
  }
  if (paramTypes == null) {
    paramTypes = getTypesFromValues(paramValues);
  }
  Method[] methods = clazz.getMethods();
  List<Wrapper> wrappers = Wrapper.wrap(methods, methodName);
  Wrapper result = findWrapper(clazz, wrappers, methodName, paramTypes, paramValues);
  return getMethod(clazz, (Method) result.unWrap());
}
origin: org.apache.tomcat.embed/tomcat-embed-el

static Constructor<?> findConstructor(Class<?> clazz, Class<?>[] paramTypes,
    Object[] paramValues) {
  String methodName = "<init>";
  if (clazz == null) {
    throw new MethodNotFoundException(
        message(null, "util.method.notfound", null, methodName,
        paramString(paramTypes)));
  }
  if (paramTypes == null) {
    paramTypes = getTypesFromValues(paramValues);
  }
  Constructor<?>[] constructors = clazz.getConstructors();
  List<Wrapper> wrappers = Wrapper.wrap(constructors);
  Wrapper result = findWrapper(clazz, wrappers, methodName, paramTypes, paramValues);
  return getConstructor(clazz, (Constructor<?>) result.unWrap());
}
origin: org.apache.tomcat.embed/tomcat-embed-el

private Method write(ELContext ctx) {
  if (this.write == null) {
    this.write = Util.getMethod(this.owner, descriptor.getWriteMethod());
    if (this.write == null) {
      throw new PropertyNotWritableException(Util.message(ctx,
          "propertyNotWritable", new Object[] {
              owner.getName(), descriptor.getName() }));
    }
  }
  return this.write;
}
origin: weld/core

    Class<?> varType = mParamTypes[i].getComponentType();
    for (int j = i; j < paramCount; j++) {
      if (!isAssignableFrom(paramTypes[j], varType)) {
        if (paramValues == null) {
          noMatch = true;
          break;
        } else {
          if (!isCoercibleFrom(paramValues[j], varType)) {
            noMatch = true;
            break;
  } else if (!isAssignableFrom(paramTypes[i], mParamTypes[i])) {
    if (paramValues == null) {
      noMatch = true;
      break;
    } else {
      if (!isCoercibleFrom(paramValues[i], mParamTypes[i])) {
        noMatch = true;
        break;
  match = resolveAmbiguousWrapper(candidates.keySet(), paramTypes);
} else {
  match = null;
  throw new MethodNotFoundException(message(
      null, "util.method.ambiguous", clazz, name,
      paramString(paramTypes)));
throw new MethodNotFoundException(message(
origin: org.apache.tomcat.embed/tomcat-embed-el

    Util.findConstructor(clazz, paramTypes, params);
Object[] parameters = Util.buildParameters(
    match.getParameterTypes(), match.isVarArgs(), params);
} catch (InvocationTargetException e) {
  Throwable cause = e.getCause();
  Util.handleThrowable(cause);
  throw new ELException(cause);
} catch (ReflectiveOperationException e) {
    Util.findMethod(clazz, methodName, paramTypes, params);
  throw new MethodNotFoundException(Util.message(context,
      "staticFieldELResolver.methodNotFound", methodName,
      clazz.getName()));
Object[] parameters = Util.buildParameters(
    match.getParameterTypes(), match.isVarArgs(), params);
} catch (InvocationTargetException e) {
  Throwable cause = e.getCause();
  Util.handleThrowable(cause);
  throw new ELException(cause);
origin: org.apache.tomcat/tomcat-el-api

@Override
public void setValue(ELContext context, Object base, Object property,
    Object value) {
  Objects.requireNonNull(context);
  if (base != null && base.getClass().isArray()) {
    context.setPropertyResolved(base, property);
    if (this.readOnly) {
      throw new PropertyNotWritableException(Util.message(context,
          "resolverNotWriteable", base.getClass().getName()));
    }
    int idx = coerce(property);
    checkBounds(base, idx);
    if (value != null && !Util.isAssignableFrom(value.getClass(),
        base.getClass().getComponentType())) {
      throw new ClassCastException(Util.message(context,
          "objectNotAssignable", value.getClass().getName(),
          base.getClass().getComponentType().getName()));
    }
    Array.set(base, idx, value);
  }
}
origin: org.apache.tomcat.embed/tomcat-embed-el

private BeanProperty get(ELContext ctx, String name) {
  BeanProperty property = this.properties.get(name);
  if (property == null) {
    throw new PropertyNotFoundException(Util.message(ctx,
        "propertyNotFound", type.getName(), name));
  }
  return property;
}
origin: codefollower/Tomcat-Research

public static ExpressionFactory getExpressionFactory() {
  return Util.getExpressionFactory();
}
origin: org.apache.tomcat.embed/tomcat-embed-el

    Util.findMethod(base.getClass(), methodName, paramTypes, params);
Object[] parameters = Util.buildParameters(
    matchingMethod.getParameterTypes(), matchingMethod.isVarArgs(),
    params);
} catch (InvocationTargetException e) {
  Throwable cause = e.getCause();
  Util.handleThrowable(cause);
  throw new ELException(cause);
origin: org.apache.tomcat.embed/tomcat-embed-el

public boolean isReadOnly() {
  return this.write == null &&
      (null == (this.write = Util.getMethod(this.owner, descriptor.getWriteMethod())));
}
origin: codefollower/Tomcat-Research

static Constructor<?> getConstructor(Class<?> type, Constructor<?> c) {
  if (c == null || Modifier.isPublic(type.getModifiers())) {
    return c;
  }
  Constructor<?> cp = null;
  Class<?> sup = type.getSuperclass();
  if (sup != null) {
    try {
      cp = sup.getConstructor(c.getParameterTypes());
      cp = getConstructor(cp.getDeclaringClass(), cp);
      if (cp != null) {
        return cp;
      }
    } catch (NoSuchMethodException e) {
      // Ignore
    }
  }
  return null;
}
origin: org.apache.tomcat/tomcat-el-api

@Override
public Object getValue(ELContext context, Object base, Object property) {
  Objects.requireNonNull(context);
  if (base == null || property == null) {
    return null;
  }
  context.setPropertyResolved(base, property);
  Method m = this.property(context, base, property).read(context);
  try {
    return m.invoke(base, (Object[]) null);
  } catch (InvocationTargetException e) {
    Throwable cause = e.getCause();
    Util.handleThrowable(cause);
    throw new ELException(Util.message(context, "propertyReadError",
        base.getClass().getName(), property.toString()), cause);
  } catch (Exception e) {
    throw new ELException(e);
  }
}
origin: codefollower/Tomcat-Research

    Class<?> varType = mParamTypes[i].getComponentType();
    for (int j = i; j < paramCount; j++) {
      if (!isAssignableFrom(paramTypes[j], varType)) {
        if (paramValues == null) {
          noMatch = true;
          break;
        } else {
          if (!isCoercibleFrom(paramValues[j], varType)) {
            noMatch = true;
            break;
  } else if (!isAssignableFrom(paramTypes[i], mParamTypes[i])) {
    if (paramValues == null) {
      noMatch = true;
      break;
    } else {
      if (!isCoercibleFrom(paramValues[i], mParamTypes[i])) {
        noMatch = true;
        break;
  match = resolveAmbiguousWrapper(candidates.keySet(), paramTypes);
} else {
  match = null;
  throw new MethodNotFoundException(message(
      null, "util.method.ambiguous", clazz, name,
      paramString(paramTypes)));
throw new MethodNotFoundException(message(
origin: codefollower/Tomcat-Research

    Util.findConstructor(clazz, paramTypes, params);
Object[] parameters = Util.buildParameters(
    match.getParameterTypes(), match.isVarArgs(), params);
} catch (InvocationTargetException e) {
  Throwable cause = e.getCause();
  Util.handleThrowable(cause);
  throw new ELException(cause);
    Util.findMethod(clazz, methodName, paramTypes, params);
  throw new MethodNotFoundException(Util.message(context,
      "staticFieldELResolver.methodNotFound", methodName,
      clazz.getName()));
Object[] parameters = Util.buildParameters(
    match.getParameterTypes(), match.isVarArgs(), params);
} catch (InvocationTargetException e) {
  Throwable cause = e.getCause();
  Util.handleThrowable(cause);
  throw new ELException(cause);
origin: org.apache.tomcat.embed/tomcat-embed-el

@Override
public void setValue(ELContext context, Object base, Object property,
    Object value) {
  Objects.requireNonNull(context);
  if (base != null && base.getClass().isArray()) {
    context.setPropertyResolved(base, property);
    if (this.readOnly) {
      throw new PropertyNotWritableException(Util.message(context,
          "resolverNotWriteable", base.getClass().getName()));
    }
    int idx = coerce(property);
    checkBounds(base, idx);
    if (value != null && !Util.isAssignableFrom(value.getClass(),
        base.getClass().getComponentType())) {
      throw new ClassCastException(Util.message(context,
          "objectNotAssignable", value.getClass().getName(),
          base.getClass().getComponentType().getName()));
    }
    Array.set(base, idx, value);
  }
}
origin: org.apache.tomcat/tomcat-el-api

private Method write(ELContext ctx) {
  if (this.write == null) {
    this.write = Util.getMethod(this.owner, descriptor.getWriteMethod());
    if (this.write == null) {
      throw new PropertyNotWritableException(Util.message(ctx,
          "propertyNotWritable", new Object[] {
              owner.getName(), descriptor.getName() }));
    }
  }
  return this.write;
}
origin: codefollower/Tomcat-Research

private BeanProperty get(ELContext ctx, String name) {
  BeanProperty property = this.properties.get(name);
  if (property == null) {
    throw new PropertyNotFoundException(Util.message(ctx,
        "propertyNotFound", type.getName(), name));
  }
  return property;
}
origin: org.apache.tomcat.embed/tomcat-embed-el

public static ExpressionFactory getExpressionFactory() {
  return Util.getExpressionFactory();
}
origin: codefollower/Tomcat-Research

    Util.findMethod(base.getClass(), methodName, paramTypes, params);
Object[] parameters = Util.buildParameters(
    matchingMethod.getParameterTypes(), matchingMethod.isVarArgs(),
    params);
} catch (InvocationTargetException e) {
  Throwable cause = e.getCause();
  Util.handleThrowable(cause);
  throw new ELException(cause);
javax.elUtil

Most used methods

  • findMethod
  • findWrapper
  • getConstructor
  • getExpressionFactory
    Provides a per class loader cache of ExpressionFactory instances without pinning any in memory as th
  • getMethod
  • getTypesFromValues
  • isAssignableFrom
  • isCoercibleFrom
  • message
  • paramString
  • resolveAmbiguousWrapper
  • buildParameters
  • resolveAmbiguousWrapper,
  • buildParameters,
  • findConstructor,
  • handleThrowable,
  • getContextClassLoader

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now