-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,001 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
jackson-jq-extra/src/main/java/net/thisptr/jackson/jq/extra/ModuleImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package net.thisptr.jackson.jq.extra; | ||
|
||
import com.google.auto.service.AutoService; | ||
|
||
import net.thisptr.jackson.jq.BuiltinFunction; | ||
import net.thisptr.jackson.jq.Function; | ||
import net.thisptr.jackson.jq.extra.functions.HostnameFunction; | ||
import net.thisptr.jackson.jq.extra.functions.RandomFunction; | ||
import net.thisptr.jackson.jq.extra.functions.StrFTimeFunction; | ||
import net.thisptr.jackson.jq.extra.functions.StrPTimeFunction; | ||
import net.thisptr.jackson.jq.extra.functions.TimestampFunction; | ||
import net.thisptr.jackson.jq.extra.functions.UriDecodeFunction; | ||
import net.thisptr.jackson.jq.extra.functions.UriParseFunction; | ||
import net.thisptr.jackson.jq.extra.functions.Uuid4Function; | ||
import net.thisptr.jackson.jq.module.BuiltinModule; | ||
import net.thisptr.jackson.jq.module.Module; | ||
import net.thisptr.jackson.jq.module.SimpleModule; | ||
|
||
@AutoService(Module.class) | ||
@BuiltinModule(path = "jackson-jq/extras") | ||
public class ModuleImpl extends SimpleModule { | ||
|
||
public ModuleImpl() { | ||
addFunction(new HostnameFunction()); | ||
addFunction(new RandomFunction()); | ||
addFunction(new StrFTimeFunction()); | ||
addFunction(new StrPTimeFunction()); | ||
addFunction(new TimestampFunction()); | ||
addFunction(new UriDecodeFunction()); | ||
addFunction(new UriParseFunction()); | ||
addFunction(new Uuid4Function()); | ||
} | ||
|
||
private void addFunction(final Function f) { | ||
final BuiltinFunction annotation = f.getClass().getAnnotation(BuiltinFunction.class); | ||
for (final String fname : annotation.value()) | ||
addFunction(fname, f); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...son-jq/src/main/java/net/thisptr/jackson/jq/internal/module/loaders/NullModuleLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.thisptr.jackson.jq.internal.module.loaders; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
import net.thisptr.jackson.jq.module.Module; | ||
import net.thisptr.jackson.jq.module.ModuleLoader; | ||
|
||
public class NullModuleLoader implements ModuleLoader { | ||
|
||
private static final NullModuleLoader INSTANCE = new NullModuleLoader(); | ||
|
||
public static NullModuleLoader getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
@Override | ||
public Module loadModule(final Module caller, final String path, final JsonNode metadata) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public JsonNode loadData(final Module caller, final String path, final JsonNode metadata) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.