Caleb Fontenot
af597b18d1
modified: .gitignore modified: Semester 2/Assignments/labEL2_CalebFontenot/target/labEL2_CalebFontenot-1.0-SNAPSHOT.war modified: Semester 2/Assignments/labEL2_CalebFontenot/target/maven-archiver/pom.properties modified: Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst modified: Semester 2/Assignments/labEL2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file: Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/LambdaAction.html new file: Semester 2/Assignments/lab_EL5_CalebFontenot/Printed HTMLs/index.html modified: Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/java/edu/slcc/asdv/beans/LambdaAction.java modified: Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/webapp/index.xhtml modified: Semester 2/Assignments/lab_EL5_CalebFontenot/target/lab_EL5_CalebFontenot-1.0-SNAPSHOT/index.xhtml new file: Semester 2/ZIPs/lab_EL5_CalebFontenot.zip
76 lines
4.8 KiB
HTML
76 lines
4.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>LambdaAction.java</title>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<style type="text/css">
|
|
<!--
|
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
|
.literal {color: #cc7832}
|
|
.ST2 {font-family: monospace; font-weight: bold; font-style: italic}
|
|
.ST0 {color: #287bde}
|
|
.string {color: #6a8759}
|
|
.number {color: #6897bb}
|
|
.ST1 {color: #ffc66d}
|
|
.comment {color: #808080}
|
|
.whitespace {color: #505050}
|
|
-->
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-WebDev/Semester 2/Assignments/lab_EL5_CalebFontenot/src/main/java/edu/slcc/asdv/beans/LambdaAction.java</td></tr></table>
|
|
<pre>
|
|
<span class="comment">/*</span>
|
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
|
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java</span><span class="comment"> to edit this template</span>
|
|
<span class="comment"> */</span>
|
|
<span class="literal">package</span> edu.slcc.asdv.beans;
|
|
|
|
<span class="literal">import</span> jakarta.el.ELContext;
|
|
<span class="literal">import</span> jakarta.el.LambdaExpression;
|
|
<span class="literal">import</span> jakarta.inject.Named;
|
|
<span class="literal">import</span> jakarta.enterprise.context.RequestScoped;
|
|
<span class="literal">import</span> jakarta.faces.context.FacesContext;
|
|
<span class="literal">import</span> java.util.ArrayList;
|
|
|
|
<span class="comment">/**</span>
|
|
<span class="comment"> *</span>
|
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
|
<span class="comment">*/</span>
|
|
@Named(value = <span class="string">"</span><span class="string">lambdaAction</span><span class="string">"</span>)
|
|
@RequestScoped
|
|
<span class="literal">public</span> <span class="literal">class</span> LambdaAction {
|
|
|
|
<span class="comment">/**</span>
|
|
<span class="comment"> * </span><span class="comment">Creates</span> <span class="comment">a</span> <span class="comment">new</span> <span class="comment">instance</span> <span class="comment">of</span> <span class="comment">LambdaAction</span>
|
|
<span class="comment">*/</span>
|
|
<span class="literal">public</span> LambdaAction() {
|
|
}
|
|
|
|
<span class="literal">public</span> Object <span class="ST1">lambda1</span>(LambdaExpression lambdaExpression) {
|
|
<span class="comment">// Useful in case of a custom ELContext</span>
|
|
FacesContext fc = FacesContext.<span class="ST2">getCurrentInstance</span>();
|
|
ELContext elContext = fc.getELContext();
|
|
<span class="literal">return</span> lambdaExpression.invoke(elContext, <span class="number">8</span>, <span class="number">3</span>);
|
|
}
|
|
|
|
<span class="literal">public</span> ArrayList<String> <span class="ST1">lambda2</span>(LambdaExpression lambdaExpression) {
|
|
ArrayList<String> returnArray = <span class="literal">new</span> ArrayList<>();
|
|
|
|
returnArray.add(lambdaExpression.invoke(<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>,<span class="number">4</span>).toString());
|
|
returnArray.add(lambdaExpression.invoke(<span class="number">2</span>,<span class="number">1</span>,<span class="number">3</span>,<span class="number">4</span>).toString());
|
|
returnArray.add(lambdaExpression.invoke(<span class="number">2</span>,<span class="number">3</span>,<span class="number">1</span>,<span class="number">4</span>).toString());
|
|
returnArray.add(lambdaExpression.invoke(<span class="number">4</span>,<span class="number">2</span>,<span class="number">3</span>,<span class="number">1</span>).toString());
|
|
returnArray.add(lambdaExpression.invoke(<span class="number">4</span>,<span class="number">2</span>,<span class="number">1</span>,<span class="number">1</span>).toString());
|
|
returnArray.add(lambdaExpression.invoke(<span class="number">4</span>,<span class="number">1</span>,<span class="number">1</span>,<span class="number">2</span>).toString());
|
|
returnArray.add(lambdaExpression.invoke(<span class="number">1</span>,<span class="number">1</span>,<span class="number">4</span>,<span class="number">2</span>).toString());
|
|
returnArray.add(lambdaExpression.invoke(<span class="number">1</span>,<span class="number">1</span>,<span class="number">1</span>,<span class="number">1</span>).toString());
|
|
<span class="literal">return</span> returnArray;
|
|
}
|
|
}
|
|
|
|
</pre></body>
|
|
</html>
|