ColumnImpl.java 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  1. package com.boman.system.common;
  2. import com.alibaba.fastjson.JSONException;
  3. import com.alibaba.fastjson.JSONObject;
  4. import io.seata.rm.datasource.sql.struct.ColumnMeta;
  5. import org.slf4j.Logger;
  6. import org.slf4j.LoggerFactory;
  7. import java.util.*;
  8. import java.util.regex.Pattern;
  9. /**
  10. * @author shiqian
  11. * @description
  12. * @date 2021年03月22日 16:17
  13. **/
  14. public class ColumnImpl implements Column {
  15. private static final Logger log = LoggerFactory.getLogger(ColumnImpl.class);
  16. private static final long serialVersionUID = -5809782578272943999L;
  17. private static Pattern msgKeyPattern = Pattern.compile("\\p{Punct}");
  18. private static Pattern spaceKeyPattern = Pattern.compile(" ");
  19. private int id = -1;
  20. private String name;
  21. private String description;
  22. private String description2 = null;
  23. private boolean isNullable;
  24. private String limit = null;
  25. private String money = null;
  26. private boolean modifiable;
  27. private String obtainManner;
  28. private String defaultValue;
  29. private String refColumnName;
  30. private String tableColumnName;
  31. private Table objectTable;
  32. private String regExpression;
  33. private String errorMessage;
  34. private String comment = null;
  35. private String filter;
  36. // private DisplaySetting displaySetting;
  37. private boolean isUpperCase;
  38. private int sqltype;
  39. private int type;
  40. private boolean isAlternateKey;
  41. private boolean isAlternateKey2;
  42. private boolean isDisplayKey;
  43. private String mask;
  44. private boolean isValueLimited;
  45. // private PairTable values = null;
  46. private int length;
  47. private Table rTable = null;
  48. private Column rColumn = null;
  49. private Table table = null;
  50. private int displayOrder;
  51. private String valueInterpreter = null;
  52. private boolean isVirtual = false;
  53. private String sumMethod = null;
  54. private String sumMethodDesc = "";
  55. private int scale = 0;
  56. private String sequenceHead = null;
  57. private String command = null;
  58. private String valueGroupName;
  59. private boolean isIndexed = false;
  60. private int onDeleteAction = 0;
  61. private int statSize = -1;
  62. private boolean isFilteredByWildcard = false;
  63. private List referenceColumnsInWildcardFilter = null;
  64. private Properties props = null;
  65. private boolean isAutoComplete = false;
  66. private JSONObject jsonProps = null;
  67. private String strProps = null;
  68. private String showcomment;
  69. private int securityGrade = 0;
  70. private Boolean showtitle;
  71. private boolean isorder = false;
  72. private String fkdisplay = null;
  73. private String querydefval = null;
  74. // private LimitvalueGroup limitvalueGroup;
  75. private String searchtype;
  76. private Boolean isremote;
  77. private String searchmodel;
  78. private String commentstp;
  79. private Boolean isagfilter;
  80. private String agfilter;
  81. private boolean isRowspan = false;
  82. private Locale defaultlocal = new Locale("zh", "CN");
  83. private ColumnMeta columnMeta;
  84. // public ColumnMeta getColumnMeta() {
  85. // return this.columnMeta;
  86. // }
  87. //
  88. // public void setColumnMeta(ColumnMeta columnMeta) {
  89. // this.columnMeta = columnMeta;
  90. // }
  91. //
  92. // public ColumnImpl() {
  93. // }
  94. //
  95. // public ColumnImpl(int id, Table table, String columnName, String desc, int sqltype, boolean isNull) {
  96. // this.id = id;
  97. // this.table = table;
  98. // this.name = columnName;
  99. // this.description = desc;
  100. // this.sqltype = sqltype;
  101. // this.type = toGrossType(sqltype);
  102. // this.isNullable = isNull;
  103. // this.isVirtual = this.checkVirtual();
  104. // }
  105. //
  106. // public static int toGrossType(int type) {
  107. // byte jType;
  108. // switch(type) {
  109. // case 1:
  110. // case 12:
  111. // case 13:
  112. // case 22:
  113. // case 24:
  114. // case 25:
  115. // jType = 2;
  116. // break;
  117. // case 2:
  118. // case 3:
  119. // case 4:
  120. // case 5:
  121. // case 6:
  122. // case 7:
  123. // case 8:
  124. // case 9:
  125. // case 10:
  126. // case 16:
  127. // jType = 0;
  128. // break;
  129. // case 11:
  130. // case 14:
  131. // jType = 1;
  132. // break;
  133. // case 15:
  134. // jType = 4;
  135. // break;
  136. // case 17:
  137. // case 18:
  138. // case 19:
  139. // case 20:
  140. // case 21:
  141. // default:
  142. // jType = 9;
  143. // break;
  144. // case 23:
  145. // jType = 3;
  146. // }
  147. //
  148. // return jType;
  149. // }
  150. //
  151. // public void setIsIndexed(boolean b) {
  152. // this.isIndexed = b;
  153. // }
  154. //
  155. // public boolean isFilteredByWildcard() {
  156. // return this.isFilteredByWildcard;
  157. // }
  158. //
  159. // public final Properties getProperties() {
  160. // return this.props;
  161. // }
  162. //
  163. // public boolean isIndexed() {
  164. // return this.isIndexed;
  165. // }
  166. //
  167. // public boolean isAutoComplete() {
  168. // return this.isAutoComplete;
  169. // }
  170. //
  171. // public boolean setIsAutoComplete(boolean b) {
  172. // return this.isAutoComplete = b;
  173. // }
  174. //
  175. // /** @deprecated */
  176. // @Deprecated
  177. // public int getOnDeleteAction() {
  178. // return this.onDeleteAction;
  179. // }
  180. //
  181. // /** @deprecated */
  182. // @Deprecated
  183. // public void setOnDeleteAction(String s) {
  184. // if ("SETNULL".equalsIgnoreCase(s)) {
  185. // this.onDeleteAction = 1;
  186. // } else if ("CASCADE".equalsIgnoreCase(s)) {
  187. // this.onDeleteAction = 2;
  188. // }
  189. //
  190. // }
  191. //
  192. // public void setIsNullable(boolean n) {
  193. // this.isNullable = n;
  194. // }
  195. //
  196. // public String getLimitValueGroupName() {
  197. // return this.valueGroupName;
  198. // }
  199. //
  200. // public int getScale() {
  201. // return this.scale;
  202. // }
  203. //
  204. // public void setScale(int scale) {
  205. // this.scale = scale;
  206. // }
  207. //
  208. // private boolean checkVirtual() {
  209. // char[] cs = this.name.toCharArray();
  210. //
  211. // for(int i = 0; i < cs.length; ++i) {
  212. // if ((cs[i] < '0' || cs[i] > '9') && cs[i] != '_' && cs[i] != '-' && (cs[i] < 'a' || cs[i] > 'z') && (cs[i] < 'A' || cs[i] > 'Z')) {
  213. // return true;
  214. // }
  215. // }
  216. //
  217. // return false;
  218. // }
  219. //
  220. // public int getStatSize() {
  221. // return this.statSize;
  222. // }
  223. //
  224. // public void setStatSize(int size) {
  225. // this.statSize = size;
  226. // }
  227. //
  228. // public String getComment() {
  229. // return this.comment;
  230. // }
  231. //
  232. // public void setComment(String s) {
  233. // this.comment = s;
  234. // }
  235. //
  236. // public void setIsAlternateKey(boolean ak) {
  237. // this.isAlternateKey = ak;
  238. // }
  239. //
  240. // public void setIsAlternateKey2(boolean ak2) {
  241. // this.isAlternateKey2 = ak2;
  242. // }
  243. //
  244. // public void setIsDisplayKey(boolean dk) {
  245. // this.isDisplayKey = dk;
  246. // }
  247. //
  248. // public boolean isDisplayKey() {
  249. // return this.isDisplayKey;
  250. // }
  251. //
  252. // public void setMask(String mask) {
  253. // this.mask = mask;
  254. // }
  255. //
  256. // public void setIsValueLimited(boolean limit) {
  257. // this.isValueLimited = limit;
  258. // }
  259. //
  260. // public void setValues(String valueGroupName, PairTable vs, Locale locale) {
  261. // this.valueGroupName = valueGroupName.toLowerCase();
  262. // if (this.values == null) {
  263. // this.values = new PairTable();
  264. // }
  265. //
  266. // this.values.put(locale, vs);
  267. // }
  268. //
  269. // public void setValueInterpreter(String interpreter) {
  270. // if (interpreter == null) {
  271. // this.valueInterpreter = null;
  272. // } else {
  273. // this.valueInterpreter = interpreter;
  274. // }
  275. // }
  276. //
  277. // public boolean isAlternateKey() {
  278. // return this.isAlternateKey;
  279. // }
  280. //
  281. // public boolean isAlternateKey2() {
  282. // return this.isAlternateKey2;
  283. // }
  284. //
  285. // public boolean isNullable() {
  286. // return this.isNullable || this.displaySetting.getObjectType() == 5;
  287. // }
  288. //
  289. // public boolean isMaskSet(int maskPosition) {
  290. // if (maskPosition >= 0 && maskPosition < this.mask.length()) {
  291. // try {
  292. // return this.mask.charAt(maskPosition) == '1';
  293. // } catch (IndexOutOfBoundsException var3) {
  294. // throw new IllegalArgumentException("mask position out of range:" + maskPosition + ",mask:" + this.mask);
  295. // }
  296. // } else {
  297. // return false;
  298. // }
  299. // }
  300. //
  301. // public boolean isMaskequls(int maskPosition) {
  302. // if (maskPosition >= 0 && maskPosition < this.mask.length()) {
  303. // try {
  304. // return this.mask.equals(Tools.replaceCharAt("0000000000", maskPosition, '1'));
  305. // } catch (IndexOutOfBoundsException var3) {
  306. // throw new IllegalArgumentException("mask position out of range:" + maskPosition + ",mask:" + this.mask);
  307. // }
  308. // } else {
  309. // return false;
  310. // }
  311. // }
  312. //
  313. // public boolean isShowable(int action) {
  314. // char c = true;
  315. // char c;
  316. // switch(action) {
  317. // case 0:
  318. // c = this.mask.charAt(0);
  319. // break;
  320. // case 1:
  321. // c = this.mask.charAt(2);
  322. // break;
  323. // case 2:
  324. // c = this.mask.charAt(4);
  325. // break;
  326. // case 3:
  327. // c = this.mask.charAt(5);
  328. // break;
  329. // case 4:
  330. // c = this.mask.charAt(6);
  331. // break;
  332. // case 5:
  333. // c = this.mask.charAt(7);
  334. // break;
  335. // case 6:
  336. // c = this.mask.charAt(8);
  337. // break;
  338. // case 7:
  339. // c = this.mask.charAt(9);
  340. // break;
  341. // default:
  342. // throw new IllegalArgumentException("action is not valid:" + action);
  343. // }
  344. //
  345. // return c == '1';
  346. // }
  347. //
  348. // public boolean isModifiable(int action) {
  349. // char c = true;
  350. // char c;
  351. // switch(action) {
  352. // case 0:
  353. // c = this.mask.charAt(1);
  354. // break;
  355. // case 1:
  356. // c = this.mask.charAt(3);
  357. // break;
  358. // case 2:
  359. // c = this.mask.charAt(1);
  360. // break;
  361. // case 3:
  362. // c = this.mask.charAt(3);
  363. // break;
  364. // case 4:
  365. // c = '0';
  366. // break;
  367. // default:
  368. // throw new IllegalArgumentException("action is not valid:" + action);
  369. // }
  370. //
  371. // return c == '1';
  372. // }
  373. //
  374. // public boolean isValueLimited() {
  375. // return this.isValueLimited;
  376. // }
  377. //
  378. // public PairTable getValues(Locale locale) {
  379. // if (this.values == null) {
  380. // return null;
  381. // } else {
  382. // PairTable pt = (PairTable)this.values.get(locale);
  383. // if (pt == null) {
  384. // pt = new PairTable();
  385. // Iterator it = this.getValues(this.defaultlocal).keys();
  386. //
  387. // while(it.hasNext()) {
  388. // Object value = it.next();
  389. // pt.put(value, Resources.getMessage("lmt_" + this.valueGroupName + "_" + value, new Object[0]).toLowerCase());
  390. // }
  391. //
  392. // this.values.put(locale, pt);
  393. // }
  394. //
  395. // return pt;
  396. // }
  397. // }
  398. //
  399. // public int getLength() {
  400. // return this.length;
  401. // }
  402. //
  403. // public void setLength(int leng) {
  404. // this.length = leng;
  405. // }
  406. //
  407. // public Table getReferenceTable() {
  408. // return this.rTable;
  409. // }
  410. //
  411. // public void setReferenceTable(Table rt) {
  412. // this.rTable = rt;
  413. // }
  414. //
  415. // public Column getReferenceColumn() {
  416. // return this.rColumn;
  417. // }
  418. //
  419. // public void setReferenceColumn(Column rc) {
  420. // this.rColumn = rc;
  421. // }
  422. //
  423. // public Table getReferenceTable(boolean tryDateNumberAsFK, TableManager tm) {
  424. // if (this.rTable != null) {
  425. // return this.rTable;
  426. // } else {
  427. // return tryDateNumberAsFK && this.type == 3 ? tm.getDateTable() : null;
  428. // }
  429. // }
  430. //
  431. // public Column getReferenceColumn(boolean tryDateNumberAsFK, TableManager tm) {
  432. // if (this.rColumn != null) {
  433. // return this.rColumn;
  434. // } else {
  435. // if (tryDateNumberAsFK && this.type == 3) {
  436. // Table tb = tm.getDateTable();
  437. // if (tb != null) {
  438. // return tb.getPrimaryKey();
  439. // }
  440. // }
  441. //
  442. // return null;
  443. // }
  444. // }
  445. //
  446. // public int getDisplayOrder() {
  447. // return this.displayOrder;
  448. // }
  449. //
  450. // public void setDisplayOrder(int order) {
  451. // this.displayOrder = order;
  452. // }
  453. //
  454. // public String getValueInterpeter() {
  455. // return this.valueInterpreter;
  456. // }
  457. //
  458. // public int getId() {
  459. // return this.id;
  460. // }
  461. //
  462. // public String getName() {
  463. // return this.name;
  464. // }
  465. //
  466. // public String getDescription() {
  467. // return this.description;
  468. // }
  469. //
  470. // public String getDescription(Locale locale) {
  471. // try {
  472. // return Resources.getMessage("adcolumn_" + this.id, locale, new Object[]{this.description});
  473. // } catch (MissingResourceException var3) {
  474. // return this.description;
  475. // }
  476. // }
  477. //
  478. // public void setDescription(String desc) {
  479. // this.description = desc;
  480. // }
  481. //
  482. // private String toMessageKey(String s) {
  483. // return spaceKeyPattern.matcher(msgKeyPattern.matcher(s).replaceAll("_")).replaceAll("");
  484. // }
  485. //
  486. // public void setDescription2(String desc2) {
  487. // this.description2 = desc2;
  488. // }
  489. //
  490. // public int getSQLType() {
  491. // return this.sqltype;
  492. // }
  493. //
  494. // public void setSQLType(int sqlType) {
  495. // this.sqltype = sqlType;
  496. // this.type = toGrossType(this.sqltype);
  497. // }
  498. //
  499. // public int getType() {
  500. // return this.type;
  501. // }
  502. //
  503. // public Table getTable() {
  504. // return this.table;
  505. // }
  506. //
  507. // public int hashCode() {
  508. // return this.id;
  509. // }
  510. //
  511. // public boolean equals(Object c) {
  512. // return c instanceof Column && ((Column)c).getId() == this.id;
  513. // }
  514. //
  515. // public String toString() {
  516. // return this.table.toString() + "." + this.name;
  517. // }
  518. //
  519. // public void clone(Object obj) {
  520. // if (!(obj instanceof ColumnImpl)) {
  521. // throw new IllegalArgumentException("Not a ColumnImpl");
  522. // } else {
  523. // ColumnImpl ci = (ColumnImpl)obj;
  524. // this.description = ci.description;
  525. // this.description2 = ci.description2;
  526. // this.displayOrder = ci.displayOrder;
  527. // this.id = ci.id;
  528. // this.isAlternateKey = ci.isAlternateKey;
  529. // this.isAlternateKey2 = ci.isAlternateKey2;
  530. // this.mask = ci.mask;
  531. // this.isValueLimited = ci.isValueLimited;
  532. // this.length = ci.length;
  533. // this.name = ci.name;
  534. // this.rTable = ci.rTable;
  535. // this.sqltype = ci.sqltype;
  536. // this.table = ci.table;
  537. // this.type = ci.type;
  538. // this.valueInterpreter = ci.valueInterpreter;
  539. // this.values = ci.values;
  540. // this.obtainManner = ci.obtainManner;
  541. // this.modifiable = ci.modifiable;
  542. // this.refColumnName = ci.refColumnName;
  543. // this.tableColumnName = ci.tableColumnName;
  544. // this.objectTable = ci.objectTable;
  545. // this.jsonProps = ci.jsonProps;
  546. // }
  547. // }
  548. //
  549. // public String getLimit() {
  550. // return this.limit;
  551. // }
  552. //
  553. // public void setLimit(String limit) {
  554. // this.limit = limit;
  555. // }
  556. //
  557. // public String getMoney() {
  558. // return this.money;
  559. // }
  560. //
  561. // public void setMoney(String money) {
  562. // this.money = money;
  563. // }
  564. //
  565. // public boolean getModifiable() {
  566. // return this.modifiable;
  567. // }
  568. //
  569. // public void setModifiable(boolean modifiable) {
  570. // this.modifiable = modifiable;
  571. // }
  572. //
  573. // public String getObtainManner() {
  574. // return this.obtainManner;
  575. // }
  576. //
  577. // public void setObtainManner(String obtainManner) {
  578. // this.obtainManner = obtainManner;
  579. // }
  580. //
  581. // public String getDefaultValue() {
  582. // return this.getDefaultValue(true);
  583. // }
  584. //
  585. // public void setDefaultValue(String defaultValue) {
  586. // this.defaultValue = defaultValue;
  587. // }
  588. //
  589. // public String getDefaultValue(boolean eval) {
  590. // if (eval && this.defaultValue != null && "=".equals(this.defaultValue.substring(0, 1))) {
  591. // }
  592. //
  593. // return this.defaultValue;
  594. // }
  595. //
  596. // public String getReferenceColumnName() {
  597. // return this.refColumnName;
  598. // }
  599. //
  600. // public void setReferenceColumnName(String columnName) {
  601. // this.refColumnName = columnName;
  602. // }
  603. //
  604. // public String getTableColumnName() {
  605. // return this.tableColumnName;
  606. // }
  607. //
  608. // public void setTableColumnName(String columnName) {
  609. // this.tableColumnName = columnName;
  610. // }
  611. //
  612. // public Table getObjectTable() {
  613. // return this.objectTable;
  614. // }
  615. //
  616. // public void setObjectTable(Table objectTable) {
  617. // this.objectTable = objectTable;
  618. // }
  619. //
  620. // public void setRegExpresion(String regExpression) {
  621. // if (Validator.isNotNull(regExpression)) {
  622. // if (this.displaySetting == null) {
  623. // throw new NDSRuntimeException("Must call setDisplaySetting before setRegExpresion for Column");
  624. // }
  625. //
  626. // if (this.displaySetting.getObjectType() == 12) {
  627. // try {
  628. // JSONObject jo = JSONObject.parseObject(regExpression);
  629. // this.props = new Properties();
  630. // Iterator var3 = jo.keySet().iterator();
  631. //
  632. // while(var3.hasNext()) {
  633. // String key = (String)var3.next();
  634. // this.props.setProperty(key, jo.getString(key));
  635. // }
  636. // } catch (Throwable var5) {
  637. // throw new NDSRuntimeException("Could not load regExpression as json object:" + var5, var5);
  638. // }
  639. // } else {
  640. // this.regExpression = regExpression;
  641. // }
  642. // }
  643. //
  644. // }
  645. //
  646. // public String getRegExpression() {
  647. // return this.regExpression;
  648. // }
  649. //
  650. // public String getErrorMessage() {
  651. // return this.errorMessage;
  652. // }
  653. //
  654. // public void setErrorMessage(String errorMessage) {
  655. // this.errorMessage = errorMessage;
  656. // }
  657. //
  658. // public boolean isVirtual() {
  659. // return this.isVirtual;
  660. // }
  661. //
  662. // public String getSubTotalMethod() {
  663. // return this.sumMethod;
  664. // }
  665. //
  666. // public void setSubTotalMethod(String method) {
  667. // this.sumMethod = method;
  668. // }
  669. //
  670. // public String getSubTotalDesc() {
  671. // return this.sumMethodDesc;
  672. // }
  673. //
  674. // void setIsFilteredByWildcard(boolean b) {
  675. // this.isFilteredByWildcard = b;
  676. // }
  677. //
  678. // public List getReferenceColumnsInWildcardFilter() {
  679. // return this.referenceColumnsInWildcardFilter;
  680. // }
  681. //
  682. // public void setReferenceColumnsInWildcardFilter(List columns) {
  683. // this.referenceColumnsInWildcardFilter = columns;
  684. // }
  685. //
  686. // public String getFilter() {
  687. // return this.filter;
  688. // }
  689. //
  690. // public void setFilter(String filter) {
  691. // this.filter = filter;
  692. // if (Validator.isNotNull(filter) && (this.getReferenceTable() != null || this.getDisplaySetting().getObjectType() == 12) && filter.indexOf(64) > -1) {
  693. // this.isFilteredByWildcard = true;
  694. // }
  695. //
  696. // }
  697. //
  698. // public DisplaySetting getDisplaySetting() {
  699. // return this.displaySetting;
  700. // }
  701. //
  702. // public void setDisplaySetting(DisplaySetting setting) {
  703. // this.displaySetting = setting;
  704. // }
  705. //
  706. // public String getSequenceHead() {
  707. // return this.sequenceHead;
  708. // }
  709. //
  710. // public void setSequenceHead(String s) {
  711. // this.sequenceHead = s;
  712. // }
  713. //
  714. // public boolean isColumnLink(TableManager tm) {
  715. // if (this.name.indexOf(";") > -1) {
  716. // try {
  717. // this.getColumnLink(tm);
  718. // return true;
  719. // } catch (Exception var3) {
  720. // return false;
  721. // }
  722. // } else {
  723. // return false;
  724. // }
  725. // }
  726. //
  727. // public ColumnLink getColumnLink(TableManager tm) throws QueryException {
  728. // return new ColumnLink(this.table.getName() + "." + this.name, tm);
  729. // }
  730. //
  731. // public Object getUIConstructor() {
  732. // Object uiConstructor = null;
  733. // if (this.getDisplaySetting().getObjectType() == 10) {
  734. // if (Validator.isNull(this.getValueInterpeter())) {
  735. // throw new NDSRuntimeException("Not found interpreter of button column " + this);
  736. // }
  737. //
  738. // try {
  739. // uiConstructor = ApplicationContextHandle.getBean(this.getValueInterpeter());
  740. // } catch (Exception var5) {
  741. // try {
  742. // uiConstructor = ApplicationContextHandle.getBean(InstanceUtil.getClass(this.getValueInterpeter()));
  743. // } catch (Exception var4) {
  744. // log.debug("Found error in get ui constructor:" + var4);
  745. // }
  746. // }
  747. // }
  748. //
  749. // return uiConstructor;
  750. // }
  751. //
  752. // public Object getUIAlerter() {
  753. // Object uiAlerter = null;
  754. // if (Validator.isNotNull(this.getValueInterpeter())) {
  755. // try {
  756. // uiAlerter = ApplicationContextHandle.getBean(this.getValueInterpeter());
  757. // } catch (Exception var5) {
  758. // try {
  759. // uiAlerter = ApplicationContextHandle.getBean(InstanceUtil.getClass(this.getValueInterpeter()));
  760. // } catch (Exception var4) {
  761. // log.debug("Found error in get ui alerter:" + var4);
  762. // }
  763. // }
  764. // }
  765. //
  766. // return uiAlerter;
  767. // }
  768. //
  769. // public void setIsUpperCase(boolean b) {
  770. // this.isUpperCase = b;
  771. // }
  772. //
  773. // public boolean isUpperCase() {
  774. // return this.isUpperCase;
  775. // }
  776. //
  777. // public int getSecurityGrade() {
  778. // return this.securityGrade;
  779. // }
  780. //
  781. // public JSONObject toJSONSimpleObject() throws JSONException {
  782. // JSONObject jo = new JSONObject();
  783. // jo.put("id", this.id);
  784. // jo.put("description", this.getDescription());
  785. // jo.put("isNullable", this.isNullable);
  786. // jo.put("refColumnId", this.getReferenceColumn() == null ? -1 : this.getReferenceColumn().getId());
  787. // if (this.getReferenceColumn() != null) {
  788. // jo.put("refTableAK", this.getReferenceTable().getAlternateKey().toJSONSimpleObject());
  789. // }
  790. //
  791. // jo.put("mask", this.mask);
  792. // jo.put("isValueLimited", this.isValueLimited);
  793. // jo.put("type", this.type);
  794. // return jo;
  795. // }
  796. //
  797. // public JSONObject toJSONObject(Locale locale) throws JSONException {
  798. // JSONObject jo = new JSONObject();
  799. // jo.put("id", this.id);
  800. // jo.put("name", this.name);
  801. // jo.put("description", this.getDescription());
  802. // jo.put("isNullable", this.isNullable);
  803. // jo.put("obtainManner", this.obtainManner);
  804. // jo.put("defaultValue", this.defaultValue);
  805. // jo.put("refColumnId", this.getReferenceColumn() == null ? -1 : this.getReferenceColumn().getId());
  806. // if (this.getReferenceColumn() != null) {
  807. // jo.put("refTableAK", this.getReferenceTable().getAlternateKey().toJSONObject(locale));
  808. // }
  809. //
  810. // jo.put("refTableId", this.getReferenceTable() == null ? -1 : this.getReferenceTable().getId());
  811. // jo.put("isAlternateKey", this.isAlternateKey);
  812. // jo.put("mask", this.mask);
  813. // jo.put("isValueLimited", this.isValueLimited);
  814. // jo.put("values", this.values);
  815. // jo.put("isUpperCase", this.isUpperCase);
  816. // jo.put("filter", this.filter);
  817. // jo.put("displaySetting", this.displaySetting.getObjectTypeString());
  818. // jo.put("type", this.type);
  819. // jo.put("length", this.length);
  820. // jo.put("scale", this.scale);
  821. // jo.put("valueInterpreter", this.valueInterpreter);
  822. // jo.put("table", this.table.getId());
  823. // jo.put("isVirtual", this.isVirtual);
  824. // jo.put("isIndexed", this.isIndexed);
  825. // jo.put("isAutoComplete", this.isAutoComplete);
  826. // jo.put("props", this.jsonProps);
  827. // return jo;
  828. // }
  829. //
  830. // public JSONObject getJSONProps() {
  831. // return this.jsonProps;
  832. // }
  833. //
  834. // public void setJSONProps(JSONObject jo) {
  835. // this.jsonProps = jo;
  836. // if (jo != null) {
  837. // this.securityGrade = jo.getIntValue("sgrade");
  838. // }
  839. //
  840. // }
  841. //
  842. // public String getStrProps() {
  843. // if (this.jsonProps == null) {
  844. // this.jsonProps = new JSONObject();
  845. // }
  846. //
  847. // return this.jsonProps.toString();
  848. // }
  849. //
  850. // public String getShowcomment() {
  851. // return this.showcomment;
  852. // }
  853. //
  854. // public Boolean getIsorder() {
  855. // return this.isorder;
  856. // }
  857. //
  858. // public void setIsorder(Boolean isorder) {
  859. // this.isorder = isorder;
  860. // }
  861. //
  862. // public void setShowcomment(String shcomment) {
  863. // this.showcomment = shcomment;
  864. // }
  865. //
  866. // public Boolean getShowtitle() {
  867. // return this.showtitle;
  868. // }
  869. //
  870. // public void setShowtitle(Boolean ishowtite) {
  871. // this.showtitle = ishowtite;
  872. // }
  873. //
  874. // public Boolean getRowspan() {
  875. // return this.isRowspan;
  876. // }
  877. //
  878. // public void setRowspan(Boolean isRowspan) {
  879. // this.isRowspan = isRowspan;
  880. // }
  881. //
  882. // public String getFkdisplay() {
  883. // return this.fkdisplay;
  884. // }
  885. //
  886. // public void setFkdisplay(String fkdisplay) {
  887. // this.fkdisplay = fkdisplay;
  888. // }
  889. //
  890. // public String getQuerydefval() {
  891. // return this.querydefval;
  892. // }
  893. //
  894. // public void setQuerydefval(String querydefval) {
  895. // this.querydefval = querydefval;
  896. // }
  897. //
  898. // public boolean isComputed() {
  899. // return "computed".equals(this.obtainManner);
  900. // }
  901. //
  902. // public LimitvalueGroup getLimitvalueGroup() {
  903. // return this.limitvalueGroup;
  904. // }
  905. //
  906. // public void setLimitvalueGroup(LimitvalueGroup limitvalueGroup) {
  907. // this.limitvalueGroup = limitvalueGroup;
  908. // }
  909. //
  910. // public String getSearchtype() {
  911. // return this.searchtype;
  912. // }
  913. //
  914. // public void setSearchtype(String searchtype) {
  915. // this.searchtype = searchtype;
  916. // }
  917. //
  918. // public boolean getIsremote() {
  919. // return this.isremote;
  920. // }
  921. //
  922. // public void setIsremote(Boolean isremote) {
  923. // this.isremote = isremote;
  924. // }
  925. //
  926. // public String getSearchmodel() {
  927. // return this.searchmodel;
  928. // }
  929. //
  930. // public void setSearchmodel(String searchmodel) {
  931. // this.searchmodel = searchmodel;
  932. // }
  933. //
  934. // public String getCommentstp() {
  935. // return Tools.nvl(this.commentstp, "list");
  936. // }
  937. //
  938. // public void setCommentstp(String commentstp) {
  939. // this.commentstp = commentstp;
  940. // }
  941. //
  942. // public Boolean getIsagfilter() {
  943. // return this.isagfilter;
  944. // }
  945. //
  946. // public void setIsagfilter(Boolean isagfilter) {
  947. // this.isagfilter = isagfilter;
  948. // }
  949. //
  950. // public String getAgfilter() {
  951. // return this.agfilter;
  952. // }
  953. //
  954. // public void setAgfilter(String agfilter) {
  955. // this.agfilter = agfilter;
  956. // }
  957. }