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.xerces.internal.jaxp.validation;
23
45 import javax.xml.transform.Result;
46 import javax.xml.transform.Source;
47 import javax.xml.transform.dom.DOMResult;
48 import javax.xml.transform.dom.DOMSource;
49 import org.w3c.dom.Attr;
50 import org.w3c.dom.CDATASection;
51 import org.w3c.dom.Comment;
52 import org.w3c.dom.Document;
53 import org.w3c.dom.DocumentType;
54 import org.w3c.dom.Entity;
55 import org.w3c.dom.NamedNodeMap;
56 import org.w3c.dom.Node;
57 import org.w3c.dom.ProcessingInstruction;
58 import org.w3c.dom.Text;
59 import org.xml.sax.SAXException;
60
61 /**
62 * <p>A validator helper for <code>DOMSource</code>s.</p>
63 *
64 * @author Michael Glavassevich, IBM
65 */
66 final class DOMValidatorHelper implements ValidatorHelper, EntityState {
67
68 //
69 // Constants
70 //
71
72 /** Chunk size (1024). */
73 private static final int CHUNK_SIZE = (1 << 10);
74
75 /** Chunk mask (CHUNK_SIZE - 1). */
76 private static final int CHUNK_MASK = CHUNK_SIZE - 1;
77
78 // property identifiers
79
80 /** Property identifier: error reporter. */
81 private static final String ERROR_REPORTER =
82 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
83
84 /** Property identifier: namespace context. */
|
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.xerces.internal.jaxp.validation;
22
44 import javax.xml.transform.Result;
45 import javax.xml.transform.Source;
46 import javax.xml.transform.dom.DOMResult;
47 import javax.xml.transform.dom.DOMSource;
48 import org.w3c.dom.Attr;
49 import org.w3c.dom.CDATASection;
50 import org.w3c.dom.Comment;
51 import org.w3c.dom.Document;
52 import org.w3c.dom.DocumentType;
53 import org.w3c.dom.Entity;
54 import org.w3c.dom.NamedNodeMap;
55 import org.w3c.dom.Node;
56 import org.w3c.dom.ProcessingInstruction;
57 import org.w3c.dom.Text;
58 import org.xml.sax.SAXException;
59
60 /**
61 * <p>A validator helper for <code>DOMSource</code>s.</p>
62 *
63 * @author Michael Glavassevich, IBM
64 * @LastModified: Oct 2017
65 */
66 final class DOMValidatorHelper implements ValidatorHelper, EntityState {
67
68 //
69 // Constants
70 //
71
72 /** Chunk size (1024). */
73 private static final int CHUNK_SIZE = (1 << 10);
74
75 /** Chunk mask (CHUNK_SIZE - 1). */
76 private static final int CHUNK_MASK = CHUNK_SIZE - 1;
77
78 // property identifiers
79
80 /** Property identifier: error reporter. */
81 private static final String ERROR_REPORTER =
82 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
83
84 /** Property identifier: namespace context. */
|