com.sap.dictionary.runtime
Interface IBroker


public interface IBroker


Method Summary
 java.util.Iterator dictionaryIterator()
          Returns an iterator over the dictionaries in squence of insertion
 java.lang.ClassLoader getClassLoader()
          Returns the broker's classLoader
 IDataType getDataType(java.lang.String name)
          Returns a dataType with the given type name whereas name contains of package and typeName.
 IDataType getDataType(java.lang.String dictionaryName, java.lang.String name)
          Returns a dataType with the given dictionaryName and type name.
 com.sap.dictionary.runtime.DdDictionary getDictionary(java.lang.String dictionaryName)
          Gets a DataDictionary as IDictionary out of the cache
 java.util.Locale getLocale()
          Returns the TypeBroker's locale
 ISimpleType getPredefinedSimpleType(java.lang.Class attributeClass)
           
 ISimpleType getSimpleType(java.lang.String dictionaryName, java.lang.String name)
          Returns a simpleType with the given given dictionaryName and SimpleType name.
 IStructure getStructure(java.lang.String dictionaryName, java.lang.String name)
          Returns a structure with the given dictionary name and structure name.
 IUnitService getUnitService(IField amountField)
          Returns a unit service for the given amount field.
 IUnitService getUnitService(IField amountField, boolean normalizingForced)
          Returns a unit service for the given amount field.
 boolean invalidateCache(java.lang.String dictionaryName)
          Invalidates the cache for the dictionary with the given name.
 void putDictionary(java.lang.String dictionaryName, IDataProvider provider)
          Introduce a new-dictionary to this TypeBroker
 void putJavaDictionary(java.lang.ClassLoader classLoader)
          Introduce a java-dictionary to this TypeBroker
 com.sap.dictionary.runtime.DdDictionary removeDictionary(java.lang.String dictionaryName)
          Removes a dictionary from the TypeBroker
 

Method Detail

putJavaDictionary

public void putJavaDictionary(java.lang.ClassLoader classLoader)
Introduce a java-dictionary to this TypeBroker
Parameters:
classLoader - - the class loader to get the java-types

putDictionary

public void putDictionary(java.lang.String dictionaryName,
                          IDataProvider provider)
Introduce a new-dictionary to this TypeBroker
Parameters:
dictionaryName - - the name to identify this dictionary
provider - - the provider-instance for backend-access

getDictionary

public com.sap.dictionary.runtime.DdDictionary getDictionary(java.lang.String dictionaryName)
Gets a DataDictionary as IDictionary out of the cache
Parameters:
dictionaryName - - logical Name of this dictionary instance
Returns:
A DataDictionary instance

getClassLoader

public java.lang.ClassLoader getClassLoader()
Returns the broker's classLoader
Returns:
A ClassLoader instance

removeDictionary

public com.sap.dictionary.runtime.DdDictionary removeDictionary(java.lang.String dictionaryName)
Removes a dictionary from the TypeBroker
Parameters:
dictionaryName - - a DataDictionary name
Returns:
true - if deleting the dictionary instance was successful, false otherwise

dictionaryIterator

public java.util.Iterator dictionaryIterator()
Returns an iterator over the dictionaries in squence of insertion
Returns:
an Iterator

invalidateCache

public boolean invalidateCache(java.lang.String dictionaryName)
Invalidates the cache for the dictionary with the given name. The dictionary remains known to the TypeBroker.
Parameters:
dictionaryName - - the logical name of the dictionary
Returns:
true - if invalidating the cache was possible, false otherwise

getDataType

public IDataType getDataType(java.lang.String dictionaryName,
                             java.lang.String name)
                      throws com.sap.dictionary.runtime.DdException
Returns a dataType with the given dictionaryName and type name. This can be an ISimpleType or an IStructure. The name is built of the name of the logical dictionary which contains this type and the package name: dictionaryName:packageName
Parameters:
dictionaryName - the name of the locical dictionary
name - - the type's name, includes package if necessary
Returns:
a dataType
Throws:
com.sap.dictionary.runtime.DdException - - if dataType with given name not found

getDataType

public IDataType getDataType(java.lang.String name)
                      throws com.sap.dictionary.runtime.DdException
Returns a dataType with the given type name whereas name contains of package and typeName. This can be an ISimpleType or an IStructure.
Parameters:
name - - the type's name, includes package
Returns:
a dataType
Throws:
com.sap.dictionary.runtime.DdException - - if dataType with given name not found

getSimpleType

public ISimpleType getSimpleType(java.lang.String dictionaryName,
                                 java.lang.String name)
                          throws com.sap.dictionary.runtime.DdException
Returns a simpleType with the given given dictionaryName and SimpleType name.
Parameters:
dictionaryName - the name of the loccal dictionary
name - - the type's name, includes package if necessary
Returns:
a simpleType
Throws:
com.sap.dictionary.runtime.DdException - - if SimpleType with given name not found

getStructure

public IStructure getStructure(java.lang.String dictionaryName,
                               java.lang.String name)
                        throws com.sap.dictionary.runtime.DdException
Returns a structure with the given dictionary name and structure name.
Parameters:
dictionaryName - the name of the loccal dictionary
name - - the type's name, includes package if necessary
Returns:
a structure
Throws:
com.sap.dictionary.runtime.DdException - - if Structure with given name not found

getUnitService

public IUnitService getUnitService(IField amountField)
                            throws com.sap.dictionary.runtime.DdException
Returns a unit service for the given amount field. In case no reference- field exists a DdException is thrown. Normalization and denormalization in case of R/3 backend is never done.
Parameters:
amountField - - the reference field
Returns:
a unit Service, as instance of DdCurrencyService or DdQuantityService
Throws:
com.sap.dictionary.runtime.DdException - - if unit Service could not be instantiated

getUnitService

public IUnitService getUnitService(IField amountField,
                                   boolean normalizingForced)
                            throws com.sap.dictionary.runtime.DdException
Returns a unit service for the given amount field. In case no reference- field exists a DdException is thrown.
Parameters:
amountField - - the reference field
normalizingForced - - true means the currency-values are always normalized during parse and denormalized during formatting, false means that the type controls wether normalization is done or not. Then in case of R/3 backend de/normalization will never be done
Returns:
a unit Service, as instance of DdCurrencyService or DdQuantityService
Throws:
com.sap.dictionary.runtime.DdException - - if unit Service could not be instantiated

getLocale

public java.util.Locale getLocale()
Returns the TypeBroker's locale
Returns:
the locale

getPredefinedSimpleType

public ISimpleType getPredefinedSimpleType(java.lang.Class attributeClass)


Copyright © 2005 SAP AG. All Rights Reserved.