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 /** The entity systen identifier or null. */ 42 public String sysid; 43 /** The encoding from XML declaration or null */ 44 public String xmlenc; 45 /** The XML version from XML declaration or 0x0000 */ 46 public char xmlver; 47 /** The entity reader. */ 48 public Reader src; 49 /** The character buffer. */ 50 public char[] chars; 51 /** The length of the character buffer. */ 52 public int chLen; 53 /** The index of the next character to read. */ 54 public int chIdx; 55 /** The next input in a chain. */ 56 public Input next; 57 58 /** 59 * Constructor. 60 * 61 * @param buffsize The input buffer size. 62 */ 63 public Input(int buffsize) { 64 chars = new char[buffsize]; 65 chLen = chars.length; 66 } 67 68 /** 69 * Constructor. 70 * 71 * @param buff The input buffer. 72 */ 73 public Input(char[] buff) { 74 chars = buff; 75 chLen = chars.length; 76 } 77 78 /** 79 * Constructor. 80 */ 81 public Input() { 82 } 83 }