Debian Codegraph @

net/sf/saxon/om/CopyOptions.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.om;
9
10 import net.sf.saxon.event.ReceiverOptions;
11
12 /**
13 * Non-instantiable class to define options for the {@link NodeInfo#copy} method
14 */
15 public abstract class CopyOptions {
16
17 public static final int LOCAL_NAMESPACES = 1;
18
19 public static final int ALL_NAMESPACES = 2;
20
21 public static final int SOME_NAMESPACES = LOCAL_NAMESPACES | ALL_NAMESPACES;
22
23 public static final int TYPE_ANNOTATIONS = 4;
24
25 public static final int FOR_UPDATE = 8;
26
27 public static final int ACCUMULATORS = 16;
28
29 public static final int IS_XQUERY = 32; // either XSLT or XQUERY: only affects error codes
30
31 public static boolean includes(int options, int option) {
32 return (options & option) == option;
33 }
34
35 public static int getStartDocumentProperties(int copyOptions) {
36 int properties = 0;
37 if (CopyOptions.includes(copyOptions, CopyOptions.FOR_UPDATE)) {
38 properties |= ReceiverOptions.MUTABLE_TREE;
39 }
40 return properties;
41 }
42 }
43