congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ProxettaFactory.process
Code IndexAdd Tabnine to your IDE (free)

How to use
process
method
in
jodd.proxetta.ProxettaFactory

Best Java code snippets using jodd.proxetta.ProxettaFactory.process (Showing top 6 results out of 315)

origin: oblac/jodd

/**
 * Reads the target and creates destination class.
 */
protected void process() {
  if (targetInputStream == null) {
    throw new ProxettaException("Target missing: " + targetClassName);
  }
  // create class reader
  final ClassReader classReader;
  try {
    classReader = new ClassReader(targetInputStream);
  } catch (IOException ioex) {
    throw new ProxettaException("Error reading class input stream", ioex);
  }
  // reads information
  final TargetClassInfoReader targetClassInfoReader = new TargetClassInfoReader(proxetta.getClassLoader());
  classReader.accept(targetClassInfoReader, 0);
  this.destClassWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
  // create proxy
  if (log.isDebugEnabled()) {
    log.debug("processing: " + classReader.getClassName());
  }
  WorkData wd = process(classReader, targetClassInfoReader);
  // store important data
  proxyApplied = wd.proxyApplied;
  proxyClassName = wd.thisReference.replace('/', '.');
}
origin: oblac/jodd

/**
 * Returns byte array of created class.
 */
public byte[] create() {
  process();
  byte[] result = toByteArray();
  dumpClassInDebugFolder(result);
  if ((!proxetta.isForced()) && (!isProxyApplied())) {
    if (log.isDebugEnabled()) {
      log.debug("Proxy not applied: " + StringUtil.toSafeString(targetClassName));
    }
    return null;
  }
  if (log.isDebugEnabled()) {
    log.debug("Proxy created " + StringUtil.toSafeString(targetClassName));
  }
  return result;
}
origin: oblac/jodd

process();
origin: org.jodd/jodd-proxetta

/**
 * Reads the target and creates destination class.
 */
protected void process() {
  if (targetInputStream == null) {
    throw new ProxettaException("Target missing: " + targetClassName);
  }
  // create class reader
  final ClassReader classReader;
  try {
    classReader = new ClassReader(targetInputStream);
  } catch (IOException ioex) {
    throw new ProxettaException("Error reading class input stream", ioex);
  }
  // reads information
  final TargetClassInfoReader targetClassInfoReader = new TargetClassInfoReader(proxetta.getClassLoader());
  classReader.accept(targetClassInfoReader, 0);
  this.destClassWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
  // create proxy
  if (log.isDebugEnabled()) {
    log.debug("processing: " + classReader.getClassName());
  }
  WorkData wd = process(classReader, targetClassInfoReader);
  // store important data
  proxyApplied = wd.proxyApplied;
  proxyClassName = wd.thisReference.replace('/', '.');
}
origin: org.jodd/jodd-proxetta

/**
 * Returns byte array of created class.
 */
public byte[] create() {
  process();
  byte[] result = toByteArray();
  dumpClassInDebugFolder(result);
  if ((!proxetta.isForced()) && (!isProxyApplied())) {
    if (log.isDebugEnabled()) {
      log.debug("Proxy not applied: " + StringUtil.toSafeString(targetClassName));
    }
    return null;
  }
  if (log.isDebugEnabled()) {
    log.debug("Proxy created " + StringUtil.toSafeString(targetClassName));
  }
  return result;
}
origin: org.jodd/jodd-proxetta

process();
jodd.proxettaProxettaFactoryprocess

Javadoc

Reads the target and creates destination class.

Popular methods of ProxettaFactory

  • setTarget
    Defines class name as a target. Class will not be loaded by classloader!
  • define
    Defines class.
  • _this
  • assertProxyIsCreated
    Checks if proxy is created and throws an exception if not.
  • assertTargetIsNotDefined
    Checks if target is not defined yet.
  • dumpClassInDebugFolder
    Writes created class content to output folder for debugging purposes.
  • getProxyClassName
    Returns proxy class name.
  • isProxyApplied
    Returns true if at least one method was wrapped.
  • toByteArray
    Returns raw bytecode.
  • newInstance
    Creates new instance of created class. Assumes default no-arg constructor.

Popular in Java

  • Creating JSON documents from java classes using gson
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Join (org.hibernate.mapping)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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