Package net.aifusion.metamodel
Class MOFParser
java.lang.Object
net.aifusion.metamodel.MOFParser
- All Implemented Interfaces:
Parser
Recursive descent parser implementing CIM Version 3 Metamodel as described in DSP0004 and DSP0221
- Author:
- Sharad Singhal
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a MOF Parser with a default in-memory repositoryMOFParser(Repository repository) Create a MOF Parser with the given repositoryMOFParser(Repository repository, Repository definitions) Create a MOF parser with a definition repository -
Method Summary
Modifier and TypeMethodDescriptionGet the repository being used by the parserstatic voidParse one or more files into a repositoryvoidparse(BufferedReader in, NameSpacePath path) Parse model constructs from a buffered readervoidparse(InputStream in, NameSpacePath path) Parse the specification given in an inputstream into the parser repositoryvoidparse(String fileName, NameSpacePath path) Parse a filevoidparseParameters(List<CimParameter> params, InputStream in) Parse a list of comma separated parameter values from the input streamparsePropertyValue(ObjectPath path, String propertyName, InputStream inputStream) Parse a property value from the input streamparseValue(InputStream in, NameSpacePath path) Parse values from an input streamparseValue(String indication, NameSpacePath path) Parse a structure value from an incoming indication
-
Constructor Details
-
MOFParser
public MOFParser()Create a MOF Parser with a default in-memory repository -
MOFParser
Create a MOF Parser with the given repository- Parameters:
repository- - CIM Repository to use for the parser
-
MOFParser
Create a MOF parser with a definition repository- Parameters:
repository- - repository to parse new inputdefinitions- - repository containing pre-existing definitions (not modified)
-
-
Method Details
-
parse
Parse a file -
parse
Description copied from interface:ParserParse the specification given in an inputstream into the parser repository -
parse
Parse model constructs from a buffered reader -
parseValue
Description copied from interface:ParserParse a structure value from an incoming indication- Specified by:
parseValuein interfaceParser- Parameters:
indication- - value of the indicationpath- - optional name space. if non-null, the parser will initialize to the name space before parsing the input- Returns:
- - incoming structure value; null if none found
-
parsePropertyValue
Parse a property value from the input stream- Parameters:
path- - path of the element to use for the propertypropertyName- - name of the property to parseinputStream- - input stream containing property value- Returns:
- - data value for the property
-
parseParameters
Parse a list of comma separated parameter values from the input stream- Parameters:
params- - expected parameters. At return values are set in the parametersin- - input stream to parse
-
parseValue
Parse values from an input stream- Parameters:
in- - input stream to parse values frompath- - namespace path to be used as initial path for the incoming values- Returns:
- - list of structure values
-
getRepository
Description copied from interface:ParserGet the repository being used by the parser- Specified by:
getRepositoryin interfaceParser- Returns:
- - repository being used by the parser
-
main
Parse one or more files into a repository- Parameters:
args- - program arguments in the form [options] fileName [fileName ...] The parser accepts the following options (defaults in [ ]):- -r repository : name of a directory in the file system where the parsed files will be added [repository]
- -n nameSpace : default namespace for the classes [/root/local]
- -l logLevel : logging level for parser messages [finest]
- -h : (must be first argument) print a usage message (also printed if no arguments are given)
-