1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Oct 2017
4 */
5 /*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22 package com.sun.org.apache.xpath.internal;
23
25 import com.sun.org.apache.xml.internal.dtm.DTM;
26 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
27 import com.sun.org.apache.xml.internal.utils.QName;
28 import com.sun.org.apache.xml.internal.utils.XMLString;
29 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
30 import com.sun.org.apache.xpath.internal.objects.XObject;
31 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
32 import java.util.List;
33 import javax.xml.transform.ErrorListener;
34 import javax.xml.transform.TransformerException;
35 import org.xml.sax.ContentHandler;
36
37 /**
38 * This abstract class serves as the base for all expression objects. An
39 * Expression can be executed to return a {@link com.sun.org.apache.xpath.internal.objects.XObject},
40 * normally has a location within a document or DOM, can send error and warning
41 * events, and normally do not hold state and are meant to be immutable once
42 * construction has completed. An exception to the immutibility rule is iterators
43 * and walkers, which must be cloned in order to be used -- the original must
44 * still be immutable.
45 */
46 public abstract class Expression implements java.io.Serializable, ExpressionNode, XPathVisitable
47 {
48 static final long serialVersionUID = 565665869777906902L;
49 /**
50 * The location where this expression was built from. Need for diagnostic
51 * messages. May be null.
52 * @serial
53 */
54 private ExpressionNode m_parent;
55
56 /**
57 * Tell if this expression or it's subexpressions can traverse outside
58 * the current subtree.
59 *
60 * @return true if traversal outside the context node's subtree can occur.
61 */
62 public boolean canTraverseOutsideSubtree()
63 {
64 return false;
|
1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 */
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one or more
6 * contributor license agreements. See the NOTICE file distributed with
7 * this work for additional information regarding copyright ownership.
8 * The ASF licenses this file to You under the Apache License, Version 2.0
9 * (the "License"); you may not use this file except in compliance with
10 * the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21 package com.sun.org.apache.xpath.internal;
22
24 import com.sun.org.apache.xml.internal.dtm.DTM;
25 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
26 import com.sun.org.apache.xml.internal.utils.QName;
27 import com.sun.org.apache.xml.internal.utils.XMLString;
28 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
29 import com.sun.org.apache.xpath.internal.objects.XObject;
30 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
31 import java.util.List;
32 import javax.xml.transform.ErrorListener;
33 import javax.xml.transform.TransformerException;
34 import org.xml.sax.ContentHandler;
35
36 /**
37 * This abstract class serves as the base for all expression objects. An
38 * Expression can be executed to return a {@link com.sun.org.apache.xpath.internal.objects.XObject},
39 * normally has a location within a document or DOM, can send error and warning
40 * events, and normally do not hold state and are meant to be immutable once
41 * construction has completed. An exception to the immutibility rule is iterators
42 * and walkers, which must be cloned in order to be used -- the original must
43 * still be immutable.
44 *
45 * @LastModified: Oct 2017
46 */
47 public abstract class Expression implements java.io.Serializable, ExpressionNode, XPathVisitable
48 {
49 static final long serialVersionUID = 565665869777906902L;
50 /**
51 * The location where this expression was built from. Need for diagnostic
52 * messages. May be null.
53 * @serial
54 */
55 private ExpressionNode m_parent;
56
57 /**
58 * Tell if this expression or it's subexpressions can traverse outside
59 * the current subtree.
60 *
61 * @return true if traversal outside the context node's subtree can occur.
62 */
63 public boolean canTraverseOutsideSubtree()
64 {
65 return false;
|