Examples of ClassDescriptor


Examples of org.apache.cayenne.reflect.ClassDescriptor

        // postprocess paths, now that all id vars are resolved
        if (paths != null) {
            for (EJBQLPath path : paths) {
                String id = normalizeIdPath(path.getId());

                ClassDescriptor descriptor = descriptorsById.get(id);
                if (descriptor == null) {
                    throw new EJBQLException("Unmapped id variable: " + id);
                }

                StringBuilder buffer = new StringBuilder(id);

                for (int i = 1; i < path.getChildrenCount(); i++) {

                    String pathChunk = path.getChild(i).getText();
                    buffer.append('.').append(pathChunk);

                    Property property = descriptor.getProperty(pathChunk);
                    if (property instanceof ArcProperty) {
                        ObjRelationship incoming = ((ArcProperty) property)
                                .getRelationship();
                        descriptor = ((ArcProperty) property).getTargetDescriptor();
                        String pathString = buffer.substring(0, buffer.length());
View Full Code Here

Examples of org.apache.jackrabbit.ocm.mapper.model.ClassDescriptor

            eventType = this.parser.next();
        }
    }

    private ClassDescriptor parseClassDescriptor() throws XmlPullParserException {
        ClassDescriptor fd = new ClassDescriptor();

        /*
         * className CDATA #REQUIRED
         * jcrType CDATA #IMPLIED
         * jcrSuperTypes CDATA #IMPLIED
         * jcrMixinTypes CDATA #IMPLIED
         * extend CDATA #IMPLIED
         * abstract (true|false) "false"
         * interface (true|false) "false"
         * discriminator (true|false) "true"
         */

        fd.setClassName(this.getRequiredAttribute("className"));
        fd.setJcrType(this.getOptionalAttribute("jcrType"));
        fd.setJcrSuperTypes(this.getOptionalAttribute("jcrSuperTypes"));
        fd.setJcrMixinTypes(this.getOptionalAttribute("jcrMixinTypes", (String[]) null));

        fd.setExtend(this.getOptionalAttribute("extend"));

        fd.setAbstract(this.getOptionalAttribute("abstract", false));
        fd.setInterface(this.getOptionalAttribute("interface", false));
        fd.setDiscriminator(this.getOptionalAttribute("discriminator", true));

        return fd;
    }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.ClassDescriptor

   * @return Object the value of attribute[fieldNum]
   */
    Object getValue(int fieldNum)
    {
        String attributeName = getAttributeName(fieldNum);
        ClassDescriptor cld = broker.getClassDescriptor(pc.getClass());
       
        // field could be a primitive typed attribute...
        AttributeDescriptorBase fld = cld.getFieldDescriptorByName(attributeName);
        // field could be a reference attribute...
        if (fld == null)
        {
      fld = cld.getObjectReferenceDescriptorByName(attributeName);
    }
    // or it could be a collection attribute:
        if (fld == null)
        {
      fld = cld.getCollectionDescriptorByName(attributeName);
    }       
        Object value = fld.getPersistentField().get(pc);
        return value;
    }
View Full Code Here

Examples of org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor

        MappingDescriptor descriptor = (MappingDescriptor) factory.getObject();
        Collection col = descriptor.getClassDescriptors();
        assertEquals(" different number of descriptors ", 2, col.size());
        Iterator iter = col.iterator();
        ClassDescriptor descr = (ClassDescriptor) iter.next();
        assertEquals("wrong class name descriptor ", "org.springmodules.jcr.mapping.A", descr.getClassName());
        descr = (ClassDescriptor) iter.next();
        assertEquals("wrong class name descriptor ", "org.springmodules.jcr.mapping.B", descr.getClassName());
    }
View Full Code Here

Examples of org.codehaus.metaclass.model.ClassDescriptor

    {
        final String basename =
            name.substring( 0, name.length() - CLASS_EXT.length() );
        final String metaName = basename + MetaClassIOBinary.EXTENSION;
        final File file = new File( dir, metaName );
        final ClassDescriptor descriptor = loadDescriptor( file );
        if( null != descriptor && isDNAComponent( descriptor ) )
        {
            list.add( descriptor.getName() );
        }
    }
View Full Code Here

Examples of org.codehaus.metaclass.model.ClassDescriptor

        {
            new Attribute( "dna.component" ),
            new Attribute( "dna.service", bad ),
            new Attribute( "dna.service", good )
        };
        return new ClassDescriptor( classname,
                                    attributes,
                                    attributes,
                                    FieldDescriptor.EMPTY_SET,
                                    MethodDescriptor.EMPTY_SET );
    }
View Full Code Here

Examples of org.codehaus.metaclass.model.ClassDescriptor

        final ParameterDescriptor param =
            new ParameterDescriptor("locator", ResourceLocator.class.getName());
        final ParameterDescriptor[] params = new ParameterDescriptor[]{param};
        final MethodDescriptor descriptor =
            new MethodDescriptor("compose","", params, attributes, attributes );
        return new ClassDescriptor( classname,
                                    Attribute.EMPTY_SET,
                                    Attribute.EMPTY_SET,
                                    FieldDescriptor.EMPTY_SET,
                                    new MethodDescriptor[]{descriptor} );
    }
View Full Code Here

Examples of org.codehaus.metaclass.model.ClassDescriptor

        final Attribute[] attributes = new Attribute[]
        {
            new Attribute( "dna.component" ),
            new Attribute( "dna.service", parameters )
        };
        final ClassDescriptor descriptor =
            new ClassDescriptor( BasicComponent.class.getName(),
                                 attributes,
                                 attributes,
                                 FieldDescriptor.EMPTY_SET,
                                 MethodDescriptor.EMPTY_SET );
        final ComponentVerifier verifier = new ComponentVerifier();
View Full Code Here

Examples of org.codehaus.metaclass.model.ClassDescriptor

        final ParameterDescriptor param =
            new ParameterDescriptor( "X", Configuration.class.getName() );
        final ParameterDescriptor[] params = new ParameterDescriptor[]{param};
        final MethodDescriptor method =
            new MethodDescriptor( "configure", "", params, attributes, attributes );
        final ClassDescriptor descriptor =
            new ClassDescriptor( BasicComponent.class.getName(),
                                 Attribute.EMPTY_SET,
                                 Attribute.EMPTY_SET,
                                 FieldDescriptor.EMPTY_SET,
                                 new MethodDescriptor[]{method} );
        final RegistrationMetaClassAccessor accessor = new RegistrationMetaClassAccessor();
View Full Code Here

Examples of org.codehaus.metaclass.model.ClassDescriptor

        final ParameterDescriptor param =
            new ParameterDescriptor( "X", Configuration.class.getName() );
        final ParameterDescriptor[] params = new ParameterDescriptor[]{param};
        final MethodDescriptor method =
            new MethodDescriptor( "configure", "", params, attributes, attributes );
        final ClassDescriptor descriptor =
            new ClassDescriptor( BasicComponent.class.getName(),
                                 Attribute.EMPTY_SET,
                                 Attribute.EMPTY_SET,
                                 FieldDescriptor.EMPTY_SET,
                                 new MethodDescriptor[]{method} );
        final RegistrationMetaClassAccessor accessor = new RegistrationMetaClassAccessor();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.