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:
18: /* $Id: MultiSwitch.java 554104 2007-07-07 01:07:10Z adelmelle $ */
19:
20: package org.apache.fop.fo.flow;
21:
22: // XML
23: import org.xml.sax.Locator;
24:
25: import org.apache.fop.apps.FOPException;
26: import org.apache.fop.fo.FONode;
27: import org.apache.fop.fo.FObj;
28: import org.apache.fop.fo.PropertyList;
29: import org.apache.fop.fo.ValidationException;
30: import org.apache.fop.fo.properties.CommonAccessibility;
31:
32: /**
33: * Class modelling the fo:multi-switch object.
34: * @todo needs implementation
35: */
36: public class MultiSwitch extends FObj {
37: // The value of properties relevant for fo:multi-switch.
38: // private ToBeImplementedProperty autoRestore;
39: // Unused but valid items, commented out for performance:
40: // private CommonAccessibility commonAccessibility;
41: // End of property values
42:
43: static boolean notImplementedWarningGiven = false;
44:
45: /**
46: * @param parent FONode that is the parent of this object
47: */
48: public MultiSwitch(FONode parent) {
49: super (parent);
50:
51: if (!notImplementedWarningGiven) {
52: log.warn("fo:multi-switch is not yet implemented.");
53: notImplementedWarningGiven = true;
54: }
55: }
56:
57: /**
58: * @see org.apache.fop.fo.FObj#bind(PropertyList)
59: */
60: public void bind(PropertyList pList) throws FOPException {
61: super .bind(pList);
62: // autoRestore = pList.get(PR_AUTO_RESTORE);
63: }
64:
65: /**
66: * Make sure content model satisfied.
67: * @see org.apache.fop.fo.FONode#endOfNode
68: */
69: protected void endOfNode() throws FOPException {
70: if (firstChild == null) {
71: missingChildElementError("(multi-case+)");
72: }
73: }
74:
75: /**
76: * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
77: * XSL Content Model: (multi-case+)
78: */
79: protected void validateChildNode(Locator loc, String nsURI,
80: String localName) throws ValidationException {
81: if (!(FO_URI.equals(nsURI) && localName.equals("multi-case"))) {
82: invalidChildError(loc, nsURI, localName);
83: }
84: }
85:
86: /** @see org.apache.fop.fo.FONode#getLocalName() */
87: public String getLocalName() {
88: return "multi-switch";
89: }
90:
91: /**
92: * @see org.apache.fop.fo.FObj#getNameId()
93: */
94: public int getNameId() {
95: return FO_MULTI_SWITCH;
96: }
97: }
|