Class DSLMappingFile

  • Direct Known Subclasses:
    DSLTokenizedMappingFile

    public abstract class DSLMappingFile
    extends java.lang.Object
    A helper class that handles a DSL Mapping file
    • Constructor Summary

      Constructors 
      Constructor Description
      DSLMappingFile()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String dumpFile()
      Method to return the current mapping as a String object
      java.util.List<org.kie.internal.builder.KnowledgeBuilderResult> getErrors()
      Returns the list of parsing errors
      DSLMapping getMapping()
      Returns the DSL mapping loaded from this file
      abstract boolean parseAndLoad​(java.io.Reader dsl)
      Parses the file.
      void saveMapping​(java.io.Writer out)
      Saves current mapping into a DSL mapping file
      static void saveMapping​(java.io.Writer out, DSLMapping mapping)
      Saves the given mapping into a DSL mapping file
      protected void setErrors​(java.util.List<? extends org.kie.internal.builder.KnowledgeBuilderResult> errors)  
      void setMapping​(DSLMapping mapping)
      Sets the
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DSLMappingFile

        public DSLMappingFile()
    • Method Detail

      • getMapping

        public DSLMapping getMapping()
        Returns the DSL mapping loaded from this file
        Returns:
      • setMapping

        public void setMapping​(DSLMapping mapping)
        Sets the
        Parameters:
        mapping -
      • getErrors

        public java.util.List<org.kie.internal.builder.KnowledgeBuilderResult> getErrors()
        Returns the list of parsing errors
        Returns:
      • setErrors

        protected void setErrors​(java.util.List<? extends org.kie.internal.builder.KnowledgeBuilderResult> errors)
      • parseAndLoad

        public abstract boolean parseAndLoad​(java.io.Reader dsl)
                                      throws java.io.IOException
        Parses the file. Throws IOException in case there is any problem reading the file;
        Returns:
        true in case no error was found parsing the file. false otherwise. Use getErrors() to check for the actual errors.
        Throws:
        java.io.IOException
      • saveMapping

        public void saveMapping​(java.io.Writer out)
                         throws java.io.IOException
        Saves current mapping into a DSL mapping file
        Parameters:
        out -
        Throws:
        java.io.IOException
      • saveMapping

        public static void saveMapping​(java.io.Writer out,
                                       DSLMapping mapping)
                                throws java.io.IOException
        Saves the given mapping into a DSL mapping file
        Parameters:
        out -
        mapping -
        Throws:
        java.io.IOException
      • dumpFile

        public java.lang.String dumpFile()
        Method to return the current mapping as a String object
        Returns: