View Javadoc

1   package net.sf.cantina.decorator;
2   
3   import net.sf.cantina.Document;
4   import net.sf.cantina.Realm;
5   
6   import java.util.Locale;
7   import java.util.Collection;
8   
9   /***
10   * @author Stephane JAIS
11   */
12  public class DocumentDecorator
13    implements Document
14  {
15    private Document itsDocument;
16  
17    public DocumentDecorator(Document d)
18    {
19      itsDocument = d;
20    }
21  
22    public Document getDocument()
23    {
24      return itsDocument;
25    }
26    public String getDocumentId()
27    {
28      return itsDocument.getDocumentId();
29    }
30  
31    public byte[] getContent(Locale locale)
32    {
33      return itsDocument.getContent(locale);
34    }
35  
36    public String getContentAsString(Locale locale) throws Exception
37    {
38      return itsDocument.getContentAsString(locale);
39    }
40  
41    public String getContentType()
42    {
43      return itsDocument.getContentType();
44    }
45  
46    public Realm getRealm()
47    {
48      return itsDocument.getRealm();
49    }
50  
51    public void setContent(Locale locale, byte[] content)
52    {
53      itsDocument.setContent(locale,content);
54    }
55  
56    public void setContentAsString(Locale locale, String content) throws Exception
57    {
58      itsDocument.setContentAsString(locale,content);
59    }
60  
61    public void setContentType(String contentType)
62    {
63      itsDocument.setContentType(contentType);
64    }
65  
66    public void setRealm(Realm realm)
67    {
68      itsDocument.setRealm(realm);
69    }
70  
71    public Collection getAvailableLocales()
72    {
73      return itsDocument.getAvailableLocales();
74    }
75  }