| Modifier and Type | Class and Description |
|---|---|
| private static class | LiquibaseEntityResolver.
Only currently implementing getResource() since that's the only method used by our logic |
| Modifier and Type | Field and Description |
|---|---|
| private static boolean | hasWarnedAboutMismatchedXsdVersion
The warning message should only be printed once. |
| private boolean | |
| private static final Pattern | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public InputSource | getExternalSubset(String
Identifies the document root element. This name comes
from a DOCTYPE declaration (where available) or from the actual
root element. name, String The document's base URI, serving as an additional
hint for selecting the external subset. This is always an absolute
URI, unless it is null because the XMLReader was given an InputSource
without one. baseURI)Implements org. Allows applications to provide an external subset for documents that don't explicitly define one. |
| protected ClassLoader | |
| public InputSource | resolveEntity(String
Identifies the external entity being resolved.
Either "[dtd]" for the external subset, or a name starting
with "%" to indicate a parameter entity, or else the name of
a general entity. This is never null when invoked by a SAX2
parser. name, String The public identifier of the external entity being
referenced (normalized as required by the XML specification), or
null if none was supplied. publicId, String The URI with respect to which relative systemIDs
are interpreted. This is always an absolute URI, unless it is
null (likely because the XMLReader was given an InputSource without
one). This URI is defined by the XML specification to be the one
associated with the "<" starting the relevant declaration. baseURI, String The system identifier of the external entity
being referenced; either a relative or absolute URI.
This is never null when invoked by a SAX2 parser; only declared
entities, and any external subset, are resolved by such parsers. systemId)Implements org. Allows applications to map references to external entities into input sources, or tell the parser it should use conventional URI resolution. |
| public InputSource | resolveEntity(String
The public identifier of the external entity
being referenced, or null if none was supplied. publicId, String The system identifier of the external entity
being referenced. systemId)Implements org. Allow the application to resolve external entities. |
| public void | setShouldWarnOnMismatchedXsdVersion(boolean shouldWarnOnMismatchedXsdVersion)
When set to true, a warning will be printed to the console if the XSD version used does not match the version of Liquibase. |
| private void | warnForMismatchedXsdVersion(String systemId)
Print a warning message to the logs and UI if the build version does not match the XSD version. |
| hasWarnedAboutMismatchedXsdVersion | back to summary |
|---|---|
| private static boolean hasWarnedAboutMismatchedXsdVersion The warning message should only be printed once. | |
| shouldWarnOnMismatchedXsdVersion | back to summary |
|---|---|
| private boolean shouldWarnOnMismatchedXsdVersion | |
| XSD_VERSION_PATTERN | back to summary |
|---|---|
| private static final Pattern XSD_VERSION_PATTERN | |
| XSD_VERSION_REGEX | back to summary |
|---|---|
| private static final String XSD_VERSION_REGEX | |
| LiquibaseEntityResolver | back to summary |
|---|---|
| public LiquibaseEntityResolver() | |
| getExternalSubset | back to summary |
|---|---|
| public InputSource getExternalSubset(String name, String baseURI) throws SAXException, IOException Implements org. Doc from org. Allows applications to provide an external subset for documents
that don't explicitly define one. Documents with DOCTYPE declarations
that omit an external subset can thus augment the declarations
available for validation, entity processing, and attribute processing
(normalization, defaulting, and reporting types including ID).
This augmentation is reported
through the This method can also be used with documents that have no DOCTYPE declaration. When the root element is encountered, but no DOCTYPE declaration has been seen, this method is invoked. If it returns a value for the external subset, that root element is declared to be the root element, giving the effect of splicing a DOCTYPE declaration at the end the prolog of a document that could not otherwise be valid. The sequence of parser callbacks in that case logically resembles this:
... comments and PIs from the prolog (as usual)
startDTD ("rootName", source.getPublicId (), source.getSystemId ());
startEntity ("[dtd]");
... declarations, comments, and PIs from the external subset
endEntity ("[dtd]");
endDTD ();
... then the rest of the document (as usual)
startElement (..., "rootName", ...);
Note that the InputSource gets no further resolution.
Implementations of this method may wish to invoke
Uses for this method include facilitating data validation when interoperating with XML processors that would always require undesirable network accesses for external entities, or which for other reasons adopt a "no DTDs" policy. Non-validation motives include forcing documents to include DTDs so that attributes are handled consistently. For example, an XPath processor needs to know which attributes have type "ID" before it can process a widely used type of reference. Warning Returning an external subset modifies the input document. By providing definitions for general entities, it can make a malformed document appear to be well formed.
| |
| getSearchClassloader | back to summary |
|---|---|
| protected ClassLoader getSearchClassloader() Return the classloader used to look for XSD files in the classpath. | |
| resolveEntity | back to summary |
|---|---|
| public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) throws SAXException, IOException Implements org. Doc from org. Allows applications to map references to external entities into input
sources, or tell the parser it should use conventional URI resolution.
This method is only called for external entities which have been
properly declared.
This method provides more flexibility than the Parsers configured to use this resolver method will call it
to determine the input source to use for any external entity
being included because of a reference in the XML text.
That excludes the document entity, and any external entity returned
by Note that the entity naming scheme used here is the same one
used in the
| |
| resolveEntity | back to summary |
|---|---|
| public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException Implements org. Doc from org. Allow the application to resolve external entities. The parser will call this method before opening any external entity except the top-level document entity. Such entities include the external DTD subset and external parameter entities referenced within the DTD (in either case, only if the parser reads external parameter entities), and external general entities referenced within the document element (if the parser reads external general entities). The application may request that the parser locate the entity itself, that it use an alternative URI, or that it use data provided by the application (as a character or byte input stream). Application writers can use this method to redirect external system identifiers to secure and/or local URIs, to look up public identifiers in a catalogue, or to read an entity from a database or other input source (including, for example, a dialog box). Neither XML nor SAX specifies a preferred policy for using public or system IDs to resolve resources. However, SAX specifies how to interpret any InputSource returned by this method, and that if none is returned, then the system ID will be dereferenced as a URL. If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to the application.
| |
| setShouldWarnOnMismatchedXsdVersion | back to summary |
|---|---|
| public void setShouldWarnOnMismatchedXsdVersion(boolean shouldWarnOnMismatchedXsdVersion) When set to true, a warning will be printed to the console if the XSD version used does not match the version of Liquibase. If "latest" is used as the XSD version, no warning is printed. | |
| warnForMismatchedXsdVersion | back to summary |
|---|---|
| private void warnForMismatchedXsdVersion(String systemId) Print a warning message to the logs and UI if the build version does not match the XSD version. This is a best effort check, this method will never throw an exception. | |
| Modifier and Type | Field and Description |
|---|---|
| private final List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public URL | getResource(String
The resource name name)Overrides java. Finds the resource with the given name. |
| classLoaders | back to summary |
|---|---|
| private final List<ClassLoader> classLoaders | |
| CombinedClassLoader | back to summary |
|---|---|
| public CombinedClassLoader() | |
| getResource | back to summary |
|---|---|
| public URL getResource(String name) Overrides java. Doc from java. Finds the resource with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code. The name of a resource is a ' Resources in named modules are subject to the encapsulation rules
specified by
| |