本文整理匯總了Java中org.hl7.fhir.instance.model.TimeType類的典型用法代碼示例。如果您正苦於以下問題:Java TimeType類的具體用法?Java TimeType怎麽用?Java TimeType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TimeType類屬於org.hl7.fhir.instance.model包,在下文中一共展示了TimeType類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fromJavaPrimitive
import org.hl7.fhir.instance.model.TimeType; //導入依賴的package包/類
@Override
protected Object fromJavaPrimitive(Object value, Object target) {
if (target instanceof DateTimeType) {
return new Date(); // TODO: Why is this so hard?
}
else if (target instanceof DateType) {
return new Date();
}
else if (target instanceof TimeType) {
if (value instanceof Time) {
return ((Time) value).getPartial().toString();
}
return new Date();
}
else {
return value;
}
}
開發者ID:Discovery-Research-Network-SCCM,項目名稱:FHIR-CQL-ODM-service,代碼行數:19,代碼來源:UsciitgFhirDataProviderHL7.java
示例2: processDateConstant
import org.hl7.fhir.instance.model.TimeType; //導入依賴的package包/類
private Base processDateConstant(Object appInfo, String value) throws PathEngineException {
if (value.startsWith("T"))
return new TimeType(value.substring(1));
String v = value;
if (v.length() > 10) {
int i = v.substring(10).indexOf("-");
if (i == -1)
i = v.substring(10).indexOf("+");
if (i == -1)
i = v.substring(10).indexOf("Z");
v = i == -1 ? value : v.substring(0, 10+i);
}
if (v.length() > 10)
return new DateTimeType(value);
else
return new DateType(value);
}
示例3: toJavaPrimitive
import org.hl7.fhir.instance.model.TimeType; //導入依賴的package包/類
@Override
protected Object toJavaPrimitive(Object result, Object source) {
if(source instanceof Iterable){
List<Object> mappedResults = new ArrayList<Object>();
for (Object item : (Iterable<?>)source) {
Object mappedItem = toJavaPrimitive(item, item);
if(mappedItem instanceof IPrimitiveType){
mappedResults.add(((IPrimitiveType<?>) mappedItem).getValue());
}else{
mappedResults.add(mappedItem);
}
}
return mappedResults;
}
else if (source instanceof DateTimeType) {
return DateTime.fromJavaDate(((DateTimeType) source).getValue()); //toDateTime((DateTimeType)source);
}
else if (source instanceof DateType) {
return DateTime.fromJavaDate(((DateType) source).getValue()); //toDateTime((DateType)source);
}
else if (source instanceof TimeType) {
return toTime((TimeType)source);
}
else if (source instanceof InstantType) {
return toDateTime((InstantType)source);
}
else {
return result;
}
}
開發者ID:Discovery-Research-Network-SCCM,項目名稱:FHIR-CQL-ODM-service,代碼行數:32,代碼來源:UsciitgFhirDataProviderHL7.java
示例4: parseTime
import org.hl7.fhir.instance.model.TimeType; //導入依賴的package包/類
private TimeType parseTime(XmlPullParser xpp) throws Exception {
TimeType res = new TimeType();
parseElementAttributes(xpp, res);
res.setValue(parseTimePrimitive(xpp.getAttributeValue(null, "value")));
next(xpp);
int eventType = nextNoWhitespace(xpp);
while (eventType != XmlPullParser.END_TAG) {
if (!parseElementContent(eventType, xpp, res))
unknownContent(xpp);
eventType = nextNoWhitespace(xpp);
}
next(xpp);
return res;
}
示例5: parseTime
import org.hl7.fhir.instance.model.TimeType; //導入依賴的package包/類
private TimeType parseTime(String v) throws Exception {
TimeType res = new TimeType();
if (v != null)
res.setValue(parseTimePrimitive(v));
return res;
}