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.xml.internal.serializer;
23
31 import java.io.UnsupportedEncodingException;
32 import java.net.URL;
33 import java.util.Enumeration;
34 import java.util.HashMap;
35 import java.util.Locale;
36 import java.util.Map;
37 import java.util.PropertyResourceBundle;
38 import java.util.ResourceBundle;
39 import javax.xml.transform.TransformerException;
40 import jdk.xml.internal.SecuritySupport;
41
42 /**
43 * This class provides services that tell if a character should have
44 * special treatement, such as entity reference substitution or normalization
45 * of a newline character. It also provides character to entity reference
46 * lookup.
47 *
48 * DEVELOPERS: See Known Issue in the constructor.
49 *
50 * @xsl.usage internal
51 */
52 final class CharInfo
53 {
54 /** Given a character, lookup a String to output (e.g. a decorated entity reference). */
55 private Map<CharKey, String> m_charToString = new HashMap<>();
56
57 /**
58 * The name of the HTML entities file.
59 * If specified, the file will be resource loaded with the default class loader.
60 */
61 public static final String HTML_ENTITIES_RESOURCE =
62 "com.sun.org.apache.xml.internal.serializer.HTMLEntities";
63
64 /**
65 * The name of the XML entities file.
66 * If specified, the file will be resource loaded with the default class loader.
67 */
68 public static final String XML_ENTITIES_RESOURCE =
69 "com.sun.org.apache.xml.internal.serializer.XMLEntities";
70
|
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.xml.internal.serializer;
22
30 import java.io.UnsupportedEncodingException;
31 import java.net.URL;
32 import java.util.Enumeration;
33 import java.util.HashMap;
34 import java.util.Locale;
35 import java.util.Map;
36 import java.util.PropertyResourceBundle;
37 import java.util.ResourceBundle;
38 import javax.xml.transform.TransformerException;
39 import jdk.xml.internal.SecuritySupport;
40
41 /**
42 * This class provides services that tell if a character should have
43 * special treatement, such as entity reference substitution or normalization
44 * of a newline character. It also provides character to entity reference
45 * lookup.
46 *
47 * DEVELOPERS: See Known Issue in the constructor.
48 *
49 * @xsl.usage internal
50 * @LastModified: Oct 2017
51 */
52 final class CharInfo
53 {
54 /** Given a character, lookup a String to output (e.g. a decorated entity reference). */
55 private Map<CharKey, String> m_charToString = new HashMap<>();
56
57 /**
58 * The name of the HTML entities file.
59 * If specified, the file will be resource loaded with the default class loader.
60 */
61 public static final String HTML_ENTITIES_RESOURCE =
62 "com.sun.org.apache.xml.internal.serializer.HTMLEntities";
63
64 /**
65 * The name of the XML entities file.
66 * If specified, the file will be resource loaded with the default class loader.
67 */
68 public static final String XML_ENTITIES_RESOURCE =
69 "com.sun.org.apache.xml.internal.serializer.XMLEntities";
70
|