Package java.beans

Examples of java.beans.MethodDescriptor


    }
  return null;
  }

  public MethodDescriptor[] getMethodDescriptors() {
    MethodDescriptor rv[] = {};
    return rv;
  }
View Full Code Here


        Class getConnection2Params[] = { String.class,String.class };
        Class escapeParams[] = { Class.forName("java.util.Date"), String.class };
        Class existsParams[] = { Class.forName("com.knowgate.jdc.JDCConnection"), String.class, String.class };
        Class getDataModelParams[] = { Class.forName("com.knowgate.jdc.JDCConnection") };

        MethodDescriptor getProfileName =
            new MethodDescriptor(DBBind.class.getMethod("getProfileName", voidParams));
        MethodDescriptor getProperties =
            new MethodDescriptor(DBBind.class.getMethod("getProperties", voidParams));
        MethodDescriptor getProperty =
            new MethodDescriptor(DBBind.class.getMethod("getProperty", getPropertyParams));
        MethodDescriptor getProperty2 =
            new MethodDescriptor(DBBind.class.getMethod("getProperty", getProperty2Params));
        MethodDescriptor restartBind =
            new MethodDescriptor(DBBind.class.getMethod("restart", voidParams));
        MethodDescriptor closeBind =
            new MethodDescriptor(DBBind.class.getMethod("close", voidParams));
        MethodDescriptor nextVal =
            new MethodDescriptor(DBBind.class.getMethod("nextVal", nextValParams));
        MethodDescriptor getTable =
            new MethodDescriptor(DBBind.class.getMethod("getTable", getTableParams));
        MethodDescriptor getConnection0 =
            new MethodDescriptor(DBBind.class.getMethod("getConnection", voidParams));
        MethodDescriptor getConnection1 =
            new MethodDescriptor(DBBind.class.getMethod("getConnection", getConnection1Params));
        MethodDescriptor getConnection2 =
            new MethodDescriptor(DBBind.class.getMethod("getConnection", getConnection2Params));
        MethodDescriptor  getDataModelVersion =
            new MethodDescriptor(DBBind.class.getMethod("getDataModelVersion", getDataModelParams));
        MethodDescriptor  getDataModelVersionNumber =
            new MethodDescriptor(DBBind.class.getMethod("getDataModelVersionNumber", getDataModelParams));
        MethodDescriptor  getDatabaseProductName =
            new MethodDescriptor(DBBind.class.getMethod("getDatabaseProductName", voidParams));
        MethodDescriptor  getTime =
            new MethodDescriptor(DBBind.class.getMethod("getTime", voidParams));
        MethodDescriptor connectionPool =
            new MethodDescriptor(DBBind.class.getMethod("connectionPool", voidParams));
        MethodDescriptor escape =
            new MethodDescriptor(DBBind.class.getMethod("escape", escapeParams));
        MethodDescriptor exists =
            new MethodDescriptor(DBBind.class.getMethod("exists", existsParams));
        MethodDescriptor toXml =
            new MethodDescriptor(DBBind.class.getMethod("toXml", voidParams));

        MethodDescriptor rv[] = { getProfileName,getProperties,getProperty,getProperty2,
                      restartBind, closeBind, nextVal, getTable,
                      getConnection0, getConnection1, getConnection2,
                      getDataModelVersion, getDataModelVersionNumber,
                      getDatabaseProductName, getTime, connectionPool, escape, exists, toXml };
        return rv;
View Full Code Here

        Class voidParams[] = {  };
        Class getRootsParams[] = { Class.forName("java.sql.Connection") };
        Class getRootsNamedParams[] = { Class.forName("java.sql.Connection"), Class.forName("String"), Class.forName("int") };
        Class getChildsNamedParams[] = { Class.forName("java.sql.Connection"), Class.forName("int"), Class.forName("String"), Class.forName("int") };

        MethodDescriptor clearCache = new MethodDescriptor(Categories.class.getMethod("clearCache", voidParams));

        MethodDescriptor getRoots = new MethodDescriptor(Categories.class.getMethod("getRoots", getRootsParams));

        MethodDescriptor getRootsCount = new MethodDescriptor(Categories.class.getMethod("getRootsCount", voidParams));

        MethodDescriptor getRootsNamed = new MethodDescriptor(Categories.class.getMethod("getRootsNamed", getRootsNamedParams));

        MethodDescriptor getChildsNamed = new MethodDescriptor(Categories.class.getMethod("getChildsNamed", getChildsNamedParams));

        MethodDescriptor rv[] = {clearCache, getRoots, getRootsCount, getRootsNamed, getChildsNamed};

        return rv;
    }
    catch (ClassNotFoundException e) {
         throw new Error(e.toString());
View Full Code Here

        Class UtilHashMap = Class.forName("java.util.HashMap");
        Class DistribCache = Class.forName("com.knowgate.cache.DistributedCacheClient");

        Class toHTMLSelectParams[] = { SQLConnection, LangString };

        MethodDescriptor toHTMLSelect =
            new MethodDescriptor(DBLanguages.class.getMethod("toHTMLSelect", toHTMLSelectParams));

        Class getHTMLCountrySelectParams[] = { JDCConnection, LangString };

        Class getStateSelectParams[] = { JDCConnection, LangString, LangString };

        Class getTermSelectParams[] = { JDCConnection, int.class, LangString };
                     
        MethodDescriptor getHTMLCountrySelect =
            new MethodDescriptor(DBLanguages.class.getMethod("getHTMLCountrySelect", getHTMLCountrySelectParams));

        MethodDescriptor getHTMLStateSelect =
            new MethodDescriptor(DBLanguages.class.getMethod("getHTMLStateSelect", getStateSelectParams));

        MethodDescriptor getHTMLTermSelect =
            new MethodDescriptor(DBLanguages.class.getMethod("getHTMLTermSelect", getTermSelectParams));

        MethodDescriptor getPlainTextStateList =
            new MethodDescriptor(DBLanguages.class.getMethod("getPlainTextStateList", getStateSelectParams));

        Class getHTMLSelectLookUpParams1[] = { JDCConnection, LangString, LangString, LangString, LangString };

        Class getHTMLSelectLookUpParams2[] = { DistribCache, JDCConnection, LangString, LangString, LangString, LangString };

        Class getHTMLSelectLookUpParams3[] = { JDCConnection, LangString, LangString, LangString, LangString, LangString };

        MethodDescriptor getHTMLSelectLookUp1 =
            new MethodDescriptor(DBLanguages.class.getMethod("getHTMLSelectLookUp", getHTMLSelectLookUpParams1));

        MethodDescriptor getHTMLSelectLookUp2 =
            new MethodDescriptor(DBLanguages.class.getMethod("getHTMLSelectLookUp", getHTMLSelectLookUpParams2));

        MethodDescriptor getHTMLSelectLookUp3 =
            new MethodDescriptor(DBLanguages.class.getMethod("getHTMLSelectLookUp", getHTMLSelectLookUpParams3));

        Class getLookUpTranslationParams[] = { SQLConnection, LangString, LangString, LangString, LangString, LangString };

        Class getLookUpMapParams[] = { SQLConnection, LangString, LangString, LangString, LangString, LangString };

        Class nextLookuUpProgressiveParams[] = {SQLConnection, LangString, LangString, LangString};

        MethodDescriptor getLookUpTranslation =
            new MethodDescriptor(DBLanguages.class.getMethod("getLookUpTranslation", getLookUpTranslationParams));

        MethodDescriptor getLookUpMap =
            new MethodDescriptor(DBLanguages.class.getMethod("getLookUpMap", getLookUpMapParams));

        MethodDescriptor nextLookuUpProgressive =
            new MethodDescriptor(DBLanguages.class.getMethod("nextLookuUpProgressive", nextLookuUpProgressiveParams));

        Class addLookupParams[] = {SQLConnection, LangString, LangString, LangString, LangString, UtilHashMap};

        MethodDescriptor addLookup =
            new MethodDescriptor(DBLanguages.class.getMethod("addLookup", addLookupParams));

        MethodDescriptor rv[] =
            {toHTMLSelect, getHTMLSelectLookUp1, getHTMLSelectLookUp2, getHTMLSelectLookUp3, getLookUpTranslation, getLookUpMap, getHTMLCountrySelect, getHTMLStateSelect, getHTMLTermSelect, getPlainTextStateList, nextLookuUpProgressive, addLookup};
        return rv;
    } catch (ClassNotFoundException e) {
         throw new Error(e.toString());
    } catch (NoSuchMethodException e) {
View Full Code Here

            if(exposureLevel < EXPOSE_PROPERTIES_ONLY)
            {
                MethodAppearanceDecision decision = new MethodAppearanceDecision()
                for(int i = mda.length - 1; i >= 0; --i)
                {
                    MethodDescriptor md = mda[i];
                    Method publicMethod = getAccessibleMethod(
                            md.getMethod(), accessibleMethods);
                    if(publicMethod != null && isSafeMethod(publicMethod))
                    {
                        decision.setDefaults(publicMethod);
                        finetuneMethodAppearance(clazz, publicMethod, decision);
                       
View Full Code Here

        List descs = new ArrayList();
        for (int i = 0; i < pds.length; i++) {
            Method write = pds[i].getWriteMethod();
            Method read = pds[i].getReadMethod();
            if (read != null && write != null) {
                descs.add(new MethodDescriptor(write));
                descs.add(new MethodDescriptor(read));
            }
        }
        _mds = (MethodDescriptor[]) descs.
            toArray(new MethodDescriptor[descs.size()]);
        return _mds;
View Full Code Here

        List<MethodDescriptor> descs = new ArrayList<MethodDescriptor>();
        for (int i = 0; i < pds.length; i++) {
            Method write = pds[i].getWriteMethod();
            Method read = pds[i].getReadMethod();
            if (read != null && write != null) {
                descs.add(new MethodDescriptor(write));
                descs.add(new MethodDescriptor(read));
            }
        }
        _mds = (MethodDescriptor[]) descs.
            toArray(new MethodDescriptor[descs.size()]);
        return _mds;
View Full Code Here

    MethodDescriptor oldDescriptor
    )
  {
    try
    {
      MethodDescriptor newDescriptor = new MethodDescriptor(
                                    oldDescriptor.getMethod(),
                                    oldDescriptor.getParameterDescriptors());

      // copy the rest of the attributes
      _copyFeatureDescriptor(oldDescriptor, newDescriptor);
View Full Code Here

    }

    if ((explicit == null) && (_superBeanInfo != null))
    {
      // We have no explicit BeanInfo methods.  Check with our parent.
      MethodDescriptor supers[] = _superBeanInfo.getMethodDescriptors();

      for (int i = 0 ; i < supers.length; i++)
      {
        _addMethod(methods, supers[i]);
      }
    }

    for (int i = 0; i < _additionalBeanInfo.length; i++)
    {
      MethodDescriptor additional[] =
                                  _additionalBeanInfo[i].getMethodDescriptors();

      if (additional != null)
      {
        for (int j = 0 ; j < additional.length; j++)
        {
          _addMethod(methods, additional[j]);
        }
      }
    }

    if (explicit != null)
    {
      // Add the explicit informant data to our results.
      for (int i = 0 ; i < explicit.length; i++)
      {
        _addMethod(methods, explicit[i]);
       }
    }
    else
    {
      // Apply some reflection to the current class.

      // First get an array of all the public beans methods at this level
      Method methodList[] = _getPublicMethods(_beanClass);

      // Add each method
      for (int i = 0; i < methodList.length; i++)
      {
        _addMethod(methods, new MethodDescriptor(methodList[i]));
      }
    }

    // Allocate and populate the result array.
    MethodDescriptor result[] = new MethodDescriptor[methods.size()];

    Enumeration<MethodDescriptor> elements = methods.elements();

    for (int i = 0; i < result.length; i++)
    {
View Full Code Here

    // We have to be careful here to distinguish method by both name
    // and argument lists.
    // This method gets called a *lot, so we try to be efficient.
    String name = descriptor.getMethod().getName();

    MethodDescriptor old = methods.get(name);

    if (old == null)
    {
      // This is the common case.
      methods.put(name, descriptor);
      return;
    }

    // We have a collision on method names.  This is rare.

    // Check if old and descriptor have the same type.
    Class   p1[]  = descriptor.getMethod().getParameterTypes();
    Class   p2[]  = old.getMethod().getParameterTypes();
    boolean match = false;

    if (p1.length == p2.length)
    {
      match = true;
      for (int i = 0; i < p1.length; i++)
      {
        if (p1[i] != p2[i])
        {
          match = false;
          break;
        }
      }
    }

    if (match)
    {
      MethodDescriptor composite = _createMergedMethodDescriptor(old,
                                                                 descriptor);
      methods.put(name, composite);
      return;
    }

    // We have a collision on method names with different type signatures.
    // This is very rare.
    String longKey = _makeQualifiedMethodName(descriptor);

    old = methods.get(longKey);

    if (old == null)
    {
      methods.put(longKey, descriptor);
      return;
    }

    MethodDescriptor composite = _createMergedMethodDescriptor(old,
                                                               descriptor);
    methods.put(longKey, composite);
  }
View Full Code Here

TOP

Related Classes of java.beans.MethodDescriptor

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.