Package com.volantis.mcs.model.descriptor

Examples of com.volantis.mcs.model.descriptor.TypeDescriptor


        // Make sure that every class descriptor was created correctly.
//        Set orderedClassDescriptors = new TreeSet(COMPARATOR);
        MostSpecificClassMap map = new MostSpecificClassMap();
        for (Iterator i = class2Descriptor.values().iterator(); i.hasNext();) {
            TypeDescriptor descriptor = (TypeDescriptor) i.next();
            if (descriptor instanceof BeanClassDescriptorImpl) {
                BeanClassDescriptorImpl bean = (BeanClassDescriptorImpl) descriptor;
                if (!bean.isComplete()) {
                    throw new IllegalStateException(
                            "Descriptor for class " + descriptor.getTypeClass()
                                                      .getName() + " has not been built");
                }
            }

            map.put(descriptor.getTypeClass(), descriptor);
//            // Add them to the list in order so that each class comes after
//            // all classes that are derived from it. e.g. Object will come
//            // last.
//            orderedClassDescriptors.add(descriptor);
        }
View Full Code Here


        return new ModelDescriptorImpl(map);
    }

    public TypeDescriptor getTypeDescriptor(Class type) {
        TypeDescriptor descriptor = (TypeDescriptor)
                class2Descriptor.get(type);
        if (descriptor == null) {
            throw new IllegalStateException("No type defined for " + type);
        }
View Full Code Here

        return builder;
    }

    private void addDescriptor(TypeDescriptor descriptor) {
        Class typeClass = descriptor.getTypeClass();
        TypeDescriptor existing = (TypeDescriptor)
                class2Descriptor.get(typeClass);
        if (existing != null) {
            throw new IllegalStateException(
                    "Type already defined for " + existing);
        }
View Full Code Here

    public ModelDescriptorImpl(MostSpecificClassMap map) {
        this.map = map;
    }

    public TypeDescriptor getTypeDescriptorStrict(Class modelClass) {
        TypeDescriptor descriptor = (TypeDescriptor) map.get(modelClass);
        if (descriptor == null) {
            throw new IllegalArgumentException("Unknown model " + modelClass);
        }

        return descriptor;
View Full Code Here

        if (modelObject == null) {
            return null;
        }

        Class modelClass = modelObject.getClass();
        TypeDescriptor descriptor =
                modelDescriptor.getTypeDescriptorStrict(modelClass);
        Proxy proxy = createProxyForType(descriptor);
        proxy.setModelObject(modelObject);
        return proxy;
    }
View Full Code Here

        return proxy;
    }

    private Proxy createPropertyProxy(PropertyDescriptor descriptor) {
        TypeDescriptor propertyType = descriptor.getPropertyType();
        Proxy proxy = interactionModel.createProxyForType(propertyType);

        return proxy;
    }
View Full Code Here

            for (int i = 0; i < count; i++) {
                PropertyDescriptor property = (PropertyDescriptor)
                        properties.get(i);

                TypeDescriptor propertyType = property.getPropertyType();

                PropertyIdentifier identifier = property.getIdentifier();
                Proxy propertyProxy = proxy.getPropertyProxy(identifier);

                panel.add(new JLabel(identifier.getDescription()));
View Full Code Here

     * throw an {@link IllegalArgumentException}.</p>
     *
     * @param modelObject The model object to assign.
     */
    protected void ensureModelObjectCompatability(Object modelObject) {
        TypeDescriptor descriptor = getTypeDescriptor();
        Class typeClass = descriptor.getTypeClass();
        if (modelObject != null && !typeClass.isInstance(modelObject)) {
            throw new IllegalArgumentException("Incompatible model object " +
                    modelObject +
                    " not instance of " +
                    typeClass);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.model.descriptor.TypeDescriptor

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.