Permalink
Browse files

spaces2tabs

  • Loading branch information...
1 parent 60ff0ef commit 7c409fc09e2b198c93e655501024482b680a40d6 @BalusC BalusC committed Aug 15, 2016
View
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>4.0.0</modelVersion>
View
@@ -1,9 +1,14 @@
-<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
- <servers>
- <server>
- <id>ossrh</id>
- <username>${env.SONATYPE_USERNAME}</username>
- <password>${env.SONATYPE_PASSWORD}</password>
- </server>
- </servers>
+<?xml version="1.0" encoding="UTF-8"?>
+<settings
+ xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"
+>
+ <servers>
+ <server>
+ <id>ossrh</id>
+ <username>${env.SONATYPE_USERNAME}</username>
+ <password>${env.SONATYPE_PASSWORD}</password>
+ </server>
+ </servers>
</settings>
@@ -30,10 +30,10 @@
@Dependent
public class InjectionPointGenerator {
- // TODO: this is a workaround originally for older OWB versions, but while OWB is fixed, newer Weld versions
- // are now broken. It seems this needs to be fixed in CDI 2.0.
- // See https://issues.jboss.org/browse/CDI-610
-
+ // TODO: this is a workaround originally for older OWB versions, but while OWB is fixed, newer Weld versions
+ // are now broken. It seems this needs to be fixed in CDI 2.0.
+ // See https://issues.jboss.org/browse/CDI-610
+
@Inject
private InjectionPoint injectionPoint;
@@ -88,13 +88,13 @@
byte[].class
};
- private static final AnnotationLiteral<Any> ANY = new AnnotationLiteral<Any>() {
- private static final long serialVersionUID = 1L;
- };
+ private static final AnnotationLiteral<Any> ANY = new AnnotationLiteral<Any>() {
+ private static final long serialVersionUID = 1L;
+ };
- private static final String ERROR_MISSING_METHOD =
+ private static final String ERROR_MISSING_METHOD =
"@GraphicImageBean bean '%s' must have a method returning an InputStream or byte[].";
- private static final String ERROR_INVALID_LASTMODIFIED =
+ private static final String ERROR_INVALID_LASTMODIFIED =
"o:graphicImage 'lastModified' attribute must be an instance of Long or Date."
+ " Encountered an invalid value of '%s'.";
private static final String ERROR_INVALID_TYPE =
@@ -1275,38 +1275,38 @@ public void processAjaxBehavior(AjaxBehaviorEvent event) throws AbortProcessingE
*/
@SuppressWarnings("unchecked")
public static List<String> getActionExpressionsAndListeners(UIComponent component) {
- List<String> actions = new ArrayList<>();
-
- if (component instanceof ActionSource2) {
- ActionSource2 source = (ActionSource2) component;
- addExpressionStringIfNotNull(source.getActionExpression(), actions);
-
- for (ActionListener actionListener : source.getActionListeners()) {
- actions.add(actionListener.getClass().getName());
- }
- }
-
- if (component instanceof ClientBehaviorHolder) {
- String behaviorEvent = getRequestParameter("javax.faces.behavior.event");
-
- if (behaviorEvent != null) {
- List<ClientBehavior> behaviors = ((ClientBehaviorHolder) component).getClientBehaviors().get(behaviorEvent);
-
- if (behaviors != null) {
- for (ClientBehavior behavior : behaviors) {
- List<BehaviorListener> listeners = getField(BehaviorBase.class, List.class, behavior);
-
- if (listeners != null) {
- for (BehaviorListener listener : listeners) {
- addExpressionStringIfNotNull(getField(listener.getClass(), MethodExpression.class, listener), actions);
- }
- }
- }
- }
- }
- }
-
- return unmodifiableList(actions);
+ List<String> actions = new ArrayList<>();
+
+ if (component instanceof ActionSource2) {
+ ActionSource2 source = (ActionSource2) component;
+ addExpressionStringIfNotNull(source.getActionExpression(), actions);
+
+ for (ActionListener actionListener : source.getActionListeners()) {
+ actions.add(actionListener.getClass().getName());
+ }
+ }
+
+ if (component instanceof ClientBehaviorHolder) {
+ String behaviorEvent = getRequestParameter("javax.faces.behavior.event");
+
+ if (behaviorEvent != null) {
+ List<ClientBehavior> behaviors = ((ClientBehaviorHolder) component).getClientBehaviors().get(behaviorEvent);
+
+ if (behaviors != null) {
+ for (ClientBehavior behavior : behaviors) {
+ List<BehaviorListener> listeners = getField(BehaviorBase.class, List.class, behavior);
+
+ if (listeners != null) {
+ for (BehaviorListener listener : listeners) {
+ addExpressionStringIfNotNull(getField(listener.getClass(), MethodExpression.class, listener), actions);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return unmodifiableList(actions);
}
// Hierarchy validation -------------------------------------------------------------------------------------------
@@ -1491,23 +1491,23 @@ private static void addExpressionStringIfNotNull(MethodExpression expression, Li
* Get first matching field of given field type from the given class type and get the value from the given instance.
* (this is a rather specific helper for getActionExpressionsAndListeners() and may not work in other cases).
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
private static <C, F> F getField(Class<? extends C> classType, Class<F> fieldType, C instance) {
- for (Field field : classType.getDeclaredFields()) {
- if (fieldType.isAssignableFrom(field.getType())) {
- field.setAccessible(true);
+ for (Field field : classType.getDeclaredFields()) {
+ if (fieldType.isAssignableFrom(field.getType())) {
+ field.setAccessible(true);
- try {
- return (F) field.get(instance);
+ try {
+ return (F) field.get(instance);
}
- catch (IllegalAccessException e) {
+ catch (IllegalAccessException e) {
throw new IllegalStateException(e);
}
- }
- }
+ }
+ }
- return null;
- }
+ return null;
+ }
// Inner classes --------------------------------------------------------------------------------------------------
@@ -1,4 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 OmniFaces.
+
+ Licensed 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.
+ -->
<beans
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -4280,10 +4280,10 @@ public enum Baz {
<![CDATA[
The <code>&lt;o:skipValidators&gt;</code> allows the developer to skip validators when
executing a submit. This taghandler must be placed inside the component that invokes the submit, may be an
- <code>UICommand</code> (both ajaxified or not) as well as any <code>ClientBehaviorHolder</code> (ajax enabled) component.
+ <code>UICommand</code> (both ajaxified or not) as well as any <code>ClientBehaviorHolder</code> (ajax enabled) component.
<p>
Validation will happen, but no validator will be executed since they will be temporary detached from processed components.
- Conversion errors could still occur. Note that the model values will be updated for all processed components.
+ Conversion errors could still occur. Note that the model values will be updated for all processed components.
]]>
</description>
<tag-name>skipValidators</tag-name>

0 comments on commit 7c409fc

Please sign in to comment.