org.sblim.cimclient.internal.util
Class MOF

java.lang.Object
  extended by org.sblim.cimclient.internal.util.MOF

public class MOF
extends Object

Class MOF is responsible for helping MOF String generation.


Field Summary
static String ANY
          ANY
static String ASSOCIATION
          ASSOCIATION
static String CLASS
          CLASS
static int DEF_FLAVOR
          OVERRIDABLE (true|false) 'true' -> DISABLEOVERRIDE=false TOSUBCLASS (true|false) 'true' -> RESTRICTED=false TOINSTANCE (true|false) 'false' TRANSLATABLE (true|false) 'false' -> TRANSLTE=false
static String DISABLEOVERRIDE
          DISABLEOVERRIDE
static String DT_BOOL
          DT_BOOL
static String DT_CHAR16
          DT_CHAR16
static String DT_DATETIME
          DT_DATETIME
static String DT_REAL32
          DT_REAL32
static String DT_REAL64
          DT_REAL64
static String DT_SINT16
          DT_SINT16
static String DT_SINT32
          DT_SINT32
static String DT_SINT64
          DT_SINT64
static String DT_SINT8
          DT_SINT8
static String DT_STR
          DT_STR
static String DT_UINT16
          DT_UINT16
static String DT_UINT32
          DT_UINT32
static String DT_UINT64
          DT_UINT64
static String DT_UINT8
          DT_UINT8
static String EMPTY
          EMPTY
static String ENABLEOVERRIDE
          ENABLEOVERRIDE
static String FALSE
          FALSE
static String INDENT
          INDENT
static String INDICATION
          INDICATION
static String INSTANCE
          INSTANCE
static String INSTOF
          INSTOF
static String INVALID
          INVALID
static String METHOD
          METHOD
static String NAMESPACE
          NAMESPACE
static String NULL
          NULL
static String PARAMETER
          PARAMETER
static String PROPERTY
          PROPERTY
static String QUALIFIER
          QUALIFIER
static String REF
          REF
static String REFERENCE
          REFERENCE
static String RESTRICTED
          RESTRICTED
static String SCOPE
          SCOPE
static String TOSUBCLASS
          TOSUBCLASS
static String TRANSLATABLE
          TRANSLATABLE
static String TRUE
          TRUE
 
Constructor Summary
MOF()
           
 
Method Summary
static String classDeclaration(CIMClass pCl, String pInd)
           classDeclaration = [ qualifierList ] CLASS className [ superClass ] "{" *classFeature "}" ";" classFeature = propertyDeclaration | methodDeclaration superClass = ":" className
static String constantValue(CIMValuedElement<?> pValuedElement, String pInd)
           constantValue = integerValue | realValue | charValue | stringValue | booleanValue | nullValue // | dateTimeValue | objectHandle
static String constantValue(Object pObj, boolean pTyped, String pInd)
          constantValue
static String constantValue(Object pObj, String pInd)
          constantValue
static String dataType(CIMDataType pType)
           dataType = DT_UINT8 | DT_SINT8 | DT_UINT16 | DT_SINT16 | DT_UINT32 | DT_SINT32 | DT_UINT64 | DT_SINT64 | DT_REAL32 | DT_REAL64 | DT_CHAR16 | DT_STR | DT_BOOL | DT_DATETIME
static String dataType(CIMTypedElement pTypedElement)
           
static String flavor(int flavor)
           flavor = ENABLEOVERRIDE | DISABLEOVERRIDE | RESTRICTED | TOSUBCLASS | TRANSLATABLE
static String instanceDeclaration(CIMInstance pInst, String pInd)
          instanceDeclaration = [ qualifierList ] INSTANCE OF className [ alias ] "{" 1*valueInitializer "}" ";"
static String methodDeclaration(CIMMethod<?> pMethod, String pInd)
           methodDeclaration = [ qualifierList ] dataType methodName "(" [ parameterList ] ")" ";"
static String objectHandle(CIMObjectPath pPath)
          objectHandle
static String objectHandle(CIMObjectPath pPath, boolean pTyped, boolean pLocal)
          objectHandle
static String objectHandleAsRef(CIMObjectPath pPath)
          objectHandleAsRef
static String objectHandleAsRef(CIMObjectPath pPath, boolean pTyped)
          objectHandleAsRef
static String parameter(CIMParameter<?> pParam, String pInd)
          parameter
static String propertyDeclaration(CIMProperty<?> pProp, String pInd)
           propertyDeclaration = typedElement [ defaultValue ] ";" defaultValue = "=" initializer
static String qualifier(CIMQualifier<?> pQuali)
           qualifier = qualifierName [ qualifierParameter ] [ ":" 1*flavor ]
static String qualifierDeclaration(CIMQualifierType<?> pQType)
           qualifierDeclaration = QUALIFIER qualifierName qualifierType scope [ defaultFlavor ] ";"
static String qualifierList(CIMElement pElement, String pInd)
           qualifierList = "[" qualifier *( "," qualifier ) "]"
static String scope(int pScopes)
           scope = "," SCOPE "(" metaElement *( "," metaElement ) ")" metaElement = CLASS | ASSOCIATION | INDICATION | QUALIFIER PROPERTY | REFERENCE | METHOD | PARAMETER | ANY
static String typedElement(CIMTypedElement pTypedElement, String pInd)
          typedElement = [ qualifierList ] (dataType|objectRef) parameterName [ array ]
static String valuedElement(CIMValuedElement<?> pValuedElement, String pInd)
           valuedElement = typedElement [ defaultValue ] ";" defaultValue = "=" initializer
static String valueInitializer(CIMProperty<?> pProp, String pInd)
           valueInitializer = [ qualifierList ] ( propertyName | referenceName ) "=" initializer ";"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS

public static final String CLASS
CLASS

See Also:
Constant Field Values

TRUE

public static final String TRUE
TRUE

See Also:
Constant Field Values

FALSE

public static final String FALSE
FALSE

See Also:
Constant Field Values

NULL

public static final String NULL
NULL

See Also:
Constant Field Values

ENABLEOVERRIDE

public static final String ENABLEOVERRIDE
ENABLEOVERRIDE

See Also:
Constant Field Values

DISABLEOVERRIDE

public static final String DISABLEOVERRIDE
DISABLEOVERRIDE

See Also:
Constant Field Values

RESTRICTED

public static final String RESTRICTED
RESTRICTED

See Also:
Constant Field Values

TOSUBCLASS

public static final String TOSUBCLASS
TOSUBCLASS

See Also:
Constant Field Values

TRANSLATABLE

public static final String TRANSLATABLE
TRANSLATABLE

See Also:
Constant Field Values

DT_BOOL

public static final String DT_BOOL
DT_BOOL

See Also:
Constant Field Values

DT_CHAR16

public static final String DT_CHAR16
DT_CHAR16

See Also:
Constant Field Values

DT_DATETIME

public static final String DT_DATETIME
DT_DATETIME

See Also:
Constant Field Values

DT_REAL32

public static final String DT_REAL32
DT_REAL32

See Also:
Constant Field Values

DT_REAL64

public static final String DT_REAL64
DT_REAL64

See Also:
Constant Field Values

DT_SINT16

public static final String DT_SINT16
DT_SINT16

See Also:
Constant Field Values

DT_SINT32

public static final String DT_SINT32
DT_SINT32

See Also:
Constant Field Values

DT_SINT64

public static final String DT_SINT64
DT_SINT64

See Also:
Constant Field Values

DT_SINT8

public static final String DT_SINT8
DT_SINT8

See Also:
Constant Field Values

DT_STR

public static final String DT_STR
DT_STR

See Also:
Constant Field Values

DT_UINT16

public static final String DT_UINT16
DT_UINT16

See Also:
Constant Field Values

DT_UINT32

public static final String DT_UINT32
DT_UINT32

See Also:
Constant Field Values

DT_UINT64

public static final String DT_UINT64
DT_UINT64

See Also:
Constant Field Values

DT_UINT8

public static final String DT_UINT8
DT_UINT8

See Also:
Constant Field Values

INVALID

public static final String INVALID
INVALID

See Also:
Constant Field Values

REF

public static final String REF
REF

See Also:
Constant Field Values

INSTOF

public static final String INSTOF
INSTOF

See Also:
Constant Field Values

QUALIFIER

public static final String QUALIFIER
QUALIFIER

See Also:
Constant Field Values

SCOPE

public static final String SCOPE
SCOPE

See Also:
Constant Field Values

ANY

public static final String ANY
ANY

See Also:
Constant Field Values

ASSOCIATION

public static final String ASSOCIATION
ASSOCIATION

See Also:
Constant Field Values

INDICATION

public static final String INDICATION
INDICATION

See Also:
Constant Field Values

METHOD

public static final String METHOD
METHOD

See Also:
Constant Field Values

PARAMETER

public static final String PARAMETER
PARAMETER

See Also:
Constant Field Values

PROPERTY

public static final String PROPERTY
PROPERTY

See Also:
Constant Field Values

REFERENCE

public static final String REFERENCE
REFERENCE

See Also:
Constant Field Values

INSTANCE

public static final String INSTANCE
INSTANCE

See Also:
Constant Field Values

NAMESPACE

public static final String NAMESPACE
NAMESPACE

See Also:
Constant Field Values

INDENT

public static final String INDENT
INDENT

See Also:
Constant Field Values

EMPTY

public static final String EMPTY
EMPTY

See Also:
Constant Field Values

DEF_FLAVOR

public static final int DEF_FLAVOR
OVERRIDABLE (true|false) 'true' -> DISABLEOVERRIDE=false TOSUBCLASS (true|false) 'true' -> RESTRICTED=false TOINSTANCE (true|false) 'false' TRANSLATABLE (true|false) 'false' -> TRANSLTE=false

See Also:
Constant Field Values
Constructor Detail

MOF

public MOF()
Method Detail

classDeclaration

public static String classDeclaration(CIMClass pCl,
                                      String pInd)
        classDeclaration                =       [ qualifierList ] CLASS className [ superClass ]
                                        "{" *classFeature "}" ";"
        classFeature                    =       propertyDeclaration | methodDeclaration
        
        superClass                              =       ":" className
 

Parameters:
pCl -
pInd -
Returns:
the MOF string

instanceDeclaration

public static String instanceDeclaration(CIMInstance pInst,
                                         String pInd)
instanceDeclaration = [ qualifierList ] INSTANCE OF className [ alias ] "{" 1*valueInitializer "}" ";"

Parameters:
pInst -
pInd -
Returns:
the MOF string

methodDeclaration

public static String methodDeclaration(CIMMethod<?> pMethod,
                                       String pInd)
        methodDeclaration               =       [ qualifierList ] dataType methodName
                                                        "(" [ parameterList ] ")" ";"
 

Parameters:
pMethod -
pInd -
Returns:
the MOF string

parameter

public static String parameter(CIMParameter<?> pParam,
                               String pInd)
parameter

Parameters:
pParam - - CIMParameter
pInd -
Returns:
the MOF string

typedElement

public static String typedElement(CIMTypedElement pTypedElement,
                                  String pInd)
typedElement = [ qualifierList ] (dataType|objectRef) parameterName [ array ]

Parameters:
pTypedElement -
pInd -
Returns:
the MOF string

valuedElement

public static String valuedElement(CIMValuedElement<?> pValuedElement,
                                   String pInd)
        valuedElement           =       typedElement [ defaultValue ] ";"
        defaultValue                    =       "=" initializer
 

Parameters:
pValuedElement -
pInd -
Returns:
the MOF string

qualifierList

public static String qualifierList(CIMElement pElement,
                                   String pInd)
        qualifierList                   =       "[" qualifier *( "," qualifier ) "]"
 

Parameters:
pElement -
pInd -
Returns:
the MOF string +newLine if qualifiers present or empty string

qualifierDeclaration

public static String qualifierDeclaration(CIMQualifierType<?> pQType)
        qualifierDeclaration    =       QUALIFIER qualifierName qualifierType scope 
                                                                [ defaultFlavor ] ";"
 

Parameters:
pQType -
Returns:
the MOF string

scope

public static String scope(int pScopes)
        scope           =       "," SCOPE "(" metaElement *( "," metaElement ) ")"
        metaElement     =       CLASS | ASSOCIATION | INDICATION | QUALIFIER
                                        PROPERTY | REFERENCE | METHOD | PARAMETER | ANY
 

Parameters:
pScopes -
Returns:
the MOF string

flavor

public static String flavor(int flavor)
 flavor = ENABLEOVERRIDE | DISABLEOVERRIDE | RESTRICTED | TOSUBCLASS | TRANSLATABLE
 

Parameters:
flavor -
Returns:
the MOF string

qualifier

public static String qualifier(CIMQualifier<?> pQuali)
        qualifier                               =       qualifierName [ qualifierParameter ] [ ":" 1*flavor ]
 

Parameters:
pQuali -
Returns:
the MOF string

propertyDeclaration

public static String propertyDeclaration(CIMProperty<?> pProp,
                                         String pInd)
        propertyDeclaration     =       typedElement [ defaultValue ] ";"
        defaultValue                    =       "=" initializer
 

Parameters:
pProp -
pInd -
Returns:
the MOF string

valueInitializer

public static String valueInitializer(CIMProperty<?> pProp,
                                      String pInd)
        valueInitializer                = [ qualifierList ] ( propertyName | referenceName ) "="
                                                                        initializer ";"
 

Parameters:
pProp -
pInd -
Returns:
the MOF string

dataType

public static String dataType(CIMDataType pType)
 dataType = DT_UINT8 | DT_SINT8 | DT_UINT16 | DT_SINT16 | DT_UINT32 | DT_SINT32 | DT_UINT64
                | DT_SINT64 | DT_REAL32 | DT_REAL64 | DT_CHAR16 | DT_STR | DT_BOOL | DT_DATETIME
 
Additionally it handles reference types too.
        objectType      =       objectRef
        objectRef               =       className REF
 

Parameters:
pType -
Returns:
the MOF string

dataType

public static String dataType(CIMTypedElement pTypedElement)
Parameters:
pTypedElement -
Returns:
the MOF string
See Also:
dataType(CIMDataType)

objectHandle

public static String objectHandle(CIMObjectPath pPath)
objectHandle

Parameters:
pPath -
Returns:
the Untyped MOF String

objectHandle

public static String objectHandle(CIMObjectPath pPath,
                                  boolean pTyped,
                                  boolean pLocal)
objectHandle

Parameters:
pPath - The path
pTyped - If true the URI is typed
pLocal - If true the path is local (omitting scheme, host and port)
Returns:
the URI string

objectHandleAsRef

public static String objectHandleAsRef(CIMObjectPath pPath)
objectHandleAsRef

Parameters:
pPath -
Returns:
the Untyped MOF String

objectHandleAsRef

public static String objectHandleAsRef(CIMObjectPath pPath,
                                       boolean pTyped)
objectHandleAsRef

Parameters:
pPath -
pTyped -
Returns:
the MOF String

constantValue

public static String constantValue(CIMValuedElement<?> pValuedElement,
                                   String pInd)
 constantValue = integerValue | realValue | charValue | stringValue | booleanValue | nullValue
 // | dateTimeValue | objectHandle
 

Parameters:
pValuedElement -
pInd -
Returns:
the MOF string

constantValue

public static String constantValue(Object pObj,
                                   boolean pTyped,
                                   String pInd)
constantValue

Parameters:
pObj -
pTyped -
pInd -
Returns:
the MOF string
See Also:
constantValue(CIMValuedElement, String)

constantValue

public static String constantValue(Object pObj,
                                   String pInd)
constantValue

Parameters:
pObj -
pInd -
Returns:
the untyped MOF String


Copyright © 2005, 2013 IBM Corporation. All Rights Reserved.