Package org.jpox.metadata

Examples of org.jpox.metadata.InterfaceMetaData


                }

                // Register all interfaces into the respective lookup maps
                for (int j = 0; j < pmd.getNoOfInterfaces(); j++)
                {
                    InterfaceMetaData intfmd = pmd.getInterface(j);
                    if (filemd.getType() == FileMetaData.JDO_FILE || filemd.getType() == FileMetaData.ANNOTATIONS)
                    {
                        registerMetaDataForClass(intfmd.getFullClassName(), intfmd);
                    }
                    else if (filemd.getType() == FileMetaData.ORM_FILE)
                    {
                        ormClassMetaDataByClass.put(intfmd.getFullClassName(), intfmd);
                    }
                }
            }
        }
    }
View Full Code Here


        if (c == null || !c.isInterface())
        {
            return null;
        }

        InterfaceMetaData imd = (InterfaceMetaData)getMetaDataForClassInternal(c, clr);
        if (imd != null)
        {
            // Make sure that anything returned is initialised
            if (!imd.isPopulated() && !imd.isInitialised())
            {
                // Initialise the interface in question
                imd.populate(clr,c.getClassLoader());
            }
            // Make sure that anything returned is initialised
            if (!imd.isInitialised())
            {
                // Initialise the interface in question
                imd.initialise();
            }

            if (utilisedFileMetaData.size() > 0)
            {
                // Initialise all FileMetaData that were processed in this call
View Full Code Here

            }
            // New interface for this package
            else if (localName.equals("interface"))
            {
                PackageMetaData pmd = (PackageMetaData)getStack();
                InterfaceMetaData imd = mgr.getMetaDataFactory().newInterfaceObject(pmd,
                                                  getAttr(attrs, "name"),
                                                  getAttr(attrs, "identity-type"),
                                                  getAttr(attrs, "objectid-class"),
                                                  getAttr(attrs, "requires-extent"),
                                                  getAttr(attrs, "detachable"),
                                                  getAttr(attrs, "embedded-only"),
                                                  getAttr(attrs, "catalog"),
                                                  getAttr(attrs, "schema"),
                                                  getAttr(attrs, "table"),
                                                  null);
                pmd.addInterface(imd);
                pushStack(imd);
            }
            // New primary-key for class/interface
            else if (localName.equals("primary-key"))
            {
                MetaData md = getStack();
                PrimaryKeyMetaData pkmd =
                    new PrimaryKeyMetaData(md, getAttr(attrs,"name"), getAttr(attrs, "column"));
                if (md instanceof AbstractClassMetaData)
                {
                    ((AbstractClassMetaData)md).setPrimaryKeyMetaData(pkmd);
                }
                else if (md instanceof JoinMetaData)
                {
                    ((JoinMetaData)md).setPrimaryKeyMetaData(pkmd);
                }
                pushStack(pkmd);
            }
            // New implements for this class
            else if (localName.equals("implements"))
            {
                ClassMetaData cmd = (ClassMetaData)getStack();
                ImplementsMetaData imd =
                    new ImplementsMetaData(cmd, getAttr(attrs,"name"));
                cmd.addImplements(imd);
                pushStack(imd);
            }
            // New property for this interface
            else if (localName.equals("property"))
            {
                MetaData parent = getStack();
                if (parent instanceof AbstractClassMetaData)
                {
                    AbstractClassMetaData acmd = (AbstractClassMetaData)parent;
                    PropertyMetaData propmd = newPropertyObject(acmd, attrs);
                    acmd.addMember(propmd);
                    pushStack(propmd);
                }
                else if (parent instanceof EmbeddedMetaData)
                {
                    EmbeddedMetaData emd = (EmbeddedMetaData)parent;
                    PropertyMetaData propmd = newPropertyObject(emd, attrs);
                    emd.addMember(propmd);
                    pushStack(propmd);
                }
                else if (parent instanceof ImplementsMetaData)
                {
                    ImplementsMetaData implmd = (ImplementsMetaData)parent;
                    PropertyMetaData propmd = newPropertyObject(implmd, attrs);
                    implmd.addProperty(propmd);
                    pushStack(propmd);
                }
                else if (parent instanceof FetchGroupMetaData)
                {
                    FetchGroupMetaData fgmd = (FetchGroupMetaData)parent;
                    PropertyMetaData propmd = newPropertyObject(fgmd, attrs);
                    fgmd.addMember(propmd);
                    pushStack(propmd);
                }
            }
            // New datastore-identity for this class
            else if (localName.equals("datastore-identity"))
            {
                AbstractClassMetaData acmd = (AbstractClassMetaData)getStack();
                IdentityMetaData imd = new IdentityMetaData(acmd,
                                getAttr(attrs,"column"),
                                getAttr(attrs,"strategy"),
                                getAttr(attrs,"sequence"));
                acmd.setIdentityMetaData(imd);
                pushStack(imd);
            }
            // New inheritance for this class
            else if (localName.equals("inheritance"))
            {
                MetaData parent = getStack();
                AbstractClassMetaData acmd = (AbstractClassMetaData)parent;
                InheritanceMetaData imd = new InheritanceMetaData(acmd,
                                getAttr(attrs,"strategy"));
                acmd.setInheritanceMetaData(imd);
                pushStack(imd);
            }
            // Discriminator for this inheritance
            else if (localName.equals("discriminator"))
            {
                InheritanceMetaData imd = (InheritanceMetaData)getStack();
                DiscriminatorMetaData dismd = new DiscriminatorMetaData(imd,
                                getAttr(attrs,"column"),
                                getAttr(attrs,"value"),
                                getAttr(attrs,"strategy"),
                                getAttr(attrs,"indexed"));
                imd.setDiscriminatorMetaData(dismd);
                pushStack(dismd);
            }
            // New query for this class
            else if (localName.equals("query"))
            {
                MetaData emd = getStack();
                QueryMetaData qmd = new QueryMetaData(emd,
                                (emd instanceof ClassMetaData ? ((ClassMetaData)emd).getFullClassName() : null),
                                getAttr(attrs, "name"),
                                getAttr(attrs, "language"),
                                getAttr(attrs, "unmodifiable"),
                                getAttr(attrs, "result-class"),
                                null,
                                getAttr(attrs, "unique"),
                                getAttr(attrs, "fetch-plan"));
                if (emd instanceof ClassMetaData)
                {
                    ClassMetaData cmd = (ClassMetaData)emd;
                    cmd.addQuery(qmd);
                }
                else if (emd instanceof FileMetaData)
                {
                    FileMetaData fmd = (FileMetaData)emd;
                    fmd.addQuery(qmd);
                }
                pushStack(qmd);
            }
            // New sequence for this class
            else if (localName.equals("sequence"))
            {
                MetaData emd = getStack();
                SequenceMetaData seqmd = new SequenceMetaData(emd,
                                getAttr(attrs,"name"),
                                getAttr(attrs,"datastore-sequence"),
                                getAttr(attrs,"factory-class"),
                                getAttr(attrs,"strategy"),
                                null, null);
                if (emd instanceof PackageMetaData)
                {
                    PackageMetaData pmd = (PackageMetaData)emd;
                    pmd.addSequence(seqmd);
                }
                pushStack(seqmd);
            }
            // New field for this class
            else if (localName.equals("field"))
            {
                MetaData md = getStack();
                FieldMetaData fmd = newFieldObject(md,attrs);
                if (md instanceof ClassMetaData)
                {
                    ClassMetaData cmd = (ClassMetaData)md;
                    cmd.addMember(fmd);
                }
                else if (md instanceof FetchGroupMetaData)
                {
                    FetchGroupMetaData fgmd = (FetchGroupMetaData)md;
                    fgmd.addMember(fmd);
                }
                else if (md instanceof EmbeddedMetaData)
                {
                    EmbeddedMetaData emd = (EmbeddedMetaData)md;
                    emd.addMember(fmd);
                }
                else if (md instanceof ForeignKeyMetaData)
                {
                    ForeignKeyMetaData fkmd = (ForeignKeyMetaData)md;
                    fkmd.addMember(fmd);
                }
                else if (md instanceof IndexMetaData)
                {
                    IndexMetaData imd = (IndexMetaData)md;
                    imd.addMember(fmd);
                }
                else if (md instanceof UniqueMetaData)
                {
                    UniqueMetaData umd = (UniqueMetaData)md;
                    umd.addMember(fmd);
                }
                pushStack(fmd);
            }
            // New join
            else if (localName.equals("join"))
            {
                MetaData parent = getStack();
                JoinMetaData jnmd = new JoinMetaData(parent,
                                                   getAttr(attrs, "table"),
                                                   null, null,
                                                   getAttr(attrs, "column"),
                                                   getAttr(attrs, "outer"),
                                                   getAttr(attrs, "delete-action"),
                                                   getAttr(attrs, "indexed"),
                                                   getAttr(attrs, "unique"));
                if (parent instanceof AbstractMemberMetaData)
                {
                    AbstractMemberMetaData fmd = (AbstractMemberMetaData)parent;
                    fmd.setJoinMetaData(jnmd);
                }
                else if (parent instanceof AbstractClassMetaData)
                {
                    AbstractClassMetaData cmd = (AbstractClassMetaData)parent;
                    cmd.addJoin(jnmd);
                }
                else if (parent instanceof InheritanceMetaData)
                {
                    InheritanceMetaData imd = (InheritanceMetaData)parent;
                    imd.setJoinMetaData(jnmd);
                }
                pushStack(jnmd);
            }
            // New map container for this field
            else if (localName.equals("map"))
View Full Code Here

    public BCELImplementationGenerator(InterfaceMetaData interfaceMetaData, String implClassName)
    {
        super(interfaceMetaData, implClassName);

        List interfaces = new ArrayList();
        InterfaceMetaData imd = interfaceMetaData;
        do
        {
            interfaces.add(imd.getFullClassName());
            imd = (InterfaceMetaData) imd.getSuperAbstractClassMetaData();
        }
        while (imd != null);

        // Start the class
        this.classGen = new ClassGen(fullClassName, fullSuperclassName, className + ".java", ACC_PUBLIC | ACC_SUPER,
View Full Code Here

                }
            }
            else
            {
                // Interface, so we need an implemenation
                InterfaceMetaData imd = mmgr.getMetaDataForInterface(cls, clr);
                if (imd == null)
                {
                    throw new JDOFatalException("Could not find metadata for class/interface "+cls.getName());
                }
View Full Code Here

        super(interfaceMetaData, implClassName);
        asmClassName = fullClassName.replace('.', '/');
        asmTypeDescriptor = "L" + asmClassName + ";";

        List interfaces = new ArrayList();
        InterfaceMetaData imd = interfaceMetaData;
        do
        {
            String intfTypeName = imd.getFullClassName().replace('.', '/');
            interfaces.add(intfTypeName);
            imd = (InterfaceMetaData) imd.getSuperAbstractClassMetaData();
        }
        while (imd != null);

        // Start the class
        writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
View Full Code Here

TOP

Related Classes of org.jpox.metadata.InterfaceMetaData

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.