Top Description Inners Fields Constructors Methods
org.eclipse.persistence.sessions.factories

public Class XMLProjectReader

extends Object
Class Inheritance
Imports
java.io.File, .FileInputStream, .FileNotFoundException, .IOException, .InputStream, .InputStreamReader, .Reader, .StringReader, .StringWriter, .UnsupportedEncodingException, java.net.URL, java.nio.charset.StandardCharsets, org.w3c.dom.Document, org.xml.sax.EntityResolver, .InputSource, .SAXException, org.eclipse.persistence.exceptions.ValidationException, .XMLMarshalException, org.eclipse.persistence.internal.helper.ConversionManager, org.eclipse.persistence.internal.sessions.factories.EclipseLinkObjectPersistenceRuntimeXMLProject, .MissingDescriptorListener, .ObjectPersistenceRuntimeXMLProject, .ObjectPersistenceRuntimeXMLProject_11_1_1, org.eclipse.persistence.oxm.XMLContext, .XMLLogin, .XMLUnmarshaller, org.eclipse.persistence.platform.xml.XMLParser, .XMLPlatform, .XMLPlatformFactory, org.eclipse.persistence.sessions.Project

Purpose: Allow for a EclipseLink Mapping Workbench generated deployment XML project file to be read. This reader returns an instance of Project to be used to initialize a EclipseLink session. This class supports reading the 11g 11.1.1 and 10g 10.1.3.

Author
James Sutherland
Since
TopLink 3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
XMLProjectReader.XMLSchemaResolver

INTERNAL: Workaround for bug #3503583.

Field Summary

Modifier and TypeField and Description
public static final String
protected static Project
project

Cache the creation and initialization of the EclipseLink XML mapping project.

public static final String
protected static boolean
shouldUseSchemaValidation

Allow for usage of schema validation to be configurable.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static XMLParser
createXMLParser(XMLPlatform xmlPlatform, boolean namespaceAware, boolean whitespacePreserving, String schema)

public static Project
read(String fileOrResourceName)

PUBLIC: Read the EclipseLink project deployment XML from the file or resource name.

public static Project
read(Reader reader, ClassLoader classLoader)

PUBLIC: Read the EclipseLink project deployment XML from the reader on the file.

public static Project
read(String fileOrResourceName, ClassLoader classLoader)

PUBLIC: Read the EclipseLink project deployment XML from the file or resource name.

public static Project
read(Reader reader)

PUBLIC: Read the EclipseLink project deployment XML from the reader on the file.

public static Project
read1013Format(Document document, ClassLoader classLoader)

INTERNAL: Read the TopLink 10.1.3 deployment XML format.

public static Project
read1111Format(Document document, ClassLoader classLoader)

INTERNAL: Read the TopLink 11.1.1 deployment XML format.

public static Project
readObjectPersistenceRuntimeFormat(Document document, ClassLoader classLoader, Project opmProject)

Read a project in the format of an ObjectPersistenceRuntimeXMLProject.

public static void
setShouldUseSchemaValidation(boolean value)

PUBLIC: Set if schema validation will be used when parsing the deployment XML.

public static boolean
shouldUseSchemaValidation()

PUBLIC: Return if schema validation will be used when parsing the deployment XML.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

OPM_SCHEMAback to summary
public static final String OPM_SCHEMA
projectback to summary
protected static Project project

Cache the creation and initialization of the EclipseLink XML mapping project.

SCHEMA_DIRback to summary
public static final String SCHEMA_DIR
shouldUseSchemaValidationback to summary
protected static boolean shouldUseSchemaValidation

Allow for usage of schema validation to be configurable.

Constructor Detail

XMLProjectReaderback to summary
private XMLProjectReader()

Method Detail

createXMLParserback to summary
private static XMLParser createXMLParser(XMLPlatform xmlPlatform, boolean namespaceAware, boolean whitespacePreserving, String schema)
readback to summary
public static Project read(String fileOrResourceName)

PUBLIC: Read the EclipseLink project deployment XML from the file or resource name. If a resource name is used the default class loader will be used to resolve the resource. Note the default class loader must be able to resolve the domain classes. Note the file must be the deployment XML, not the Mapping Workbench project file.

readback to summary
public static Project read(Reader reader, ClassLoader classLoader)

PUBLIC: Read the EclipseLink project deployment XML from the reader on the file. Note the class loader must be able to resolve the domain classes. Note the file must be the deployment XML, not the Mapping Workbench project file. This API supports 10g (10.0.3), 11g (11.1.1) formats.

readback to summary
public static Project read(String fileOrResourceName, ClassLoader classLoader)

PUBLIC: Read the EclipseLink project deployment XML from the file or resource name. If a resource name is used the class loader will be used to resolve the resource. Note the class loader must be able to resolve the domain classes. Note the file must be the deployment XML, not the Mapping Workbench project file.

readback to summary
public static Project read(Reader reader)

PUBLIC: Read the EclipseLink project deployment XML from the reader on the file. Note the default class loader must be able to resolve the domain classes. Note the file must be the deployment XML, not the Mapping Workbench project file.

read1013Formatback to summary
public static Project read1013Format(Document document, ClassLoader classLoader)

INTERNAL: Read the TopLink 10.1.3 deployment XML format.

read1111Formatback to summary
public static Project read1111Format(Document document, ClassLoader classLoader)

INTERNAL: Read the TopLink 11.1.1 deployment XML format.

readObjectPersistenceRuntimeFormatback to summary
public static Project readObjectPersistenceRuntimeFormat(Document document, ClassLoader classLoader, Project opmProject)

Read a project in the format of an ObjectPersistenceRuntimeXMLProject. This could include a TopLink 11.1.1 project or a TopLink 10.1.3 project

setShouldUseSchemaValidationback to summary
public static void setShouldUseSchemaValidation(boolean value)

PUBLIC: Set if schema validation will be used when parsing the deployment XML. By default schema validation is on, but can be turned off if validation problems occur, or to improve parsing performance.

shouldUseSchemaValidationback to summary
public static boolean shouldUseSchemaValidation()

PUBLIC: Return if schema validation will be used when parsing the deployment XML.

org.eclipse.persistence.sessions.factories back to summary

private Class XMLProjectReader.XMLSchemaResolver

extends Object
implements EntityResolver
Class Inheritance
  • java.lang.Object
  • org.eclipse.persistence.sessions.factories.XMLProjectReader.XMLSchemaResolver
All Implemented Interfaces
org.xml.sax.EntityResolver

INTERNAL: Workaround for bug #3503583. This works around a bug in the xdk in resolving relative jar based xsd references in oc4j.

Constructor Summary

AccessConstructor and Description
public
XMLSchemaResolver()

INTERNAL:

Method Summary

Modifier and TypeMethod and Description
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.xml.sax.EntityResolver.resolveEntity.

INTERNAL: Resolve the XSD.
public URL
resolveURL(String resource)

INTERNAL: Return the URL for the resource.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

XMLSchemaResolverback to summary
public XMLSchemaResolver()

INTERNAL:

Method Detail

resolveEntityback to summary
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException

Implements org.xml.sax.EntityResolver.resolveEntity.

INTERNAL: Resolve the XSD.

Parameters
publicId:String

Doc from org.xml.sax.EntityResolver.resolveEntity.

The public identifier of the external entity being referenced, or null if none was supplied.

systemId:String

Doc from org.xml.sax.EntityResolver.resolveEntity.

The system identifier of the external entity being referenced.

Returns:InputSource

Doc from org.xml.sax.EntityResolver.resolveEntity.

An InputSource object describing the new input source, or null to request that the parser open a regular URI connection to the system identifier.

Annotations
@Override
Exceptions
SAXException:

Doc from org.xml.sax.EntityResolver.resolveEntity.

Any SAX exception, possibly wrapping another exception.

IOException:

Doc from org.xml.sax.EntityResolver.resolveEntity.

A Java-specific IO exception, possibly the result of creating a new InputStream or Reader for the InputSource.

resolveURLback to summary
public URL resolveURL(String resource)

INTERNAL: Return the URL for the resource.