public abstract class AbstractCFMetaDataFactory extends AbstractMetaDataFactory
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractCFMetaDataFactory.Parser
Internal parser interface.
|
static interface |
AbstractCFMetaDataFactory.Serializer
Internal serializer interface.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Collection<java.lang.String> |
cpath |
protected java.util.Collection<java.io.File> |
files |
static java.lang.String |
JAR_FILE_URLS |
static java.lang.String |
MAPPING_FILE_NAMES |
static java.lang.String |
PERSISTENCE_UNIT_ROOT_URL |
protected java.util.Collection<java.lang.String> |
rsrcs |
protected java.util.Collection<java.net.URL> |
urls |
dir, log, repos, store, strict, typesSTORE_DEFAULT, STORE_PER_CLASS, STORE_VERBOSEMODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY| Constructor and Description |
|---|
AbstractCFMetaDataFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
backupAndDelete(java.util.Collection files)
Backup and delete the source files for the given metadatas.
|
void |
clear()
Clear any internal caches.
|
protected void |
clearMapping(ClassMetaData meta)
Clear mapping information from the given metadata.
|
static java.lang.String |
decode(java.lang.String s)
Decodes a URL-encoded path string.
|
protected abstract java.io.File |
defaultSourceFile(ClassMetaData meta)
Return the default file for the given metadata.
|
protected abstract java.io.File |
defaultSourceFile(QueryMetaData query,
java.util.Map clsNames)
Return a default file for the given query.
|
protected abstract java.io.File |
defaultSourceFile(SequenceMetaData seq,
java.util.Map clsNames)
Return a default file for the given sequence.
|
boolean |
drop(java.lang.Class[] cls,
int mode,
java.lang.ClassLoader envLoader)
Drop the metadata for the given classes in the given mode(s).
|
protected ClassMetaData |
getDefiningMetaData(QueryMetaData query,
java.util.Map clsNames)
Return the metadata that defines the given query, if any.
|
java.util.Set<java.lang.String> |
getPersistentTypeNames(boolean devpath,
java.lang.ClassLoader envLoader)
Return all persistent class names, using the metadata locations supplied
in configuration, optionally scanning the classpath.
|
protected java.io.File |
getSourceFile(ClassMetaData meta)
Return the current source file of the given metadata.
|
protected java.io.File |
getSourceFile(SequenceMetaData meta)
Return the current source file of the given metadata.
|
protected boolean |
isMappingOnlyFactory()
Return true if this factory deals only with mapping data, and relies
on a separate factory for metadata.
|
protected boolean |
isParseTopDown()
Whether to parse classes top down.
|
protected void |
mapPersistentTypeNames(java.lang.Object rsrc,
java.lang.String[] names)
Implement this method to map metadata resources to the persistent
types contained within them.
|
protected abstract AbstractCFMetaDataFactory.Serializer |
newAnnotationSerializer()
Create a new annotation metadata serializer.
|
protected abstract MetaDataFilter |
newMetaDataFilter()
Return a metadata filter that identifies metadata resources when
performing jar and classpath scans.
|
protected abstract AbstractCFMetaDataFactory.Parser |
newParser(boolean loading)
Create a new metadata parser.
|
protected abstract AbstractCFMetaDataFactory.Serializer |
newSerializer()
Create a new metadata serializer.
|
protected void |
parse(MetaDataParser parser,
java.lang.Class[] cls)
Parse all given classses.
|
protected void |
parse(MetaDataParser parser,
java.util.Collection files)
Parse all given files.
|
protected java.util.Set<java.lang.String> |
parsePersistentTypeNames(java.lang.ClassLoader loader)
Parse persistent type names.
|
protected void |
serialize(MetaDataSerializer ser,
java.util.Map<java.io.File,java.lang.String> output,
int flags)
Tell the given serialier to write its metadatas.
|
void |
setClasspathScan(java.util.Collection<java.lang.String> cpath)
Set of classpath directories or jars to scan for metadata supplied
by user.
|
void |
setClasspathScan(java.lang.String cpath)
Set of classpath directories or jars to scan for metadata supplied
by user via auto-configuration.
|
void |
setFiles(java.util.Collection<java.io.File> files)
Set of
Files of metadata files or directories supplied by user. |
void |
setFiles(java.lang.String files)
Set of semicolon-separated
Files of metadata files or
directories supplied by user via auto-configuration. |
void |
setResources(java.util.Collection<java.lang.String> rsrcs)
Set of resource paths of metadata files or jars supplied by user.
|
void |
setResources(java.lang.String rsrcs)
Set of semicolon-separated resource paths of metadata files or jars
supplied by user via auto-configuration.
|
protected void |
setSourceFile(ClassMetaData meta,
java.io.File sourceFile)
Set the current source file of the given metadata.
|
protected void |
setSourceFile(SequenceMetaData meta,
java.io.File sourceFile)
Set the current source file of the given metadata.
|
void |
setURLs(java.util.Collection<java.net.URL> urls)
Set of
URLs of metadata files or jars supplied by user. |
void |
setURLs(java.lang.String urls)
Set of semicolon-separated
URLs of metadata files or jars
supplied by user via auto-configuration. |
boolean |
store(ClassMetaData[] metas,
QueryMetaData[] queries,
SequenceMetaData[] seqs,
int mode,
java.util.Map<java.io.File,java.lang.String> output)
Store the given metadata.
|
addClassExtensionKeys, addFieldExtensionKeys, getQueryScope, getResultSetMappingScope, newClassArgParser, setRepository, setStoreDirectory, setStoreMode, setStrict, setTypes, setTypesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaults, getManagedClass, getManagedClassName, getMetaModelClassName, isMetaClass, load, loadXMLMetaDataprotected java.util.Collection<java.io.File> files
protected java.util.Collection<java.net.URL> urls
protected java.util.Collection<java.lang.String> rsrcs
protected java.util.Collection<java.lang.String> cpath
public static final java.lang.String PERSISTENCE_UNIT_ROOT_URL
public static final java.lang.String MAPPING_FILE_NAMES
public static final java.lang.String JAR_FILE_URLS
public void setFiles(java.util.Collection<java.io.File> files)
Files of metadata files or directories supplied by user.public void setFiles(java.lang.String files)
Files of metadata files or
directories supplied by user via auto-configuration.public void setURLs(java.util.Collection<java.net.URL> urls)
URLs of metadata files or jars supplied by user.public void setURLs(java.lang.String urls)
URLs of metadata files or jars
supplied by user via auto-configuration.public void setResources(java.util.Collection<java.lang.String> rsrcs)
public void setResources(java.lang.String rsrcs)
public void setClasspathScan(java.util.Collection<java.lang.String> cpath)
public void setClasspathScan(java.lang.String cpath)
public boolean store(ClassMetaData[] metas, QueryMetaData[] queries, SequenceMetaData[] seqs, int mode, java.util.Map<java.io.File,java.lang.String> output)
MetaDataFactorystore in interface MetaDataFactorystore in class AbstractMetaDataFactorymode - hint about what aspects of the metadata have changedoutput - if non-null, rather than storing metadata directly,
add entries mapping each output destination such
as a File to the planned output for that
destination in string formpublic boolean drop(java.lang.Class[] cls,
int mode,
java.lang.ClassLoader envLoader)
MetaDataFactorydrop in interface MetaDataFactorydrop in class AbstractMetaDataFactoryprotected boolean isMappingOnlyFactory()
protected void parse(MetaDataParser parser, java.util.Collection files)
protected void parse(MetaDataParser parser, java.lang.Class[] cls)
protected boolean isParseTopDown()
protected void serialize(MetaDataSerializer ser, java.util.Map<java.io.File,java.lang.String> output, int flags)
protected void backupAndDelete(java.util.Collection files)
protected void clearMapping(ClassMetaData meta)
protected java.io.File getSourceFile(ClassMetaData meta)
protected void setSourceFile(ClassMetaData meta, java.io.File sourceFile)
protected java.io.File getSourceFile(SequenceMetaData meta)
protected void setSourceFile(SequenceMetaData meta, java.io.File sourceFile)
protected abstract java.io.File defaultSourceFile(ClassMetaData meta)
protected abstract java.io.File defaultSourceFile(QueryMetaData query, java.util.Map clsNames)
protected abstract java.io.File defaultSourceFile(SequenceMetaData seq, java.util.Map clsNames)
protected abstract AbstractCFMetaDataFactory.Parser newParser(boolean loading)
loading - if true, this will be the cached parser used for
loading metadataprotected abstract AbstractCFMetaDataFactory.Serializer newSerializer()
protected abstract AbstractCFMetaDataFactory.Serializer newAnnotationSerializer()
protected ClassMetaData getDefiningMetaData(QueryMetaData query, java.util.Map clsNames)
clsNames - map of class names to metadataspublic java.util.Set<java.lang.String> getPersistentTypeNames(boolean devpath,
java.lang.ClassLoader envLoader)
MetaDataFactoryMetaDataRepository.getPersistentTypeNames(boolean, java.lang.ClassLoader) instead.getPersistentTypeNames in interface MetaDataFactorygetPersistentTypeNames in class AbstractMetaDataFactoryMetaDataRepository.getPersistentTypeNames(boolean, java.lang.ClassLoader),
MetaDataRepository.loadPersistentTypes(boolean, java.lang.ClassLoader)protected java.util.Set<java.lang.String> parsePersistentTypeNames(java.lang.ClassLoader loader)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String decode(java.lang.String s)
String - encoded - the encoded URL stringprotected void mapPersistentTypeNames(java.lang.Object rsrc,
java.lang.String[] names)
getPersistentTypeNames(boolean, java.lang.ClassLoader) is invoked.protected abstract MetaDataFilter newMetaDataFilter()
public void clear()
MetaDataFactoryclear in interface MetaDataFactoryclear in class AbstractMetaDataFactoryCopyright © 2006-2013 Apache Software Foundation. All Rights Reserved.