Examples of SafeText


Examples of hirondelle.web4j.security.SafeText

    }
    return result;
  }
 
  private SafeText parseSafeText(String aUserInputValue) throws ModelCtorException {
    SafeText result = null;
    if( Util.textHasContent(aUserInputValue) ) {
      try {
        result = new SafeText(aUserInputValue);
      }
      catch(IllegalArgumentException ex){
        throw PROBLEM_FOUND;
      }
    }
View Full Code Here

Examples of hirondelle.web4j.security.SafeText

  private final ConvertParam fConvertParam = BuildImpl.forConvertParam();
  private static final Logger fLogger = Util.getLogger(ConvertColumnImpl.class);
 
  private SafeText convertToSafeText(ResultSet aRow, int aColumnIdx) throws SQLException {
    String result = convertToString(aRow, aColumnIdx);
    return result == null ? null : new SafeText(result);
  }
View Full Code Here

Examples of hirondelle.web4j.security.SafeText

    return Collections.unmodifiableList(result);
  }

  /** Return a single-valued request parameter as {@link SafeText}.  */
  public final SafeText toSafeText(RequestParameter aReqParam) {
    SafeText result = null;
    try {
      result = toSupportedObject(aReqParam, SafeText.class);
    }
    catch (ModelCtorException ex){
      changeToRuntimeException(ex);
View Full Code Here

Examples of hirondelle.web4j.security.SafeText

   may contain special characters, it is appropriate to model it as
  <tt>SafeText</tt>.
  */
  protected final SafeText getLoggedInUserName(){
    Principal principal = fRequestParser.getRequest().getUserPrincipal();
    return principal == null ? null : new SafeText(principal.getName());
  }
View Full Code Here

Examples of hirondelle.web4j.security.SafeText

   <P>If, however, the caller needs to use a request parameter
   value <em>to perform a computation</em>, as opposed to presenting user
   data in markup, then this method is provided as a convenience.
  */
  protected final String getParamUnsafe(RequestParameter aReqParam){
    SafeText result = fRequestParser.toSafeText(aReqParam);
    return result == null ? null : result.getRawString();
  }
View Full Code Here

Examples of hirondelle.web4j.security.SafeText

   This class uses a {@link SafeText} object internally.
   @param aText is non-null, and contains characters that are allowed
   by {@link hirondelle.web4j.security.PermittedCharacters}.
  */
  public Id(String aText) {
    fId = new SafeText(aText);
    validateState();
  }
View Full Code Here

Examples of hirondelle.web4j.security.SafeText

      if ( Util.textHasContent(id.toString()) ) {
        result = id.toString().trim().length();
      }
    }
    else if (aObject instanceof SafeText){
      SafeText text = (SafeText)aObject;
      if ( Util.textHasContent(text.getRawString()) ) {
        result = text.getRawString().trim().length();
      }
    }
    else if (aObject instanceof Code){
      Code code = (Code)aObject;
      if ( Util.textHasContent(code.getText()) ) {
View Full Code Here

Examples of hirondelle.web4j.security.SafeText

    if ( aObject instanceof String ){
      String text = (String) aObject;
      result = text.toString();
    }
    else if (aObject instanceof SafeText ){
      SafeText text = (SafeText)aObject;
      result = text.getRawString();
    }
    return result;
  }
View Full Code Here

Examples of hirondelle.web4j.security.SafeText

  
   <P>See class description.
  */
  Map<String, SafeText> build(ResultSet aRow) throws SQLException {
    LinkedHashMap<String, SafeText> result = new LinkedHashMap<String, SafeText>();
    SafeText value = null;
    ResultSetMetaData metaData = aRow.getMetaData();
    for (int columnIdx = 1; columnIdx <= metaData.getColumnCount(); ++columnIdx) {
      if ( doNotTranslateToObjects() ) {
        value = getSafeText(aRow, columnIdx);
        //fLogger.finest("Raw unformatted text value: " + value.getRawString());
View Full Code Here

Examples of hirondelle.web4j.security.SafeText

  private boolean doNotTranslateToObjects() {
    return fColumnTypes == null;
  }

  private SafeText getSafeText(ResultSet aRow, int aColumn) throws SQLException {
    SafeText result = null;
    String text = aRow.getString(aColumn);
    if ( text == null ) {
      result = new SafeText(Formats.getEmptyOrNullText());
    }
    else {
      result = new SafeText(text);
    }
    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.