org.eclipse.higgins.rp.servlet.server
Class AttributeHelper

java.lang.Object
  extended by org.eclipse.higgins.rp.servlet.server.AttributeHelper

public class AttributeHelper
extends Object


Constructor Summary
AttributeHelper()
           
 
Method Summary
static String[] getAllSimpleStringClaims(javax.servlet.http.HttpServletRequest request)
          Parse out both required and optional space-separated claim names and return just the suffix of the claim names
static String[] getMultiValuedAttribute(javax.servlet.http.HttpServletRequest req, String attrname)
           
static String[] getSimpleStringClaims(javax.servlet.http.HttpServletRequest request, boolean optional)
          Parse out space-separated claim names and return just the suffix of the claim name
static String getSimpleStringClaimsAsMarkup(javax.servlet.http.HttpServletRequest request, String startMarker, String endMarker, boolean optional)
          Parse either the required claims or the optional claims and returns a string delineated by whatever marker is passed in.
static String getSingleValuedAttribute(javax.servlet.http.HttpServletRequest req, String attrname)
           
static String[] getSuffixes(String urlS, String separatorS)
          Parse out URLs and return just the suffix of the URL string
static String[] getValues(String[][] list, int index)
           
static String getValueString(String[][] list, int index)
           
static String htmlEncode(String pText)
          Html-encode to guard against CSS and/or SQL injection attacks
static String writeXClaims(List claimList, boolean optional)
          Parse out space-separated claim names and return xhtml-style add claimType entries
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeHelper

public AttributeHelper()
Method Detail

getSingleValuedAttribute

public static String getSingleValuedAttribute(javax.servlet.http.HttpServletRequest req,
                                              String attrname)

getMultiValuedAttribute

public static String[] getMultiValuedAttribute(javax.servlet.http.HttpServletRequest req,
                                               String attrname)

getAllSimpleStringClaims

public static String[] getAllSimpleStringClaims(javax.servlet.http.HttpServletRequest request)
Parse out both required and optional space-separated claim names and return just the suffix of the claim names

Parameters:
request - the servletrequest whose context will be examined to find configured claims
Returns:
an array of claim suffixes

getSimpleStringClaims

public static String[] getSimpleStringClaims(javax.servlet.http.HttpServletRequest request,
                                             boolean optional)
Parse out space-separated claim names and return just the suffix of the claim name

Parameters:
request - the servletrequest whose context will be examined to find configured claims
optional - whether to process the optional or required claims
Returns:
an array of claim suffixes

getSuffixes

public static String[] getSuffixes(String urlS,
                                   String separatorS)
Parse out URLs and return just the suffix of the URL string

Parameters:
urlS - a string of concatenated URLs
separatorS - the chars that act as separators
optional - whether to process the optional or required claims
Returns:
an array of suffixes from individual URL strings

getSimpleStringClaimsAsMarkup

public static String getSimpleStringClaimsAsMarkup(javax.servlet.http.HttpServletRequest request,
                                                   String startMarker,
                                                   String endMarker,
                                                   boolean optional)
Parse either the required claims or the optional claims and returns a string delineated by whatever marker is passed in.

Parameters:
request - the servletrequest whose context will be examined to find configured claims
startMarker - the tag to start an entry with
endMarker - the tag to end an entry with
optional - whether to process the optional or required claims
Returns:
a list item string of claims

getValues

public static String[] getValues(String[][] list,
                                 int index)

getValueString

public static String getValueString(String[][] list,
                                    int index)

htmlEncode

public static String htmlEncode(String pText)
Html-encode to guard against CSS and/or SQL injection attacks

Parameters:
pText - string that may contain special characters like &, <, >, "
Returns:
encoded string with offending characters replaced with innocuous content like &, >, < or ".

writeXClaims

public static String writeXClaims(List claimList,
                                  boolean optional)
                           throws IOException
Parse out space-separated claim names and return xhtml-style add claimType entries

Parameters:
request - the servlet whose context will be examined to find configured claims
response - the response stream, not currently used
optional - whether to process the optional or required claims
Returns:
Throws:
IOException