Codota Logo
ClassFile
Code IndexAdd Codota to your IDE (free)

How to use
ClassFile
in
com.sun.enterprise.deployment.annotation.introspection

Best Java code snippets using com.sun.enterprise.deployment.annotation.introspection.ClassFile (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: org.glassfish.main.deployment/dol

public AnnotationDetector(AnnotationScanner scanner) {
  this.scanner = scanner;
  ConstantPoolInfo poolInfo = new ConstantPoolInfo(scanner);
  classFile = new ClassFile(poolInfo);
}

origin: org.glassfish.deployment/dol

  protected boolean containsAnnotation(InputStream is, long size) 
    throws IOException {
    boolean result = false;
    // check if it contains top level annotations...
    ReadableByteChannel channel = null;
    try {
      channel = Channels.newChannel(is);
      if (channel!=null) {
        result = classFile.containsAnnotation(channel, size);
       }
       return result;
    } finally {
      if (channel != null) {
        channel.close();
      }
    }
  }
}
origin: org.glassfish.main.deployment/dol

  protected boolean containsAnnotation(InputStream is, long size) 
    throws IOException {
    boolean result = false;
    // check if it contains top level annotations...
    ReadableByteChannel channel = null;
    try {
      channel = Channels.newChannel(is);
      if (channel!=null) {
        result = classFile.containsAnnotation(channel, size);
       }
       return result;
    } finally {
      if (channel != null) {
        channel.close();
      }
    }
  }
}
origin: org.glassfish.deployment/dol

public AnnotationDetector(AnnotationScanner scanner) {
  this.scanner = scanner;
  ConstantPoolInfo poolInfo = new ConstantPoolInfo(scanner);
  classFile = new ClassFile(poolInfo);
}

origin: org.glassfish.deployment/dol

/**
 * Read the input channel and initialize instance data
 * structure.
 */public boolean containsAnnotation(ReadableByteChannel in, long size) throws IOException {
  header.clear();
  if (size!=-1 && size>header.capacity()) {
    // time to expand...
    header = ByteBuffer.allocate((int) size);
  }
  long read = (long) in.read(header);
  if (size!=-1 && read!=size) {
    return false;
  }
  header.rewind();
  return containsAnnotation(header);
}
origin: org.glassfish.deployment/dol

/**
 * The component has been injected with any dependency and
 * will be placed into commission by the subsystem.
 */
public void postConstruct() {
  classFile = new ClassFile(new ConstantPoolInfo(defaultScanner));
}
origin: org.glassfish.main.deployment/dol

/**
 * Read the input channel and initialize instance data
 * structure.
 */public boolean containsAnnotation(ReadableByteChannel in, long size) throws IOException {
  header.clear();
  if (size!=-1 && size>header.capacity()) {
    // time to expand...
    header = ByteBuffer.allocate((int) size);
  }
  long read = (long) in.read(header);
  if (size!=-1 && read!=size) {
    return false;
  }
  header.rewind();
  return containsAnnotation(header);
}
origin: org.glassfish.deployment/dol

private boolean containsAnnotation(final ByteBuffer headerBuffer) throws IOException {
  /**
   * this is the .class file layout
   *
  ClassFile {
    u4 magic;
    u2 minor_version;
    u2 major_version;
    u2 constant_pool_count;
    cp_info constant_pool[constant_pool_count-1];
    u2 access_flags;
    u2 this_class;
    u2 super_class;
    u2 interfaces_count;
    u2 interfaces[interfaces_count];
    u2 fields_count;
    field_info fields[fields_count];
    u2 methods_count;
    method_info methods[methods_count];
    u2 attributes_count;
    attribute_info attributes[attributes_count];
  }        
   **/
      
  if (headerBuffer.getInt()!=magic) {
    return false;
  }
  
origin: org.glassfish.main.deployment/dol

private boolean containsAnnotation(final ByteBuffer headerBuffer) throws IOException {
  /**
   * this is the .class file layout
   *
  ClassFile {
    u4 magic;
    u2 minor_version;
    u2 major_version;
    u2 constant_pool_count;
    cp_info constant_pool[constant_pool_count-1];
    u2 access_flags;
    u2 this_class;
    u2 super_class;
    u2 interfaces_count;
    u2 interfaces[interfaces_count];
    u2 fields_count;
    field_info fields[fields_count];
    u2 methods_count;
    method_info methods[methods_count];
    u2 attributes_count;
    attribute_info attributes[attributes_count];
  }        
   **/
      
  if (headerBuffer.getInt()!=magic) {
    return false;
  }
  
origin: org.glassfish.deployment/dol

  baos.write(buffer, 0, bytesRead);
if (classFile.containsAnnotation(baos.toByteArray())) {
  addEntry(je);
com.sun.enterprise.deployment.annotation.introspectionClassFile

Javadoc

This class is encapsulating binary .class file information as defined at http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html This is used by the annotation frameworks to quickly scan .class files for the presence of annotations. This avoid the annotation framework having to load each .class file in the class loader. The bytecode to be scanned could come from either a File (which lends itself easily to a channel) or from a JAR (which works better with a byte array). So we provide two variants of the containsAnnotation method, one for each.

Most used methods

  • <init>
    Creates a new instance of ClassFile
  • containsAnnotation
    Read the input channel and initialize instance data structure.

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
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