Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.objectstyle.cayenne.wocompat
Class EOModelHelper  view EOModelHelper download EOModelHelper.java

java.lang.Object
  extended byorg.objectstyle.cayenne.wocompat.EOModelHelper

public class EOModelHelper
extends java.lang.Object

Helper class used by EOModelProcessor. During creation, it loads EOModel from the specified location and parses EOModel files storing them internally as maps. EOModelProcessor will use this information to create DataMap instance.


Field Summary
protected  org.objectstyle.cayenne.map.DataMap dataMap
           
protected  java.util.Map entityClassIndex
           
protected  java.util.Map entityIndex
           
private static org.objectstyle.cayenne.util.ResourceLocator locator
           
protected  java.net.URL modelUrl
           
private  org.objectstyle.cayenne.wocompat.parser.Parser plistParser
           
private  java.util.Map prototypeValues
           
 
Constructor Summary
EOModelHelper(java.lang.String path)
          Creates helper instance and tries to locate EOModel and load index file.
 
Method Summary
 java.lang.String entityClass(java.lang.String entityName)
          Returns an info map for the entity called entityName.
 java.util.Map entityInfo(java.lang.String entityName)
          Returns an info map for the entity called entityName.
protected  java.lang.String findModelName(java.lang.String path)
          Returns EOModel name based on its path.
protected  java.net.URL findModelUrl(java.lang.String path)
          Returns a URL of the EOModel directory.
 org.objectstyle.cayenne.map.DataMap getDataMap()
          Returns a DataMap associated with this helper.
 java.net.URL getModelUrl()
          Returns EOModel location as URL.
 java.util.Map getPrototypeAttributeMapFor(java.lang.String aPrototypeAttributeName)
           
 java.lang.String javaTypeForEOModelerType(java.lang.String type)
          Performs Objective C data types conversion to Java types.
protected  java.util.Map loadEntityIndex(java.lang.String entityName)
          Loads EOEntity information and returns it as a map.
protected  java.util.Map loadModelIndex()
          Loads EOModel index and returns it as a map.
 java.util.Iterator modelNames()
          Returns an iterator of model names.
protected  java.io.InputStream openEntityStream(java.lang.String entityName)
          Returns InputStream to read an EOEntity plist file.
protected  java.io.InputStream openIndexStream()
          Returns InputStream to read an EOModel index file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locator

private static final org.objectstyle.cayenne.util.ResourceLocator locator

plistParser

private org.objectstyle.cayenne.wocompat.parser.Parser plistParser

modelUrl

protected java.net.URL modelUrl

entityIndex

protected java.util.Map entityIndex

entityClassIndex

protected java.util.Map entityClassIndex

dataMap

protected org.objectstyle.cayenne.map.DataMap dataMap

prototypeValues

private java.util.Map prototypeValues
Constructor Detail

EOModelHelper

public EOModelHelper(java.lang.String path)
              throws java.lang.Exception
Creates helper instance and tries to locate EOModel and load index file.

Method Detail

javaTypeForEOModelerType

public java.lang.String javaTypeForEOModelerType(java.lang.String type)
Performs Objective C data types conversion to Java types.


getDataMap

public org.objectstyle.cayenne.map.DataMap getDataMap()
Returns a DataMap associated with this helper.


getModelUrl

public java.net.URL getModelUrl()
Returns EOModel location as URL.


modelNames

public java.util.Iterator modelNames()
Returns an iterator of model names.


getPrototypeAttributeMapFor

public java.util.Map getPrototypeAttributeMapFor(java.lang.String aPrototypeAttributeName)

entityInfo

public java.util.Map entityInfo(java.lang.String entityName)
Returns an info map for the entity called entityName.


entityClass

public java.lang.String entityClass(java.lang.String entityName)
Returns an info map for the entity called entityName.


loadModelIndex

protected java.util.Map loadModelIndex()
                                throws java.lang.Exception
Loads EOModel index and returns it as a map.


loadEntityIndex

protected java.util.Map loadEntityIndex(java.lang.String entityName)
                                 throws java.lang.Exception
Loads EOEntity information and returns it as a map.


findModelName

protected java.lang.String findModelName(java.lang.String path)
Returns EOModel name based on its path.


findModelUrl

protected java.net.URL findModelUrl(java.lang.String path)
Returns a URL of the EOModel directory. Throws exception if it can't be found.


openIndexStream

protected java.io.InputStream openIndexStream()
                                       throws java.lang.Exception
Returns InputStream to read an EOModel index file.


openEntityStream

protected java.io.InputStream openEntityStream(java.lang.String entityName)
                                        throws java.lang.Exception
Returns InputStream to read an EOEntity plist file.