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
16       *            the appInfo in focus.
17       */
18      public AppInfoJpaNature(final AppInfo appInfo) {
19          super(appInfo);
20      }
21  
22      /**
23       * Returns the id of the Nature. Implementation returns the fully qualified
24       * class name.
25       * 
26       * @return the id.
27       * @see org.exolab.castor.builder.info.nature.Nature#getId()
28       */
29      public String getId() {
30          return getClass().getName();
31      }
32  
33      /**
34       * Adds a content value to the content.
35       * 
36       * @param contentValue
37       *            content value
38       */
39      @SuppressWarnings("unchecked")
40      public void addContent(final Object contentValue) {
41          List<Object> content = getPropertyAsList(CONTENT_KEY);
42          content.add(contentValue);
43      }
44      
45      /**
46       * Returns a list of JDO content values.
47       * 
48       * @return the JDO content values.
49       */
50      @SuppressWarnings("unchecked")
51      public List<Object> getContent() {
52          return this.getPropertyAsList(CONTENT_KEY);
53      }
54  
55  }