View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.page.document;
18  
19  /***
20   * <p>
21   * DocumentHandlerFactory
22   * </p>
23   * <p>
24   *  Factory for generating <code>DocumentHandlers</code> for specific document types
25   * </p>
26   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
27   * @version $Id: DocumentHandlerFactory.java 516448 2007-03-09 16:25:47Z ate $
28   *
29   */
30  public interface DocumentHandlerFactory
31  {
32      /***
33       * 
34       * <p>
35       * getDocumentHandler
36       * </p>     
37       *
38       * @param documentType document type to retreive a handler for.  Examples: .psml, .link
39       * @return DocumentHanlder for the <code>documentType</code> indicated.  Never returns <code>null.</code>
40       * @throws UnsupportedDocumentTypeException If no handler has been registered for the
41       * <code>documentType</code> argument.
42       */
43      DocumentHandler getDocumentHandler(String documentType) throws UnsupportedDocumentTypeException;
44      
45      /***
46       * 
47       * <p>
48       * getDocumentHandlerForPath
49       * </p>
50       *
51       * @param documentPath
52       * @return
53       * @throws UnsupportedDocumentTypeException
54       */
55      DocumentHandler getDocumentHandlerForPath( String documentPath) throws UnsupportedDocumentTypeException;
56      
57      /***
58       * 
59       * <p>
60       * addDocumentHandler
61       * </p>
62       *
63       * @param documentHandler
64       */
65      void registerDocumentHandler(DocumentHandler documentHandler) throws DocumentTypeAlreadyRegisteredException;
66      
67      /***
68       * <p>
69       * getConstraintsEnabled
70       * </p>
71       *
72       * @return enabled indicator
73       */
74      boolean getConstraintsEnabled();
75  
76      /***
77       * <p>
78       * setConstraintsEnabled
79       * </p>
80       *
81       * @param enabled indicator
82       */
83      void setConstraintsEnabled(boolean enabled);
84  
85      /***
86       * <p>
87       * getPermissionsEnabled
88       * </p>
89       *
90       * @return enabled indicator
91       */
92      boolean getPermissionsEnabled();
93  
94      /***
95       * <p>
96       * setPermissionsEnabled
97       * </p>
98       *
99       * @param enabled indicator
100      */
101     void setPermissionsEnabled(boolean enabled);
102 }