Class Dissector

    • Constructor Detail

      • Dissector

        public Dissector()
    • Method Detail

      • initializeFromSettingsParameter

        public boolean initializeFromSettingsParameter​(String settings)
        If a Dissector is loaded through an external language then this is the method that is called to set all the parameters. There is exactly one String as input so it is up to the specific Dissector implementation to parse and handle this input.
        Returns:
        true if everything went right. false otherwise.
      • getInputType

        public abstract String getInputType()
        Returns:
        The required typename of the input
      • getPossibleOutput

        public abstract List<String> getPossibleOutput()
        What are all possible outputs that can be provided.
        Returns:
        array of "type:name" values that indicates all the possible outputs. Never a null!
      • prepareForDissect

        public abstract EnumSet<Casts> prepareForDissect​(String inputname,
                                                         String outputname)
        This tells the dissector that it should prepare that we will call it soon with 'inputname' and expect to get 'inputname.outputname' because inputname is of the type returned by getInputType and outputname was part of the answer from getPossibleOutput. This can be used by the dissector implementation to optimize the internal parsing algorithms and lookup tables and such. The dissector must return the types to which this value can be mapped later on during the run.
        Returns:
        The EnumSet of all allowed casts. Returns an empty EnumSet if nothing is allowed. Never a null !
      • getNewInstance

        public Dissector getNewInstance()
        Create an additional instance of this dissector. This is needed because in the parse tree we may need the same dissector multiple times. In order to optimize per node we need separate instances.
        Returns:
        New instance of this Dissector
      • extractFieldName

        public String extractFieldName​(String inputname,
                                       String outputname)
      • initializeNewInstance

        protected void initializeNewInstance​(Dissector newInstance)
                                      throws InvalidDissectorException
        This is called after instantiating the class that is actually in the parsetree.
        Parameters:
        newInstance - The new instances of this class that must be initialized
        Throws:
        InvalidDissectorException
      • createAdditionalDissectors

        public <RECORD> void createAdditionalDissectors​(Parser<RECORD> parser)
        If a dissector really needs to add an additional dissector to the set this method is the place to do so.
        Type Parameters:
        RECORD - The type of the record.
        Parameters:
        parser - The instance of the parser where the extra dissector is to be added to.