@NotThreadSafe public class PSPreprocessor extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_KEEP_DIAGNOSTICS |
static boolean |
DEFAULT_KEEP_EMPTY_PATTERNS |
static boolean |
DEFAULT_KEEP_EMPTY_SCHEMA |
static boolean |
DEFAULT_KEEP_REPORTS |
static boolean |
DEFAULT_KEEP_TITLES |
Constructor and Description |
---|
PSPreprocessor(IPSQueryBinding aQueryBinding) |
Modifier and Type | Method and Description |
---|---|
static PSPreprocessor |
createPreprocessorWithoutInformationLoss(IPSQueryBinding aQueryBinding) |
PSSchema |
getAsMinimalSchema(PSSchema aSchema)
Convert the passed schema to a minimal schema.
|
PSSchema |
getAsPreprocessedSchema(PSSchema aSchema)
Convert the passed schema to a pre-processed schema.
|
PSSchema |
getForcedPreprocessedSchema(PSSchema aSchema)
Convert the passed schema to a pre-processed schema independent if it is
already minimal or not.
|
IPSQueryBinding |
getQueryBinding() |
boolean |
isKeepDiagnostics() |
boolean |
isKeepEmptyPatterns() |
boolean |
isKeepEmptySchema() |
boolean |
isKeepReports() |
boolean |
isKeepTitles() |
PSPreprocessor |
setKeepDiagnostics(boolean bKeepDiagnostics)
Should <diagnostics>-elements be kept?
|
PSPreprocessor |
setKeepEmptyPatterns(boolean bKeepEmptyPatterns)
Should <pattern>-elements without a single rule be kept or deleted?
|
PSPreprocessor |
setKeepEmptySchema(boolean bKeepEmptySchema)
Should schema objects without a pattern be kept?
|
PSPreprocessor |
setKeepReports(boolean bKeepReports)
Should <report>-elements be kept or should they be converted to
<assert>-elements?
|
PSPreprocessor |
setKeepTitles(boolean bKeepTitles)
Should <title>-elements be kept?
|
String |
toString() |
public static final boolean DEFAULT_KEEP_TITLES
public static final boolean DEFAULT_KEEP_DIAGNOSTICS
public static final boolean DEFAULT_KEEP_REPORTS
public static final boolean DEFAULT_KEEP_EMPTY_PATTERNS
public static final boolean DEFAULT_KEEP_EMPTY_SCHEMA
public PSPreprocessor(@Nonnull IPSQueryBinding aQueryBinding)
@Nonnull public IPSQueryBinding getQueryBinding()
null
!public boolean isKeepTitles()
true
if <title>-elements should be kept. Default
is false.@Nonnull public PSPreprocessor setKeepTitles(boolean bKeepTitles)
bKeepTitles
- true
to keep titles, false
otherwise.public boolean isKeepDiagnostics()
true
if <diagnostics>-elements should be kept.
Default is false.@Nonnull public PSPreprocessor setKeepDiagnostics(boolean bKeepDiagnostics)
bKeepDiagnostics
- true
to keep diagnostics, false
otherwise.public boolean isKeepReports()
true
if <report>-elements should be kept,
false
if they should be converted to
<assert>-elements. Default is false.@Nonnull public PSPreprocessor setKeepReports(boolean bKeepReports)
bKeepReports
- true
to keep <report>-elements,
false
to change them to <assert>-elementspublic boolean isKeepEmptyPatterns()
true
if <pattern>-elements without a rule should
be kept. Default is true.@Nonnull public PSPreprocessor setKeepEmptyPatterns(boolean bKeepEmptyPatterns)
bKeepEmptyPatterns
- true
to keep <pattern>-elements without a rule,
false
to delete thempublic boolean isKeepEmptySchema()
true
if <schema>-elements without a pattern
should be kept. Default is true.@Nonnull public PSPreprocessor setKeepEmptySchema(boolean bKeepEmptySchema)
false
if setKeepEmptyPatterns(boolean)
is also
set to false, because otherwise patterns without rules are kept.bKeepEmptySchema
- true
to keep them, false
to discard them.@Nullable public PSSchema getAsMinimalSchema(@Nonnull PSSchema aSchema) throws SchematronPreprocessException
aSchema
- The schema to be made minimal. May not be null
null
if the original schema is
not yet minimal and isKeepEmptySchema()
is set to
false
.SchematronPreprocessException
- In case a preprocessing error occurs@Nullable public PSSchema getAsPreprocessedSchema(@Nonnull PSSchema aSchema) throws SchematronPreprocessException
aSchema
- The schema to pre-process. May not be null
null
if the
original schema is not yet pre-processed and
isKeepEmptySchema()
is set to false
.SchematronPreprocessException
- In case a preprocessing error occurs@Nullable public PSSchema getForcedPreprocessedSchema(@Nonnull PSSchema aSchema) throws SchematronPreprocessException
aSchema
- The schema to be made minimal. May not be null
null
if the
original schema is not yet minimal and isKeepEmptySchema()
is set to false
.SchematronPreprocessException
- In case a preprocessing error occurs@Nonnull public static PSPreprocessor createPreprocessorWithoutInformationLoss(@Nonnull IPSQueryBinding aQueryBinding)
Copyright © 2014–2019 Philip Helger. All rights reserved.