1212import javax .servlet .http .HttpServletRequest ;
1313import javax .servlet .http .HttpServletResponse ;
1414
15- import net .arnx .jsonic .JSON ;
16- import net .arnx .jsonic .JSONException ;
17-
1815import org .support .project .common .bean .ValidateError ;
1916import org .support .project .common .config .CommonBaseParameter ;
2017import org .support .project .common .config .Resources ;
4340import org .support .project .web .config .MessageStatus ;
4441import org .support .project .web .control .service .Get ;
4542import org .support .project .web .exception .InvalidParamException ;
43+ import org .support .project .web .logic .impl .DefaultAuthenticationLogicImpl ;
44+
45+ import net .arnx .jsonic .JSON ;
46+ import net .arnx .jsonic .JSONException ;
4647
4748/**
4849 * Controlの基底クラス
@@ -69,9 +70,9 @@ public abstract class Control {
6970
7071 /** リソース */
7172 protected Resources resources = Resources .getInstance (CommonBaseParameter .APP_RESOURCE );
72-
73+ /** Viewのベースパス */
7374 public static final String BASE_PATH = "/WEB-INF/views" ;
74-
75+ /** HTMLエスケープして送信するかのフラグ */
7576 private boolean sendEscapeHtml = true ;
7677
7778 /**
@@ -158,7 +159,7 @@ protected String getForwardDir() {
158159 if (StringUtils .isNotEmpty (subPackageName )) {
159160 if (subPackageName .indexOf ("\\ ." ) != -1 ) {
160161 String [] packages = StringUtils .split (subPackageName , "." );
161- for (int i = packages .length -1 ; i <= 0 ; i --) {
162+ for (int i = packages .length - 1 ; i <= 0 ; i --) {
162163 String string = packages [i ];
163164 builder .append (string ).append ("/" );
164165 }
@@ -467,35 +468,73 @@ public Integer getLoginUserId() {
467468 return loginedUser .getLoginUser ().getUserId ();
468469 }
469470
470-
471+ /**
472+ * request を取得
473+ * @return
474+ */
471475 public HttpServletRequest getRequest () {
472476 return request ;
473477 }
478+ /**
479+ * request をセット
480+ * @return
481+ */
474482 public void setRequest (HttpServletRequest request ) {
475483 this .request = request ;
476484 }
485+ /**
486+ * response を取得
487+ * @return
488+ */
477489 public HttpServletResponse getResponse () {
478490 return response ;
479491 }
492+ /**
493+ * response をセット
494+ * @return
495+ */
480496 public void setResponse (HttpServletResponse response ) {
481497 this .response = response ;
482498 }
499+ /**
500+ * invokeTarget を取得
501+ * @return
502+ */
483503 public InvokeTarget getInvokeTarget () {
484504 return invokeTarget ;
485505 }
486-
506+ /**
507+ * invokeTarget をセット
508+ * @return
509+ */
487510 public void setInvokeTarget (InvokeTarget invokeTarget ) {
488511 this .invokeTarget = invokeTarget ;
489512 }
513+ /**
514+ * path を取得
515+ * @return
516+ */
490517 public String getPath () {
491518 return path ;
492519 }
520+ /**
521+ * path をセット
522+ * @return
523+ */
493524 public void setPath (String path ) {
494525 this .path = path ;
495526 }
527+ /**
528+ * pathInfo を取得
529+ * @return
530+ */
496531 public String getPathInfo () {
497532 return pathInfo ;
498533 }
534+ /**
535+ * pathInfo をセット
536+ * @return
537+ */
499538 public void setPathInfo (String pathInfo ) {
500539 this .pathInfo = pathInfo ;
501540 }
@@ -622,23 +661,35 @@ protected String getParamWithDefault(String paramName, String defaultval) {
622661 }
623662 }
624663
625-
664+ /**
665+ * パラメータを取得
666+ * @param paramName
667+ * @param type
668+ * @return
669+ */
626670 protected <T > T getParam (String paramName , Class <? extends T > type ) {
627671 try {
628672 return HttpUtil .getParameter (request , paramName , type );
629673 } catch (InvalidParamException e ) {
630674 throw new SystemException (e );
631675 }
632676 }
633-
677+ /**
678+ * パラメータを取得
679+ * @param type
680+ * @return
681+ */
634682 protected <T > T getParams (Class <? extends T > type ) {
635683 try {
636684 return HttpUtil .parseRequest (request , type );
637685 } catch (InstantiationException | IllegalAccessException | JSONException | IOException | InvalidParamException e ) {
638686 throw new SystemException (e );
639687 }
640688 }
641-
689+ /**
690+ * パラメータをマップで取得
691+ * @return
692+ */
642693 protected Map <String , String > getParams () {
643694 Map <String , String > map = new HashMap <>();
644695 Enumeration <String > enumeration = request .getParameterNames ();
@@ -664,6 +715,16 @@ public void setSendEscapeHtml(boolean sendEscapeHtml) {
664715 this .sendEscapeHtml = sendEscapeHtml ;
665716 }
666717
718+ /**
719+ * パラメータをオブジェクトにセットして取得
720+ * @param type
721+ * @return
722+ * @throws InstantiationException
723+ * @throws IllegalAccessException
724+ * @throws JSONException
725+ * @throws IOException
726+ * @throws InvalidParamException
727+ */
667728 public <T > T getParamOnProperty (final Class <? extends T > type )
668729 throws InstantiationException , IllegalAccessException , JSONException , IOException , InvalidParamException {
669730 return HttpUtil .parseRequest (request , type );
0 commit comments