Package org.hibernate.boot.jaxb.internal
Class XmlSources
java.lang.Object
org.hibernate.boot.jaxb.internal.XmlSources
Helper for building and handling
XmlSource
references.
An XmlSource
represents an XML document containing
O/R mapping metadata, either a JPA orm.xml
file, or a
Hibernate .hbm.xml
file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic XmlSource
fromCacheableFile
(File file) static XmlSource
fromCacheableFile
(File file, boolean strict) static XmlSource
fromCacheableFile
(File file, File cacheableDir) static XmlSource
fromCacheableFile
(File file, File cacheableDir, boolean strict) static XmlSource
fromDocument
(Document document) static XmlSource
static void
Read all.hbm.xml
mappings from a jar file and pass them to the givenConsumer
.static XmlSource
fromResource
(String resourceName, ClassLoaderService classLoaderService) Create anXmlSource
from a named resourcestatic XmlSource
fromStream
(InputStream inputStream) static XmlSource
fromStream
(InputStreamAccess inputStreamAccess) static XmlSource
Create anXmlSource
from a URL
-
Constructor Details
-
XmlSources
public XmlSources()
-
-
Method Details
-
fromResource
Create anXmlSource
from a named resource -
fromUrl
Create anXmlSource
from a URL -
fromFile
-
fromCacheableFile
-
fromCacheableFile
-
fromCacheableFile
-
fromCacheableFile
-
fromStream
-
fromStream
-
fromDocument
-
fromJar
Read all.hbm.xml
mappings from a jar file and pass them to the givenConsumer
.Assumes that any file named
*.hbm.xml
is a mapping document. This method does not supportorm.xml
files!- Parameters:
jar
- a jar fileconsumer
- a consumer of the resulting XML sources
-