|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ocl.examples.domain.utilities.DomainUtil
public class DomainUtil
Nested Class Summary | |
---|---|
static class |
DomainUtil.EAnnotationComparator
|
static class |
DomainUtil.ENamedElementComparator
|
static class |
DomainUtil.NameableComparator
|
Field Summary | |
---|---|
static DomainUtil.NameableComparator |
NAMEABLE_COMPARATOR
|
Constructor Summary | |
---|---|
DomainUtil()
|
Method Summary | ||
---|---|---|
static java.lang.String |
bind(java.lang.String messageTemplate,
java.lang.Object... bindings)
|
|
static java.lang.String |
convertFromOCLString(java.lang.String javaString)
Mostly copied from Properties.loadConvert(char[], int, int, char[]) via
Strings.convertFromJavaString(java.lang.String, boolean) |
|
static java.lang.String |
convertToOCLString(java.lang.String theString)
Mostly copied from Properties.saveConvert(java.lang.String, boolean, boolean) via
Strings.convertToJavaString(java.lang.String) |
|
static java.lang.Number |
createNumberFromString(java.lang.String aValue)
|
|
static java.lang.String |
debugEventType(int eventType)
|
|
static java.lang.String |
debugFullName(java.lang.Object object)
|
|
static java.lang.String |
debugSimpleName(java.lang.Object object)
|
|
static void |
formatMultiplicity(java.lang.StringBuilder s,
long lower,
long upper)
Append a multiplicity string such as "[1..5]" to a StringBuilder. |
|
static org.eclipse.emf.ecore.EAnnotation |
getEAnnotation(org.eclipse.emf.ecore.EModelElement eModelElement,
java.lang.String sourceURI)
Return the sourceURI annotation of eModelElement, creating and installing it if required. |
|
static java.lang.String |
getIndentation(int depth,
java.lang.String string)
|
|
static java.lang.String |
getLabel(org.eclipse.emf.ecore.EClassifier eClassifier,
java.lang.Object object,
java.util.Map<java.lang.Object,java.lang.Object> context)
Return a simple readable description of object. |
|
static java.lang.String |
getLabel(org.eclipse.emf.ecore.EObject eObject)
Return a simple readable description of eObject using an IItemLabelProvider if possible. |
|
static DomainType[] |
getLambdaParameterTypes(DomainLambdaType lambdaType)
|
|
static
|
getNamedElement(java.lang.Iterable<T> elements,
java.lang.String name)
|
|
static DomainType[] |
getOperationParameterTypes(DomainOperation anOperation)
|
|
static java.lang.String |
getSafeName(Nameable aNameable)
|
|
static boolean |
isRegistered(org.eclipse.emf.ecore.resource.Resource resource)
Return true if resource is a registered resource; hosting a compile Java model. |
|
static
|
nonNullEMF(T aT)
Return aT, checking the assertion that this call would not be necessary if EMF had comprehensive @NonNull annotations. |
|
static
|
nonNullModel(T aT)
Check for an in appropriate model state which should have been detected by a model validation pass. |
|
static
|
nonNullPivot(T aT)
Return aT, checking the assertion that this call would not be necessary if the Pivot model was guaranteed to be valid. |
|
static
|
nonNullState(T aT)
Check for an in appropriate program state. |
|
static
|
safeCompareTo(T object,
T otherObject)
Safely determines the relative order of object and
otherObject , i.e. |
|
static boolean |
safeEquals(java.lang.Object object,
java.lang.Object otherObject)
Safely determines whether object equals
otherObject , i.e. |
|
static void |
suppressThrowWarnings()
Deprecated. |
|
static char |
toHex(int nibble)
Copied from Properties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final DomainUtil.NameableComparator NAMEABLE_COMPARATOR
Constructor Detail |
---|
public DomainUtil()
Method Detail |
---|
@NonNull public static java.lang.String bind(java.lang.String messageTemplate, java.lang.Object... bindings)
@NonNull public static java.lang.String convertFromOCLString(@NonNull java.lang.String javaString)
Properties.loadConvert(char[], int, int, char[])
via
Strings.convertFromJavaString(java.lang.String, boolean)
public static java.lang.String convertToOCLString(java.lang.String theString)
Properties.saveConvert(java.lang.String, boolean, boolean)
via
Strings.convertToJavaString(java.lang.String)
@NonNull public static java.lang.Number createNumberFromString(@NonNull java.lang.String aValue) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static java.lang.String debugEventType(int eventType)
public static java.lang.String debugFullName(java.lang.Object object)
public static java.lang.String debugSimpleName(java.lang.Object object)
public static void formatMultiplicity(@NonNull java.lang.StringBuilder s, long lower, long upper)
@NonNull public static org.eclipse.emf.ecore.EAnnotation getEAnnotation(@NonNull org.eclipse.emf.ecore.EModelElement eModelElement, java.lang.String sourceURI)
public static java.lang.String getLabel(org.eclipse.emf.ecore.EObject eObject)
public static java.lang.String getIndentation(int depth, @NonNull java.lang.String string)
public static java.lang.String getLabel(org.eclipse.emf.ecore.EClassifier eClassifier, java.lang.Object object, java.util.Map<java.lang.Object,java.lang.Object> context)
@NonNull public static DomainType[] getLambdaParameterTypes(@NonNull DomainLambdaType lambdaType)
public static <T extends Nameable> T getNamedElement(java.lang.Iterable<T> elements, java.lang.String name)
@NonNull public static DomainType[] getOperationParameterTypes(@NonNull DomainOperation anOperation)
@NonNull public static java.lang.String getSafeName(@Nullable Nameable aNameable)
public static boolean isRegistered(org.eclipse.emf.ecore.resource.Resource resource)
@NonNull public static <T> T nonNullEMF(@Nullable T aT)
@NonNull public static <T> T nonNullModel(@Nullable T aT)
Return aT, checking the assertion that this call would not be necessary if the Ecore model was guaranteed to be valid.
@NonNull public static <T> T nonNullPivot(@Nullable T aT)
@NonNull public static <T> T nonNullState(@Nullable T aT)
If the inappropriate state really cannot happen, an assertion should be used instead to avoid non-debug run-time cost.
Return aT, throwing an IllegalStateException if null.
public static <T extends java.lang.Comparable<T>> int safeCompareTo(@Nullable T object, @Nullable T otherObject)
object
and
otherObject
, i.e. without throwing an exception if
object
is null
.
public static boolean safeEquals(@Nullable java.lang.Object object, @Nullable java.lang.Object otherObject)
object
equals
otherObject
, i.e. without throwing an exception if
object
is null
.
object
- The first object to compare.otherObject
- The second object to compare.
true
if object
equals
otherObject
; false
otherwise.@Deprecated public static void suppressThrowWarnings()
InvalidValueException
public static char toHex(int nibble)
Properties
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |