1 /*
2 * Copyright (c) 2007, 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.xml.internal.dtm.ref.sax2dtm;
23
45 import org.xml.sax.SAXException;
46
47 /**
48 * SAX2DTM2 is an optimized version of SAX2DTM which is used in non-incremental situation.
49 * It is used as the super class of the XSLTC SAXImpl. Many of the interfaces in SAX2DTM
50 * and DTMDefaultBase are overridden in SAX2DTM2 in order to allow fast, efficient
51 * access to the DTM model. Some nested iterators in DTMDefaultBaseIterators
52 * are also overridden in SAX2DTM2 for performance reasons.
53 * <p>
54 * Performance is the biggest consideration in the design of SAX2DTM2. To make the code most
55 * efficient, the incremental support is dropped in SAX2DTM2, which means that you should not
56 * use it in incremental situation. To reduce the overhead of pulling data from the DTM model,
57 * a few core interfaces in SAX2DTM2 have direct access to the internal arrays of the
58 * SuballocatedIntVectors.
59 * <p>
60 * The design of SAX2DTM2 may limit its extensibilty. If you have a reason to extend the
61 * SAX2DTM model, please extend from SAX2DTM instead of this class.
62 * <p>
63 * %MK% The code in this class is critical to the XSLTC_DTM performance. Be very careful
64 * when making changes here!
65 */
66 public class SAX2DTM2 extends SAX2DTM
67 {
68
69 /****************************************************************
70 * Optimized version of the nested iterators
71 ****************************************************************/
72
73 /**
74 * Iterator that returns all immediate children of a given node
75 */
76 public final class ChildrenIterator extends InternalAxisIteratorBase
77 {
78
79 /**
80 * Setting start to END should 'close' the iterator,
81 * i.e. subsequent call to next() should return END.
82 * <p>
83 * If the iterator is not restartable, this has no effect.
84 * %REVIEW% Should it return/throw something in that case,
|
1 /*
2 * Copyright (c) 2007, 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.xml.internal.dtm.ref.sax2dtm;
22
44 import org.xml.sax.SAXException;
45
46 /**
47 * SAX2DTM2 is an optimized version of SAX2DTM which is used in non-incremental situation.
48 * It is used as the super class of the XSLTC SAXImpl. Many of the interfaces in SAX2DTM
49 * and DTMDefaultBase are overridden in SAX2DTM2 in order to allow fast, efficient
50 * access to the DTM model. Some nested iterators in DTMDefaultBaseIterators
51 * are also overridden in SAX2DTM2 for performance reasons.
52 * <p>
53 * Performance is the biggest consideration in the design of SAX2DTM2. To make the code most
54 * efficient, the incremental support is dropped in SAX2DTM2, which means that you should not
55 * use it in incremental situation. To reduce the overhead of pulling data from the DTM model,
56 * a few core interfaces in SAX2DTM2 have direct access to the internal arrays of the
57 * SuballocatedIntVectors.
58 * <p>
59 * The design of SAX2DTM2 may limit its extensibilty. If you have a reason to extend the
60 * SAX2DTM model, please extend from SAX2DTM instead of this class.
61 * <p>
62 * %MK% The code in this class is critical to the XSLTC_DTM performance. Be very careful
63 * when making changes here!
64 *
65 * @LastModified: Oct 2017
66 */
67 public class SAX2DTM2 extends SAX2DTM
68 {
69
70 /****************************************************************
71 * Optimized version of the nested iterators
72 ****************************************************************/
73
74 /**
75 * Iterator that returns all immediate children of a given node
76 */
77 public final class ChildrenIterator extends InternalAxisIteratorBase
78 {
79
80 /**
81 * Setting start to END should 'close' the iterator,
82 * i.e. subsequent call to next() should return END.
83 * <p>
84 * If the iterator is not restartable, this has no effect.
85 * %REVIEW% Should it return/throw something in that case,
|