Class PSWriter
java.lang.Object
com.helger.schematron.pure.exchange.PSWriter
This class serializes the Schematron created within the domain object
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionPSWriter()Constructor using the defaultPSWriterSettingsinstance.PSWriter(IPSWriterSettings aWriterSettings) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.helger.xml.microdom.IMicroNodegetAsDocument(com.helger.xml.microdom.IMicroElement aElement) getXMLString(IPSElement aPSElement) Get the passed Schematron element as a StringgetXMLStringNotNull(IPSElement aPSElement) Get the passed Schematron element as a StringtoString()com.helger.commons.state.ESuccesswriteToFile(IPSElement aPSElement, File aFile) Write the passed Schematron element to the passed file.com.helger.commons.state.ESuccesswriteToStream(IPSElement aPSElement, OutputStream aOS) Write the passed Schematron element to the passed output stream.com.helger.commons.state.ESuccesswriteToWriter(IPSElement aPSElement, Writer aWriter) Write the passed Schematron element to the passed writer.
-
Constructor Details
-
PSWriter
public PSWriter()Constructor using the defaultPSWriterSettingsinstance. -
PSWriter
Constructor.- Parameters:
aWriterSettings- The writer settings to be used. May not benull.
-
-
Method Details
-
getWriterSettings
- Returns:
- The writer settings specified in the constructor.
-
getAsDocument
-
writeToFile
@Nonnull public com.helger.commons.state.ESuccess writeToFile(@Nonnull IPSElement aPSElement, @Nonnull File aFile) Write the passed Schematron element to the passed file.- Parameters:
aPSElement- The schematron element to write. May not benull.aFile- The file to write things to. May not benull.- Returns:
ESuccess.
-
writeToStream
@Nonnull public com.helger.commons.state.ESuccess writeToStream(@Nonnull IPSElement aPSElement, @Nonnull @WillClose OutputStream aOS) Write the passed Schematron element to the passed output stream.- Parameters:
aPSElement- The schematron element to write. May not benull.aOS- The output stream to write things to. May not benull. The stream is automatically closed.- Returns:
ESuccess.
-
writeToWriter
@Nonnull public com.helger.commons.state.ESuccess writeToWriter(@Nonnull IPSElement aPSElement, @Nonnull @WillClose Writer aWriter) Write the passed Schematron element to the passed writer.- Parameters:
aPSElement- The schematron element to write. May not benull.aWriter- The writer to write things to. May not benull. The writer is automatically closed.- Returns:
ESuccess.
-
getXMLString
Get the passed Schematron element as a String- Parameters:
aPSElement- The schematron element to convert to a string. May not benull.- Returns:
- The passed element as a string or
nullif serialization failed.
-
getXMLStringNotNull
Get the passed Schematron element as a String- Parameters:
aPSElement- The schematron element to convert to a string. May not benull.- Returns:
- The passed element as a string and never
null. - Throws:
IllegalStateException- if serialization failed
-
toString
-