-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathTimeStampHandler.java
More file actions
29 lines (22 loc) · 918 Bytes
/
TimeStampHandler.java
File metadata and controls
29 lines (22 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
Copyright 2014 Yahoo! Inc.
Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
package com.yahoo.xpathproto.handler;
import org.apache.commons.jxpath.JXPathContext;
import java.util.List;
import com.yahoo.xpathproto.ObjectToFieldHandler;
import com.yahoo.xpathproto.dataobject.Config;
import com.yahoo.xpathproto.dataobject.Config.Entry;
import com.yahoo.xpathproto.dataobject.Context;
public class TimeStampHandler implements ObjectToFieldHandler {
@Override
public Object getProtoValue(final JXPathContext context, final Context vars, final Config.Entry entry) {
long curTime = System.currentTimeMillis() / 1000;
return curTime;
}
@Override
public List<Object> getRepeatedProtoValue(final JXPathContext context, final Context vars, final Entry entry) {
throw new UnsupportedOperationException("Invalid operation");
}
}