|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.shibboleth.common.attribute.resolver.provider.AbstractResolutionPlugIn<BaseAttribute>
edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.BaseAttributeDefinition
edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.TemplateAttributeDefinition
public class TemplateAttributeDefinition
An AttributeDefinition
that constructs its values based on the values of its dependencies using the Velocity
Template Language. Dependencies may have multiple values, however multiples dependencies must have the same number of
values. In the case of multi-valued dependencies, the template will be evaluated multiples times, iterating over each
dependency.
Field Summary | |
---|---|
private String |
attributeTemplate
Template that produces the attribute value. |
private org.slf4j.Logger |
log
Class logger. |
private List<String> |
sourceAttributes
IDs of the attributes used in this composite. |
private String |
templateName
Name the attribute template is registered under within the template engine. |
private org.apache.velocity.app.VelocityEngine |
velocity
Velocity engine to use to render attribute values. |
Constructor Summary | |
---|---|
TemplateAttributeDefinition(org.apache.velocity.app.VelocityEngine newVelocityEngine)
Constructor. |
Method Summary | |
---|---|
protected BaseAttribute |
doResolve(ShibbolethResolutionContext resolutionContext)
Creates and populates the values for the resolved attribute. |
String |
getAttributeTemplate()
Get the attribute template. |
List<String> |
getSourceAttributes()
Get the source attribute IDs. |
void |
initialize()
Initialize the attribute definition and prepare it for use. |
protected void |
registerTemplate()
Registers the template with template engine. |
void |
setAttributeTemplate(String newAttributeTemplate)
Set the attribute template. |
void |
setSourceAttributes(List<String> newSourceAttributes)
Set the source attribute IDs. |
void |
validate()
Validate the internal state of this plug-in. |
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.BaseAttributeDefinition |
---|
getAttributeEncoders, getDisplayDescriptions, getDisplayNames, getSourceAttributeID, getValuesFromAllDependencies, isDependencyOnly, resolve, setDependencyOnly, setSourceAttributeID |
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.AbstractResolutionPlugIn |
---|
getDependencyIds, getId, getValuesFromAllDependencies, getValuesFromAttributeDependency, getValuesFromConnectorDependency, setId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.ResolutionPlugIn |
---|
getDependencyIds, getId |
Field Detail |
---|
private final org.slf4j.Logger log
private org.apache.velocity.app.VelocityEngine velocity
private String templateName
private String attributeTemplate
private List<String> sourceAttributes
Constructor Detail |
---|
public TemplateAttributeDefinition(org.apache.velocity.app.VelocityEngine newVelocityEngine)
newVelocityEngine
- velocity engine used to parse template.Method Detail |
---|
protected BaseAttribute doResolve(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException
doResolve
in class BaseAttributeDefinition
resolutionContext
- current attribute resolution context
AttributeResolutionException
- thrown if there is a problem resolving and creating the attributepublic void initialize() throws Exception
Exception
- if unable to initialize attribute definitionprotected void registerTemplate()
public void validate() throws AttributeResolutionException
AttributeResolutionException
- if the plug-in has an invalid internal statepublic String getAttributeTemplate()
public void setAttributeTemplate(String newAttributeTemplate)
newAttributeTemplate
- the attribute templatepublic List<String> getSourceAttributes()
public void setSourceAttributes(List<String> newSourceAttributes)
newSourceAttributes
- the source attribute IDs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |