View Javadoc
1   package org.exolab.castor.xml.schema;
2   
3   import java.util.List;
4   
5   import org.castor.core.nature.BaseNature;
6   
7   public class AppInfoJpaNature extends BaseNature {
8   
9     /**
10     * Property key of content.
11     */
12    private static final String CONTENT_KEY = "content";
13  
14    /**
15     * @param appInfo the appInfo in focus.
16     */
17    public AppInfoJpaNature(final AppInfo appInfo) {
18      super(appInfo);
19    }
20  
21    /**
22     * Returns the id of the Nature. Implementation returns the fully qualified class name.
23     * 
24     * @return the id.
25     * @see org.exolab.castor.builder.info.nature.Nature#getId()
26     */
27    public String getId() {
28      return getClass().getName();
29    }
30  
31    /**
32     * Adds a content value to the content.
33     * 
34     * @param contentValue content value
35     */
36    @SuppressWarnings("unchecked")
37    public void addContent(final Object contentValue) {
38      List<Object> content = getPropertyAsList(CONTENT_KEY);
39      content.add(contentValue);
40    }
41  
42    /**
43     * Returns a list of JDO content values.
44     * 
45     * @return the JDO content values.
46     */
47    @SuppressWarnings("unchecked")
48    public List<Object> getContent() {
49      return this.getPropertyAsList(CONTENT_KEY);
50    }
51  
52  }