Package org.apache.openjpa.meta
Class NonPersistentMetaData
- java.lang.Object
-
- org.apache.openjpa.meta.NonPersistentMetaData
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable,SourceTracker,Commentable,MetaDataContext
public class NonPersistentMetaData extends java.lang.Object implements java.lang.Comparable, SourceTracker, Commentable, MetaDataContext, java.io.Serializable
Metadata about a persistence-aware type.- Author:
- Pinaki Poddar
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intTYPE_NON_MAPPED_INTERFACEstatic intTYPE_PERSISTENCE_AWARE-
Fields inherited from interface org.apache.openjpa.lib.xml.Commentable
EMPTY_COMMENTS
-
Fields inherited from interface org.apache.openjpa.lib.meta.SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNonPersistentMetaData(java.lang.Class cls, MetaDataRepository repos, int type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object o)intgetColNumber()Return the column number in the line of the file at which this instance was parsed.java.lang.String[]getComments()Return comments, or empty array if none.java.lang.ClassgetDescribedType()Persistence-aware type.intgetLineNumber()Return the line number of the file at which this instance was parsed.intgetListingIndex()The index in which this class was listed in the metadata.MetaDataRepositorygetRepository()Owning repository.java.lang.StringgetResourceName()Return the domain-meaningful name of the resource that was loaded from this source.java.io.FilegetSourceFile()Return the file from which this instance was parsed.java.lang.ObjectgetSourceScope()Return the domain-dependent scope of this instance within its file.intgetSourceType()Return the type of source.intgetType()The type of metadata.voidsetColNumber(int colNum)voidsetComments(java.lang.String[] comments)Set comments.voidsetLineNumber(int lineNum)voidsetListingIndex(int index)The index in which this field was listed in the metadata.voidsetSource(java.io.File file, int srcType)
-
-
-
Field Detail
-
TYPE_PERSISTENCE_AWARE
public static final int TYPE_PERSISTENCE_AWARE
- See Also:
- Constant Field Values
-
TYPE_NON_MAPPED_INTERFACE
public static final int TYPE_NON_MAPPED_INTERFACE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NonPersistentMetaData
protected NonPersistentMetaData(java.lang.Class cls, MetaDataRepository repos, int type)
-
-
Method Detail
-
getRepository
public MetaDataRepository getRepository()
Owning repository.- Specified by:
getRepositoryin interfaceMetaDataContext
-
getDescribedType
public java.lang.Class getDescribedType()
Persistence-aware type.
-
getType
public int getType()
The type of metadata.
-
getListingIndex
public int getListingIndex()
The index in which this class was listed in the metadata. Defaults to-1if this class was not listed in the metadata.
-
setListingIndex
public void setListingIndex(int index)
The index in which this field was listed in the metadata. Defaults to-1if this class was not listed in the metadata.
-
getSourceFile
public java.io.File getSourceFile()
Description copied from interface:SourceTrackerReturn the file from which this instance was parsed.- Specified by:
getSourceFilein interfaceSourceTracker
-
getSourceScope
public java.lang.Object getSourceScope()
Description copied from interface:SourceTrackerReturn the domain-dependent scope of this instance within its file.- Specified by:
getSourceScopein interfaceSourceTracker
-
getSourceType
public int getSourceType()
Description copied from interface:SourceTrackerReturn the type of source.- Specified by:
getSourceTypein interfaceSourceTracker
-
setSource
public void setSource(java.io.File file, int srcType)
-
getLineNumber
public int getLineNumber()
Description copied from interface:SourceTrackerReturn the line number of the file at which this instance was parsed.- Specified by:
getLineNumberin interfaceSourceTracker
-
setLineNumber
public void setLineNumber(int lineNum)
-
getColNumber
public int getColNumber()
Description copied from interface:SourceTrackerReturn the column number in the line of the file at which this instance was parsed.- Specified by:
getColNumberin interfaceSourceTracker
-
setColNumber
public void setColNumber(int colNum)
-
getResourceName
public java.lang.String getResourceName()
Description copied from interface:SourceTrackerReturn the domain-meaningful name of the resource that was loaded from this source. I.e., if we had loaded the source for a Java class, this would return the name of the class.- Specified by:
getResourceNamein interfaceSourceTracker
-
getComments
public java.lang.String[] getComments()
Description copied from interface:CommentableReturn comments, or empty array if none.- Specified by:
getCommentsin interfaceCommentable
-
setComments
public void setComments(java.lang.String[] comments)
Description copied from interface:CommentableSet comments.- Specified by:
setCommentsin interfaceCommentable
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareToin interfacejava.lang.Comparable
-
-