Package com.sun.jdo.api.persistence.enhancer.util

Examples of com.sun.jdo.api.persistence.enhancer.util.ClassFileSource


        // check arguments
        affirm(inByteCode, "Illegal argument: inByteCode == null.");//NOI18N
        affirm(outByteCode, "Illegal argument: outByteCode == null.");//NOI18N

        // parse class
        final ClassFileSource cfs;
        final ClassFile cf;
        final ClassControl cc;
        try {
            // create class file source
            cfs = new ClassFileSource(null, inByteCode);

            // create class file
            final DataInputStream dis = cfs.classFileContents();
            cf = new ClassFile(dis);
//@lars: do not close the input stream
//            dis.close();

            // create class control
            cc = new ClassControl(cfs, cf, env);
            env.addClass(cc);

            // get real class name
            final String className = cc.className();
            cfs.setExpectedClassName(className);
        } catch (IOException ex) {
            //@olsen: support for I18N
            throw new UserException(
                getI18N("enhancer.io_error_while_reading_stream"),//NOI18N
                ex);
View Full Code Here


     * Look up the specified class in the class search path.  Callers
     * should normally consult the classmap prior to calling this function.
     * The class is not entered into the classmap
     */
    public ClassControl lookupClass(String className) {
        ClassFileSource source = classPathOption.findClass(className);

        while (true) {
            if (source == null)
                return null;

            //@olsen: cosmetics
            try {
                ClassControl cc = new ClassControl(source, this);
                if (cc.className() != null &&
                    cc.className().equals(className))
                    return cc;
            } catch (ClassFormatError e) {
            }

            // Try to find an alternate source for the class
            source = source.nextSource(className);
        }
    }
View Full Code Here

            } else {
                lookupName = className();
            }
*/

            ClassFileSource annotatedSource;
            if (env.updateInPlace() && !theClassSource.isZipped())
                annotatedSource = theClassSource;
            else
                annotatedSource = env.lookupDestClass(lookupName);

            if (annotatedSource == null) {
                // No annotated class exists
                updateType = UpdateNew;
            } else {
                try {
                    long annModDate = annotatedSource.modificationDate();
                    long srcModDate = source().modificationDate();
                    if (annModDate < srcModDate) {
                        // An annotated class exists, but it is older than
                        // the input
                        updateType = UpdateNewer;
View Full Code Here

        // check arguments
        affirm(inByteCode, "Illegal argument: inByteCode == null.");//NOI18N
        affirm(outByteCode, "Illegal argument: outByteCode == null.");//NOI18N

        // parse class
        final ClassFileSource cfs;
        final ClassFile cf;
        final ClassControl cc;
        try {
            // create class file source
            cfs = new ClassFileSource(null, inByteCode);

            // create class file
            final DataInputStream dis = cfs.classFileContents();
            cf = new ClassFile(dis);
//@lars: do not close the input stream
//            dis.close();

            // create class control
            cc = new ClassControl(cfs, cf, env);
            env.addClass(cc);

            // get real class name
            final String className = cc.className();
            cfs.setExpectedClassName(className);
        } catch (IOException ex) {
            //@olsen: support for I18N
            throw new UserException(
                getI18N("enhancer.io_error_while_reading_stream"),//NOI18N
                ex);
View Full Code Here

     * Look up the specified class in the class search path.  Callers
     * should normally consult the classmap prior to calling this function.
     * The class is not entered into the classmap
     */
    public ClassControl lookupClass(String className) {
        ClassFileSource source = classPathOption.findClass(className);

        while (true) {
            if (source == null)
                return null;

            //@olsen: cosmetics
            try {
                ClassControl cc = new ClassControl(source, this);
                if (cc.className() != null &&
                    cc.className().equals(className))
                    return cc;
            } catch (ClassFormatError e) {
            }

            // Try to find an alternate source for the class
            source = source.nextSource(className);
        }
    }
View Full Code Here

            } else {
                lookupName = className();
            }
*/

            ClassFileSource annotatedSource;
            if (env.updateInPlace() && !theClassSource.isZipped())
                annotatedSource = theClassSource;
            else
                annotatedSource = env.lookupDestClass(lookupName);

            if (annotatedSource == null) {
                // No annotated class exists
                updateType = UpdateNew;
            } else {
                try {
                    long annModDate = annotatedSource.modificationDate();
                    long srcModDate = source().modificationDate();
                    if (annModDate < srcModDate) {
                        // An annotated class exists, but it is older than
                        // the input
                        updateType = UpdateNewer;
View Full Code Here

TOP

Related Classes of com.sun.jdo.api.persistence.enhancer.util.ClassFileSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.