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 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

        // get the field's declaring class from the model
        final String declClassName =
            meta.getDeclaringClass(qualifyingClassName, fieldName);
        affirm(declClassName != null, "Cannot get declaring class of "
               + qualifyingClassName + "." + fieldName);
        final ConstClass declClass = pool.addClass(declClassName);

        // check if field is known to be non-managed
        if (meta.isKnownNonManagedField(declClassName, fieldName, fieldType)) {
            return insn;
        }
View Full Code Here

            if (!(methodName.equals("clone")
                  && methodSig.equals("()Ljava/lang/Object;")))
                continue;

            if (false) {
                final ConstClass methodClass = methodRef.className();
                final String methodClassName = methodClass.asString();
                System.out.println("        found invocation of: "
                                   + methodClassName
                                   + "." + methodName + methodSig);
            }

            // check whether next instruction already is a downcast to a
            // class implementing PersistenceCapable
            final String thisClass = classFile.classNameString();
            final Insn checkCastInsn = insn.next();
            final boolean needCheckcast;
            if (checkCastInsn.opcode() != opc_checkcast) {
                needCheckcast = true;
            } else {
                ConstClass target =
                    (ConstClass) ((InsnConstOp)checkCastInsn).value();
                if (target.asString().equals(thisClass)) {
                    insn = checkCastInsn;
                    needCheckcast = false;
                } else {
                    needCheckcast = true;
                }
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.