Package java.beans

Examples of java.beans.BeanInfo


    public void aMethodThatExpectsUUIDExceptionWrapper(UUIDExceptionWrapper exception) {
        this.args = exception;
    }

    public static Method methodFor(String methodName) throws IntrospectionException {
        BeanInfo beanInfo = Introspector.getBeanInfo(SomeSteps.class);
        for (MethodDescriptor md : beanInfo.getMethodDescriptors()) {
            if (md.getMethod().getName().equals(methodName)) {
                return md.getMethod();
            }
        }
        return null;
View Full Code Here


        return null;
    }   


    static Method stepMethodFor(String methodName, Class<? extends Steps> stepsClass) throws IntrospectionException {
        BeanInfo beanInfo = Introspector.getBeanInfo(stepsClass);
        for (MethodDescriptor md : beanInfo.getMethodDescriptors()) {
            if (md.getMethod().getName().equals(methodName)) {
                return md.getMethod();
            }
        }
        return null;
View Full Code Here

            return resolveType(readMethod.getGenericReturnType());
        }

        private PropertyDescriptor getPropertyDescriptor(String propertyName) {
            BeanInfo beanInfo = null;
            try {
                beanInfo = Introspector.getBeanInfo(beanClass);
            } catch (IntrospectionException e) {
                throw new FacesException(e.getMessage(), e);
            } finally {
                Introspector.flushFromCaches(beanClass);
            }

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

            PropertyDescriptor[] propertyDescriptorsArray = beanInfo.getPropertyDescriptors();
            for (PropertyDescriptor pd : propertyDescriptorsArray) {
                if (propertyName.equals(pd.getName())) {
                    return pd;
                }
            }
View Full Code Here

        jso.put("_name", theEnum.name());

        if (ser.getMarshallClassHints())
          jso.put("javaClass", theEnum.getClass().getName());

        BeanInfo info = Introspector.getBeanInfo(clazz);
        PropertyDescriptor props[] = info.getPropertyDescriptors();

        for (PropertyDescriptor prop : props) {
          if ("declaringClass".equals(prop.getName())
              || "class".equals(prop.getName()))
            continue;
View Full Code Here

         * Obtain a reference to the composite component metadata for this composite component by calling
         * ViewDeclarationLanguage.getComponentMetadata(javax.faces.context.FacesContext,
         * javax.faces.application.Resource), passing the facesContext and componentResource arguments to this method.
         * This version of JSF specification uses JavaBeans as the API to the component metadata.
         */
        BeanInfo metadata = vdl.getComponentMetadata(context, componentResource);

        /*
         * Determine if the component author declared a component-type for this component instance by obtaining the
         * BeanDescriptor from the component metadata and calling its getValue() method, passing
         * UIComponent.COMPOSITE_COMPONENT_TYPE_KEY as the argument. If non-null, the result must be a ValueExpression
         * whose value is the component-type of the UIComponent to be created for this Resource component. Call through
         * to createComponent(java.lang.String) to create the component.
         */
        BeanDescriptor descriptor = metadata.getBeanDescriptor();
        ValueExpression componentType = (ValueExpression) descriptor.getValue(UIComponent.COMPOSITE_COMPONENT_TYPE_KEY);

        if (componentType != null)
        {
            component = createComponent((String) componentType.getValue(context.getELContext()));
View Full Code Here

    private static void _writeAttributes(Writer writer, UIComponent c)
    {
        try
        {
            BeanInfo info = Introspector.getBeanInfo(c.getClass());
            PropertyDescriptor[] pd = info.getPropertyDescriptors();
            Method m = null;
            Object v = null;
            String str = null;
            for (int i = 0; i < pd.length; i++)
            {
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public BeanInfo getComponentMetadata(FacesContext context, Resource componentResource)
    {
        BeanInfo beanInfo = null;
       
        try
        {
            Facelet compositeComponentFacelet;
            FaceletFactory.setInstance(_faceletFactory);
View Full Code Here

    @Override
    @SuppressWarnings("unchecked")
    public void retargetAttachedObjects(FacesContext context,
            UIComponent topLevelComponent, List<AttachedObjectHandler> handlerList)
    {
        BeanInfo compositeComponentMetadata = (BeanInfo) topLevelComponent.getAttributes().get(UIComponent.BEANINFO_KEY);
       
        if (compositeComponentMetadata == null)
        {
            log.severe("Composite component metadata not found for: "+topLevelComponent.getClientId());
            return;
        }
       
        BeanDescriptor compositeComponentDescriptor = compositeComponentMetadata.getBeanDescriptor();
       
        List<AttachedObjectTarget> targetList = (List<AttachedObjectTarget>)
            compositeComponentDescriptor.getValue(AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
       
        if (targetList == null || targetList.isEmpty())
View Full Code Here

    @Override
    public void retargetMethodExpressions(FacesContext context,
            UIComponent topLevelComponent)
    {
        BeanInfo compositeComponentMetadata = (BeanInfo) topLevelComponent.getAttributes().get(UIComponent.BEANINFO_KEY);
       
        if (compositeComponentMetadata == null)
        {
            log.severe("Composite component metadata not found for: "+topLevelComponent.getClientId());
            return;
        }

        // "...For each attribute that is a MethodExpression..." This means we have to scan
        // all attributes with "method-signature" attribute and no "type" attribute
        // javax.faces.component._ComponentAttributesMap uses BeanInfo.getPropertyDescriptors to
        // traverse over it, but here the metadata returned by UIComponent.BEANINFO_KEY is available
        // only for composite components.
        // That means somewhere we need to create a custom BeanInfo object for composite components
        // that will be filled somewhere (theorically in ViewDeclarationLanguage.getComponentMetadata())
       
        PropertyDescriptor[] propertyDescriptors = compositeComponentMetadata.getPropertyDescriptors();
       
        for (PropertyDescriptor propertyDescriptor : propertyDescriptors)
        {
            if (propertyDescriptor.getValue("type") != null)
            {
View Full Code Here

        // Unfortunately, we can't check it on constructor because we need to call
        // ViewDeclarationLanguage.getComponentMetadata() and on that point it is possible to not
        // have a viewId.
        if (!facesContext.isProjectStage(ProjectStage.Production))
        {
            BeanInfo beanInfo = (BeanInfo) component.getAttributes().get(UIComponent.BEANINFO_KEY);
            for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors())
            {
                ValueExpression ve = (ValueExpression) propertyDescriptor.getValue("required");
                if (ve != null)
                {
                    // QUESTION: Almost positive that the value expression is supposed to evaluate to a boolean, but originally
View Full Code Here

TOP

Related Classes of java.beans.BeanInfo

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.