org.jpox.metadata
Class FileMetaData

java.lang.Object
  extended byorg.jpox.metadata.MetaData
      extended byorg.jpox.metadata.ExtendableMetaData
          extended byorg.jpox.metadata.FileMetaData
All Implemented Interfaces:
java.io.Serializable

public class FileMetaData
extends ExtendableMetaData

Representation of a Meta-Data file. Contains a list of package meta-data.

MetaData Element

The MetaData Element represented here is as follows
 
 
 
 

Since:
1.1
Version:
$Revision: 1.13 $
See Also:
Serialized Form

Field Summary
protected  java.lang.String catalog
          Catalog name for all classes in this file
protected  java.lang.String filename
          Name of file
static int JDO_FILE
          jdo file
static int JDOQUERY_FILE
          jdoquery file
protected  MetaDataManager metaDataManager
          Manager for this MetaData object.
static int ORM_FILE
          orm file
protected  java.util.List packages
          list of packages
protected  java.util.List queries
          List of named queries
protected  java.lang.String schema
          Schema name for all classes in this file
protected  int type
          Type of file (JDO, ORM, JDOQUERY, etc)
 
Fields inherited from class org.jpox.metadata.ExtendableMetaData
extensions, JPOX_VENDOR_NAME
 
Fields inherited from class org.jpox.metadata.MetaData
LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent
 
Constructor Summary
FileMetaData(java.lang.String filename, MetaDataManager metaDataManager, java.lang.String catalog, java.lang.String schema)
          Constructor.
 
Method Summary
 void addPackage(PackageMetaData pkg)
          Method to add a package
 void addQuery(QueryMetaData qmd)
          Method to add a named query to this class.
 java.lang.String getCatalog()
          Accessor for the catalog name for all classes in this file
 ClassMetaData getClass(java.lang.String pkg_name, java.lang.String class_name)
          Utility method to check if the MetaData for a class is contained in this file.
 java.lang.String getFilename()
          Accessor for the filename
 MetaDataManager getMetaDataManager()
          Accessor for the MetaDataManager for this file.
 int getNoOfPackages()
          Accessor for the number of packages.
 int getNoOfQueries()
          Accessor for the number of named queries.
 PackageMetaData getPackage(int i)
          Accessor for the meta-data of a package.
 PackageMetaData getPackage(java.lang.String name)
          Accessor for the Meta-Data of a package with a given name.
 QueryMetaData getQuery(int index)
          Accessor for the metadata of a named query.
 java.lang.String getSchema()
          Accessor for the schema name for all classes in this file
 int getType()
          Accessor for the file type (JDO, ORM, etc)
 void mergeORMData(FileMetaData filemd)
          Method to merge in the associated metadata from the ORM definition
 void setCatalog(java.lang.String catalog)
          Mutator for the catalog for all classes in this file
 void setFilename(java.lang.String filename)
          Mutator for the filename for this MetaData file.
 void setSchema(java.lang.String schema)
          Mutator for the schema for all classes in this file
 void setType(int type)
          Mutator for the file type.
 java.lang.String toString()
          Returns a string representation of the object.
 java.lang.String toString(java.lang.String indent)
          Returns a string representation of the object.
 
Methods inherited from class org.jpox.metadata.ExtendableMetaData
addExtension, addExtension, getExtension, getExtensions, getNoOfExtensions, getValueForExtension, getValuesForExtension, getValuesForExtensionStartingWith, hasExtension, removeExtension, toString
 
Methods inherited from class org.jpox.metadata.MetaData
getParent, initialise, isCreated, isInitialised, isPopulated, isUsed, populate, setInitialised, setPopulated, setUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JDO_FILE

public static final int JDO_FILE
jdo file

See Also:
Constant Field Values

ORM_FILE

public static final int ORM_FILE
orm file

See Also:
Constant Field Values

JDOQUERY_FILE

public static final int JDOQUERY_FILE
jdoquery file

See Also:
Constant Field Values

metaDataManager

protected final transient MetaDataManager metaDataManager
Manager for this MetaData object.


type

protected int type
Type of file (JDO, ORM, JDOQUERY, etc)


filename

protected java.lang.String filename
Name of file


catalog

protected java.lang.String catalog
Catalog name for all classes in this file


schema

protected java.lang.String schema
Schema name for all classes in this file


queries

protected java.util.List queries
List of named queries


packages

protected java.util.List packages
list of packages

Constructor Detail

FileMetaData

public FileMetaData(java.lang.String filename,
                    MetaDataManager metaDataManager,
                    java.lang.String catalog,
                    java.lang.String schema)
Constructor.

Parameters:
filename - The file where this is stored (or null).
metaDataManager - the manager for this MetaData object.
catalog - Name of the catalog for all classes in this file
schema - Name of the schema for all classes in this file
Method Detail

mergeORMData

public void mergeORMData(FileMetaData filemd)
Method to merge in the associated metadata from the ORM definition

Parameters:
filemd - The FileMetaData definition

getType

public int getType()
Accessor for the file type (JDO, ORM, etc)

Returns:
The file type

getNoOfQueries

public int getNoOfQueries()
Accessor for the number of named queries.

Returns:
no of named queries

getQuery

public QueryMetaData getQuery(int index)
Accessor for the metadata of a named query.

Parameters:
index - query index
Returns:
Meta-Data for the named query.

getMetaDataManager

public MetaDataManager getMetaDataManager()
Accessor for the MetaDataManager for this file.

Returns:
The MetaDataManager for this file.

getFilename

public java.lang.String getFilename()
Accessor for the filename

Returns:
The filename of this MetaData file.

getCatalog

public java.lang.String getCatalog()
Accessor for the catalog name for all classes in this file

Returns:
Name of the catalog to use.

getSchema

public java.lang.String getSchema()
Accessor for the schema name for all classes in this file

Returns:
Name of the schema to use

getNoOfPackages

public int getNoOfPackages()
Accessor for the number of packages.

Returns:
no of packages.

getPackage

public PackageMetaData getPackage(int i)
Accessor for the meta-data of a package.

Parameters:
i - index number
Returns:
Meta-Data for a package.

getPackage

public PackageMetaData getPackage(java.lang.String name)
Accessor for the Meta-Data of a package with a given name.

Parameters:
name - Name of the package
Returns:
Meta-Data for the package

getClass

public ClassMetaData getClass(java.lang.String pkg_name,
                              java.lang.String class_name)
Utility method to check if the MetaData for a class is contained in this file.

Parameters:
pkg_name - Name of package
class_name - Name of class
Returns:
The MetaData for the class

setType

public void setType(int type)
Mutator for the file type.

Parameters:
type - The file type

addQuery

public void addQuery(QueryMetaData qmd)
Method to add a named query to this class. Rejects the addition of duplicate named queries.

Parameters:
qmd - Meta-Data for the query.

setFilename

public void setFilename(java.lang.String filename)
Mutator for the filename for this MetaData file.

Parameters:
filename - The filename of this MetaData file.

setCatalog

public void setCatalog(java.lang.String catalog)
Mutator for the catalog for all classes in this file

Parameters:
catalog - Catalog name to use

setSchema

public void setSchema(java.lang.String schema)
Mutator for the schema for all classes in this file

Parameters:
schema - Schema name to use

addPackage

public void addPackage(PackageMetaData pkg)
Method to add a package

Parameters:
pkg - The PackageMetaData to add.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class ExtendableMetaData
Returns:
a string representation of the object.

toString

public java.lang.String toString(java.lang.String indent)
Returns a string representation of the object.

Parameters:
indent - The indent
Returns:
a string representation of the object.


Copyright © -2007 . All Rights Reserved.