-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Java Geci dependency was removed, and instead Jamal dependency added …
…with the 2.1.0-SNAPSHOT release it will not compile on the GitHub site, not relesable version
- Loading branch information
Showing
13 changed files
with
238 additions
and
240 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<!-- | ||
This file was generated from extensions.jam in the same directory as extensions.xml | ||
The current version of Jamal is 1.12.3-SNAPSHOT. | ||
The latest version is 1.12.2. | ||
The current version of Jamal is 2.1.0-SNAPSHOT. | ||
The latest version is 2.0.2. | ||
--><extensions> | ||
<extension> | ||
<groupId>com.javax0.jamal</groupId> | ||
<artifactId>jamal-maven-extension</artifactId> | ||
<version>1.12.2</version> | ||
<version>2.0.2</version> | ||
</extension> | ||
</extensions> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{%!@for [separator="\\s*\n\\s*" skipEmpty] ($type,$vType,$value) in `LOOP` | ||
Binary|byte[]|value | ||
String|String|value.getBytes(StandardCharsets.UTF_8) | ||
Byte|Byte|new byte[]{value} | ||
Short|Short|ByteBuffer.allocate(Short.BYTES).putShort(value).array() | ||
Int|Integer|ByteBuffer.allocate(Integer.BYTES).putInt(value).array() | ||
Long|Long|ByteBuffer.allocate(Long.BYTES).putLong(value).array() | ||
Float|Float|ByteBuffer.allocate(Float.BYTES).putFloat(value).array() | ||
Double|Double|ByteBuffer.allocate(Double.BYTES).putDouble(value).array() | ||
BigInteger|BigInteger|value.toByteArray() | ||
uuid|java.util.UUID|ByteBuffer.allocate(2 * Long.BYTES).putLong(value.getLeastSignificantBits()).putLong(value.getMostSignificantBits()).array() | ||
Date|Date|ByteBuffer.allocate(Long.BYTES).putLong(value.getTime()).array() | ||
`LOOP`= | ||
/** | ||
* Create a new {%@case:decap $type%} feature. | ||
* | ||
* @param name the name of the new feature | ||
* @param value the value for the new feature. {@code null} value will throw an exception | ||
* @return the newly created feature object | ||
*{%@comment%}/ | ||
public static Feature {%@case:decap $type%}Feature(String name, $vType value) { | ||
Objects.requireNonNull(value); | ||
return new Feature(name, Type.{%@case:upper $type%}, $value); | ||
} | ||
%} | ||
{%@java:insert to="../java/javax0/license3j/Feature.java" id="FeatureMethods"%} |
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,21 @@ | ||
private enum Type {{%@counter:define id=typeSerial%}\ | ||
{%!@for [separator="\\s*\n\\s*" skipEmpty]($type,$length,$cast,$stringer,$unstringer,$sep) in `LOOP` | ||
binary|VARIABLE_LENGTH|byte[]|ba -> Base64.getEncoder().encodeToString((byte[]) ba)|enc -> Base64.getDecoder().decode(enc)| | ||
string|VARIABLE_LENGTH|||s -> s| | ||
byte|||b -> String.format("0x%02X", (Byte) b)|NumericParser.Byte::parse| | ||
short||||NumericParser.Short::parse| | ||
int|Integer.BYTES|Integer||NumericParser.Int::parse| | ||
long||||NumericParser.Long::parse| | ||
float||||Float::parseFloat| | ||
double||||Double::parseDouble| | ||
bigInteger|VARIABLE_LENGTH|||BigInteger::new| | ||
bigDecimal|VARIABLE_LENGTH|||BigDecimal::new| | ||
date|Long.BYTES||Feature::dateFormat|Feature::dateParse| | ||
UUID|2 * Long.BYTES|java.util.UUID||java.util.UUID::fromString|; | ||
`LOOP`= | ||
{%@case:upper $type%}({%typeSerial%}, {%#if/$length/$length/{%@case:cap $type%}.BYTES%}, | ||
Feature::get{%@case:cap $type%}, | ||
(name, value) -> Create.{%@replace /$type/UUID/uuid%}Feature(name, ({%#if/$cast/$cast/{%@case:cap $type%}%}) value), | ||
{%#if/$stringer/$stringer/Object::toString%}, $unstringer){%@if/$sep/$sep/,%} | ||
%} | ||
{%@java:insert to="../java/javax0/license3j/Feature.java" id="TypesEnum"%} |
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,14 @@ | ||
{%!@for [separator="\\s*\n\\s*" skipEmpty]($rettype,$name,$exceptions) in | ||
`LOOP` | ||
String|getName| | ||
byte[]|getHardwareAddress|SocketException | ||
String|getDisplayName| | ||
boolean|isLoopback|SocketException | ||
boolean|isVirtual|SocketException | ||
boolean|isPointToPoint|SocketException | ||
`LOOP`= | ||
public $rettype $name(){%#if/$exceptions/ throws $exceptions/%} { | ||
return ni.$name(); | ||
} | ||
%} | ||
{%@java:insert to="../java/javax0/license3j/hardware/Network.java" id="Network"%} |
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,15 @@ | ||
{%!@for ($Type) in (Public,Private)= /**GENERATED CODE | ||
* Get the byte representation of the {%@case:lower $Type%} key as it is returned | ||
* by the underlying security library. It is NOT the byte array | ||
* that contains the algorithm at the start. It is the key in raw | ||
* format. | ||
* | ||
* @return the key as bytes | ||
*{%@comment%}/ | ||
public byte[] get$Type() { | ||
keyNotNull(pair.get$Type()); | ||
final var key = pair.get$Type(); | ||
return getKeyBytes(key); | ||
} | ||
%}\ | ||
{%@java:insert to="../java/javax0/license3j/crypto/LicenseKeyPair.java" id="getTypes"%} |
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,21 @@ | ||
{%@comment UUID and BigDecimal are handled separately, because they differ significantly%}\ | ||
{%!@for [separator="\\s*\n\\s*" skipEmpty]($Type,$return,$rType) in `LOOP` | ||
Binary|value|byte[] | ||
String|new String(value, StandardCharsets.UTF_8)|String | ||
Byte|value[0]|byte | ||
Short|ByteBuffer.wrap(value).getShort()|short | ||
Int|ByteBuffer.wrap(value).getInt()|int | ||
Long|ByteBuffer.wrap(value).getLong()|long | ||
Float|ByteBuffer.wrap(value).getFloat()|float | ||
Double|ByteBuffer.wrap(value).getDouble()|double | ||
BigInteger|new BigInteger(value)|BigInteger | ||
Date|new Date(ByteBuffer.wrap(value).getLong())|Date | ||
`LOOP`= | ||
public $rType get$Type() { | ||
if (type != Type.{%@case:upper $Type%}) { | ||
throw new IllegalArgumentException("Feature is not {%@case:upper $Type%}"); | ||
} | ||
return $return; | ||
} | ||
%}\ | ||
{%@java:insert to="../java/javax0/license3j/Feature.java" id="getTypes"%}\ |
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,10 @@ | ||
// {%@rot13 TRARENGRQ PBQR%} | ||
{%!@for $Type in (Binary,String,Byte,Short,Int,Long,Float,Double,BigInteger,BigDecimal,Date,UUID)= | ||
/** | ||
* @return {@code true} if the feature is of type $Type | ||
*{%@ident%}/ | ||
public boolean is$Type() { | ||
return type == Type.{%@case:upper $Type%}; | ||
} | ||
%}\ | ||
{%@java:insert to="../java/javax0/license3j/Feature.java" id="isTypes"%}\ |
Oops, something went wrong.