Impressum CompositeELResolver.java
Interaktion und PortierbarkeitJAVA
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*/ package jakarta.el;
if (this.size >= this.resolvers.length) {
ELResolver[] nr = new ELResolver[this.size * 2];
System.arraycopy(this.resolvers, 0, nr, 0, this.size); this.resolvers = nr;
} this.resolvers[this.size++] = elResolver;
}
@Override public Object getValue(ELContext context, Object base, Object property) {
context.setPropertyResolved(false); int sz = this.size; for (int i = 0; i < sz; i++) {
Object result = this.resolvers[i].getValue(context, base, property); if (context.isPropertyResolved()) { return result;
}
} returnnull;
}
@Override public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) {
context.setPropertyResolved(false); int sz = this.size; for (int i = 0; i < sz; i++) {
Object obj = this.resolvers[i].invoke(context, base, method, paramTypes, params); if (context.isPropertyResolved()) { return obj;
}
} returnnull;
}
@Override publicClass<?> getType(ELContext context, Object base, Object property) {
context.setPropertyResolved(false); int sz = this.size; for (int i = 0; i < sz; i++) { Class<?> type = this.resolvers[i].getType(context, base, property); if (context.isPropertyResolved()) { if (SCOPED_ATTRIBUTE_EL_RESOLVER != null &&
SCOPED_ATTRIBUTE_EL_RESOLVER.isAssignableFrom(resolvers[i].getClass())) { // Special case since // jakarta.servlet.jsp.el.ScopedAttributeELResolver will // always return Object.class for type
Object value = resolvers[i].getValue(context, base, property); if (value != null) { return value.getClass();
}
} return type;
}
} returnnull;
}
@Override publicvoid setValue(ELContext context, Object base, Object property, Object value) {
context.setPropertyResolved(false); int sz = this.size; for (int i = 0; i < sz; i++) { this.resolvers[i].setValue(context, base, property, value); if (context.isPropertyResolved()) { return;
}
}
}
@Override publicboolean isReadOnly(ELContext context, Object base, Object property) {
context.setPropertyResolved(false); int sz = this.size; for (int i = 0; i < sz; i++) { boolean readOnly = this.resolvers[i].isReadOnly(context, base, property); if (context.isPropertyResolved()) { return readOnly;
}
} returnfalse;
}
@Deprecated(forRemoval = true, since = "EL 5.0")
@Override public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) { returnnew FeatureIterator(context, base, this.resolvers, this.size);
}
@Override publicClass<?> getCommonPropertyType(ELContext context, Object base) { Class<?> commonType = null; int sz = this.size; for (int i = 0; i < sz; i++) { Class<?> type = this.resolvers[i].getCommonPropertyType(context, base); if (type != null && (commonType == null || commonType.isAssignableFrom(type))) {
commonType = type;
}
} return commonType;
}
@Override public <T> T convertToType(ELContext context, Object obj, Class<T> type) {
context.setPropertyResolved(false); int sz = this.size; for (int i = 0; i < sz; i++) {
T result = this.resolvers[i].convertToType(context, obj, type); if (context.isPropertyResolved()) { return result;
}
} returnnull;
}
@Deprecated(forRemoval = true, since = "EL 5.0") privatestaticfinalclass FeatureIterator implements Iterator<FeatureDescriptor> {
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.18Bemerkung:
Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.