Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Woodstox 6.4.0 - Source Code Files
Woodstox 6.4.0 Source Code Files are provided at the Woodstox GitHub Website.
You can download them from the "src/main/java" folder.
You can also browse Woodstox Source Code files below:
✍: FYIcenter
⏎ com/ctc/wstx/io/BaseInputSource.java
package com.ctc.wstx.io;
import java.io.IOException;
import java.net.URL;
import javax.xml.stream.XMLStreamException;
/**
* Abstract base class that implements shared functionality that all current
* {@link WstxInputSource} implementations Woodstox includes need.
*/
public abstract class BaseInputSource
extends WstxInputSource
{
final String mPublicId;
/**
* URL for/from systemId points to original source of input, if known; null if not
* known (source constructed with just a stream or reader). Used for
* resolving references from the input that's read from this source.
* Can be overridden by reader; done if P_BASE_URL is changed on
* stream reader for which this input source is the currently
* active input source.
*/
SystemId mSystemId;
/**
* Input buffer this input source uses, if any.
*/
protected char[] mBuffer;
/**
* Length of the buffer, if buffer used
*/
protected int mInputLast;
/*
////////////////////////////////////////////////////////////////
// Saved location information; active information is directly
// handled by Reader, and then saved to input source when switching
// to a nested input source.
////////////////////////////////////////////////////////////////
*/
/**
* Number of characters read from the current input source prior to
* the current buffer
*/
long mSavedInputProcessed = 0;
int mSavedInputRow = 1;
int mSavedInputRowStart = 0;
int mSavedInputPtr = 0;
/*
////////////////////////////////////////////////////////////////
// Some simple lazy-loading/reusing support...
////////////////////////////////////////////////////////////////
*/
transient WstxInputLocation mParentLocation = null;
/*
////////////////////////////////////////////////////////////////
// Life-cycle
////////////////////////////////////////////////////////////////
*/
protected BaseInputSource(WstxInputSource parent, String fromEntity,
String publicId, SystemId systemId)
{
super(parent, fromEntity);
mSystemId = systemId;
mPublicId = publicId;
}
@Override
public void overrideSource(URL src)
{
//19-May-2014, tatu: I assume this should also override observed systemId...
mSystemId = SystemId.construct(src);
}
@Override
public abstract boolean fromInternalEntity();
@Override
public URL getSource() throws IOException {
return (mSystemId == null) ? null : mSystemId.asURL();
}
@Override
public String getPublicId() {
return mPublicId;
}
@Override
public String getSystemId() {
return (mSystemId == null) ? null : mSystemId.toString();
}
@Override
protected abstract void doInitInputLocation(WstxInputData reader);
@Override
public abstract int readInto(WstxInputData reader)
throws IOException, XMLStreamException;
@Override
public abstract boolean readMore(WstxInputData reader, int minAmount)
throws IOException, XMLStreamException;
@Override
public void saveContext(WstxInputData reader)
{
// First actual input data
mSavedInputPtr = reader.mInputPtr;
// then location
mSavedInputProcessed = reader.mCurrInputProcessed;
mSavedInputRow = reader.mCurrInputRow;
mSavedInputRowStart = reader.mCurrInputRowStart;
}
@Override
public void restoreContext(WstxInputData reader)
{
reader.mInputBuffer = mBuffer;
reader.mInputEnd = mInputLast;
reader.mInputPtr = mSavedInputPtr;
// then location
reader.mCurrInputProcessed = mSavedInputProcessed;
reader.mCurrInputRow = mSavedInputRow;
reader.mCurrInputRowStart = mSavedInputRowStart;
}
@Override
public abstract void close() throws IOException;
/*
//////////////////////////////////////////////////////////
// Methods for accessing location information
//////////////////////////////////////////////////////////
*/
/**
* This method only gets called by the 'child' input source (for example,
* contents of an expanded entity), to get the enclosing context location.
*/
@Override
protected final WstxInputLocation getLocation()
{
// Note: columns are 1-based, need to add 1.
return getLocation(mSavedInputProcessed + mSavedInputPtr - 1L,
mSavedInputRow,
mSavedInputPtr - mSavedInputRowStart + 1);
}
@Override
public final WstxInputLocation getLocation(long total, int row, int col)
{
WstxInputLocation pl;
if (mParent == null) {
pl = null;
} else {
/* 13-Apr-2005, TSa: We can actually reuse parent location, since
* it can not change during lifetime of this child context...
*/
pl = mParentLocation;
if (pl == null) {
mParentLocation = pl = mParent.getLocation();
}
pl = mParent.getLocation();
}
/* !!! 15-Apr-2005, TSa: This will cause overflow for total count,
* but since StAX 1.0 API doesn't have any way to deal with that,
* let's just let that be...
*/
return new WstxInputLocation(pl, getPublicId(), getSystemId(),
total, row, col);
}
}
⏎ com/ctc/wstx/io/BaseInputSource.java
Or download all of them as a single archive file:
File name: woodstox-core-6.4.0-fyi.zip File size: 552992 bytes Release date: 2022-10-25 Download
⇒ woodstox-core-6.4.0.jar - Woodstox Core 6.4.0
⇐ What Is Woodstox XML Processing
2023-01-29, ≈45🔥, 0💬
Popular Posts:
JDK 11 java.compiler.jmod is the JMOD file for JDK 11 Compiler module. JDK 11 Compiler module compil...
What Is HttpComponents httpclient-4.2.2.jar? HttpComponents httpclient-4.2.2.jar is the JAR file for...
JDK 11 java.sql.rowset.jmod is the JMOD file for JDK 11 SQL Rowset module. JDK 11 SQL Rowset module ...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...