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
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 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