Skip to content

Commit 8a3e91a

Browse files
committed
Initial version with swap pricer example
0 parents  commit 8a3e91a

File tree

102 files changed

+8009
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+8009
-0
lines changed

examples/swap-pricer.xlsx

14.2 KB
Binary file not shown.

pom.xml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.jinx</groupId>
8+
<artifactId>strata-excel</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<packaging>jar</packaging>
11+
<name>Strata-Excel</name>
12+
<description>Excel bindings for Strata</description>
13+
14+
<!-- ==================================================================== -->
15+
<build>
16+
<resources>
17+
<resource>
18+
<directory>src/main/resources</directory>
19+
</resource>
20+
</resources>
21+
<plugins>
22+
<plugin>
23+
<groupId>org.apache.maven.plugins</groupId>
24+
<artifactId>maven-compiler-plugin</artifactId>
25+
<configuration>
26+
<source>1.8</source>
27+
<target>1.8</target>
28+
</configuration>
29+
</plugin>
30+
<plugin>
31+
<artifactId>maven-dependency-plugin</artifactId>
32+
<executions>
33+
<execution>
34+
<phase>package</phase>
35+
<goals>
36+
<goal>copy-dependencies</goal>
37+
</goals>
38+
<configuration>
39+
<outputDirectory>${project.build.directory}/lib</outputDirectory>
40+
</configuration>
41+
</execution>
42+
</executions>
43+
</plugin>
44+
</plugins>
45+
</build>
46+
47+
<!-- ==================================================================== -->
48+
<dependencies>
49+
<!-- Jinx -->
50+
<dependency>
51+
<groupId>com.jinx</groupId>
52+
<artifactId>jinx</artifactId>
53+
<version>1.0-SNAPSHOT</version>
54+
</dependency>
55+
56+
<!-- OpenGamma, relying on transitive dependencies -->
57+
<dependency>
58+
<groupId>com.opengamma.strata</groupId>
59+
<artifactId>strata-measure</artifactId>
60+
<version>1.5.2</version>
61+
</dependency>
62+
<dependency>
63+
<groupId>com.opengamma.strata</groupId>
64+
<artifactId>strata-report</artifactId>
65+
<version>1.5.2</version>
66+
</dependency>
67+
<dependency>
68+
<groupId>com.opengamma.strata</groupId>
69+
<artifactId>strata-loader</artifactId>
70+
<version>1.5.2</version>
71+
</dependency>
72+
</dependencies>
73+
</project>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.jinx.strataexcel.basics;
10+
11+
import com.jinx.ExcelAddIn;
12+
import com.jinx.ExcelArgument;
13+
import com.jinx.ExcelArguments;
14+
import com.jinx.ExcelFunction;
15+
import com.opengamma.strata.basics.ReferenceData;
16+
17+
18+
public class ReferenceDataXL {
19+
private final ExcelAddIn xl;
20+
21+
public ReferenceDataXL(ExcelAddIn xl) {
22+
this.xl = xl;
23+
}
24+
25+
@ExcelFunction(
26+
value = "og.ReferenceData.combinedWith",
27+
category = "Strata",
28+
isThreadSafe = true
29+
)
30+
@ExcelArguments({
31+
@ExcelArgument("referenceData"),
32+
@ExcelArgument("other")
33+
})
34+
public ReferenceData combinedWith(ReferenceData referenceData, ReferenceData other) {
35+
return referenceData.combinedWith(other);
36+
}
37+
38+
@ExcelFunction(
39+
value = "og.ReferenceData.empty",
40+
category = "Strata",
41+
isThreadSafe = true
42+
)
43+
public ReferenceData empty() {
44+
return ReferenceData.empty();
45+
}
46+
47+
@ExcelFunction(
48+
value = "og.ReferenceData.minimal",
49+
category = "Strata",
50+
isThreadSafe = true
51+
)
52+
public ReferenceData minimal() {
53+
return ReferenceData.minimal();
54+
}
55+
56+
@ExcelFunction(
57+
value = "og.ReferenceData.standard",
58+
category = "Strata",
59+
isThreadSafe = true
60+
)
61+
public ReferenceData standard() {
62+
return ReferenceData.standard();
63+
}
64+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.jinx.strataexcel.basics;
10+
11+
import com.jinx.ExcelAddIn;
12+
import com.jinx.ExcelArgument;
13+
import com.jinx.ExcelArgumentConverter;
14+
import com.jinx.ExcelArguments;
15+
import com.jinx.ExcelFunction;
16+
import com.opengamma.strata.basics.StandardId;
17+
18+
19+
public class StandardIdXL {
20+
private final ExcelAddIn xl;
21+
22+
public StandardIdXL(ExcelAddIn xl) {
23+
this.xl = xl;
24+
}
25+
26+
@ExcelFunction(
27+
value = "og.StandardId.of",
28+
category = "Strata",
29+
isThreadSafe = true
30+
)
31+
@ExcelArguments({
32+
@ExcelArgument("scheme"),
33+
@ExcelArgument("value")
34+
})
35+
public StandardId of(String scheme, String value) {
36+
return StandardId.of(scheme, value);
37+
}
38+
39+
@ExcelArgumentConverter
40+
@ExcelFunction(
41+
value = "og.StandardId.parse",
42+
category = "Strata",
43+
isThreadSafe = true
44+
)
45+
@ExcelArguments({
46+
@ExcelArgument("str")
47+
})
48+
public StandardId parse(String str) {
49+
return StandardId.parse(str);
50+
}
51+
52+
@ExcelFunction(
53+
value = "og.StandardId.toString",
54+
category = "Strata",
55+
isThreadSafe = true
56+
)
57+
@ExcelArguments({
58+
@ExcelArgument("standardId")
59+
})
60+
public String toString(StandardId standardId) {
61+
return standardId.toString();
62+
}
63+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.jinx.strataexcel.basics.currency;
10+
11+
import com.jinx.ExcelAddIn;
12+
import com.jinx.ExcelArgument;
13+
import com.jinx.ExcelArgumentConverter;
14+
import com.jinx.ExcelArguments;
15+
import com.jinx.ExcelFunction;
16+
import com.opengamma.strata.basics.currency.Currency;
17+
import com.opengamma.strata.basics.currency.CurrencyAmount;
18+
19+
20+
public class CurrencyAmountXL {
21+
private final ExcelAddIn xl;
22+
23+
public CurrencyAmountXL(ExcelAddIn xl) {
24+
this.xl = xl;
25+
}
26+
27+
@ExcelFunction(
28+
value = "og.CurrencyAmount.getAmount",
29+
category = "Strata",
30+
isThreadSafe = true
31+
)
32+
@ExcelArguments({
33+
@ExcelArgument("currencyAmount")
34+
})
35+
public double getAmount(CurrencyAmount currencyAmount) {
36+
return currencyAmount.getAmount();
37+
}
38+
39+
@ExcelFunction(
40+
value = "og.CurrencyAmount.getCurrency",
41+
category = "Strata",
42+
isThreadSafe = true
43+
)
44+
@ExcelArguments({
45+
@ExcelArgument("currencyAmount")
46+
})
47+
public Currency getCurrency(CurrencyAmount currencyAmount) {
48+
return currencyAmount.getCurrency();
49+
}
50+
51+
@ExcelFunction(
52+
value = "og.CurrencyAmount.of",
53+
category = "Strata",
54+
isThreadSafe = true
55+
)
56+
@ExcelArguments({
57+
@ExcelArgument("currency"),
58+
@ExcelArgument("amount")
59+
})
60+
public CurrencyAmount of(Currency currency, double amount) {
61+
return CurrencyAmount.of(currency, amount);
62+
}
63+
64+
@ExcelArgumentConverter
65+
@ExcelFunction(
66+
value = "og.CurrencyAmount.parse",
67+
category = "Strata",
68+
isThreadSafe = true
69+
)
70+
@ExcelArguments({
71+
@ExcelArgument("amountStr")
72+
})
73+
public CurrencyAmount parse(String amountStr) {
74+
return CurrencyAmount.parse(amountStr);
75+
}
76+
77+
@ExcelFunction(
78+
value = "og.CurrencyAmount.toString",
79+
category = "Strata",
80+
isThreadSafe = true
81+
)
82+
@ExcelArguments({
83+
@ExcelArgument("currencyAmount")
84+
})
85+
public String toString(CurrencyAmount currencyAmount) {
86+
return currencyAmount.toString();
87+
}
88+
89+
@ExcelFunction(
90+
value = "og.CurrencyAmount.zero",
91+
category = "Strata",
92+
isThreadSafe = true
93+
)
94+
@ExcelArguments({
95+
@ExcelArgument("currency")
96+
})
97+
public CurrencyAmount zero(Currency currency) {
98+
return CurrencyAmount.zero(currency);
99+
}
100+
}

0 commit comments

Comments
 (0)