Examples of ComponentBean


Examples of com.sun.faces.config.beans.ComponentBean

                                       digester.getMatch() +
                                       "} Push " + CLASS_NAME);
        }
        Class clazz =
            digester.getClassLoader().loadClass(CLASS_NAME);
        ComponentBean cb = (ComponentBean) clazz.newInstance();
        digester.push(cb);

    }

Examples of com.sun.faces.config.beans.ComponentBean

     * @exception IllegalStateException if the popped object is not
     *  of the correct type
     */
    public void end(String namespace, String name) throws Exception {

        ComponentBean top = null;
        try {
            top = (ComponentBean) digester.pop();
        } catch (Exception e) {
            throw new IllegalStateException("Popped object is not a " +
                                            CLASS_NAME + " instance");
        }
        FacesConfigBean fcb = (FacesConfigBean) digester.peek();
        ComponentBean old = fcb.getComponent(top.getComponentType());
        if (old == null) {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[ComponentRule]{" +
                                           digester.getMatch() +
                                           "} New(" +

Examples of com.sun.faces.config.beans.ComponentBean

     * the class declaration.</p>
     */
    private void prefix() throws Exception {

        // Acquire the config bean for our base component
        ComponentBean base = configBean.getComponent(cb.getBaseComponentType());
        if (base == null) {
            throw new IllegalArgumentException("No base component type for '" +
                cb.getComponentType() + "'");
        }

        // Generate the copyright information
        writer.writeBlockComment(
            propManager.getProperty(PropertyManager.COPYRIGHT));

        // Generate the package declaration
        writer.writePackage("javax.faces.component.html");

        writer.write('\n');

        // Generate the imports
        writer.writeImport("java.io.IOException");
        writer.writeImport("java.util.List");
        writer.writeImport("java.util.ArrayList");
        writer.writeImport("java.util.Arrays");
        writer.write('\n');
        writer.writeImport("javax.faces.context.FacesContext");
        writer.writeImport("javax.el.MethodExpression");
        writer.writeImport("javax.el.ValueExpression");
        writer.write("\n\n");

        writer.writeBlockComment("******* GENERATED CODE - DO NOT EDIT *******");
        writer.write("\n\n");

        // Generate the class JavaDocs (if any)
        DescriptionBean db = cb.getDescription("");
        String rendererType = cb.getRendererType();

        String description = null;
        if (db != null) {
            description = db.getDescription().trim();
        }

        if (rendererType != null) {
            if (description == null) {
                description = "";
            }
            description +=
            "\n<p>By default, the <code>rendererType</code> property must be set to \"<code>" +
                rendererType +
                "</code>\".\nThis value can be changed by calling the <code>setRendererType()</code> method.</p>\n";
        }

        if (description != null && description.length() > 0) {
            writer.writeJavadocComment(description);
        }

        // Generate the class declaration
        writer.writePublicClassDeclaration(shortName(cb.getComponentClass()),
                                           base.getComponentClass(),
                                           null, false, false);

        writer.write("\n\n");

        writer.indent();

Examples of com.sun.faces.config.beans.ComponentBean

     * <p>Generate the property instance variable, and getter and setter
     * methods, for all non-duplicate properties of this component class.</p>
     */
    private void properties() throws Exception {

        ComponentBean base = configBean.getComponent(cb.getBaseComponentType());
        PropertyBean[] pbs = cb.getProperties();
        for (PropertyBean pb : pbs) {

            // Should we generate this property?
            if (base.getProperty(pb.getPropertyName()) != null) {
                if (logger.isLoggable(Level.FINER)) {
                    logger.log(Level.FINER, "Skipping base class property '" +
                                            pb.getPropertyName() + "'");
                }
                continue;

Examples of com.sun.faces.config.beans.ComponentBean

        writer.fwrite("HashMap<String,String[]> map = new HashMap<String,String[]>();\n");

        ComponentBean[] components = bean.getComponents();
        List<String> keys = new ArrayList<String>();
        for (int i = 0, len = components.length; i < len; i ++) {
            ComponentBean comp = components[i];
            if (!comp.getComponentClass().contains("Html")) {
                continue;
            }
            String type = comp.getRendererType();
            if (type != null) {
                String family = comp.getBaseComponentType();
                type = type.substring(type.lastIndexOf('.') + 1);
                family = family.substring(family.lastIndexOf('.') + 1);
                String key = family + type;
                keys.add(key);
                writer.fwrite("map.put(\"");
                writer.write(key);
                writer.write("\",\n");
                writer.indent();
                writer.indent();
                writer.fwrite("new String[] {\n");
                writer.indent();
                writer.indent();
                PropertyBean[] props = comp.getProperties();
                boolean attributeWritten = false;
                for (int ii = 0, llen = props.length; ii < llen; ii++) {
                    PropertyBean aBean = props[ii];
                    // The RI doesn't use any JS for the command button, so
                    // treat

Examples of com.sun.faces.config.beans.ComponentBean

     */
    public static Map<String,ComponentBean> getComponentFamilyComponentMap(
        FacesConfigBean configBean) {

        TreeMap<String,ComponentBean> result = new TreeMap<String, ComponentBean>();
        ComponentBean component;
        ComponentBean[] components = configBean.getComponents();
        for (int i = 0, len = components.length; i < len; i++) {
            component = components[i];
            if (component == null) {
                throw new IllegalStateException("No Components Found");
            }
            if (component.getBaseComponentType() != null) {
                continue;
            }
            String componentFamily = component.getComponentFamily();

            result.put(componentFamily, component);
        }

        return result;

Examples of com.sun.faces.config.beans.ComponentBean

                // Generate tag attributes
                //

                // Component Properties first...
                //
                ComponentBean component = componentsByComponentFamily.get(componentFamily);

                PropertyBean[] properties = component.getProperties();
                PropertyBean property;

                for (int i = 0, len = properties.length; i < len; i++) {
                    if (null == (property = properties[i])) {
                        continue;

Examples of com.sun.faces.config.beans.ComponentBean

                // Generate tag attributes
                //

                // Component Properties first...
                //
                ComponentBean component = componentsByComponentFamily.get(componentFamily);

                PropertyBean[] properties = component.getProperties();
                PropertyBean property;

                for (int i = 0, len = properties.length; i < len; i++) {
                    if (null == (property = properties[i])) {
                        continue;

Examples of org.ajax4jsf.builder.config.ComponentBean

   * @see com.exadel.vcp.builder.ant.InnerGenerator#createFiles(com.exadel.vcp.builder.config.BuilderConfig)
   */
  public void createFiles(BuilderConfig config) throws GeneratorException {
    // Put common properties
    for (Iterator iter = config.getComponents().iterator(); iter.hasNext();) {
      ComponentBean component = (ComponentBean) iter.next();
      RendererBean renderer = component.getRenderer();
      createRenderer(renderer, component);
    }
    for (Iterator iter = config.getRenderers().iterator(); iter.hasNext();) {
      RendererBean renderer = (RendererBean) iter.next();
      createRenderer(renderer, null);

Examples of org.ajax4jsf.builder.config.ComponentBean

   
    context.put("testDataGenerator", new TestDataGenerator(getClassLoader(), getLog()));
   
    // Put common properties
    for (Iterator iter = config.getComponents().iterator(); iter.hasNext();) {
      ComponentBean component = (ComponentBean) iter.next();
      if(component.getTest() != null){
        info("Create component test class file for component "+component.getClassname());
        if (component.isGenerate()) {
          context.put("component", component);
          context.put("renderer", component.getRenderer());
          context.put("package", component.getPackageName());
          Set<String> importClasses = new HashSet<String>();
          for (Iterator it = component.getProperties().iterator(); it
              .hasNext();) {
            PropertyBean property = (PropertyBean) it.next();
            // For non-primitive types, add import declaration.
            if (!property.isSimpleType() && !property.isExist()) {
              importClasses.add(property.getClassname());
            }
          }
          importClasses.add(component.getTest().getSuperclassname());
          context.put("imports", importClasses);
          String resultPath = component.getTest().getClassname().replace('.', '/')
              + ".java";
          File javaFile = new File(getDestDir(), resultPath);
          File javaDir = javaFile.getParentFile();
          if (!javaDir.exists()) {
            javaDir.mkdirs();
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.