Class StaticWeaveProcessor

java.lang.Object
org.eclipse.persistence.tools.weaving.jpa.StaticWeaveProcessor

public class StaticWeaveProcessor extends Object

Description: The StaticWeaveProcessor controls the static weaving process. It is invoked by both the command line StaticWeave class and the StaticWeaveAntTask.

Responsibilities: Process the source classes, performs weaving as necessary out outputs to the target

  • Constructor Details

    • StaticWeaveProcessor

      public StaticWeaveProcessor(String source, String target) throws MalformedURLException
      Constructs an instance of StaticWeaveProcessor
      Parameters:
      source - the name of the location to be weaved
      target - the name of the location to be weaved to
      Throws:
      MalformedURLException
    • StaticWeaveProcessor

      public StaticWeaveProcessor(File source, File target) throws MalformedURLException
      Constructs an instance of StaticWeaveProcessor
      Parameters:
      source - the File object of the source to be weaved
      target - the File object of the target to be weaved to
      Throws:
      MalformedURLException
    • StaticWeaveProcessor

      public StaticWeaveProcessor(URL source, URL target)
      Constructs an instance of StaticWeaveProcessor
      Parameters:
      source - the URL of the source to be weaved
      target - the URL of the target to be weaved to
  • Method Details

    • setLog

      public void setLog(Writer logWriter)
      The method allows user to specify the output for the log message.
      Parameters:
      logWriter - the location where the log message writes to. the default value is standard out
    • setLogLevel

      public void setLogLevel(int level)
      The method allows user to define nine levels EclipseLink logging.
      Parameters:
      level - - the integer value of log level. default is OFF.
    • setClassLoader

      public void setClassLoader(ClassLoader classLoader)
      Set the user classloader.
    • setPersistenceInfo

      public void setPersistenceInfo(URL persistenceInfo)
      Set an explicitly identified URL of the location containing persistence.xml.
      Parameters:
      persistenceInfo - the URL of the location containing persistence.xml, the URL must point to the root of META-INF/persistence.xml
    • setPersistenceInfo

      public void setPersistenceInfo(String persistenceInfoPath) throws MalformedURLException
      Set an explicitly identified the location containing persistence.xml.
      Parameters:
      persistenceInfoPath - the path of the location containing persistence.xml, the path must point to the root of META-INF/persistence.xml
      Throws:
      MalformedURLException
    • getPersistenceXMLLocation

      public String getPersistenceXMLLocation()
    • setPersistenceXMLLocation

      public void setPersistenceXMLLocation(String persistenceXMLLocation)
      Set a specific location to look for persistence.xml by default we will look in META-INF/persistence.xml
    • setPersistenceInfo

      public void setPersistenceInfo(File persistenceInfoFile) throws MalformedURLException
      Set an explicitly identified the location containing persistence.xml.
      Parameters:
      persistenceInfoFile - the file containing persistence.xml, the file should contain META-INF/persistence.xml
      Throws:
      MalformedURLException
    • performWeaving

      public void performWeaving() throws URISyntaxException, MalformedURLException, IOException
      This method performs weaving function on the class individually from the specified source.
      Throws:
      URISyntaxException
      MalformedURLException
      IOException
    • getDirectoryFromEntryName

      public static String getDirectoryFromEntryName(String entryName)