public class CcUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_NAME_ARRAY_PREFIX |
static java.lang.String |
CLASS_NAME_ARRAY_SUFFIX |
static java.util.List |
LOGICAL_ELEMENTS_LIST |
static java.util.List |
NOT_REQUIRED_QUOTED_RESOURCES |
| Constructor and Description |
|---|
CcUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.jdom.Element |
addChild(org.jdom.Element aParent,
java.lang.String aName) |
static org.jdom.Element |
addChild(org.jdom.Element aParent,
java.lang.String aName,
java.lang.String aValue) |
static org.jdom.Element |
addChild(org.jdom.Element aParent,
java.lang.String aNodeName,
java.lang.String aAttributeName,
java.lang.String aAttributeValue) |
static int |
calculateOverlap(int aiBeginOne,
int aiEndOne,
int aiBeginTwo,
int aiEndTwo)
Calculate the overlap between two ranges of values.
|
static java.lang.String |
capitalize(java.lang.String astrString)
Trim and capitalize a string (i.e., make the first character uppercase).
|
static org.eclipse.emf.ecore.EObject |
cloneEObject(org.eclipse.emf.ecore.EObject aEObject,
boolean abUnresolve)
Create a deep clone of the specified EMF object.
|
static boolean |
containsAllowableCharacters(java.lang.String astrString,
java.lang.String astrCharactersAllowable)
Determine whether the specified string contains allowable characters
|
static boolean |
containsBlanks(java.lang.String astrString)
Determine whether the specified string contains any blanks.
|
static java.lang.String |
convertEscapeToSpace(java.lang.String astrInput)
Convert Java escape characters such as carriage return and line feed
to spaces.
|
static java.lang.String |
convertFileURIToFilePath(java.lang.String lstrResult)
Convert file URI to file path, e.g.
|
static java.lang.String |
convertPathToRelative(java.lang.String astrPathInput)
Convert the specified absolute path to Eclipse workspace-relative.
|
static java.lang.String |
convertPlatformURIToFilePath(java.lang.String astrURI)
Convert platform URI to file path, e.g.
|
static java.lang.String |
convertValueSetToString(java.lang.Object aObject)
Convert a ValueSet instance to a string in set notation.
|
static ValueSet |
createValueSetFromString(java.lang.String astrInput)
Create a new instance of ValueSet from a string in set notation.
|
static void |
debugStackTrace()
Handy method to generate a stack trace.
|
static java.lang.String |
decapitalize(java.lang.String astrString)
Trim and decapitalize a string (i.e., make the first character lowercase).
|
static java.lang.String |
determineCommonRoot(java.util.List<java.lang.String> alstFilePaths) |
static java.lang.String |
escapeUnicodeString(java.lang.String astrInput,
boolean abEscapeAscii)
Given a Unicode string, display the hexadecimal Unicode values.
|
static java.lang.String |
exceptionToString(java.lang.Throwable aThrowable)
Convert an exception or error stack trace to string form.
|
static boolean |
exists(org.eclipse.emf.ecore.EObject aEObject)
Does this EObject exist with given URI?
|
static boolean |
exists(org.eclipse.emf.common.util.URI aURI)
Does object pointed to by the URI exist?
|
static org.eclipse.core.resources.IResource |
findResource(org.eclipse.emf.ecore.EObject aEObject)
Retrieve the Eclipse platform Resource (IResource) corresponding to the specified EMF
object.
|
static org.eclipse.core.resources.IResource |
findResource(org.eclipse.emf.common.util.URI aURI)
Find resource in workspace given a URI.
|
static java.lang.String |
formatCustomDataType(java.lang.String astrCustomDataTypeName,
java.lang.String astrEnumerationLabel)
Format and return a custom data type reference given a name and enumeration
label
|
static java.lang.String |
formatValueSetString(java.lang.String astrSet,
java.util.Locale aLocale,
boolean abAvoidQuotingKeywords)
Given a caller-supplied set in standard notation, add apostrophes (single quotes) if
necessary.
|
static java.lang.String |
fromDateToString(java.util.Date aDate) |
static java.lang.String |
generateHibernateUserFriendlyExceptionMessage(java.lang.Throwable aThrowable) |
static java.lang.String |
getArrayClass(java.lang.String astrClassNameArray)
Returns the "real" class name of an array class without the array prefix and suffix.
|
static java.lang.String |
getBaseRuleID(java.lang.String astrRuleId,
java.util.Locale aLocale)
Given a localized Rule ID expressed in a particular locale, return
the corresponding base ID.
|
static boolean |
getBooleanFromProperties(java.lang.String astrPropertyName,
boolean abDefault)
Get the specified boolean property.
|
static java.lang.String |
getCustomDataTypeEnumerationLabel(java.lang.String astrCustomDataTypeReference)
Given a custom data type reference (e.g., "ShirtSize#Small"), return
the enumeration label portion (e.g., "Small").
|
static java.lang.String |
getCustomDataTypeName(java.lang.String astrCustomDataTypeReference)
Given a custom data type reference (e.g., "ShirtSize#Small"), return
the custom data type portion (e.g., "ShirtSize").
|
static java.lang.String |
getDatabaseCatalogName(java.lang.String astrFullyQualifiedTableName)
Given fully-qualified table name, return the catalog name.
|
static java.lang.String |
getDatabaseFullyQualifiedName(java.lang.String astrCatalog,
java.lang.String astrSchema,
java.lang.String astrTable)
Return a fully-qualified database table name given optional catalog, schema and table name.
|
static java.lang.String |
getDatabaseSchemaName(java.lang.String astrFullyQualifiedTableName)
Given fully-qualified table name, return the schema name.
|
static java.lang.String |
getDatabaseTableName(java.lang.String astrFullyQualifiedTableName)
Given fully-qualified table name, return the unqualified table name.
|
static int |
getDecimalPortion(java.lang.String astrColumnHeader)
Return decimal portion of a decimal number
|
static char |
getDecimalSeparator()
Get the decimal separator for the base locale (i.e., ENGLISH).
|
static char |
getDecimalSeparator(java.util.Locale aLocale)
Get the decimal separator for the specified locale.
|
static java.io.File |
getDirectoryPath(java.lang.String astrPath,
java.lang.String astrClassName)
Given the fully-qualified path of a class name PLUS the class name,
return the directory in which that class is located.
|
static java.lang.String |
getEclipsePlatformPath(java.lang.String astrPathEMF)
Convert the given EMF Resource path to an Eclipse Platform IResource
path.
|
static org.eclipse.emf.ecore.EObject |
getEContainer(java.lang.Class aClassContainer,
java.lang.Object aObjectContained)
Given an EMF object, traverse upwards through the containment hierarchy until an
instance of the specified type is found; if so, return the instance of that type.
|
static org.eclipse.emf.common.util.URI |
getEMFResourceURI(org.eclipse.emf.ecore.EObject aEObject)
Return the EMF URI of the supplied EObject instance, even if the
object is a proxy.
|
static java.lang.String |
getEMFVocabularyProxyName(org.eclipse.emf.ecore.ENamedElement aENamedElement)
Return the last node of the EMF Vocabulary proxy fragment from the supplied
ENamedElement instance.
|
static java.lang.String |
getEmptyAsNull(java.lang.Object aObjectInput)
If the specified input is
null or empty when trimmed, this method will return null. |
static java.lang.String |
getEmptyString(java.lang.Object aObjectInput)
If the specified input is
null, this method will return an empty string;
otherwise, simply return the string value of the input. |
static int |
getIntegerFromProperties(java.lang.String astrPropertyName,
int aiDefault)
Get the specified integer property.
|
static int |
getIntegerPortion(java.lang.String astrColumnHeader)
Return integer portion of a decimal number
|
static java.io.File |
getJarPath(java.lang.String astrPath)
Given the fully-qualified path of a Jar element, return a File instance
of the Jar in which that element is contained.
|
static java.util.List |
getListOfType(java.lang.Class aClass,
java.util.List aList)
Given a heterogenous list of objects, return a list of only those objects of the specified
type.
|
static java.lang.String |
getLocalizedRuleID(java.lang.String astrRuleId,
java.util.Locale aLocale)
Return a (possibly decimal) rule identifier localized in accord with the
specified locale.
|
static java.lang.String |
getLocationOfFile(java.lang.String astrResourceName,
java.lang.ClassLoader aClassLoader)
Return the fully-qualified path name of a particular resource name,
typically a java class name or a specialized "locator" name.
|
static java.lang.String |
getNameOnly(java.lang.String astrName)
Return only the prefix prior to the "_" (dropping the suffix and underscore).
|
static java.lang.Object |
getObjectInList(java.lang.Class aClass,
java.util.List aList)
Returns the first instance of aClass found in aList.
|
static org.eclipse.emf.ecore.EObject |
getProxyEquivalent(org.eclipse.emf.ecore.EObject aEObject) |
static java.lang.String |
getQuotedValue(java.lang.String astrString)
Return the quoted value contained within apostrophes.
|
static org.eclipse.emf.ecore.resource.Resource |
getResource(org.eclipse.emf.common.notify.Notification aNotification)
Given an EMF model notification, return the EMF resource that contains
the notifier.
|
static java.lang.String |
getServiceCalloutClassName(java.lang.String astrInput)
Return the Service Call-out class name from the specified string.
|
static java.lang.String |
getServiceCalloutName(java.lang.String astrClassName,
java.lang.String astrServiceName)
Return the Service Call-out class plus service name by concatenating
the input parameter values.
|
static java.lang.String |
getServiceCalloutServiceName(java.lang.String astrInput)
Return the Service Call-out service name from the specified string.
|
static char |
getSetDelimiter()
Get the set delimiter for the base locale (i.e., ENGLISH).
|
static char |
getSetDelimiter(java.util.Locale aLocale)
Get the set delimiter for the specified locale.
|
static java.lang.String |
getSqlTypeName(java.lang.String astrSqlTypeName)
Given an SQL type of the form \
|
static java.lang.String |
getStringOrNull(java.lang.Object aObject)
Return either the toString of the specified object or
null
if the object is null. |
static int |
getSuffixOnly(java.lang.String astrName)
Return only the numeric suffix after the "_" or zero if none found.
|
static java.lang.Object |
getValidDataValuePerDataType(java.lang.String astrDataType,
java.lang.String astrDataValue,
boolean abQuotes)
Method to check the data string value against the data type.
|
static java.util.List |
insertBlankItem(java.util.List aList)
Insert a blank item into the beginning of the specified list.
|
static boolean |
isClassInList(java.lang.Class aClass,
java.util.List aList)
Returns
true if at least one instance of class aClass can
be found in aList. |
static boolean |
isDecimalColumn(java.lang.String astrColumnHeader)
Determine whether this is a decimal or integer column header.
|
static boolean |
isEContainer(java.lang.Object aObjectContainer,
java.lang.Object aObjectContained)
Determine whether one EMF object is a container of another, directly or
indirectly.
|
static boolean |
isFirstCharNumber(java.lang.String astrName) |
static boolean |
isHeadless()
Are we running in headless mode
(as foundation API only, without Eclipse IDE and workspace)?
|
static boolean |
isIn(java.util.Vector avect,
int ai) |
static boolean |
isInteger(java.lang.String aString) |
static boolean |
isJavaReservedWord(java.lang.String astrName)
Check to see if the String matches a Java Reserved Word.
|
static boolean |
isLiteral(java.lang.String astrInput)
Determine whether the value is a string or date literal.
|
static boolean |
isMyNotification(IModelAPI aIModelAPI,
org.eclipse.emf.common.notify.Notification aNotification)
Given an API instance and a notification, return and indication of whether
the notification pertains to the primary resource of the API (i.e.,
whether the notification came from that resource as opposed to some
other resource.
|
static boolean |
isMyNotificationBatch(IModelAPI aIModelAPI,
NotificationBatch aNotificationBatch)
Given an API instance and a notification batch, return and indication of whether
the notification batch pertains to the primary resource of the API (i.e.,
whether the notification came from that resource as opposed to some
other resource.
|
static boolean |
isMyNotificationInBatch(IModelAPI aIModelAPI,
NotificationBatch aNotificationBatch)
Given an API instance and a notification batch, return and indication of whether
the notification batch contains any resource that pertains the primary resource of the API (i.e.,
whether the notification came from that resource as opposed to some
other resource.
|
static boolean |
isSame(java.lang.Object ao1,
java.lang.Object ao2)
Compare two objects and determine whether they are the equal.
|
static boolean |
isSame(java.lang.String astrValue1,
java.lang.String astrValue2,
java.lang.String astrDataType,
boolean abQuotedString) |
static boolean |
isSameEmptyIsNull(java.lang.String astrStringOne,
java.lang.String astrStringTwo)
Compare two strings and determine whether they are the equal, trimming the strings and treating empty string and null as equal.
|
static boolean |
isSameIgnoreCase(java.lang.String astrStringOne,
java.lang.String astrStringTwo)
Compare two strings and determine whether they are the equal, irrespective of case.
|
static boolean |
isSet(org.eclipse.emf.ecore.EObject aEObject,
org.eclipse.emf.ecore.EStructuralFeature aEStructuralFeature)
Determine whether the specified EMF object has an instance of the specified
feature.
|
static boolean |
isValid(java.lang.String astr) |
static boolean |
isValidAlias(java.lang.String astrName)
Determine whether the specified alias is valid.
|
static boolean |
isValidAssociationName(java.lang.String astrName)
Determine whether the specified association name is valid.
|
static boolean |
isValidAttributeName(java.lang.String astrName)
Determine whether the specified attribute name is valid.
|
static boolean |
isValidCustomDataTypeName(java.lang.String astrName)
Determine whether the specified custom data type name is valid.
|
static boolean |
isValidDatabaseColumnName(java.lang.String astrColumnName)
Determine whether the specified database column name is valid.
|
static boolean |
isValidDatabaseTableName(java.lang.String astrTableName)
Determine whether the specified database table name is valid.
|
static boolean |
isValidDataValuePerDataType(java.lang.String astrDataType,
java.lang.String astrDataValue,
boolean abQuotes)
Method to check the data string value against the data type.
|
static boolean |
isValidDomainName(java.lang.String astrName)
Determine whether the specified domain name is valid.
|
static boolean |
isValidEntityName(java.lang.String astrName)
Determine whether the specified entity name is valid.
|
static boolean |
isValidEnumerationLabel(java.lang.String astrName)
Determine whether the specified enumeration label name is valid.
|
static boolean |
isValidFileName(java.lang.String astrFileName,
java.lang.String astrFileExtension) |
static boolean |
isValidName(java.lang.String astrName)
Determine whether the specified names meets some basic reasonableness
criteria, such as non-null, non-blank, trimmed, no imbedded blanks,
no unusual characters, and must begin with a letter.
|
static boolean |
isValidName(java.lang.String astrName,
boolean abDisallowNumbersAsFirstCharacter)
Determine whether the specified names meets some basic reasonableness
criteria, such as non-null, non-blank, trimmed, no imbedded blanks,
no unusual characters, and must begin with a letter.
|
static boolean |
isValidName(java.lang.String astrName,
java.lang.String astrCharactersAllowable,
boolean abDisallowNumbersAsFirstCharacter)
Determine whether the specified names meets some basic reasonableness
criteria, such as non-null, non-blank, trimmed, no imbedded blanks,
no unusual characters, and must begin with a letter.
|
static boolean |
isValidQuotedLiteral(java.lang.String astrLiteral)
Return
true if the specified value is a properly quoted literal. |
static boolean |
isValidVocabularyReference(org.eclipse.emf.ecore.ENamedElement aENamedElement)
Return
true if the specified Vocabulary reference is valid (i.e.,
points to an ENamedElement that still exists in the Vocabulary). |
static boolean |
isValidXMLName(java.lang.String astrName)
Return
true if the specified name is a valid XML element (tag) name. |
static int |
parseInteger(java.lang.String astrInput)
Parse a string into an integer value.
|
static java.lang.String |
removeSingleQuotesFromStartAndEnd(java.lang.String astrValue)
Removes single quotes from the beginning and end of the passed string.
|
static java.lang.String |
replaceString(java.lang.String astrLookIn,
java.lang.String astrLookFor,
java.lang.String astrReplaceWith) |
static void |
setAttribute(org.jdom.Element aNode,
java.lang.String aAttribute,
java.lang.String aValue) |
static java.lang.String |
stripSpaces(java.lang.String astrInput)
Strip spaces from a value quickly and efficiently.
|
static java.lang.String |
toHexString(byte[] abyInput)
Convert the supplied byte array into a String of hexadecimal digits.
|
static java.lang.String |
trimDomain(java.lang.String astrFullyQualifiedEntityName)
Given a fully-qualified entity name, trim off the domain portion
and return the unqualified entity name.
|
static java.lang.String |
trimExtension(java.lang.String astrFileName)
Given a file name (or path) in string form, remove the file extension.
|
static java.lang.String |
trimTrailingSpaces(java.lang.String astrValue)
Trim trailing spaces only.
|
static java.lang.String |
trimURI(org.eclipse.emf.ecore.EObject aObject)
Trim URI for display, remove bookmarks
|
static void |
unresolve(org.eclipse.emf.ecore.EObject aEObject)
Unresolve a given EObject.
|
static void |
unresolveAll(org.eclipse.emf.ecore.EObject aEObject)
Unresolve a given EObject plus all of the objects it contains.
|
public static final java.lang.String CLASS_NAME_ARRAY_PREFIX
public static final java.lang.String CLASS_NAME_ARRAY_SUFFIX
public static final java.util.List NOT_REQUIRED_QUOTED_RESOURCES
public static final java.util.List LOGICAL_ELEMENTS_LIST
public static java.lang.String getNameOnly(java.lang.String astrName)
astrName - Name with suffix (e.g., "age_1").public static int getSuffixOnly(java.lang.String astrName)
astrName - Name with suffix (e.g., "age_1").public static java.lang.String getQuotedValue(java.lang.String astrString)
astrString - Quoted string, typically a literal.public static boolean isInteger(java.lang.String aString)
public static boolean isDecimalColumn(java.lang.String astrColumnHeader)
column - Column header stringtrue if decimal header; otherwise return falsepublic static int getIntegerPortion(java.lang.String astrColumnHeader)
column - Column header stringpublic static java.lang.String getArrayClass(java.lang.String astrClassNameArray)
astrClassNameArray - Class name with array prefix and suffix.astrClassName - Class name without array prefix and suffix.public static boolean getBooleanFromProperties(java.lang.String astrPropertyName,
boolean abDefault)
astrPropertyName - Property name.abDefault - Default value.true if property is String "true".public static int getIntegerFromProperties(java.lang.String astrPropertyName,
int aiDefault)
astrPropertyName - Property name.aiDefault - Default value.public static java.lang.String getCustomDataTypeName(java.lang.String astrCustomDataTypeReference)
astrCustomDataTypeReference - Custom data type reference.null.public static java.lang.String getCustomDataTypeEnumerationLabel(java.lang.String astrCustomDataTypeReference)
astrCustomDataTypeReference - Custom data type reference.null.public static java.lang.String getDatabaseFullyQualifiedName(java.lang.String astrCatalog,
java.lang.String astrSchema,
java.lang.String astrTable)
astrCatalog - Optional catalog name.astrSchema - Optional schema name.astrTable - Optional table name.public static java.lang.String getDatabaseCatalogName(java.lang.String astrFullyQualifiedTableName)
astrFullyQualifiedTableName - Fully-qualified table name.public static java.lang.String getDatabaseSchemaName(java.lang.String astrFullyQualifiedTableName)
astrFullyQualifiedTableName - Fully-qualified table name.public static java.lang.String getDatabaseTableName(java.lang.String astrFullyQualifiedTableName)
astrFullyQualifiedTableName - Fully-qualified table name.public static int getDecimalPortion(java.lang.String astrColumnHeader)
column - Column header stringpublic static boolean isValid(java.lang.String astr)
public static boolean isValidFileName(java.lang.String astrFileName,
java.lang.String astrFileExtension)
public static boolean isIn(java.util.Vector avect,
int ai)
public static boolean isValidDomainName(java.lang.String astrName)
astrName - to test.true if name id valid.public static boolean isValidEntityName(java.lang.String astrName)
astrName - to test.true if name id valid.public static boolean isValidAttributeName(java.lang.String astrName)
astrName - to test.true if name id valid.public static boolean isValidAssociationName(java.lang.String astrName)
astrName - to test.true if name id valid.public static boolean isValidCustomDataTypeName(java.lang.String astrName)
astrName - to test.true if name id valid.public static boolean isValidEnumerationLabel(java.lang.String astrName)
astrName - to test.true if name id valid.public static boolean isValidDatabaseTableName(java.lang.String astrTableName)
astrTableName - Database table name.true if database table name is valid.public static boolean isValidDatabaseColumnName(java.lang.String astrColumnName)
astrColumnName - Database column name.true if database column name is valid.public static boolean isValidName(java.lang.String astrName)
astrName - Nametrue if the name is validpublic static boolean isValidName(java.lang.String astrName,
boolean abDisallowNumbersAsFirstCharacter)
astrName - Nametrue if the name is validpublic static boolean isValidName(java.lang.String astrName,
java.lang.String astrCharactersAllowable,
boolean abDisallowNumbersAsFirstCharacter)
astrName - NameastrCharactersAllowable - List of allowable charactersabLeadingAlphaCheck - Ensure that first character is alphabetic charactertrue if the name is validpublic static boolean isFirstCharNumber(java.lang.String astrName)
public static boolean isValidQuotedLiteral(java.lang.String astrLiteral)
true if the specified value is a properly quoted literal.astrLiteral - Literal enclosed in apostrophes.true if the specified value is a properly quoted literal.public static boolean isValidDataValuePerDataType(java.lang.String astrDataType,
java.lang.String astrDataValue,
boolean abQuotes)
astrDataType - String Data type (e.g., Constants.UI_TYPE_DECIMAL).astrDataValue - Value to be tested.abQuotes - true if String and Date values are to be supplied with apostrophes.true if user data is of valid with respect to type, else falsepublic static java.lang.Object getValidDataValuePerDataType(java.lang.String astrDataType,
java.lang.String astrDataValue,
boolean abQuotes)
astrDataType - String Data type (e.g., Constants.UI_TYPE_DECIMAL).astrDataValue - Value to be tested.abQuotes - true if String and Date values are to be supplied with apostrophes.true if user data is of valid with respect to type, else falsepublic static boolean isValidXMLName(java.lang.String astrName)
true if the specified name is a valid XML element (tag) name.astrName - XML element name.true if the specified name is a valid XML element (tag) name.public static boolean isValidAlias(java.lang.String astrName)
astrName - to test.true if name id valid.public static boolean isValidVocabularyReference(org.eclipse.emf.ecore.ENamedElement aENamedElement)
true if the specified Vocabulary reference is valid (i.e.,
points to an ENamedElement that still exists in the Vocabulary).
System-wide protocol for Vocabulary deletion involves the conversion of any
existing cross-references back to unresolved proxies. This means that a
Vocabulary reference should either be a proxy or a valid reference. As long
as this contract holds true, this test is extremely simple.aENamedElement - Named element from Vocabulary.true if Vocabulary element exists in Vocabulary.public static java.lang.String replaceString(java.lang.String astrLookIn,
java.lang.String astrLookFor,
java.lang.String astrReplaceWith)
public static java.lang.String stripSpaces(java.lang.String astrInput)
astrInput - Input to strip.public static boolean isSame(java.lang.Object ao1,
java.lang.Object ao2)
ao1 - Object oneao2 - Object twotrue if strings are identicalpublic static boolean isSame(java.lang.String astrValue1,
java.lang.String astrValue2,
java.lang.String astrDataType,
boolean abQuotedString)
public static boolean isSameIgnoreCase(java.lang.String astrStringOne,
java.lang.String astrStringTwo)
astrStringOne - String one.astrStringTwo - String two.true if strings are identical ignoring case.public static boolean isSet(org.eclipse.emf.ecore.EObject aEObject,
org.eclipse.emf.ecore.EStructuralFeature aEStructuralFeature)
aEObject - EObject to be tested.aEStructuralFeature - EStructuralFeature to be tested.true if the object has any cross references.public static boolean isLiteral(java.lang.String astrInput)
astrInput - String to test.true if string is a literal.public static boolean isSameEmptyIsNull(java.lang.String astrStringOne,
java.lang.String astrStringTwo)
astrStringOne - String oneastrStringTwo - String twotrue if strings are identicalpublic static java.lang.String getEmptyAsNull(java.lang.Object aObjectInput)
null or empty when trimmed, this method will return null.
otherwise, it will simply return the trimmed input value.aObjectInput - Object input.null if input is empty when trimmed.public static java.lang.String getEmptyString(java.lang.Object aObjectInput)
null, this method will return an empty string;
otherwise, simply return the string value of the input.aObjectInput - Object input.null.public static java.lang.String getStringOrNull(java.lang.Object aObject)
null
if the object is null.null.public static java.lang.String decapitalize(java.lang.String astrString)
astrStringOne - String to decapitalize.public static void debugStackTrace()
public static java.lang.String capitalize(java.lang.String astrString)
astrStringOne - String to decapitalizepublic static int calculateOverlap(int aiBeginOne,
int aiEndOne,
int aiBeginTwo,
int aiEndTwo)
aiBeginOne - Starting value one.aiEndOne - Ending value one.aiBeginTwo - Starting value two.aiEndTwo - Ending value two.public static boolean isJavaReservedWord(java.lang.String astrName)
astrName - String to testtrue if the String matches a Java reserved wordpublic static boolean containsBlanks(java.lang.String astrString)
astrString - String to testtrue if the string contains one or more blankspublic static boolean containsAllowableCharacters(java.lang.String astrString,
java.lang.String astrCharactersAllowable)
astrString - String to testastrCharactersAllowable - List of allowable characterstrue if the string contains allowable characterspublic static int parseInteger(java.lang.String astrInput)
null or non-numeric, return -1.astrInput - Input string containing purported integer value.public static java.lang.String escapeUnicodeString(java.lang.String astrInput,
boolean abEscapeAscii)
astrInput - Input stringababEscapeAscii - Format all characters (even US-ASCII)public static java.lang.String toHexString(byte[] abyInput)
abyInput - Input byte arraypublic static char getDecimalSeparator()
public static char getDecimalSeparator(java.util.Locale aLocale)
aLocale - Locale for which decimal separator is to be returned.public static char getSetDelimiter()
public static char getSetDelimiter(java.util.Locale aLocale)
aLocale - Locale for which set delimiter is to be returned.public static java.lang.String getSqlTypeName(java.lang.String astrSqlTypeName)
SQL - Type name optionally with modifier.public static java.lang.String getServiceCalloutClassName(java.lang.String astrInput)
astrInput - Input string.public static java.lang.String getServiceCalloutServiceName(java.lang.String astrInput)
astrInput - Input string.public static java.lang.String getServiceCalloutName(java.lang.String astrClassName,
java.lang.String astrServiceName)
astrClassName - Class name.astrServiceName - Service name.public static ValueSet createValueSetFromString(java.lang.String astrInput)
astrInput - Input string in set notation.public static java.lang.String convertValueSetToString(java.lang.Object aObject)
aValueSet - ValueSet instance.public static java.lang.String convertEscapeToSpace(java.lang.String astrInput)
astrInput - Input to be converted.public static boolean isClassInList(java.lang.Class aClass,
java.util.List aList)
true if at least one instance of class aClass can
be found in aList.aClass - Class to locate.aList - List of objects to search.true if at least one instance of the specified class is in the list.public static java.lang.Object getObjectInList(java.lang.Class aClass,
java.util.List aList)
aClass - Class to locate.aList - List of objects to search.null.public static java.util.List getListOfType(java.lang.Class aClass,
java.util.List aList)
aClass - Class to locate.aList - List of objects of that type.List - of all instances of the specified type.public static java.lang.String getLocalizedRuleID(java.lang.String astrRuleId,
java.util.Locale aLocale)
astrRuleId - Rule ID in base form.aLocale - Locale in which Rule ID should be returned.public static java.lang.String getBaseRuleID(java.lang.String astrRuleId,
java.util.Locale aLocale)
astrRuleId - Rule ID in localized form.aLocale - Locale in which Rule ID is expressed.public static org.eclipse.emf.ecore.EObject getEContainer(java.lang.Class aClassContainer,
java.lang.Object aObjectContained)
aClassContainer - Class of container to locateEObjectContained - Contained EMF object.null if none.public static boolean isEContainer(java.lang.Object aObjectContainer,
java.lang.Object aObjectContained)
aObjectContainer - EObject container.aObjectContained - EObject contained.true if first parameter contains the second.public static java.lang.String getEclipsePlatformPath(java.lang.String astrPathEMF)
astrPathEMF - EMF path.null for invalid EMF path.public static org.eclipse.emf.common.util.URI getEMFResourceURI(org.eclipse.emf.ecore.EObject aEObject)
aEObject - EObject whose resource URI is to be returned.public static java.lang.String getEMFVocabularyProxyName(org.eclipse.emf.ecore.ENamedElement aENamedElement)
aENamedElement - ENamedElement whose base name is to be returned.java.lang.IllegalArgumentException - if EObject is not a proxy.public static org.eclipse.core.resources.IResource findResource(org.eclipse.emf.ecore.EObject aEObject)
aEObject - EObject instance.public static org.eclipse.core.resources.IResource findResource(org.eclipse.emf.common.util.URI aURI)
aURI - URI whose resource should be found.public static java.lang.String formatCustomDataType(java.lang.String astrCustomDataTypeName,
java.lang.String astrEnumerationLabel)
astrCustomDataTypeName - Custom data type name.astrEnumerationLabel - Enumeration label.public static java.lang.String formatValueSetString(java.lang.String astrSet,
java.util.Locale aLocale,
boolean abAvoidQuotingKeywords)
astrSet - Input set in localized form.aLocale - in which input set is expressed.abAvoidQuotingKeywords - true to avoid quoting keywords like null.public static java.util.List insertBlankItem(java.util.List aList)
aList - List to be updated (in place).public static boolean exists(org.eclipse.emf.ecore.EObject aEObject)
aEObject - EObject to test.true if the object exists.public static boolean isHeadless()
public static boolean exists(org.eclipse.emf.common.util.URI aURI)
aURI - URI to test.true if URI exists.public static java.lang.String trimTrailingSpaces(java.lang.String astrValue)
astrValue - Value to be stripped.public static java.lang.String trimURI(org.eclipse.emf.ecore.EObject aObject)
aObject - public static java.lang.String convertPlatformURIToFilePath(java.lang.String astrURI)
astrURI - public static java.lang.String convertFileURIToFilePath(java.lang.String lstrResult)
lstrResult - public static java.lang.String convertPathToRelative(java.lang.String astrPathInput)
astrPathInput - Absolute path (including drive letter).public static org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.emf.common.notify.Notification aNotification)
aNotification - EMF model notification.null.public static boolean isMyNotification(IModelAPI aIModelAPI, org.eclipse.emf.common.notify.Notification aNotification)
aIModelAPI - Model API instance.aNotification - EMF model notification.true if notification comes from the specified API.public static boolean isMyNotificationBatch(IModelAPI aIModelAPI, NotificationBatch aNotificationBatch)
aIModelAPI - Model API instance.aNotificationBatch - Notification batch instance.true if notification comes from the specified API.public static boolean isMyNotificationInBatch(IModelAPI aIModelAPI, NotificationBatch aNotificationBatch)
aIModelAPI - Model API instance.aNotificationBatch - Notification batch instance.true if notification comes from the specified API.public static java.lang.String removeSingleQuotesFromStartAndEnd(java.lang.String astrValue)
astrValue - Original string with the single quote at then beginning and end.public static org.eclipse.emf.ecore.EObject cloneEObject(org.eclipse.emf.ecore.EObject aEObject,
boolean abUnresolve)
aEObject - EObject to be cloned.abUnresolve - true to unresolve proxies.public static java.lang.String exceptionToString(java.lang.Throwable aThrowable)
aThrowable - Error or exception.public static java.lang.String getLocationOfFile(java.lang.String astrResourceName,
java.lang.ClassLoader aClassLoader)
astrResourceName - Resource name to find.aClassLoader - ClassLoader to use for resource lookup.public static java.io.File getJarPath(java.lang.String astrPath)
astrPath - Path name of Jar element.public static java.io.File getDirectoryPath(java.lang.String astrPath,
java.lang.String astrClassName)
astrPath - File path.astrClassName - Class name.public static java.lang.String trimExtension(java.lang.String astrFileName)
astrFileName - File name to be used.public static java.lang.String trimDomain(java.lang.String astrFullyQualifiedEntityName)
astrInput - Fully-qualified entity name.public static void unresolve(org.eclipse.emf.ecore.EObject aEObject)
aEObject - EObject (root) to unresolve.public static org.eclipse.emf.ecore.EObject getProxyEquivalent(org.eclipse.emf.ecore.EObject aEObject)
public static void unresolveAll(org.eclipse.emf.ecore.EObject aEObject)
aEObject - EObject (root) to unresolve.public static java.lang.String fromDateToString(java.util.Date aDate)
public static void setAttribute(org.jdom.Element aNode,
java.lang.String aAttribute,
java.lang.String aValue)
public static org.jdom.Element addChild(org.jdom.Element aParent,
java.lang.String aName)
public static org.jdom.Element addChild(org.jdom.Element aParent,
java.lang.String aName,
java.lang.String aValue)
public static org.jdom.Element addChild(org.jdom.Element aParent,
java.lang.String aNodeName,
java.lang.String aAttributeName,
java.lang.String aAttributeValue)
public static java.lang.String determineCommonRoot(java.util.List<java.lang.String> alstFilePaths)
public static java.lang.String generateHibernateUserFriendlyExceptionMessage(java.lang.Throwable aThrowable)
Copyright © 2005-2013 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.