Package java.beans

Examples of java.beans.BeanInfo


  return tmpls;
    }

    @Override
    public FieldEntry[] toFieldEntries(Class<?> targetClass, FieldOption implicitOption) {
  BeanInfo desc;
  try {
      desc = Introspector.getBeanInfo(targetClass);
  } catch (IntrospectionException e1) {
      throw new TemplateBuildException("Class must be java beans class:" + targetClass.getName());
  }

  PropertyDescriptor[] props = desc.getPropertyDescriptors();
  ArrayList<PropertyDescriptor> list = new ArrayList<PropertyDescriptor>();
  for (int i = 0; i < props.length; i++) {
      PropertyDescriptor pd = props[i];
      if (!isIgnoreProperty(pd)) {
    list.add(pd);
View Full Code Here


 
  /**
   * @see net.sf.jasperreports.engine.JRDataSourceProvider#getFields(net.sf.jasperreports.engine.JasperReport)
   */
  public JRField[] getFields(JasperReport report) throws JRException {
    BeanInfo beanInfo = null;

    try {
      beanInfo = Introspector.getBeanInfo(beanClass);
    } catch (IntrospectionException e) {
      throw new JRException(e);
    }

    PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
    if(descriptors != null)
    {
      ArrayList fields = new ArrayList(descriptors.length);
     
      for (int i = 0; i < descriptors.length; i++) {
View Full Code Here

  protected final Representation getRepresentation(RDFWriterFactory factory, MediaType mediaType)
    throws ResourceException
  {
    try {
      BeanInfo info = Introspector.getBeanInfo(RepositoryMetaData.class);
      PropertyDescriptor[] properties = info.getPropertyDescriptors();

      Repository repository = getRepository();
      RepositoryMetaData data = repository.getMetaData();
      URIFactory uf = repository.getURIFactory();
      LiteralFactory lf = repository.getLiteralFactory();
View Full Code Here

  public BeanMetaData(Class beanClass) {
    this.beanClass = beanClass;

    if (beanClass != null) {
      try {
        BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
        propertyDescriptors = beanInfo.getPropertyDescriptors();
      } catch (IntrospectionException e) {
        handleException(e);
      }
    }
View Full Code Here

   private Map<String, PropertyDescriptor> getPropertyDescriptors(
           Class<? extends Object> clazz)
   {
      try
      {
         BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
         HashMap<String, PropertyDescriptor> results = new HashMap<String, PropertyDescriptor>();
         PropertyDescriptor[] propertyDescriptors = beanInfo
                 .getPropertyDescriptors();
         for (PropertyDescriptor propertyDescriptor : propertyDescriptors)
         {
            results.put(propertyDescriptor.getName(), propertyDescriptor);
         }
View Full Code Here

   * Get map with property descriptors for the specified bean class
   */
  private static Map getPropertyDescriptors(Class clazz) {
    HashMap map = (HashMap)descriptorCache.get(clazz);
    if (map == null) {
      BeanInfo beanInfo = null;
      try {
        beanInfo = Introspector.getBeanInfo(clazz);
      } catch (IntrospectionException e) {
        return Collections.EMPTY_MAP;
      }
      PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
      if (descriptors == null)
         descriptors = new PropertyDescriptor[0];
      map = new HashMap(descriptors.length);
      for (int i = 0; i < descriptors.length; i++)
        map.put(descriptors[i].getName(), descriptors[i]);
View Full Code Here

    {
      PDF annotation;
      {
        if(feature instanceof String) // Property name.
        {
          BeanInfo classInfo;
          try
          {classInfo = Introspector.getBeanInfo(getClass());}
          catch(IntrospectionException e)
          {throw new RuntimeException(e);}
          for(PropertyDescriptor property : classInfo.getPropertyDescriptors())
          {
            if(feature.equals(property.getName()))
            {
              feature = property.getReadMethod();
              break;
View Full Code Here

    private final Method dynaSetter;
    private final Map propertySetters = new HashMap();
   
    protected JspTagModelBase(Class tagClass) throws IntrospectionException {
        this.tagClass = tagClass;
        BeanInfo bi = Introspector.getBeanInfo(tagClass);
        PropertyDescriptor[] pda = bi.getPropertyDescriptors();
        for (int i = 0; i < pda.length; i++) {
            PropertyDescriptor pd = pda[i];
            Method m = pd.getWriteMethod();
            if(m != null) {
                propertySetters.put(pd.getName(), m);
View Full Code Here

        {
            return classMap;
        }
       
        try {
            BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
            PropertyDescriptor[] pda = beanInfo.getPropertyDescriptors();
            MethodDescriptor[] mda = beanInfo.getMethodDescriptors();

            for(int i = pda.length - 1; i >= 0; --i) {
                populateClassMapWithPropertyDescriptor(
                        pda[i], clazz, accessibleMethods,
                        classMap);
View Full Code Here

  public BeanMapper(Class<T> type)
    {
        this.type = type;
        try
        {
            BeanInfo info = Introspector.getBeanInfo(type);

      for (PropertyDescriptor descriptor : info.getPropertyDescriptors())
      {
        properties.put(descriptor.getName().toLowerCase(), descriptor);
      }
    }
        catch (IntrospectionException e)
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.