Class FHIRAbstractParser

    • Field Detail

      • validating

        protected boolean validating
      • ignoringUnrecognizedElements

        protected boolean ignoringUnrecognizedElements
    • Constructor Detail

      • FHIRAbstractParser

        public FHIRAbstractParser()
    • Method Detail

      • parse

        public abstract <T extends Resource> T parse​(InputStream in)
                                              throws FHIRParserException
        Description copied from interface: FHIRParser
        Read a resource from the passed InputStream. This method does not close the passed InputStream.
        Specified by:
        parse in interface FHIRParser
        Type Parameters:
        T - The resource type to read
        Returns:
        Throws:
        FHIRParserException - if the resource could not be parsed for any reason
      • parse

        public abstract <T extends Resource> T parse​(Reader reader)
                                              throws FHIRParserException
        Description copied from interface: FHIRParser
        Read a resource using the passed Reader. This method does not close the passed Reader.
        Specified by:
        parse in interface FHIRParser
        Type Parameters:
        T - The resource type to read
        Returns:
        Throws:
        FHIRParserException - if the resource could not be parsed for any reason
      • setValidating

        public void setValidating​(boolean validating)
        Description copied from interface: FHIRParser
        Set the validating parser indicator for this parser

        A validating parser performs basic validation during parsing / deserialization of the input format including:

        • element cardinality checking
        • element type checking
        • element value checking
        Specified by:
        setValidating in interface FHIRParser
        Parameters:
        validating - the validating parser indicator
        See Also:
        ValidationSupport
      • isValidating

        public boolean isValidating()
        Description copied from interface: FHIRParser
        Indicates whether this parser is a validating parser
        Specified by:
        isValidating in interface FHIRParser
        Returns:
        true if this parser is a validating parser, false otherwise
      • setIgnoringUnrecognizedElements

        public void setIgnoringUnrecognizedElements​(boolean ignoringUnrecognizedElements)
        Description copied from interface: FHIRParser
        Set the ignoring unrecognized elements indicator for this parser
        Specified by:
        setIgnoringUnrecognizedElements in interface FHIRParser
        Parameters:
        ignoringUnrecognizedElements - the ignoring unrecognized elements indicator
      • isIgnoringUnrecognizedElements

        public boolean isIgnoringUnrecognizedElements()
        Description copied from interface: FHIRParser
        Indicates whether this parser is ignoring unrecognized elements
        Specified by:
        isIgnoringUnrecognizedElements in interface FHIRParser
        Returns:
        true if this parser is ignoring unrecognized elements, false otherwise
      • setProperty

        public void setProperty​(String name,
                                Object value)
        Description copied from interface: FHIRParser
        Set the property with the given name to the passed value
        Specified by:
        setProperty in interface FHIRParser
      • getProperty

        public Object getProperty​(String name)
        Specified by:
        getProperty in interface FHIRParser
        Returns:
        the property value or null if the property has no value
      • getProperty

        public <T> T getProperty​(String name,
                                 Class<T> type)
        Specified by:
        getProperty in interface FHIRParser
        Returns:
        the property value or null if the property has no value
      • getPropertyOrDefault

        public <T> T getPropertyOrDefault​(String name,
                                          T defaultValue,
                                          Class<T> type)
        Specified by:
        getPropertyOrDefault in interface FHIRParser
        Returns:
        the property value or defaultValue if the property has no value
      • isPropertySupported

        public boolean isPropertySupported​(String name)
        Description copied from interface: FHIRParser
        Whether the generator supports the property with the passed name
        Specified by:
        isPropertySupported in interface FHIRParser
      • as

        public <T extends FHIRParser> T as​(Class<T> parserClass)
        Description copied from interface: FHIRParser
        Attempt to cast the FHIRParser to a specific subclass
        Specified by:
        as in interface FHIRParser
        Type Parameters:
        T - The FHIRParser subclass to cast to
        Returns: