本文整理汇总了Java中org.apache.tomcat.util.IntrospectionUtils类的典型用法代码示例。如果您正苦于以下问题:Java IntrospectionUtils类的具体用法?Java IntrospectionUtils怎么用?Java IntrospectionUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IntrospectionUtils类属于org.apache.tomcat.util包,在下文中一共展示了IntrospectionUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: begin
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Handle the beginning of an XML element.
*
* @param attributes The attributes of this element
*
* @exception Exception if a processing error occurs
*/
@Override
public void begin(String namespace, String nameX, Attributes attributes)
throws Exception {
for (int i = 0; i < attributes.getLength(); i++) {
String name = attributes.getLocalName(i);
if ("".equals(name)) {
name = attributes.getQName(i);
}
String value = attributes.getValue(i);
if ( !excludes.containsKey(name)) {
if (!digester.isFakeAttribute(digester.peek(), name)
&& !IntrospectionUtils.setProperty(digester.peek(), name, value)
&& digester.getRulesValidation()) {
digester.getLogger().warn("[SetAllPropertiesRule]{" + digester.getMatch() +
"} Setting property '" + name + "' to '" +
value + "' did not find a matching property.");
}
}
}
}
示例2: begin
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Handle the beginning of an XML element.
*
* @param attributes The attributes of this element
*
* @exception Exception if a processing error occurs
*/
@Override
public void begin(String namespace, String nameX, Attributes attributes)
throws Exception {
for (int i = 0; i < attributes.getLength(); i++) {
String name = attributes.getLocalName(i);
if ("".equals(name)) {
name = attributes.getQName(i);
}
if ("path".equals(name) || "docBase".equals(name)) {
continue;
}
String value = attributes.getValue(i);
if (!digester.isFakeAttribute(digester.peek(), name)
&& !IntrospectionUtils.setProperty(digester.peek(), name, value)
&& digester.getRulesValidation()) {
digester.getLogger().warn("[SetContextPropertiesRule]{" + digester.getMatch() +
"} Setting property '" + name + "' to '" +
value + "' did not find a matching property.");
}
}
}
示例3: init
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
@Override
public void init(FilterConfig filterConfig) throws ServletException {
Enumeration<String> paramNames = filterConfig.getInitParameterNames();
while (paramNames.hasMoreElements()) {
String paramName = paramNames.nextElement();
if (!IntrospectionUtils.setProperty(this, paramName,
filterConfig.getInitParameter(paramName))) {
String msg = sm.getString("filterbase.noSuchProperty",
paramName, this.getClass().getName());
if (isConfigProblemFatal()) {
throw new ServletException(msg);
} else {
getLogger().warn(msg);
}
}
}
}
示例4: end
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Process the end of this element.
*
* @param namespace the namespace URI of the matching element, or an
* empty string if the parser is not namespace aware or the element has
* no namespace
* @param name the local name if the parser is namespace aware, or just
* the element name otherwise
*/
@Override
public void end(String namespace, String name) throws Exception {
// Identify the objects to be used
Object child = digester.peek(0);
Object parent = digester.root;
if (digester.log.isDebugEnabled()) {
if (parent == null) {
digester.log.debug("[SetRootRule]{" + digester.match +
"} Call [NULL ROOT]." +
methodName + "(" + child + ")");
} else {
digester.log.debug("[SetRootRule]{" + digester.match +
"} Call " + parent.getClass().getName() + "." +
methodName + "(" + child + ")");
}
}
// Call the specified method
IntrospectionUtils.callMethod1(parent, methodName,
child, paramType, digester.getClassLoader());
}
示例5: updateAttributes
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Returns an attributes list which contains all the attributes
* passed in, with any text of form "${xxx}" in an attribute value
* replaced by the appropriate value from the system property.
*/
private Attributes updateAttributes(Attributes list) {
if (list.getLength() == 0) {
return list;
}
AttributesImpl newAttrs = new AttributesImpl(list);
int nAttributes = newAttrs.getLength();
for (int i = 0; i < nAttributes; ++i) {
String value = newAttrs.getValue(i);
try {
String newValue =
IntrospectionUtils.replaceProperties(value, null, source);
if (value != newValue) {
newAttrs.setValue(i, newValue);
}
}
catch (Exception e) {
// ignore - let the attribute have its original value
}
}
return newAttrs;
}
示例6: updateBodyText
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Return a new StringBuilder containing the same contents as the
* input buffer, except that data of form ${varname} have been
* replaced by the value of that var as defined in the system property.
*/
private StringBuilder updateBodyText(StringBuilder bodyText) {
String in = bodyText.toString();
String out;
try {
out = IntrospectionUtils.replaceProperties(in, null, source);
} catch(Exception e) {
return bodyText; // return unchanged data
}
if (out == in) {
// No substitutions required. Don't waste memory creating
// a new buffer
return bodyText;
} else {
return new StringBuilder(out);
}
}
示例7: end
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Process the end of this element.
*
* @param namespace the namespace URI of the matching element, or an
* empty string if the parser is not namespace aware or the element has
* no namespace
* @param name the local name if the parser is namespace aware, or just
* the element name otherwise
*/
@Override
public void end(String namespace, String name) throws Exception {
// Identify the objects to be used
Object child = digester.peek(0);
Object parent = digester.peek(1);
if (digester.log.isDebugEnabled()) {
if (child == null) {
digester.log.debug("[SetTopRule]{" + digester.match +
"} Call [NULL CHILD]." +
methodName + "(" + parent + ")");
} else {
digester.log.debug("[SetTopRule]{" + digester.match +
"} Call " + child.getClass().getName() + "." +
methodName + "(" + parent + ")");
}
}
// Call the specified method
IntrospectionUtils.callMethod1(child, methodName,
parent, paramType, digester.getClassLoader());
}
示例8: begin
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Handle the beginning of an XML element.
*
* @param attributes The attributes of this element
*
* @exception Exception if a processing error occurs
*/
public void begin(String namespace, String nameX, Attributes attributes)
throws Exception {
for (int i = 0; i < attributes.getLength(); i++) {
String name = attributes.getLocalName(i);
if ("".equals(name)) {
name = attributes.getQName(i);
}
String value = attributes.getValue(i);
if ( !excludes.containsKey(name)) {
if (!digester.isFakeAttribute(digester.peek(), name)
&& !IntrospectionUtils.setProperty(digester.peek(), name, value)
&& digester.getRulesValidation()) {
digester.getLogger().warn("[SetAllPropertiesRule]{" + digester.getMatch() +
"} Setting property '" + name + "' to '" +
value + "' did not find a matching property.");
}
}
}
}
示例9: begin
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Handle the beginning of an XML element.
*
* @param attributes The attributes of this element
*
* @exception Exception if a processing error occurs
*/
public void begin(String namespace, String nameX, Attributes attributes)
throws Exception {
for (int i = 0; i < attributes.getLength(); i++) {
String name = attributes.getLocalName(i);
if ("".equals(name)) {
name = attributes.getQName(i);
}
if ("path".equals(name) || "docBase".equals(name)) {
continue;
}
String value = attributes.getValue(i);
if (!digester.isFakeAttribute(digester.peek(), name)
&& !IntrospectionUtils.setProperty(digester.peek(), name, value)
&& digester.getRulesValidation()) {
digester.getLogger().warn("[SetContextPropertiesRule]{" + digester.getMatch() +
"} Setting property '" + name + "' to '" +
value + "' did not find a matching property.");
}
}
}
示例10: end
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Process the end of this element.
*/
public void end() throws Exception {
// Identify the objects to be used
Object child = digester.peek(0);
Object parent = digester.root;
if (digester.log.isDebugEnabled()) {
if (parent == null) {
digester.log.debug("[SetRootRule]{" + digester.match +
"} Call [NULL ROOT]." +
methodName + "(" + child + ")");
} else {
digester.log.debug("[SetRootRule]{" + digester.match +
"} Call " + parent.getClass().getName() + "." +
methodName + "(" + child + ")");
}
}
// Call the specified method
IntrospectionUtils.callMethod1(parent, methodName,
child, paramType, digester.getClassLoader());
}
示例11: updateBodyText
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Return a new StringBuffer containing the same contents as the
* input buffer, except that data of form ${varname} have been
* replaced by the value of that var as defined in the system property.
*/
private StringBuffer updateBodyText(StringBuffer bodyText) {
String in = bodyText.toString();
String out;
try {
out = IntrospectionUtils.replaceProperties(in, null, source);
} catch(Exception e) {
return bodyText; // return unchanged data
}
if (out == in) {
// No substitutions required. Don't waste memory creating
// a new buffer
return bodyText;
} else {
return new StringBuffer(out);
}
}
示例12: end
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Process the end of this element.
*/
public void end() throws Exception {
// Identify the objects to be used
Object child = digester.peek(0);
Object parent = digester.peek(1);
if (digester.log.isDebugEnabled()) {
if (child == null) {
digester.log.debug("[SetTopRule]{" + digester.match +
"} Call [NULL CHILD]." +
methodName + "(" + parent + ")");
} else {
digester.log.debug("[SetTopRule]{" + digester.match +
"} Call " + child.getClass().getName() + "." +
methodName + "(" + parent + ")");
}
}
// Call the specified method
IntrospectionUtils.callMethod1(child, methodName,
parent, paramType, digester.getClassLoader());
}
示例13: end
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Process the end of this element.
*/
public void end() throws Exception {
// Identify the objects to be used
Object child = digester.peek(0);
Object parent = digester.peek(1);
if (digester.log.isDebugEnabled()) {
if (parent == null) {
digester.log.debug("[SetNextRule]{" + digester.match +
"} Call [NULL PARENT]." +
methodName + "(" + child + ")");
} else {
digester.log.debug("[SetNextRule]{" + digester.match +
"} Call " + parent.getClass().getName() + "." +
methodName + "(" + child + ")");
}
}
// Call the specified method
IntrospectionUtils.callMethod1(parent, methodName,
child, paramType, digester.getClassLoader());
}
示例14: findProxyConnector
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Find the most likely connector the proxy server should connect to, or
* accept connections from.
*
* @param connectors
* @return
*/
protected Connector findProxyConnector(Connector[] connectors) {
int pos = 0;
int maxThreads = 0;
for (int i = 0; i < connectors.length; i++) {
if (connectors[i].getProtocol().startsWith("AJP")) {
// Return any AJP connector found
return connectors[i];
}
if (Boolean.TRUE.equals(IntrospectionUtils.getProperty(connectors[i].getProtocolHandler(), "reverseConnection"))) {
return connectors[i];
}
Integer mt = (Integer) IntrospectionUtils.getProperty(connectors[i].getProtocolHandler(), "maxThreads");
if (mt.intValue() > maxThreads) {
maxThreads = mt.intValue();
pos = i;
}
}
// If no AJP connector and no reverse, return the connector with the most threads
return connectors[pos];
}
示例15: end
import org.apache.tomcat.util.IntrospectionUtils; //导入依赖的package包/类
/**
* Process the end of this element.
*
* @param namespace the namespace URI of the matching element, or an
* empty string if the parser is not namespace aware or the element has
* no namespace
* @param name the local name if the parser is namespace aware, or just
* the element name otherwise
*/
@Override
public void end(String namespace, String name) throws Exception {
// Identify the objects to be used
Object child = digester.peek(0);
Object parent = digester.peek(1);
if (digester.log.isDebugEnabled()) {
if (parent == null) {
digester.log.debug("[SetNextRule]{" + digester.match +
"} Call [NULL PARENT]." +
methodName + "(" + child + ")");
} else {
digester.log.debug("[SetNextRule]{" + digester.match +
"} Call " + parent.getClass().getName() + "." +
methodName + "(" + child + ")");
}
}
// Call the specified method
IntrospectionUtils.callMethod1(parent, methodName,
child, paramType, digester.getClassLoader());
}