Class FHIRAbstractParser

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends FHIRParser>
      T
      as​(java.lang.Class<T> parserClass)
      Attempt to cast the FHIRParser to a specific subclass
      java.lang.Object getProperty​(java.lang.String name)  
      <T> T getProperty​(java.lang.String name, java.lang.Class<T> type)  
      java.lang.Object getPropertyOrDefault​(java.lang.String name, java.lang.Object defaultValue)  
      <T> T getPropertyOrDefault​(java.lang.String name, T defaultValue, java.lang.Class<T> type)  
      boolean isIgnoringUnrecognizedElements()
      Indicates whether this parser is ignoring unrecognized elements
      boolean isPropertySupported​(java.lang.String name)
      Whether the generator supports the property with the passed name
      boolean isValidating()
      Indicates whether this parser is a validating parser
      abstract <T extends Resource>
      T
      parse​(java.io.InputStream in)
      Read a resource from the passed InputStream.
      abstract <T extends Resource>
      T
      parse​(java.io.Reader reader)
      Read a resource using the passed Reader.
      void setIgnoringUnrecognizedElements​(boolean ignoringUnrecognizedElements)
      Set the ignoring unrecognized elements indicator for this parser
      void setProperty​(java.lang.String name, java.lang.Object value)
      Set the property with the given name to the passed value
      void setValidating​(boolean validating)
      Set the validating parser indicator for this parser
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • properties

        protected java.util.Map<java.lang.String,​java.lang.Object> properties
      • validating

        protected boolean validating
      • ignoringUnrecognizedElements

        protected boolean ignoringUnrecognizedElements
    • Constructor Detail

      • FHIRAbstractParser

        public FHIRAbstractParser()
    • Method Detail

      • parse

        public abstract <T extends Resource> T parse​(java.io.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​(java.io.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​(java.lang.String name,
                                java.lang.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 java.lang.Object getProperty​(java.lang.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​(java.lang.String name,
                                 java.lang.Class<T> type)
        Specified by:
        getProperty in interface FHIRParser
        Returns:
        the property value or null if the property has no value
      • getPropertyOrDefault

        public java.lang.Object getPropertyOrDefault​(java.lang.String name,
                                                     java.lang.Object defaultValue)
        Specified by:
        getPropertyOrDefault in interface FHIRParser
        Returns:
        the property value or defaultValue if the property has no value
      • getPropertyOrDefault

        public <T> T getPropertyOrDefault​(java.lang.String name,
                                          T defaultValue,
                                          java.lang.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​(java.lang.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​(java.lang.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: