@Override protected String parse(String theValue) { if (XmlDetectionUtil.isStaxPresent()) { // for validation XmlUtil.parse(theValue); } return theValue; }
private XMLStreamWriter decorateStreamWriter(XMLStreamWriter eventWriter) { if (myPrettyPrint) { PrettyPrintWriterWrapper retVal = new PrettyPrintWriterWrapper(eventWriter); return retVal; } NonPrettyPrintWriterWrapper retVal = new NonPrettyPrintWriterWrapper(eventWriter); return retVal; }
/** * Finish the counter on the current task (which was started by calling * {@link #startTask(String)}. This method has no effect if no task * is currently started so it's ok to call it more than once. */ public void endCurrentTask() { ensureTasksListExists(); if (myCurrentTask != null) { myCurrentTask.setEnd(now()); } myCurrentTask = null; }
@CoverageIgnore public void setSystemDao(IFhirSystemDao<Bundle, MetaDt> mySystemDao) { this.mySystemDao = mySystemDao; } }
/** * Formats value in an appropriate format. See {@link #formatMillis(long)}} * for a description of the format * * @see #formatMillis(long) */ @Override public String toString() { return formatMillis(getMillis()); }
/** * Returns values stored in an element identified by its path. The list of values is of * type {@link Object}. * * @param theResource The resource instance to be accessed. Must not be null. * @param thePath The path for the element to be accessed. * @return A list of values of type {@link Object}. */ public List<Object> getValues(IBaseResource theResource, String thePath) { Class<Object> wantedClass = Object.class; return getValues(theResource, thePath, wantedClass); }
/** * Parses the date value using the given date formats. * * @param dateValue the date value to parse * @param dateFormats the date formats to use * * @return the parsed date or null if input could not be parsed */ public static Date parseDate(final String dateValue, final String[] dateFormats) { return parseDate(dateValue, dateFormats, null); }
/** * Constructor which accepts an {@link IBaseOperationOutcome} resource which will be supplied in the response */ public UnprocessableEntityException(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, OperationOutcomeUtil.getFirstIssueDetails(theCtx, theOperationOutcome), theOperationOutcome); }
public static Object newInstanceOfFhirServerType(String theType) { String errorMessage = "Unable to instantiate server framework. Please make sure that hapi-fhir-server library is on your classpath!"; String wantedType = "ca.uhn.fhir.rest.api.server.IFhirVersionServer"; Object fhirServerVersion = newInstanceOfType(theType, errorMessage, wantedType); return fhirServerVersion; }
public long getMillisAndRestart() { long now = now(); long retVal = now - myStarted; myStarted = now; return retVal; }
public boolean matchesIncludeSet(Set<Include> theIncludes) { if (theIncludes == null) return false; for (Include include : theIncludes) { if (matchesInclude(include)) return true; } return false; }
static Class<? extends Enum<?>> determineEnumTypeForBoundField(Field next) { @SuppressWarnings("unchecked") Class<? extends Enum<?>> enumType = (Class<? extends Enum<?>>) ReflectionUtil.getGenericCollectionTypeOfFieldWithSecondOrderForList(next); return enumType; }
private static XMLOutputFactory getOrCreateOutputFactory() throws FactoryConfigurationError { if (ourOutputFactory == null) { ourOutputFactory = createOutputFactory(); } return ourOutputFactory; }
/** * Extract all of the resources from a given bundle */ public static List<IBaseResource> toListOfResources(FhirContext theContext, IBaseBundle theBundle) { return toListOfResourcesOfType(theContext, theBundle, null); }
@Override public boolean shouldIncludeReferencedResource(ResourceReferenceInfo theReferenceInfo, Set<Include> theIncludes) { return theReferenceInfo.matchesIncludeSet(theIncludes); } },
@CoverageIgnore public void setSystemDao(IFhirSystemDao<Bundle, Meta> mySystemDao) { this.mySystemDao = mySystemDao; } }
@SuppressWarnings("unchecked") public static <EVS_IN, EVS_OUT, SDT, CST, CDCT, IST> ca.uhn.fhir.context.support.IContextValidationSupport<EVS_IN, EVS_OUT, SDT, CST, CDCT, IST> newInstanceOfFhirProfileValidationSupport( String theType) { String errorMessage = "Unable to instantiate validation support! Please make sure that hapi-fhir-validation and the appropriate structures JAR are on your classpath!"; String wantedType = "ca.uhn.fhir.context.support.IContextValidationSupport"; Object fhirServerVersion = newInstanceOfType(theType, errorMessage, wantedType); return (IContextValidationSupport<EVS_IN, EVS_OUT, SDT, CST, CDCT, IST>) fhirServerVersion; }
@CoverageIgnore @Override public CodeSystem fetchCodeSystem(FhirContext theContext, String theSystem) { return null; }
/** * Returns false */ @Override @CoverageIgnore public boolean hasFormatComment() { return false; }
/** * Non instantiable */ @CoverageIgnore private DependencyLogFactory() { // nothing }