|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ca.commons.datamodel.MetaDataDefs
com.ca.commons.datamodel.DataModelUtil
public class DataModelUtil
Utility methods. Note that information on metadata properties must be maintained in MetaDataDefs rather then here.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.ca.commons.datamodel.MetaDataDefs |
|---|
MetaDataDefs.AssocType, MetaDataDefs.EncryptAlgorithms, MetaDataDefs.FlattenStyle, MetaDataDefs.ForceCaseValue, MetaDataDefs.ForceModModeValue, MetaDataDefs.GeneratedOverrideStatus, MetaDataDefs.NormalizeConnValue, MetaDataDefs.NormalizeConnValueStyle, MetaDataDefs.RegexStyle |
| Field Summary | |
|---|---|
static Class<?> |
BYTE_ARRAY_CLASS
|
static String |
ET_ACCOUNT
Used to identify account object class, which will have this in "extends" list. |
static com.ca.commons.functional.Fn<DataModelProperty,DataModelValue> |
fnGetValue
|
static com.ca.commons.functional.Fn<Item,String> |
jaxbItemNameGetter
|
static int |
MAX_DESCRIPTION_LENGTH
Namespace descriptions must be between 0 and 128 chars long. |
static int |
MAX_NAME_LENGTH
Namespace names must be between 1 and 50 chars long. |
static String |
META_DATA_NAME
Used in absolute names for metadata properties, to distinguish them from normal properties, e.g. |
| Constructor Summary | |
|---|---|
protected |
DataModelUtil()
|
| Method Summary | ||
|---|---|---|
static Iterable<? extends DataModelProperty> |
directProperties(DataModelClass dmClass)
|
|
static com.ca.commons.functional.Pred<DataModelItem> |
fnIsContainedBy(DataModelItem item)
|
|
static com.ca.commons.functional.Fn<DataModelItem,String> |
fnItemName()
|
|
static
|
fnMatchMdValue(String name,
Class<? extends T> cl,
com.ca.commons.functional.Fn<? super T,Boolean> pred)
|
|
static String |
getAbsoluteMetadataPropertyName(String parent,
String mdPropName)
|
|
static boolean |
getBoolean(DataModelProperty prop)
Returns true if prop is both not null, and true. |
|
static boolean |
getBooleanMetaData(DataModelItem item,
String mdName,
boolean def)
|
|
static String[] |
getCollectionValues(DataModelValue value)
Get values contained in a collection, as an array. |
|
static String[] |
getItemPropertyCollectionValues(DataModelItem item,
String propName)
Return string values for multi-valued metadata property propName
on the provided class cls. |
|
static Map<String,String[]> |
getItemPropertyMapStringValues(DataModelItem item,
String propName)
Get values contained in a data model map as Map of String, String[] pairs suitable for Maps using Strings for both key and all values. |
|
static Map<DataModelValue,DataModelValue> |
getItemPropertyMapValues(DataModelItem item,
String propName)
Get values contained in a data model map as Map of DataModelValue,DataModelValue pairs |
|
static Map<DataModelValue,DataModelValue> |
getMapValues(DataModelValue value)
Get values contained in a data model map as Map of DataModelValue,DataModelValue pairs |
|
static DataModelProperty |
getNamingAttribute(DataModelClass dmClass)
|
|
static boolean |
hasConnectorMapping(DataModelClass cls)
Helper method to check for all the ways a class can be mapped to connector-speak. |
|
static boolean |
hasConnectorMapping(DataModelProperty prop)
Helper method to check for all the ways a property can be mapped to connector-speak. |
|
static boolean |
isMultiValued(DataModelProperty prop)
Check if a property is defined to contain multiple values. |
|
static boolean |
isPropertyTypeDN(DataModelProperty prop)
Check if a property is defined to contain DN (Distinguished Name) values. |
|
static boolean |
isSensitive(DataModelProperty prop)
Return true if values for prop shouldn't be logged. |
|
static boolean |
isValidDataModelName(String name)
Checks if a given datamodel name is valid |
|
static String |
javaClassToDataModel(Class<?> cl)
|
|
static void |
mapJavaClassToDataModel(Class<?> cl,
String absoluteDataModelName)
|
|
static com.ca.commons.functional.Pred<DataModelItem> |
matchItemName(String name)
|
|
static com.ca.commons.functional.Pred<Item> |
matchJaxbItemName(String name)
|
|
static
|
testMetadataEquals(String metadataName,
T defaultValue,
T compare)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_NAME_LENGTH
public static final int MAX_DESCRIPTION_LENGTH
public static final Class<?> BYTE_ARRAY_CLASS
public static final String ET_ACCOUNT
public static final String META_DATA_NAME
@NotNull public static final com.ca.commons.functional.Fn<Item,String> jaxbItemNameGetter
public static com.ca.commons.functional.Fn<DataModelProperty,DataModelValue> fnGetValue
| Constructor Detail |
|---|
protected DataModelUtil()
| Method Detail |
|---|
public static String getAbsoluteMetadataPropertyName(String parent,
String mdPropName)
public static boolean isValidDataModelName(String name)
public static boolean getBoolean(DataModelProperty prop)
public static boolean getBooleanMetaData(DataModelItem item,
String mdName,
boolean def)
@Nullable public static Map<DataModelValue,DataModelValue> getMapValues(DataModelValue value)
DataModelValue,DataModelValue pairs
value - Map value.
@Nullable
public static Map<DataModelValue,DataModelValue> getItemPropertyMapValues(DataModelItem item,
String propName)
DataModelValue,DataModelValue pairs
item - Data model element to be looked up.propName - Map metadata property name
@Nullable
public static Map<String,String[]> getItemPropertyMapStringValues(DataModelItem item,
String propName)
item - Data model element to be looked up.propName - Map metadata property name
@Nullable public static String[] getCollectionValues(DataModelValue value)
value - Collection value.
@Nullable
public static String[] getItemPropertyCollectionValues(DataModelItem item,
String propName)
propName
on the provided class cls.
item - Data model element to be looked up.propName - Multi-valued metadata property name
public static boolean isMultiValued(@NotNull
DataModelProperty prop)
prop - Property to be checked.
setValue or
sequenceValue) or has a true MetaDataDefs.MD_IS_MULTI_VALUED setting).
public static boolean isSensitive(@NotNull
DataModelProperty prop)
public static boolean hasConnectorMapping(DataModelClass cls)
cls - The class to be checked.
public static boolean hasConnectorMapping(DataModelProperty prop)
prop - Property to be checked.
public static boolean isPropertyTypeDN(DataModelProperty prop)
prop - Property to be checked.
@NotNull public static com.ca.commons.functional.Fn<DataModelItem,String> fnItemName()
@NotNull
public static <T> com.ca.commons.functional.Pred<HasMetadata> testMetadataEquals(@NotNull
String metadataName,
@NotNull
T defaultValue,
@NotNull
T compare)
@NotNull
public static com.ca.commons.functional.Pred<DataModelItem> matchItemName(@NotNull
String name)
public static <T> com.ca.commons.functional.Pred<HasMetadata> fnMatchMdValue(String name,
Class<? extends T> cl,
com.ca.commons.functional.Fn<? super T,Boolean> pred)
@NotNull
public static com.ca.commons.functional.Pred<Item> matchJaxbItemName(@NotNull
String name)
public static com.ca.commons.functional.Pred<DataModelItem> fnIsContainedBy(DataModelItem item)
public static Iterable<? extends DataModelProperty> directProperties(DataModelClass dmClass)
public static void mapJavaClassToDataModel(@NotNull
Class<?> cl,
@NotNull
String absoluteDataModelName)
@NotNull
public static String javaClassToDataModel(@NotNull
Class<?> cl)
public static DataModelProperty getNamingAttribute(@NotNull
DataModelClass dmClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||