1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.properties

File BeanManager.java

 

Code metrics

0
0
0
1
57
9
0
-
-
0
-

Classes

Class Line # Actions
BeanManager 39 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.properties;
21   
22    import java.util.Map;
23   
24    import org.xwiki.component.annotation.Role;
25   
26    /**
27    * Component used to populate or parse a java bean.
28    * <ul>
29    * <li>{@link #populate(Object, Map)} ignore properties names case</li>
30    * <li>{@link #populate(Object, Map)} validate the bean based JSR 303</li>
31    * <li>if the bean implements {@link RawProperties}, the remaining property (the one non populated using setters of
32    * public fields) are given to it as custom non converted properties</li>
33    * </ul>
34    *
35    * @version $Id: fd09b9b3b92d6eacabb0bc093f92a4a638a688dd $
36    * @since 2.0M2
37    */
38    @Role
 
39    public interface BeanManager
40    {
41    /**
42    * Convert provided values and inject them in the provided java bean.
43    *
44    * @param bean the java bean to populate
45    * @param values the values to convert and inject in the java bean
46    * @throws PropertyException error append during the populate
47    */
48    void populate(Object bean, Map<String, ?> values) throws PropertyException;
49   
50    /**
51    * Parse provided java bean and return a descriptor with all its public properties.
52    *
53    * @param beanClass the java bean class to parse.
54    * @return the descriptor of the bean class.
55    */
56    BeanDescriptor getBeanDescriptor(Class<?> beanClass);
57    }