1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.cling.invoker.mvnenc;
20
21 import java.util.List;
22 import java.util.Map;
23
24 import org.apache.maven.api.cli.InvokerRequest;
25 import org.apache.maven.api.cli.mvnenc.EncryptOptions;
26 import org.apache.maven.cling.invoker.LookupContext;
27 import org.jline.reader.LineReader;
28 import org.jline.utils.AttributedString;
29 import org.jline.utils.AttributedStringBuilder;
30 import org.jline.utils.AttributedStyle;
31
32 @SuppressWarnings("VisibilityModifier")
33 public class EncryptContext extends LookupContext {
34 public EncryptContext(InvokerRequest invokerRequest, EncryptOptions encryptOptions) {
35 super(invokerRequest, true, encryptOptions);
36 }
37
38 public Map<String, Goal> goals;
39
40 public List<AttributedString> header;
41 public AttributedStyle style;
42 public LineReader reader;
43
44 public void addInHeader(String text) {
45 addInHeader(AttributedStyle.DEFAULT, text);
46 }
47
48 public void addInHeader(AttributedStyle style, String text) {
49 AttributedStringBuilder asb = new AttributedStringBuilder();
50 asb.style(style).append(text);
51 header.add(asb.toAttributedString());
52 }
53
54 @Override
55 public EncryptOptions options() {
56 return (EncryptOptions) super.options();
57 }
58 }