object JavaxSource
Provides helpers for creating Source[XmlEvent]
using javax.xml.stream
for the underlying event provider.
- Source
- JavaxSource.scala
- Alphabetic
- By Inheritance
- JavaxSource
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(eventReader: XMLEventReader): Source[XmlEvent]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- lazy val defaultFactory: XMLInputFactory
Default
XMLInputFactory
used when creating an underlyingXMLEventReader
with the methods in this object.Default
XMLInputFactory
used when creating an underlyingXMLEventReader
with the methods in this object.This factory disables the
IS_REPLACING_ENTITY_REFERENCES
andIS_SUPPORTING_EXTERNAL_ENTITIES
features, in efforts to mitigate xml injection attacks.When using the methods in this object, if you want to override this default factory, define an implicit
XMLInputFactory
somewhere and make it available in the scope where you call the method, e.g.implicit val mySpecificXmlFactory: XMLInputFactory = ??? val xmlEvents = JavaxSource[IO](new File("./stuff.xml"))
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromFile(file: File, factory: XMLInputFactory = defaultFactory): Source[XmlEvent]
Returns a
Source[XmlEvent]
which can open the given file to read raw XML data.Returns a
Source[XmlEvent]
which can open the given file to read raw XML data.The returned
Source
is reusable. The underlying streams are managed by theopen
method and theclose
function it returns.- file
A file containing XML
- factory
Factory instance for the underlying Javax parser
- returns
A reusable
Source[XmlEvent]
- def fromFileWithCharset(file: File, charset: String, factory: XMLInputFactory = defaultFactory): Source[XmlEvent]
Like
fromFile
, but passes an explicitcharset
to the underlying XmlEventReader constructor.Like
fromFile
, but passes an explicitcharset
to the underlying XmlEventReader constructor.- file
A file containing XML
- charset
A Charset name used to interpret the bytes to characters
- factory
Factory instance for the underlying Javax parser
- def fromInputStream(rawXml: InputStream, factory: XMLInputFactory = defaultFactory): Source[XmlEvent]
Returns a single-use
Source[XmlEvent]
which interprets the contents of the givenInputStream
as raw XML bytes.Returns a single-use
Source[XmlEvent]
which interprets the contents of the givenInputStream
as raw XML bytes.The returned
Source
will *not* attempt to close therawXml
stream; responsibility for closingrawXml
lies with whoever created it.- rawXml
An InputStream containing raw XML bytes
- factory
Factory instance for the underlying Javax parser
- returns
A single-use
Source[XmlEvent]
- def fromInputStreamWithCharset(rawXml: InputStream, charset: String, factory: XMLInputFactory = defaultFactory): Source[XmlEvent]
Returns a single-use
Source[XmlEvent]
which interprets the contents of the givenInputStream
as raw XML bytes, passing the given charset to the underlying XMLEventReader constructorReturns a single-use
Source[XmlEvent]
which interprets the contents of the givenInputStream
as raw XML bytes, passing the given charset to the underlying XMLEventReader constructorThe returned
Source
will *not* attempt to close therawXml
stream; responsibility for closingrawXml
lies with whoever created it.- rawXml
An InputStream containing raw XML bytes
- charset
Name of the charset used to interpret the bytes to characters.
- factory
Factory instance for the underlying Javax parser
- returns
A single-use
Source[XmlEvent]
- def fromReader(rawXml: Reader, factory: XMLInputFactory = defaultFactory): Source[XmlEvent]
Returns a single-use
Source[XmlEvent]
which interprets the contents of the givenReader
as raw XML characters.Returns a single-use
Source[XmlEvent]
which interprets the contents of the givenReader
as raw XML characters.The returned
Source
will *not* attempt to close therawXml
reader; responsibility for closingrawXml
lies with whoever created it.- rawXml
A Reader containing raw XML character data
- factory
Factory instance for the underlying Javax parser
- returns
A single-use
Source[XmlEvent]
- def fromString(rawXml: String, factory: XMLInputFactory = defaultFactory): Source[XmlEvent]
Returns a
Source[XmlEvent]
which interprets the given string as raw XML.Returns a
Source[XmlEvent]
which interprets the given string as raw XML.- rawXml
A string of raw XML
- factory
Factory instance for the underlying Javax parser
- returns
A reusable
Source[XmlEvent]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()