|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.connectivity.oda.design.util.DesignUtil
public class DesignUtil
An utility class to handle the ODA Design API objects.
Method Summary | |
---|---|
static java.lang.String |
addDefaultToResourceAttribute(java.lang.String newDefault,
java.lang.String attributeValue)
Adds or replaces the default resource string in the specified design attribute value. |
static java.lang.String |
addKeyToResourceAttribute(java.lang.String newKey,
java.lang.String attributeValue)
Adds or replaces the resource key in the specified design attribute value. |
static java.util.Properties |
convertDataSourceProperties(DataSourceDesign dataSourceDesign)
Converts the public and private properties defined in an ODA data source design definition, and returns in a combined java.util.Properties collection. |
static java.util.Properties |
convertDesignProperties(Properties designProps)
Converts the given design properties defined in an ODA data source or data set design definition, to a java.util.Properties collection. |
static java.lang.String |
convertFileToPath(java.io.File aFile)
Converts the specified file to a string representation that can be persisted in an oda design model. |
static java.lang.String |
convertFileToResourcePath(java.io.File aFile,
ResourceIdentifiers designResourceIds,
boolean convertToRelativePath)
Converts the specified file to a string representation that can be persisted in an oda design model. |
static java.io.File |
convertPathToFile(java.lang.String filePath)
Converts the specified string representation of a file pathname, persisted in an oda design model, to its abstract representation. |
static java.io.File |
convertPathToResourceFile(java.lang.String filePath,
ResourceIdentifiers designResourceIds)
Converts the specified string representation of a file pathname, persisted in an oda design model, to its abstract absolute representation. |
static Properties |
convertToDesignProperties(java.util.Properties utilProps)
Converts the given java.util.Properties collection to ODA design properties that can be applied in an ODA data source or data set design definition. |
static ExpressionVariable |
createFilterVariable(ResultSetColumns columns,
int columnIndex)
Creates a new filter expression variable for the column defined in the specified result set at the specified index. |
static SortKey |
createSortKeyWithColumnIdentifier(ResultSetColumns columns,
int columnIndex)
Creates a new SortKey with the identifier, i.e. |
static org.eclipse.emf.common.util.Diagnostic |
diagnoseObject(org.eclipse.emf.ecore.EObject eObject)
Diagnoses the given EMF object, and returns the diagnostic result found. |
static java.lang.String |
getDefaultResourceString(java.lang.String attributeValue)
Returns the default resource string, if any, in the specified design attribute value. |
static java.lang.String |
getResourceKey(java.lang.String attributeValue)
Returns the resource key, if any, in the specified design attribute value. |
static OdaDesignSession |
loadOdaDesignSession(java.io.File resourceFile)
An utility method to load the specified resource file, and returns the OdaDesignSession instance found in the file. |
static OdaDesignSession |
loadOdaDesignSession(org.eclipse.emf.common.util.URI uri)
An utility method to load the specified resource URI, and returns the OdaDesignSession instance found in the resource. |
static java.lang.String |
resolveToApplResourcePath(java.lang.String filePath,
ResourceIdentifiers designResourceIds)
Returns the absolute path of the specified filePath based on the specified host application resource identifiers. |
static void |
saveOdaDesignSession(OdaDesignSession odaDesignSession,
java.io.File outputFile)
An utility method to save the specified OdaDesignSession instance in the specified output file. |
static void |
saveOdaDesignSession(OdaDesignSession odaDesignSession,
org.eclipse.emf.common.util.URI uri)
An utility method to save the specified OdaDesignSession instance in the specified URI. |
static void |
validateDataSourceDesign(DataSourceDesign dataSourceDesign)
Validates the specified data source design instance. |
static void |
validateObject(org.eclipse.emf.ecore.EObject eObject)
Validates the given EMF object is valid and has all required elements. |
static java.lang.String |
validateRequestSession(DesignSessionRequest requestSession)
Validates the specified design session request. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void validateObject(org.eclipse.emf.ecore.EObject eObject) throws java.lang.IllegalStateException
eObject
- an EMF object
java.lang.IllegalStateException
- if the given object is not valid
and have error diagnostics;
the exception thrown includes all error and warning
diagnostic messages found in given objectpublic static org.eclipse.emf.common.util.Diagnostic diagnoseObject(org.eclipse.emf.ecore.EObject eObject)
eObject
- an EMF object
public static java.util.Properties convertDataSourceProperties(DataSourceDesign dataSourceDesign)
dataSourceDesign
-
public static java.util.Properties convertDesignProperties(Properties designProps)
designProps
- the ODA design properties to convert from
public static Properties convertToDesignProperties(java.util.Properties utilProps)
utilProps
- the java.util.Properties collection to convert from
public static java.lang.String validateRequestSession(DesignSessionRequest requestSession) throws java.lang.IllegalStateException
requestSession
-
java.lang.IllegalStateException
- if specified session request is invalidpublic static void validateDataSourceDesign(DataSourceDesign dataSourceDesign) throws java.lang.IllegalStateException
dataSourceDesign
-
java.lang.IllegalStateException
- if specified design is invalidpublic static java.io.File convertPathToFile(java.lang.String filePath)
filePath
- the string representation of a file
convertPathToResourceFile(String, ResourceIdentifiers)
,
convertFileToPath(File)
public static java.io.File convertPathToResourceFile(java.lang.String filePath, ResourceIdentifiers designResourceIds)
filePath
- the string representation of a file,
may be an absolute file path, or relative path based on the specified designResourceIdsdesignResourceIds
- a design resource identifier instance
defined by the host application
public static java.lang.String convertFileToPath(java.io.File aFile)
aFile
- the abstract representation of a file pathname
convertFileToResourcePath(File, ResourceIdentifiers, boolean)
,
convertPathToFile(String)
public static java.lang.String convertFileToResourcePath(java.io.File aFile, ResourceIdentifiers designResourceIds, boolean convertToRelativePath)
aFile
- the abstract representation of an absolute file pathnamedesignResourceIds
- a design resource identifier instance
defined by the host applicationconvertToRelativePath
- true indicates whether to convert the specified file
to a relative path based on the host-defined design resource;
false to convert to the absolute path of the specified file
public static java.lang.String resolveToApplResourcePath(java.lang.String filePath, ResourceIdentifiers designResourceIds)
filePath
- the path to resolve; may be a relative or absolute pathdesignResourceIds
- a design resource identifier instance
defined by the host application
public static void saveOdaDesignSession(OdaDesignSession odaDesignSession, java.io.File outputFile) throws java.io.IOException, java.lang.IllegalArgumentException
outputFile
- an output file; any existing content would get overwrittenodaDesignSession
- the design session instance to save
java.io.IOException
java.lang.IllegalArgumentException
public static void saveOdaDesignSession(OdaDesignSession odaDesignSession, org.eclipse.emf.common.util.URI uri) throws java.io.IOException
uri
- the URI of the saved resourceodaDesignSession
- the design session instance to save
java.io.IOException
public static OdaDesignSession loadOdaDesignSession(java.io.File resourceFile) throws java.io.IOException, java.lang.IllegalArgumentException
resourceFile
- a resource file to load from
java.io.IOException
java.lang.IllegalArgumentException
public static OdaDesignSession loadOdaDesignSession(org.eclipse.emf.common.util.URI uri) throws java.io.IOException
uri
- the URI of the resource to load from
java.io.IOException
public static ExpressionVariable createFilterVariable(ResultSetColumns columns, int columnIndex)
columns
- a ResultSetColumns
that contains a collection of column definitionscolumnIndex
- 0-based index of column in the specified columns;
must be a valid index within range of the specified columns
ExpressionVariable
based on the attributes
of the specified column; may be null if specified column does not existpublic static SortKey createSortKeyWithColumnIdentifier(ResultSetColumns columns, int columnIndex)
columns
- a ResultSetColumns
that contains a collection of column definitionscolumnIndex
- 0-based index of column in the specified columns;
must be a valid index within range of the specified columns
SortKey
based on the name and position
of the specified column; may be null if specified column does not existpublic static java.lang.String getResourceKey(java.lang.String attributeValue)
attributeValue
- the persisted value of a localizable attribute
that may contain a resource key and a default resource string
public static java.lang.String addKeyToResourceAttribute(java.lang.String newKey, java.lang.String attributeValue)
newKey
- the resource key to add or replace in the specified attributeValue;
the key must not contain any embedded white spaceattributeValue
- the current persisted value of a localizable attribute
that may contain a resource key and a default string
public static java.lang.String getDefaultResourceString(java.lang.String attributeValue)
attributeValue
- the persisted value of a localizable attribute
that may contain a resource key and a default resource string
public static java.lang.String addDefaultToResourceAttribute(java.lang.String newDefault, java.lang.String attributeValue)
newDefault
- the new default resource string to add or replace in the specified attributeValueattributeValue
- the current persisted value of a localizable attribute
that may contain a resource key and a default string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |