Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.tools.weaving.jpa
Class StaticWeaveProcessor

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


public class StaticWeaveProcessor
extends java.lang.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


Field Summary
private  java.lang.ClassLoader classLoader
           
private  int logLevel
           
private  java.io.Writer logWriter
           
private static int NUMBER_OF_BYTES
           
private  java.net.URL persistenceInfo
           
private  java.lang.String persistenceXMLLocation
           
private  java.net.URL source
           
private  java.net.URL target
           

 

Constructor Summary
StaticWeaveProcessor(java.io.File source, java.io.File target)
          Constructs an instance of StaticWeaveProcessor
StaticWeaveProcessor(java.lang.String source, java.lang.String target)
          Constructs an instance of StaticWeaveProcessor
StaticWeaveProcessor(java.net.URL source, java.net.URL target)
          Constructs an instance of StaticWeaveProcessor

 

Method Summary
static java.lang.String getDirectoryFromEntryName(java.lang.String entryName)
           
 java.lang.String getPersistenceXMLLocation()
           
private  java.net.URL[] getURLs()
          Generate URL array for specified source and persistenceinfo.
private  boolean isDirectory(java.net.URL url)
          Determine whether or not the URL is pointing to directory.
 void performWeaving()
          This method performs weaving function on the class individually from the specified source.
private  void preProcess()
          INTERNAL: This method perform all necessary steps(verification, pre-build the target directory) prior to the invocation of the weaving function.
private  void process()
          INTERNAL: The method performs weaving function
 void setClassLoader(java.lang.ClassLoader classLoader)
          Set the user classloader.
 void setLog(java.io.Writer logWriter)
          The method allows user to specify the output for the log message.
 void setLogLevel(int level)
          The method allows user to define nine levels EclipseLink logging.
 void setPersistenceInfo(java.io.File persistenceInfoFile)
          Set an explicitly identified the location containing persistence.xml.
 void setPersistenceInfo(java.lang.String persistenceInfoPath)
          Set an explicitly identified the location containing persistence.xml.
 void setPersistenceInfo(java.net.URL persistenceInfo)
          Set an explicitly identified URL of the location containing persistence.xml.
 void setPersistenceXMLLocation(java.lang.String persistenceXMLLocation)
          Set a specific location to look for persistence.xml by default we will look in META-INF/persistence.xml

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

source

private java.net.URL source

target

private java.net.URL target

persistenceInfo

private java.net.URL persistenceInfo

persistenceXMLLocation

private java.lang.String persistenceXMLLocation

logWriter

private java.io.Writer logWriter

classLoader

private java.lang.ClassLoader classLoader

logLevel

private int logLevel

NUMBER_OF_BYTES

private static final int NUMBER_OF_BYTES
See Also:
Constant Field Values

Constructor Detail

StaticWeaveProcessor

public StaticWeaveProcessor(java.lang.String source,
                            java.lang.String target)
                     throws java.net.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:
java.net.MalformedURLException

StaticWeaveProcessor

public StaticWeaveProcessor(java.io.File source,
                            java.io.File target)
                     throws java.net.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:
java.net.MalformedURLException

StaticWeaveProcessor

public StaticWeaveProcessor(java.net.URL source,
                            java.net.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 Detail

setLog

public void setLog(java.io.Writer logWriter)
The method allows user to specify the output for the log message.
Parameters:
log - writer - 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(java.lang.ClassLoader classLoader)
Set the user classloader.

setPersistenceInfo

public void setPersistenceInfo(java.net.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(java.lang.String persistenceInfoPath)
                        throws java.net.MalformedURLException
Set an explicitly identified the location containing persistence.xml.
Parameters:
persistenceinfo - the path of the location containing persistence.xml, the path must point to the root of META-INF/persistence.xml
Throws:
java.net.MalformedURLException

getPersistenceXMLLocation

public java.lang.String getPersistenceXMLLocation()

setPersistenceXMLLocation

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

setPersistenceInfo

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

performWeaving

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

preProcess

private void preProcess()
                 throws java.net.URISyntaxException,
                        java.net.MalformedURLException
INTERNAL: This method perform all necessary steps(verification, pre-build the target directory) prior to the invocation of the weaving function.
Throws:
java.net.URISyntaxException
java.net.MalformedURLException

process

private void process()
              throws java.io.IOException,
                     java.net.URISyntaxException
INTERNAL: The method performs weaving function
Throws:
java.io.IOException
java.net.URISyntaxException

getDirectoryFromEntryName

public static java.lang.String getDirectoryFromEntryName(java.lang.String entryName)

isDirectory

private boolean isDirectory(java.net.URL url)
                     throws java.net.URISyntaxException
Determine whether or not the URL is pointing to directory.
Throws:
java.net.URISyntaxException

getURLs

private java.net.URL[] getURLs()
Generate URL array for specified source and persistenceinfo.

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.