gluu
公開メンバ関数 | 静的変数 | 非公開変数類 | 全メンバ一覧
org.gluu.credmanager.plugins.authnmethod.conf.QRConfig クラス
org.gluu.credmanager.plugins.authnmethod.conf.QRConfig の継承関係図
Inheritance graph
org.gluu.credmanager.plugins.authnmethod.conf.QRConfig 連携図
Collaboration graph

公開メンバ関数

void populate (Map< String, String > properties) throws Exception
 
String getFormattedQROptions (int maxWidth)
 
String getFormattedQROptions ()
 
String getLabel ()
 
void setLabel (String label)
 
int getQrSize ()
 
void setQrSize (int qrSize)
 
double getQrMSize ()
 
void setQrMSize (double qrMSize)
 
String getRegistrationUri ()
 
void setRegistrationUri (String registrationUri)
 

静的変数

static ObjectMapper MAPPER = new ObjectMapper()
 

非公開変数類

String label
 
String registrationUri
 
int qrSize
 
double qrMSize
 

詳解

著者
jgomer

関数詳解

◆ getFormattedQROptions() [1/2]

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getFormattedQROptions ( int  maxWidth)
inline

Creates a string for a Json representation of two values: size and mSize for QR code

戻り値
Json String
55  {
56 
57  List<String> list = new ArrayList<>();
58  int size = getQrSize();
59  int ival = maxWidth > 0 ? Math.min(size, maxWidth - 30) : size;
60 
61  if (ival > 0) {
62  list.add("size:" + ival);
63  }
64 
65  double dval = getQrMSize();
66  if (dval > 0) {
67  list.add("mSize: " + dval);
68  }
69 
70  return list.toString().replaceFirst("\\[", "{").replaceFirst("\\]", "}");
71 
72  }
double getQrMSize()
Definition: QRConfig.java:94
int getQrSize()
Definition: QRConfig.java:86

◆ getFormattedQROptions() [2/2]

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getFormattedQROptions ( )
inline
74  {
75  return getFormattedQROptions(0);
76  }
String getFormattedQROptions()
Definition: QRConfig.java:74

◆ getLabel()

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getLabel ( )
inline
78  {
79  return label;
80  }
String label
Definition: QRConfig.java:22

◆ getQrMSize()

double org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getQrMSize ( )
inline
94  {
95  return qrMSize;
96  }
double qrMSize
Definition: QRConfig.java:26

◆ getQrSize()

int org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getQrSize ( )
inline
86  {
87  return qrSize;
88  }

◆ getRegistrationUri()

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getRegistrationUri ( )
inline
102  {
103  return registrationUri;
104  }
String registrationUri
Definition: QRConfig.java:23

◆ populate()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.populate ( Map< String, String >  properties) throws Exception
inline
28  {
29 
30  setLabel(properties.get("label"));
31  setRegistrationUri(properties.get("registration_uri"));
32 
33  String value = properties.get("qr_options");
34  //value may come not properly formated (without quotes, for instance...)
35  if (!value.contains("\"")) {
36  value = value.replaceFirst("mSize", "\"mSize\"").replaceFirst("size", "\"size\"");
37  }
38 
39  JsonNode tree = MAPPER.readTree(value);
40 
41  if (tree.get("size") != null) {
42  setQrSize(tree.get("size").asInt());
43  }
44 
45  if (tree.get("mSize") != null) {
46  setQrMSize(tree.get("mSize").asDouble());
47  }
48 
49  }
void setRegistrationUri(String registrationUri)
Definition: QRConfig.java:106
static ObjectMapper MAPPER
Definition: QRConfig.java:20
void setLabel(String label)
Definition: QRConfig.java:82
void setQrSize(int qrSize)
Definition: QRConfig.java:90
void setQrMSize(double qrMSize)
Definition: QRConfig.java:98

◆ setLabel()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.setLabel ( String  label)
inline
82  {
83  this.label = label;
84  }
String label
Definition: QRConfig.java:22

◆ setQrMSize()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.setQrMSize ( double  qrMSize)
inline
98  {
99  this.qrMSize = qrMSize;
100  }
double qrMSize
Definition: QRConfig.java:26

◆ setQrSize()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.setQrSize ( int  qrSize)
inline
90  {
91  this.qrSize = qrSize;
92  }

◆ setRegistrationUri()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.setRegistrationUri ( String  registrationUri)
inline
106  {
108  }
String registrationUri
Definition: QRConfig.java:23

メンバ詳解

◆ label

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.label
private

◆ MAPPER

ObjectMapper org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.MAPPER = new ObjectMapper()
staticpackage

◆ qrMSize

double org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.qrMSize
private

◆ qrSize

int org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.qrSize
private

◆ registrationUri

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.registrationUri
private

このクラス詳解は次のファイルから抽出されました: