|
Struts example source code file (LocatableConstantFactory.java)
The Struts LocatableConstantFactory.java source code/** * */ package com.opensymphony.xwork2.config.impl; import com.opensymphony.xwork2.inject.Context; import com.opensymphony.xwork2.inject.Factory; import com.opensymphony.xwork2.util.location.Located; import com.opensymphony.xwork2.util.location.LocationUtils; /** * Factory that remembers where a constant came from */ public class LocatableConstantFactory<T> extends Located implements Factory { T constant; public LocatableConstantFactory(T constant, Object location) { this.constant = constant; setLocation(LocationUtils.getLocation(location)); } public T create(Context ignored) { return constant; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append(" defined at "); sb.append(getLocation().toString()); return sb.toString(); } } Other Struts examples (source code examples)Here is a short list of links related to this Struts LocatableConstantFactory.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.