forked from la-team/light-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
la-team#164 Demo not work due Customer.java @FileReference(baseDirec…
…tory = "/Users/max/Desktop/lightadmin-demo")
- Loading branch information
Showing
10 changed files
with
105 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
lightadmin-core/src/main/java/org/lightadmin/core/reporting/DefaultProblemReporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright 2012-2014 the original author or authors. | ||
* | ||
* 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. | ||
*/ | ||
package org.lightadmin.core.reporting; | ||
|
||
import com.google.common.base.Predicate; | ||
import com.google.common.collect.Collections2; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.Collection; | ||
|
||
import static com.google.common.collect.Lists.newArrayList; | ||
import static org.lightadmin.core.reporting.Problem.ProblemLevel.ERROR; | ||
import static org.lightadmin.core.reporting.Problem.ProblemLevel.WARNING; | ||
|
||
public class DefaultProblemReporter implements ProblemReporter { | ||
|
||
public static final ProblemReporter INSTANCE = new DefaultProblemReporter(); | ||
|
||
private final Logger logger = LoggerFactory.getLogger(getClass()); | ||
|
||
private DefaultProblemReporter() { | ||
} | ||
|
||
@Override | ||
public void handle(final Problem problem) { | ||
handle(newArrayList(problem)); | ||
} | ||
|
||
@Override | ||
public void handle(Collection<? extends Problem> problems) { | ||
for (Problem warning : select(problems, WARNING)) { | ||
logger.warn(warning.getMessage()); | ||
} | ||
|
||
Collection<? extends Problem> errors = select(problems, ERROR); | ||
if (!errors.isEmpty()) { | ||
throw new ConfigurationProblemException(errors); | ||
} | ||
} | ||
|
||
private Collection<? extends Problem> select(Collection<? extends Problem> problems, final Problem.ProblemLevel problemLevel) { | ||
return Collections2.filter(problems, new Predicate<Problem>() { | ||
@Override | ||
public boolean apply(Problem problem) { | ||
return problem.getProblemLevel() == problemLevel; | ||
} | ||
}); | ||
} | ||
} |
41 changes: 0 additions & 41 deletions
41
lightadmin-core/src/main/java/org/lightadmin/core/reporting/FailFastProblemReporter.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
lightadmin-core/src/main/java/org/lightadmin/core/reporting/ProblemReporterFactory.java
This file was deleted.
Oops, something went wrong.
53 changes: 0 additions & 53 deletions
53
lightadmin-core/src/main/java/org/lightadmin/core/reporting/ProblemReporterLogImpl.java
This file was deleted.
Oops, something went wrong.