congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
XmlReader
Code IndexAdd Tabnine to your IDE (free)

How to use
XmlReader
in
org.apache.wicket.util.io

Best Java code snippets using org.apache.wicket.util.io.XmlReader (Showing top 14 results out of 315)

origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * 
 * @see org.apache.wicket.markup.parser.IXmlPullParser#getEncoding()
 */
public String getEncoding()
{
  return xmlReader.getEncoding();
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * 
 * @see org.apache.wicket.markup.parser.IXmlPullParser#getXmlDeclaration()
 */
public String getXmlDeclaration()
{
  return xmlReader.getXmlDeclaration();
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

if (getXmlDeclaration(inputStream, readAheadSize))
  encoding = determineEncoding(xmlDeclarationString);
origin: apache/wicket

/**
 * Reads and parses markup from an input stream.
 * <p>
 * Note: The input is closed after parsing.
 * 
 * @param inputStream
 *            The input stream to read and parse
 * @param encoding
 *            The default character encoding of the input
 * @throws IOException
 */
@Override
public void parse(final InputStream inputStream, final String encoding) throws IOException
{
  Args.notNull(inputStream, "inputStream");
  try
  {
    XmlReader xmlReader = new XmlReader(new BufferedInputStream(inputStream, 4000),
      encoding);
    this.input = new FullyBufferedReader(xmlReader);
    this.encoding = xmlReader.getEncoding();
  }
  finally
  {
    IOUtils.closeQuietly(inputStream);
  }
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Reads and parses markup from an input stream
 * 
 * @param inputStream
 *            The input stream to read and parse
 * @param encoding
 *            The default character encoding of the input
 * @throws IOException
 * @throws ResourceStreamNotFoundException
 */
public void parse(final InputStream inputStream, final String encoding) throws IOException,
  ResourceStreamNotFoundException
{
  try
  {
    xmlReader = new XmlReader(new BufferedInputStream(inputStream, 4000), encoding);
    input = new FullyBufferedReader(xmlReader);
  }
  finally
  {
    inputStream.close();
    if (xmlReader != null)
    {
      xmlReader.close();
    }
  }
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Construct.
 * 
 * @param inputStream
 *            The InputStream to read the xml data from
 * @param defaultEncoding
 *            Default character encoding to use when not specified in XML declaration, specify
 *            null to use JVM default
 * @throws IOException
 *             In case something went wrong while reading the data
 */
public XmlReader(final InputStream inputStream, final String defaultEncoding)
  throws IOException
{
  // The xml parser does not have a parent filter
  super();
  this.inputStream = inputStream;
  encoding = defaultEncoding;
  if (inputStream == null)
  {
    throw new IllegalArgumentException("Parameter 'inputStream' must not be null");
  }
  init();
}
origin: org.apache.wicket/wicket-util

String xmlDeclaration = getXmlDeclaration(inputStream, readAheadSize);
if (!Strings.isEmpty(xmlDeclaration))
  encoding = determineEncoding(xmlDeclaration);
origin: org.apache.wicket/wicket-core

/**
 * Reads and parses markup from an input stream.
 * <p>
 * Note: The input is closed after parsing.
 * 
 * @param inputStream
 *            The input stream to read and parse
 * @param encoding
 *            The default character encoding of the input
 * @throws IOException
 */
@Override
public void parse(final InputStream inputStream, final String encoding) throws IOException
{
  Args.notNull(inputStream, "inputStream");
  try
  {
    XmlReader xmlReader = new XmlReader(new BufferedInputStream(inputStream, 4000),
      encoding);
    this.input = new FullyBufferedReader(xmlReader);
    this.encoding = xmlReader.getEncoding();
  }
  finally
  {
    IOUtils.closeQuietly(inputStream);
  }
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Reads and parses markup from an input stream
 * 
 * @param inputStream
 *            The input stream to read and parse
 * @param encoding
 *            The default character encoding of the input
 * @throws IOException
 * @throws ResourceStreamNotFoundException
 */
public void parse(final InputStream inputStream, final String encoding) throws IOException,
    ResourceStreamNotFoundException
{
  try
  {
    xmlReader = new XmlReader(new BufferedInputStream(inputStream, 4000), encoding);
    input = new FullyBufferedReader(xmlReader);
  }
  finally
  {
    inputStream.close();
    if (xmlReader != null)
    {
      xmlReader.close();
    }
  }
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Construct.
 * 
 * @param inputStream
 *            The InputStream to read the xml data from
 * @param defaultEncoding
 *            Default character encoding to use when not specified in XML declaration, specify
 *            null to use JVM default
 * @throws IOException
 *             In case something went wrong while reading the data
 */
public XmlReader(final InputStream inputStream, final String defaultEncoding)
    throws IOException
{
  // The xml parser does not have a parent filter
  super();
  this.inputStream = inputStream;
  encoding = defaultEncoding;
  if (inputStream == null)
  {
    throw new IllegalArgumentException("Parameter 'inputStream' must not be null");
  }
  init();
}
origin: org.ops4j.pax.wicket/pax-wicket-service

if (getXmlDeclaration(inputStream, readAheadSize))
  encoding = determineEncoding(xmlDeclarationString);
origin: org.apache.wicket/wicket-util

/**
 * Construct.
 * 
 * @param inputStream
 *            The InputStream to read the xml data from
 * @param defaultEncoding
 *            Default character encoding to use when not specified in XML declaration, specify
 *            null to use JVM default
 * @throws IOException
 *             In case something went wrong while reading the data
 */
public XmlReader(final InputStream inputStream, final String defaultEncoding)
  throws IOException
{
  Args.notNull(inputStream, "inputStream");
  if (!inputStream.markSupported())
  {
    this.inputStream = new BufferedInputStream(new BOMInputStream(inputStream));
  }
  else
  {
    this.inputStream = new BOMInputStream(inputStream);
  }
  encoding = defaultEncoding;
  init();
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * 
 * @see org.apache.wicket.markup.parser.IXmlPullParser#getEncoding()
 */
public String getEncoding()
{
  return xmlReader.getEncoding();
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * 
 * @see org.apache.wicket.markup.parser.IXmlPullParser#getXmlDeclaration()
 */
public String getXmlDeclaration()
{
  return xmlReader.getXmlDeclaration();
}
org.apache.wicket.util.ioXmlReader

Javadoc

This is a simple XmlReader. Its only purpose is to read the xml decl string from the input and apply proper character encoding to all subsequent characters. The xml decl string itself is removed from the output.

Most used methods

  • <init>
    Construct.
  • determineEncoding
    Determine the encoding from the xml decl.
  • getEncoding
    Return the encoding used while reading the markup file.
  • getXmlDeclaration
    Read-ahead the input stream (markup file). If the first line contains , than remember the
  • init
    Reads and parses markup from a resource such as file.
  • close

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now