Tabnine Logo
ClassFile
Code IndexAdd Tabnine 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)

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

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • compareTo (BigDecimal)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • ImageIO (javax.imageio)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top Sublime Text plugins
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