Package org.apache.jdo.impl.enhancer.classfile

Examples of org.apache.jdo.impl.enhancer.classfile.ConstClass


        throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError
    {
        // get the instruction arguments
        final InsnConstOp fieldInsn = (InsnConstOp)insn;
        final ConstFieldRef fieldRef = (ConstFieldRef)fieldInsn.value();
        final ConstClass declClass = fieldRef.className();
        final String declClassName = declClass.asString();
        final ConstNameAndType fieldNameAndType = fieldRef.nameAndType();
        final String fieldName = fieldNameAndType.name().asString();
        final String fieldType = fieldNameAndType.signature().asString();

        // check if field is known to be non-managed or not annotatable
View Full Code Here


        throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError
    {
        // get the instruction arguments
        final InsnConstOp methodInsn = (InsnConstOp)insn;
        final ConstMethodRef methodRef = (ConstMethodRef)methodInsn.value();
        final ConstClass declClass = methodRef.className();
        final String declClassName = declClass.asString();
        final ConstNameAndType methodNameAndType = methodRef.nameAndType();
        final String methodName = methodNameAndType.name().asString();
        final String methodType = methodNameAndType.signature().asString();

        if (!methodName.startsWith("jdoSet")
View Full Code Here

            affirm(!classFile.isInterface());
            //affirm(!classFile.isInnerClass());

            //^olsen: assert consistency between Java and JDO metadata
            // disallow enhancing classes not derived from java.lang.Object
            final ConstClass superConstClass = classFile.superName();
            affirm(superConstClass != null);

            // non-pc-root classes must not derive from java.lang.Object
            affirm(pcSuperClassName == null
                   || !superConstClass.asString().equals("java/lang/Object"));

            // define the PC key owner class
            pcKeyOwnerClassName = className;
            while (meta.getKeyClass(pcKeyOwnerClassName) == null) {
                final String pcSuperClassName
View Full Code Here

    private void scanForImplementsPC()
    {
        hasImplementsPC = false;
        for (final Iterator ifc = classFile.interfaces().iterator();
             ifc.hasNext();) {
            final ConstClass i = (ConstClass)ifc.next();
            if (i.asString().equals(JDO_PersistenceCapable_Path)) {
                hasImplementsPC = true;
                break;
            }
        }
        env.message(
View Full Code Here

    private void augmentClassInterface(String interfaceName)
    {
        env.message("adding: implements "
                    + ClassFile.userClassFromVMClass(interfaceName));

        final ConstClass iface = pool.addClass(interfaceName);
        classFile.addInterface(iface);

        // notify controller of class change
        control.noteUpdate();
    }
View Full Code Here

        // end of exception handler
        insn = insn.append(Insn.create(opc_athrow));

        // create exception table
        final ConstClass catchType
            = pool.addClass(JAVA_ClassNotFoundException_Path);
        final ExceptionRange exceptionRange
            = new ExceptionRange(begin, end, beginHandler, catchType);
        final ExceptionTable exceptionTable
            = new ExceptionTable();
View Full Code Here

        final boolean isPCRoot = analyzer.isAugmentableAsRoot();
        if (isPCRoot) {
            insn = insn.append(InsnUtils.integerConstant(managedFieldCount, pool));
        }
        else {
            final ConstClass superConstClass = classFile.superName();
            affirm(superConstClass != null);
            final String superClassName = superConstClass.asString();
            affirm(superClassName != null);
            // call the superclass' jdoGetManagedFieldCount method
            insn = insn.append(
                Insn.create(opc_invokestatic,
                            pool.addMethodRef(
View Full Code Here

        // invoke jdoGetManagedFieldCount if not PCRoot class
        final boolean isPCRoot = analyzer.isAugmentableAsRoot();
        if (isPCRoot) {
            insn = insn.append(Insn.create(opc_iconst_0));
        } else {
            final ConstClass superConstClass = classFile.superName();
            affirm(superConstClass != null);
            final String superClassName = superConstClass.asString();
            affirm(superClassName != null);
            insn = insn.append(
                Insn.create(opc_invokestatic,
                            pool.addMethodRef(
                                superClassName,
View Full Code Here

        // push a newly created an instance of this class or null if
        // class is abstract
        if (classFile.isAbstract()) {
            insn = insn.append(Insn.create(opc_aconst_null));
        } else {
            final ConstClass thisConstClass = classFile.className();
            affirm(thisConstClass != null);
            insn = insn.append(Insn.create(opc_new, thisConstClass));
            insn = insn.append(Insn.create(opc_dup));
            insn = insn.append(
                Insn.create(opc_invokespecial,
View Full Code Here

        // begin of method body
        final InsnTarget begin = new InsnTarget();
        Insn insn = begin;

        // push a newly created an instance of this class
        final ConstClass thisConstClass = classFile.className();
        affirm(thisConstClass != null);
        insn = insn.append(Insn.create(opc_new, thisConstClass));
        insn = insn.append(Insn.create(opc_dup));
        insn = insn.append(
            Insn.create(opc_invokespecial,
View Full Code Here

TOP

Related Classes of org.apache.jdo.impl.enhancer.classfile.ConstClass

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.