Package org.mitre.oval.xmlSchema.ovalVariables5

Examples of org.mitre.oval.xmlSchema.ovalVariables5.VariableType


      ResultContext resultContext = config.getResultContextResolver().resolve(getSourceContext(), "oval-results_", ".xml");

      File resultFile = resultContext.getResultFile();
            exec.setResultsFile(resultFile);

            OvalVariablesDocument variablesDocument = getVariablesDocument(getExports(), config);
            if (variablesDocument != null) {
          File variablesFile = resultContext.getAuxiliaryFile("oval-variables_", ".xml");
                variablesDocument.save( variablesFile, new XmlOptions().setSavePrettyPrint() );
                exec.setExternalVariableFile( variablesFile );
                variablesDocumentContent = new FileResultContent(variablesFile);
            }

            Set<String> defList = getCheckedDefinitions();
View Full Code Here


  private OvalVariablesDocument getVariablesDocument(Collection<CheckExport> exports, CheckInterpreterConfiguration config) throws XmlException, IOException {
        if (exports.size() == 0) {
            return null;
        }

        OvalVariablesDocument retval = OvalVariablesDocument.Factory.newInstance();
        OvalVariablesDocument.OvalVariables variables = retval.addNewOvalVariables();

        File schema = new File("ovaldi/xml/oval-variables-schema.xsd").getAbsoluteFile();
       
        XmlCursor cursor = variables.newCursor();
        cursor.toNextToken();
View Full Code Here

        for (CheckExport export : exports) {
            String variableId = export.getName();

            org.mitre.oval.xmlSchema.ovalDefinitions5.VariableType defVariable = ovalResolver.getVariable(variableId);

            VariableType variable = variablesType.addNewVariable();
               
            if (defVariable != null) {
                variable.setDatatype(defVariable.getDatatype());
            } else {
              // TODO: P3: handle simple and complex type
                switch (export.getType()) {
                    case BOOLEAN:
                        variable.setDatatype(SimpleDatatypeEnumeration.BOOLEAN);
                        break;
                    case NUMBER:
                    case STRING:
                    default:
                        variable.setDatatype(SimpleDatatypeEnumeration.STRING);
                        break;
                }
            }
            variable.setId(variableId);
            for (String s : export.getValues()) {
              variable.addNewValue().setStringValue(s);
            }
            variable.setComment("");
        }

        return retval;
    }
View Full Code Here

        cursor.dispose();

        GeneratorType generator = variables.addNewGenerator();
        generator.set(OVALCheckSystem.getGenerator(config));

        VariablesType variablesType = variables.addNewVariables();
        for (CheckExport export : exports) {
            String variableId = export.getName();

            org.mitre.oval.xmlSchema.ovalDefinitions5.VariableType defVariable = ovalResolver.getVariable(variableId);

            VariableType variable = variablesType.addNewVariable();
               
            if (defVariable != null) {
                variable.setDatatype(defVariable.getDatatype());
            } else {
              // TODO: P3: handle simple and complex type
View Full Code Here

TOP

Related Classes of org.mitre.oval.xmlSchema.ovalVariables5.VariableType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.