Examples of BeanInfo


Examples of com.github.nmorel.gwtjackson.rebind.bean.BeanInfo

        try {
            mapperInfo = typeOracle.getBeanJsonMapperInfo( beanType );

            if ( null == mapperInfo ) {
                // retrieve the informations on the beans and its properties
                BeanInfo beanInfo = BeanProcessor.processBean( logger, typeOracle, configuration, beanType );

                ImmutableMap<String, PropertyInfo> properties = PropertyProcessor
                        .findAllProperties( configuration, logger, typeOracle, beanInfo, samePackage );

                mapperInfo = new BeanJsonMapperInfo( beanType, qualifiedSerializerClassName, simpleSerializerClassName,
View Full Code Here

Examples of com.googlecode.openbeans.BeanInfo

        String propertyValue = getAttr("property"); //$NON-NLS-1$
        if (hasAttr("index")) { //$NON-NLS-1$
          addArgument(new Argument(int.class, new Integer(getAttr("index"))), 0); //$NON-NLS-1$
        }

        BeanInfo beanInfo = Introspector.getBeanInfo(getTarget(references).getClass());
        PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();

        boolean methodFound = false;
        Method method = null;
        for (PropertyDescriptor pd : pds)
        {
View Full Code Here

Examples of java.beans.BeanInfo

   * @param classifier the classifier to get the global info for
   * @return the global info (synopsis) for the classifier
   * @throws Exception if there is a problem reflecting on the classifier
   */
  protected static String getGlobalInfo(Classifier classifier) throws Exception {
    BeanInfo bi = Introspector.getBeanInfo(classifier.getClass());
    MethodDescriptor[] methods;
    methods = bi.getMethodDescriptors();
    Object[] args = {};
    String result = "\nSynopsis for " + classifier.getClass().getName()
      + ":\n\n";

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

Examples of java.beans.BeanInfo

    scrollablePanel.setLayout(gbLayout);
    setVisible(false);
    m_NumEditable = 0;
    m_Target = targ;
    try {
      BeanInfo bi = Introspector.getBeanInfo(m_Target.getClass());
      m_Properties = bi.getPropertyDescriptors();
      m_Methods = bi.getMethodDescriptors();
    } catch (IntrospectionException ex) {
      System.err.println("PropertySheet: Couldn't introspect");
      return;
    }
View Full Code Here

Examples of java.beans.BeanInfo

   * @return the generated BeanConnection
   * @throws Exception if something goes wrong
   */
  protected BeanConnection createBeanConnection(int sourcePos, int targetPos, String event, boolean hidden) throws Exception {
    BeanConnection          result;
    BeanInfo                compInfo;
    EventSetDescriptor[]    esds;
    int                     i;
    BeanInstance            instSource;
    BeanInstance            instTarget;

    result = null;
   
    // was there a connection?
    if ( (sourcePos == -1) || (targetPos == -1) )
      return result;
   
    instSource = (BeanInstance) m_BeanInstances.get(sourcePos);
    instTarget = (BeanInstance) m_BeanInstances.get(targetPos);
   
    compInfo = Introspector.getBeanInfo(((BeanInstance) m_BeanInstances.get(sourcePos)).getBean().getClass());
    esds     = compInfo.getEventSetDescriptors();

    for (i = 0; i < esds.length; i++) {
      if (esds[i].getName().equals(event)) {
        result = new BeanConnection(instSource, instTarget, esds[i], m_vectorIndex);
        ((BeanConnection) result).setHidden(hidden);
View Full Code Here

Examples of java.beans.BeanInfo

   */
  public static String getGlobalInfo(Object tempBean) {
    // set tool tip text from global info if supplied
    String gi = null;
    try {
      BeanInfo bi = Introspector.getBeanInfo(tempBean.getClass());
      MethodDescriptor [] methods = bi.getMethodDescriptors();
      for (int i = 0; i < methods.length; i++) {
        String name = methods[i].getDisplayName();
        Method meth = methods[i].getMethod();
        if (name.equals("globalInfo")) {
          if (meth.getReturnType().equals(String.class)) {
View Full Code Here

Examples of java.beans.BeanInfo

  {
    try
    {
      this.properties = new HashMap();

      final BeanInfo bi = Introspector.getBeanInfo(className);
      final PropertyDescriptor[] propertyDescriptors
          = bi.getPropertyDescriptors();
      for (int i = 0; i < propertyDescriptors.length; i++)
      {
        final PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
        final Method readMethod = propertyDescriptor.getReadMethod();
        final Method writeMethod = propertyDescriptor.getWriteMethod();
View Full Code Here

Examples of java.beans.BeanInfo

        logger.warn("Expression '" + expression.getExpressionType() + " is null");
      }

      try
      {
        final BeanInfo beanInfo = expression.getBeanDescriptor();
        if (beanInfo == null)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Cannot get BeanDescriptor: Null");
        }
      }
      catch (IntrospectionException e)
      {
        logger.warn("Expression '" + expression.getExpressionType() + ": Cannot get BeanDescriptor", e);
      }

      final Locale locale = Locale.getDefault();
      final String displayName = expression.getDisplayName(locale);
      if (isValid(displayName, expression.getName()) == false)
      {
        logger.warn("Expression '" + expression.getExpressionType() + ": No valid display name");
      }
      if (expression.isDeprecated())
      {
        deprecatedExpressionsCounter += 1;
        final String deprecateMessage = expression.getDeprecationMessage(locale);
        if (isValid(deprecateMessage, "Use a Formula instead") == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": No valid deprecate message");
        }
      }
      final String grouping = expression.getGrouping(locale);
      if (isValid(grouping, "Group") == false)
      {
        logger.warn("Expression '" + expression.getExpressionType() + ": No valid grouping message");
      }

      expressionsByGroup.add(grouping, expression);

      final ExpressionPropertyMetaData[] properties = expression.getPropertyDescriptions();
      for (int j = 0; j < properties.length; j++)
      {
        final ExpressionPropertyMetaData propertyMetaData = properties[j];
        final String name = propertyMetaData.getName();
        if (StringUtils.isEmpty(name))
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property without a name");
        }
        final String propertyDisplayName = propertyMetaData.getDisplayName(locale);
        if (isValid(propertyDisplayName, name) == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": No DisplayName");
        }

        final String propertyGrouping = propertyMetaData.getGrouping(locale);
        if (isValid(propertyGrouping, "Group") == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Grouping is not valid");
        }
        final int groupingOrdinal = propertyMetaData.getGroupingOrdinal(locale);
        if (groupingOrdinal == Integer.MAX_VALUE)
        {
          if (propertyMetaData instanceof DefaultExpressionMetaData)
          {
            final DefaultExpressionPropertyMetaData demd = (DefaultExpressionPropertyMetaData) propertyMetaData;
            missingProperties.add(demd.getKeyPrefix() + "grouping.ordinal=1000");
          }
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Grouping ordinal is not valid");
        }
        final int ordinal = propertyMetaData.getItemOrdinal(locale);
        if (groupingOrdinal == Integer.MAX_VALUE)
        {
          if (propertyMetaData instanceof DefaultExpressionMetaData)
          {
            final DefaultExpressionPropertyMetaData demd = (DefaultExpressionPropertyMetaData) propertyMetaData;
            missingProperties.add(demd.getKeyPrefix() + "ordinal=1000");
          }
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Ordinal is not valid");
        }
        final String propertyDescription = propertyMetaData.getDescription(locale);
        if (isValid(propertyDescription, "") == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Description is not valid");
        }
        final String propertyDeprecated = propertyMetaData.getDeprecationMessage(locale);
        if (isValid(propertyDeprecated, "") == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Deprecation is not valid");
        }

        final String role = propertyMetaData.getPropertyRole();
        if (isValid(role, "Value") == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Role is not valid");
        }
        final Class propertyType = propertyMetaData.getPropertyType();
        if (propertyType == null)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Property Type is not valid");
        }

        // should not crash!
        final PropertyDescriptor propertyDescriptor = propertyMetaData.getBeanDescriptor();

        if (propertyMetaData.isDeprecated())
        {
          final String deprecateMessage = propertyMetaData.getDeprecationMessage(locale);
          if (isValid(deprecateMessage, "Deprecated") == false)
          {
            logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": No valid deprecate message");
          }
        }

      }

      try
      {
        final BeanInfo beanInfo = Introspector.getBeanInfo(expression.getExpressionType());
        final PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
        for (int propIdx = 0; propIdx < descriptors.length; propIdx++)
        {
          final PropertyDescriptor descriptor = descriptors[propIdx];
          final String key = descriptor.getName();
View Full Code Here

Examples of java.beans.BeanInfo

      expressionAttrList.setAttribute(META_NAMESPACE, "expert", "false");
      expressionAttrList.setAttribute(META_NAMESPACE, "hidden", "false");
      expressionAttrList.setAttribute(META_NAMESPACE, "preferred", "false");
      writer.writeTag(META_NAMESPACE, "expression", expressionAttrList, XmlWriter.OPEN);

      final BeanInfo beanInfo = Introspector.getBeanInfo(aClass);
      final PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
      for (int j = 0; j < descriptors.length; j++)
      {
        final PropertyDescriptor descriptor = descriptors[j];
        final String key = descriptor.getName();
View Full Code Here

Examples of java.beans.BeanInfo

    for (int i = 0; i < classes.length; i++)
    {
      final Class aClass = classes[i];

      final BeanInfo beanInfo = Introspector.getBeanInfo(aClass);
      final BeanUtility bu = new BeanUtility(aClass.newInstance());
      final PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
      for (int j = 0; j < descriptors.length; j++)
      {
        final PropertyDescriptor descriptor = descriptors[j];
        final String key = descriptor.getName();
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.