1 /* 2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package jdk.internal.util.xml.impl; 27 28 import java.io.Reader; 29 30 /** 31 * A parsed entity input state. 32 * 33 * This class represents a parsed entity input state. The parser uses 34 * an instance of this class to manage input. 35 */ 36 37 public class Input 38 { 39 /** The entity public identifier or null. */ 40 public String pubid; 41 42 /** The entity systen identifier or null. */ 43 public String sysid; 44 45 /** The encoding from XML declaration or null */ 46 public String xmlenc; 47 48 /** The XML version from XML declaration or 0x0000 */ 49 public char xmlver; 50 51 /** The entity reader. */ 52 public Reader src; 53 54 /** The character buffer. */ 55 public char[] chars; 56 57 /** The length of the character buffer. */ 58 public int chLen; 59 60 /** The index of the next character to read. */ 61 public int chIdx; 62 63 /** The next input in a chain. */ 64 public Input next; 65 66 /** 67 * Constructor. 68 * 69 * @param buffsize The input buffer size. 70 */ 71 public Input(int buffsize) 72 { 73 chars = new char[buffsize]; 74 chLen = chars.length; 75 } 76 77 /** 78 * Constructor. 79 * 80 * @param buff The input buffer. 81 */ 82 public Input(char[] buff) 83 { 84 chars = buff; 85 chLen = chars.length; 86 } 87 88 /** 89 * Constructor. 90 */ 91 public Input() 92 { 93 } 94 }