Package com.ibm.fhir.model.parser
Class FHIRAbstractParser
- java.lang.Object
- 
- com.ibm.fhir.model.parser.FHIRAbstractParser
 
- 
- All Implemented Interfaces:
- FHIRParser
 - Direct Known Subclasses:
- FHIRJsonParser,- FHIRXMLParser
 
 public abstract class FHIRAbstractParser extends Object implements FHIRParser 
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleanignoringUnrecognizedElementsprotected Map<String,Object>propertiesprotected booleanvalidating
 - 
Constructor SummaryConstructors Constructor Description FHIRAbstractParser()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T extends FHIRParser>
 Tas(Class<T> parserClass)Attempt to cast the FHIRParser to a specific subclassObjectgetProperty(String name)<T> TgetProperty(String name, Class<T> type)ObjectgetPropertyOrDefault(String name, Object defaultValue)<T> TgetPropertyOrDefault(String name, T defaultValue, Class<T> type)booleanisIgnoringUnrecognizedElements()Indicates whether this parser is ignoring unrecognized elementsbooleanisPropertySupported(String name)Whether the generator supports the property with the passed namebooleanisValidating()Indicates whether this parser is a validating parserabstract <T extends Resource>
 Tparse(InputStream in)Read a resource from the passed InputStream.abstract <T extends Resource>
 Tparse(Reader reader)Read a resource using the passed Reader.voidsetIgnoringUnrecognizedElements(boolean ignoringUnrecognizedElements)Set the ignoring unrecognized elements indicator for this parservoidsetProperty(String name, Object value)Set the property with the given name to the passed valuevoidsetValidating(boolean validating)Set the validating parser indicator for this parser
 
- 
- 
- 
Method Detail- 
parsepublic abstract <T extends Resource> T parse(InputStream in) throws FHIRParserException Description copied from interface:FHIRParserRead a resource from the passed InputStream. This method does not close the passed InputStream.- Specified by:
- parsein interface- FHIRParser
- Type Parameters:
- T- The resource type to read
- Returns:
- Throws:
- FHIRParserException- if the resource could not be parsed for any reason
 
 - 
parsepublic abstract <T extends Resource> T parse(Reader reader) throws FHIRParserException Description copied from interface:FHIRParserRead a resource using the passed Reader. This method does not close the passed Reader.- Specified by:
- parsein interface- FHIRParser
- Type Parameters:
- T- The resource type to read
- Returns:
- Throws:
- FHIRParserException- if the resource could not be parsed for any reason
 
 - 
setValidatingpublic void setValidating(boolean validating) Description copied from interface:FHIRParserSet the validating parser indicator for this parserA validating parser performs basic validation during parsing / deserialization of the input format including: - element cardinality checking
- element type checking
- element value checking
 - Specified by:
- setValidatingin interface- FHIRParser
- Parameters:
- validating- the validating parser indicator
- See Also:
- ValidationSupport
 
 - 
isValidatingpublic boolean isValidating() Description copied from interface:FHIRParserIndicates whether this parser is a validating parser- Specified by:
- isValidatingin interface- FHIRParser
- Returns:
- true if this parser is a validating parser, false otherwise
 
 - 
setIgnoringUnrecognizedElementspublic void setIgnoringUnrecognizedElements(boolean ignoringUnrecognizedElements) Description copied from interface:FHIRParserSet the ignoring unrecognized elements indicator for this parser- Specified by:
- setIgnoringUnrecognizedElementsin interface- FHIRParser
- Parameters:
- ignoringUnrecognizedElements- the ignoring unrecognized elements indicator
 
 - 
isIgnoringUnrecognizedElementspublic boolean isIgnoringUnrecognizedElements() Description copied from interface:FHIRParserIndicates whether this parser is ignoring unrecognized elements- Specified by:
- isIgnoringUnrecognizedElementsin interface- FHIRParser
- Returns:
- true if this parser is ignoring unrecognized elements, false otherwise
 
 - 
setPropertypublic void setProperty(String name, Object value) Description copied from interface:FHIRParserSet the property with the given name to the passed value- Specified by:
- setPropertyin interface- FHIRParser
 
 - 
getPropertypublic Object getProperty(String name) - Specified by:
- getPropertyin interface- FHIRParser
- Returns:
- the property value or nullif the property has no value
 
 - 
getPropertypublic <T> T getProperty(String name, Class<T> type) - Specified by:
- getPropertyin interface- FHIRParser
- Returns:
- the property value or nullif the property has no value
 
 - 
getPropertyOrDefaultpublic Object getPropertyOrDefault(String name, Object defaultValue) - Specified by:
- getPropertyOrDefaultin interface- FHIRParser
- Returns:
- the property value or defaultValueif the property has no value
 
 - 
getPropertyOrDefaultpublic <T> T getPropertyOrDefault(String name, T defaultValue, Class<T> type) - Specified by:
- getPropertyOrDefaultin interface- FHIRParser
- Returns:
- the property value or defaultValueif the property has no value
 
 - 
isPropertySupportedpublic boolean isPropertySupported(String name) Description copied from interface:FHIRParserWhether the generator supports the property with the passed name- Specified by:
- isPropertySupportedin interface- FHIRParser
 
 - 
aspublic <T extends FHIRParser> T as(Class<T> parserClass) Description copied from interface:FHIRParserAttempt to cast the FHIRParser to a specific subclass- Specified by:
- asin interface- FHIRParser
- Type Parameters:
- T- The FHIRParser subclass to cast to
- Returns:
 
 
- 
 
-