01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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.cocoon.components.language.markup;
18:
19: import org.apache.avalon.framework.service.ServiceManager;
20: import org.apache.cocoon.ProcessingException;
21: import org.apache.excalibur.source.SourceException;
22: import org.apache.excalibur.source.SourceResolver;
23: import org.xml.sax.SAXException;
24:
25: import java.io.IOException;
26:
27: /**
28: * An extension to <code>Logicsheet</code> that is associated with a namespace.
29: * Named logicsheets are implicitly declared (and automagically applied) when
30: * the markup language document's root element declares the same logichseet's
31: * namespace
32: *
33: * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
34: * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
35: * @version CVS $Id: NamedLogicsheet.java 433543 2006-08-22 06:22:54Z crossley $
36: */
37: public class NamedLogicsheet extends Logicsheet {
38:
39: /**
40: * The namespace uri
41: */
42: protected String uri;
43:
44: /**
45: * The namespace prefix
46: */
47: private String prefix;
48:
49: public NamedLogicsheet(String systemId, ServiceManager manager,
50: SourceResolver resolver, LogicsheetFilter filter)
51: throws IOException, ProcessingException, SourceException,
52: SAXException {
53: super (systemId, manager, resolver, filter);
54: }
55:
56: /**
57: * Set the logichseet's namespace prefix
58: *
59: * @param prefix The namespace prefix
60: */
61: public void setPrefix(String prefix) {
62: this .prefix = prefix;
63: }
64:
65: /**
66: * Return the logicsheet's namespace prefix
67: *
68: * @return The logicsheet's namespace prefix
69: */
70: public String getPrefix() {
71: return this .prefix;
72: }
73:
74: /**
75: * Set the logichseet's uri
76: *
77: * @param uri The logicsheet's uri
78: */
79: public void setURI(String uri) {
80: this .uri = uri;
81: }
82:
83: /**
84: * Return the logicsheet's namespace prefix
85: *
86: * @return The logicsheet's namespace prefix
87: */
88: public String getURI() {
89: return this.uri;
90: }
91: }
|