Package nbbrd.io.xml
Class Sax
- java.lang.Object
-
- nbbrd.io.xml.Sax
-
public class Sax extends Object
- Author:
- Philippe Charles
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSax.Parser<T>
-
Constructor Summary
Constructors Constructor Description Sax()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NonNull XMLReadercreateReader()InputSourcenewInputSource(File file)Creates a new InputSource from a file.InputSourcenewInputSource(File file, Charset encoding)Creates a new InputSource from a file.voidpreventXXE(@NonNull XMLReader reader)Prevents XXE vulnerability by disabling features.IOExceptiontoIOException(SAXException ex)
-
-
-
Method Detail
-
preventXXE
public void preventXXE(@NonNull XMLReader reader)
Prevents XXE vulnerability by disabling features.- Parameters:
reader- non-null reader- See Also:
- XXE
-
createReader
public static @NonNull XMLReader createReader() throws IOException
- Throws:
IOException
-
newInputSource
public InputSource newInputSource(File file)
Creates a new InputSource from a file.- Parameters:
file-- Returns:
- See Also:
SAXParser.parse(java.io.File, org.xml.sax.helpers.DefaultHandler)
-
newInputSource
public InputSource newInputSource(File file, Charset encoding)
Creates a new InputSource from a file.- Parameters:
file-encoding-- Returns:
- See Also:
SAXParser.parse(java.io.File, org.xml.sax.helpers.DefaultHandler)
-
toIOException
public IOException toIOException(SAXException ex)
-
-