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.axes;
23
24 import com.sun.org.apache.xalan.internal.res.XSLMessages;
25 import com.sun.org.apache.xml.internal.dtm.Axis;
26 import com.sun.org.apache.xml.internal.dtm.DTMFilter;
27 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
28 import com.sun.org.apache.xpath.internal.Expression;
29 import com.sun.org.apache.xpath.internal.compiler.Compiler;
30 import com.sun.org.apache.xpath.internal.compiler.FunctionTable;
31 import com.sun.org.apache.xpath.internal.compiler.OpCodes;
32 import com.sun.org.apache.xpath.internal.compiler.OpMap;
33 import com.sun.org.apache.xpath.internal.objects.XNumber;
34 import com.sun.org.apache.xpath.internal.patterns.ContextMatchStepPattern;
35 import com.sun.org.apache.xpath.internal.patterns.FunctionPattern;
36 import com.sun.org.apache.xpath.internal.patterns.NodeTest;
37 import com.sun.org.apache.xpath.internal.patterns.StepPattern;
38 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
39
40 /**
41 * This class is both a factory for XPath location path expressions,
42 * which are built from the opcode map output, and an analysis engine
43 * for the location path expressions in order to provide optimization hints.
44 */
45 public class WalkerFactory
46 {
47
48 /**
49 * This method is for building an array of possible levels
50 * where the target element(s) could be found for a match.
51 * @param lpi The owning location path iterator.
52 * @param compiler non-null reference to compiler object that has processed
53 * the XPath operations into an opcode map.
54 * @param stepOpCodePos The opcode position for the step.
55 *
56 * @return non-null AxesWalker derivative.
57 *
58 * @throws javax.xml.transform.TransformerException
59 * @xsl.usage advanced
60 */
61 static AxesWalker loadOneWalker(
62 WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
63 throws javax.xml.transform.TransformerException
|
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.axes;
22
23 import com.sun.org.apache.xalan.internal.res.XSLMessages;
24 import com.sun.org.apache.xml.internal.dtm.Axis;
25 import com.sun.org.apache.xml.internal.dtm.DTMFilter;
26 import com.sun.org.apache.xml.internal.dtm.DTMIterator;
27 import com.sun.org.apache.xpath.internal.Expression;
28 import com.sun.org.apache.xpath.internal.compiler.Compiler;
29 import com.sun.org.apache.xpath.internal.compiler.FunctionTable;
30 import com.sun.org.apache.xpath.internal.compiler.OpCodes;
31 import com.sun.org.apache.xpath.internal.compiler.OpMap;
32 import com.sun.org.apache.xpath.internal.objects.XNumber;
33 import com.sun.org.apache.xpath.internal.patterns.ContextMatchStepPattern;
34 import com.sun.org.apache.xpath.internal.patterns.FunctionPattern;
35 import com.sun.org.apache.xpath.internal.patterns.NodeTest;
36 import com.sun.org.apache.xpath.internal.patterns.StepPattern;
37 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
38
39 /**
40 * This class is both a factory for XPath location path expressions,
41 * which are built from the opcode map output, and an analysis engine
42 * for the location path expressions in order to provide optimization hints.
43 *
44 * @LastModified: Oct 2017
45 */
46 public class WalkerFactory
47 {
48
49 /**
50 * This method is for building an array of possible levels
51 * where the target element(s) could be found for a match.
52 * @param lpi The owning location path iterator.
53 * @param compiler non-null reference to compiler object that has processed
54 * the XPath operations into an opcode map.
55 * @param stepOpCodePos The opcode position for the step.
56 *
57 * @return non-null AxesWalker derivative.
58 *
59 * @throws javax.xml.transform.TransformerException
60 * @xsl.usage advanced
61 */
62 static AxesWalker loadOneWalker(
63 WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
64 throws javax.xml.transform.TransformerException
|