Class AbstractCFMetaDataFactory

    • Constructor Detail

      • AbstractCFMetaDataFactory

        public AbstractCFMetaDataFactory()
    • Method Detail

      • setFiles

        public void setFiles​(Collection<File> files)
        Set of Files of metadata files or directories supplied by user.
      • setFiles

        public void setFiles​(String files)
        Set of semicolon-separated Files of metadata files or directories supplied by user via auto-configuration.
      • setURLs

        public void setURLs​(Collection<URL> urls)
        Set of URLs of metadata files or jars supplied by user.
      • setURLs

        public void setURLs​(String urls)
        Set of semicolon-separated URLs of metadata files or jars supplied by user via auto-configuration.
      • setResources

        public void setResources​(Collection<String> rsrcs)
        Set of resource paths of metadata files or jars supplied by user.
      • setResources

        public void setResources​(String rsrcs)
        Set of semicolon-separated resource paths of metadata files or jars supplied by user via auto-configuration.
      • setClasspathScan

        public void setClasspathScan​(Collection<String> cpath)
        Set of classpath directories or jars to scan for metadata supplied by user.
      • setClasspathScan

        public void setClasspathScan​(String cpath)
        Set of classpath directories or jars to scan for metadata supplied by user via auto-configuration.
      • store

        public boolean store​(ClassMetaData[] metas,
                             QueryMetaData[] queries,
                             SequenceMetaData[] seqs,
                             int mode,
                             Map<File,​String> output)
        Description copied from interface: MetaDataFactory
        Store the given metadata.
        Specified by:
        store in interface MetaDataFactory
        Overrides:
        store in class AbstractMetaDataFactory
        mode - hint about what aspects of the metadata have changed
        output - 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 form
        Returns:
        false if this factory is unable to store metadata
      • isMappingOnlyFactory

        protected boolean isMappingOnlyFactory()
        Return true if this factory deals only with mapping data, and relies on a separate factory for metadata.
      • parse

        protected void parse​(MetaDataParser parser,
                             Class[] cls)
        Parse all given classses.
      • isParseTopDown

        protected boolean isParseTopDown()
        Whether to parse classes top down. Defaults to false.
      • serialize

        protected void serialize​(MetaDataSerializer ser,
                                 Map<File,​String> output,
                                 int flags)
        Tell the given serialier to write its metadatas.
      • backupAndDelete

        protected void backupAndDelete​(Collection files)
        Backup and delete the source files for the given metadatas.
      • clearMapping

        protected void clearMapping​(ClassMetaData meta)
        Clear mapping information from the given metadata.
      • getSourceFile

        protected File getSourceFile​(ClassMetaData meta)
        Return the current source file of the given metadata.
      • setSourceFile

        protected void setSourceFile​(ClassMetaData meta,
                                     File sourceFile)
        Set the current source file of the given metadata.
      • getSourceFile

        protected File getSourceFile​(SequenceMetaData meta)
        Return the current source file of the given metadata.
      • setSourceFile

        protected void setSourceFile​(SequenceMetaData meta,
                                     File sourceFile)
        Set the current source file of the given metadata.
      • defaultSourceFile

        protected abstract File defaultSourceFile​(ClassMetaData meta)
        Return the default file for the given metadata.
      • defaultSourceFile

        protected abstract File defaultSourceFile​(QueryMetaData query,
                                                  Map clsNames)
        Return a default file for the given query.
      • defaultSourceFile

        protected abstract File defaultSourceFile​(SequenceMetaData seq,
                                                  Map clsNames)
        Return a default file for the given sequence.
      • newParser

        protected abstract AbstractCFMetaDataFactory.Parser newParser​(boolean loading)
        Create a new metadata parser.
        Parameters:
        loading - if true, this will be the cached parser used for loading metadata
      • getDefiningMetaData

        protected ClassMetaData getDefiningMetaData​(QueryMetaData query,
                                                    Map clsNames)
        Return the metadata that defines the given query, if any.
        Parameters:
        clsNames - map of class names to metadatas
      • decode

        public static String decode​(String s)
        Decodes a URL-encoded path string. For example, an encoded space (%20) is decoded into a normal space (' ') character. Added via OPENJPA-2102.
        Parameters:
        s - - the encoded URL string
        Returns:
        String decoded - the decoded string.
      • newMetaDataFilter

        protected abstract MetaDataFilter newMetaDataFilter()
        Return a metadata filter that identifies metadata resources when performing jar and classpath scans.