se.kmr.scam.web.taglib.common
Class BasePropertyTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byse.kmr.scam.web.taglib.common.BodyTagSupport
              extended byse.kmr.scam.web.taglib.common.BasePropertyTag
All Implemented Interfaces:
BodyTag, IterationTag, Serializable, Tag
Direct Known Subclasses:
se.portfolio.scam.web.taglib.ContentBasePropertyTag, SimpleBasePropertyTag, TypeMapperTag

public abstract class BasePropertyTag
extends BodyTagSupport

An abstract class for exposing the value of a property. (The property value is exopsed as a java.lang.String)

Version:
$Revision: 1.15 $
Author:
Jöran
See Also:
Serialized Form
Created:
den 23 oktober 2002

Field Summary
protected  Object _currentObject
           
protected  String _default
           
protected  String _delimiter
           
protected  Iterator _iterator
           
protected  String _lang
           
protected  int _maxSize
           
protected  int _maxSizeTot
           
protected  List _values
           
protected  String default_
           
protected  String delimiter_
           
protected  String lang_
           
protected  String maxSize_
           
protected  String maxSizeTot_
           
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
BasePropertyTag()
           
 
Method Summary
 int doAfterBody()
          Recives notification after body evaluation
 int doEndTag()
          Receives notification at end of tag.
 int doStartTag()
          Recives notification of the start of a tag.
protected  void exposeValues()
          Expose all values on the page.
 Object getCurrentObject()
          Gets current object in the iteration
 boolean getHasMore()
          determines if there are more elements in the iterator.
 String getLanguage()
          Gets the value of the language attribute.
abstract  List getValueNodes()
          Gets the property value that the implementation represents.
protected  boolean info()
           
 void release()
          Release allocated resources.
 void setDefault(String def)
           
 void setDelimiter(String delimiter)
          Sets the delimiter attribute of the BaseTag object
 void setLanguage(String lang)
          Sets the language attribute of the BaseTag object
 void setMaxSize(String size)
          Sets the maxSize attribute of the BaseTag object
 void setMaxSizeTot(String size)
          Sets the maxSizeTot attribute of the BaseTag object
 String toString()
           
 
Methods inherited from class se.kmr.scam.web.taglib.common.BodyTagSupport
escape, exposeObject, exposeTag, getSubjectAsResource, getVar, printObject, removeObject, removeTag, setSubject, setVar
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

_lang

protected String _lang

lang_

protected String lang_

_delimiter

protected String _delimiter

delimiter_

protected String delimiter_

_default

protected String _default

default_

protected String default_

maxSize_

protected String maxSize_

_maxSize

protected int _maxSize

maxSizeTot_

protected String maxSizeTot_

_maxSizeTot

protected int _maxSizeTot

_values

protected List _values

_iterator

protected Iterator _iterator

_currentObject

protected Object _currentObject
Constructor Detail

BasePropertyTag

public BasePropertyTag()
Method Detail

setLanguage

public void setLanguage(String lang)
Sets the language attribute of the BaseTag object

Parameters:
lang - The new lang value

getLanguage

public String getLanguage()
Gets the value of the language attribute.

Returns:
If the language attribute is an expression then the result from evaluating the expression is return otherwise the value of the language attribute.

setDelimiter

public void setDelimiter(String delimiter)
Sets the delimiter attribute of the BaseTag object

Parameters:
delimiter - The new delimiter value

setMaxSize

public void setMaxSize(String size)
Sets the maxSize attribute of the BaseTag object

Parameters:
size - The new maxSize value

setMaxSizeTot

public void setMaxSizeTot(String size)
Sets the maxSizeTot attribute of the BaseTag object

Parameters:
size - The new maxSizeTot value

getCurrentObject

public Object getCurrentObject()
Gets current object in the iteration

Returns:
current object

getHasMore

public boolean getHasMore()
determines if there are more elements in the iterator.

Returns:
true if the iterator hase more elements, false otherwise.

setDefault

public void setDefault(String def)

doStartTag

public int doStartTag()
               throws JspException
Recives notification of the start of a tag. Value(s) of the tag is written to the page if a delimiter is defined. If a variable is defined, then each value is exposed in that variable in each iteration.

Returns:
the value SKIP_BODY if the value(s) is written to the page, otherwise EVAL_BODY_INCLUDE.
Throws:
JspException - thrown in case of exception writing to the page or extracting property value.

doAfterBody

public int doAfterBody()
Recives notification after body evaluation

Returns:
how the body should be evaluated.

doEndTag

public int doEndTag()
             throws JspException
Receives notification at end of tag.
If the tag has no content the values are exposed on the page.

Returns:
the value of EVAL_PAGE
Throws:
JspException - is thrown in case of exception exposing the values

release

public void release()
Release allocated resources.

Specified by:
release in interface Tag
Overrides:
release in class BodyTagSupport

getValueNodes

public abstract List getValueNodes()
                            throws RDFException,
                                   JspException
Gets the property value that the implementation represents.

Returns:
the value object, if the property exists (of defiend language), oterwise null.
Throws:
RDFException - thrown in case of exception extracting property value
JspException - thrown in case of internal exception.

exposeValues

protected void exposeValues()
                     throws JspException
Expose all values on the page.
If a delimiter is defined each value is separated by the delimiter.
If a mximum value size is defined a value will not be longer then that size. A pruned value is indicated by "..." after the value.
Note: the delimiter is only placed inbetween values, not before or after the set of values

Throws:
JspException

info

protected boolean info()

toString

public String toString()


Copyright © 2003 SCAM. All Rights Reserved.