org.apache.cayenne.wocompat
Class EOModelHelper

java.lang.Object
  extended by org.apache.cayenne.wocompat.EOModelHelper

public class EOModelHelper
extends java.lang.Object

Helper class used by EOModelProcessor. EOModelHelper loads an EOModel from the specified location and gives its users access to the untyped EOModel information.


Field Summary
protected  DataMap dataMap
           
protected  java.util.Map entityClassIndex
           
protected  java.util.Map entityClientClassIndex
           
protected  java.util.Map entityIndex
           
protected  java.util.Map entityQueryIndex
           
protected  java.net.URL modelUrl
           
 
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, boolean getClientClass)
           
 java.util.Map entityPListMap(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.
 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 valueClassName, java.lang.String valueType)
          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.
protected  java.util.Map loadQueryIndex(java.lang.String entityName)
          Loads EOFetchSpecification information and returns it as a map.
 java.util.Iterator modelNames()
          Returns an iterator of model names.
 java.util.List modelNamesAsList()
          Returns a list of model entity names.
protected  java.lang.Class numericAttributeClass(java.lang.String valueType)
           
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.
protected  java.io.InputStream openQueryStream(java.lang.String entityName)
          Returns InputStream to read an EOFetchSpecification plist file.
 java.util.Iterator queryNames(java.lang.String entityName)
          Returns the iterator over EOFetchSpecification names for a given entity.
 java.util.Map queryPListMap(java.lang.String entityName, java.lang.String queryName)
          Returns a map containing EOFetchSpecification information for entity name and query name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelUrl

protected java.net.URL modelUrl

entityIndex

protected java.util.Map entityIndex

entityClassIndex

protected java.util.Map entityClassIndex

entityQueryIndex

protected java.util.Map entityQueryIndex

entityClientClassIndex

protected java.util.Map entityClientClassIndex

dataMap

protected DataMap dataMap
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.

Throws:
java.lang.Exception
Method Detail

javaTypeForEOModelerType

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

Returns:
String representation for Java type corresponding to String representation of Objective C type.
Since:
1.1

numericAttributeClass

protected java.lang.Class numericAttributeClass(java.lang.String valueType)
Since:
1.1

getDataMap

public 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.


modelNamesAsList

public java.util.List modelNamesAsList()
Returns a list of model entity names.

Since:
1.1

getPrototypeAttributeMapFor

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

entityPListMap

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


queryNames

public java.util.Iterator queryNames(java.lang.String entityName)
Returns the iterator over EOFetchSpecification names for a given entity.

Since:
1.1

queryPListMap

public java.util.Map queryPListMap(java.lang.String entityName,
                                   java.lang.String queryName)
Returns a map containing EOFetchSpecification information for entity name and query name. Returns null if no such query is found.

Since:
1.1

entityClass

public java.lang.String entityClass(java.lang.String entityName,
                                    boolean getClientClass)

loadModelIndex

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

Throws:
java.lang.Exception

loadEntityIndex

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

Throws:
java.lang.Exception

loadQueryIndex

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

Throws:
java.lang.Exception

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.

Throws:
java.lang.Exception

openEntityStream

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

Parameters:
entityName - name of EOEntity to be loaded.
Returns:
InputStream to read an EOEntity plist file or null if entityname.plist file can not be located.
Throws:
java.lang.Exception

openQueryStream

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

Parameters:
entityName - name of EOEntity to be loaded.
Returns:
InputStream to read an EOEntity plist file or null if entityname.plist file can not be located.
Throws:
java.lang.Exception


Copyright © 2001-2006 Apache.org All Rights Reserved.