diff --git a/.gitignore b/.gitignore index 2edea19340..349efbcb67 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ bin/ *.class # Package Files # +*.jar *.war *.ear @@ -29,7 +30,7 @@ out/ .DS_Store # Maven -log/ +log/* target/ # Gradle @@ -82,4 +83,11 @@ jta/transaction-logs/ software-security/sql-injection-samples/derby.log spring-soap/src/main/java/com/baeldung/springsoap/gen/ /report-*.json -transaction.log \ No newline at end of file +transaction.log +*-shell.log + +apache-cxf/cxf-aegis/baeldung.xml +apache-fop/src/test/resources/input.xml +apache-fop/src/test/resources/output_herold.pdf +apache-fop/src/test/resources/output_html2fo.pdf +apache-fop/src/test/resources/output_jtidy.pdf \ No newline at end of file diff --git a/akka-http/README.md b/akka-http/README.md index 3831b5079f..ebe6581ff6 100644 --- a/akka-http/README.md +++ b/akka-http/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Akka HTTP + +This module contains articles about Akka HTTP. + +### Relevant articles: - [Introduction to Akka HTTP](https://www.baeldung.com/akka-http) diff --git a/akka-streams/README.md b/akka-streams/README.md index 7f2751422b..a59b7fde5c 100644 --- a/akka-streams/README.md +++ b/akka-streams/README.md @@ -1,3 +1,7 @@ +## Akka Streams + +This module contains articles about Akka Streams. + ### Relevant articles -- [Guide to Akka Streams](http://www.baeldung.com/akka-streams) +- [Guide to Akka Streams](https://www.baeldung.com/akka-streams) diff --git a/algorithms-genetic/README.md b/algorithms-genetic/README.md index 39f8d59eee..1c9e831ac2 100644 --- a/algorithms-genetic/README.md +++ b/algorithms-genetic/README.md @@ -1,6 +1,10 @@ -## Relevant articles: +## Genetic Algorithms -- [Introduction to Jenetics Library](http://www.baeldung.com/jenetics) -- [Ant Colony Optimization](http://www.baeldung.com/java-ant-colony-optimization) +This module contains articles about genetic algorithms. + +### Relevant articles: + +- [Introduction to Jenetics Library](https://www.baeldung.com/jenetics) +- [Ant Colony Optimization](https://www.baeldung.com/java-ant-colony-optimization) - [Design a Genetic Algorithm in Java](https://www.baeldung.com/java-genetic-algorithm) - [The Traveling Salesman Problem in Java](https://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) diff --git a/algorithms-miscellaneous-1/.gitignore b/algorithms-miscellaneous-1/.gitignore deleted file mode 100644 index 30b2b7442c..0000000000 --- a/algorithms-miscellaneous-1/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/target/ -.settings/ -.classpath -.project \ No newline at end of file diff --git a/algorithms-miscellaneous-1/README.md b/algorithms-miscellaneous-1/README.md index 479c2792f6..6a25f8cac8 100644 --- a/algorithms-miscellaneous-1/README.md +++ b/algorithms-miscellaneous-1/README.md @@ -1,18 +1,15 @@ -## Relevant articles: +## Algorithms - Miscellaneous -- [Validating Input With Finite Automata in Java](http://www.baeldung.com/java-finite-automata) -- [Example of Hill Climbing Algorithm](http://www.baeldung.com/java-hill-climbing-algorithm) -- [Monte Carlo Tree Search for Tic-Tac-Toe Game](http://www.baeldung.com/java-monte-carlo-tree-search) -- [Binary Search Algorithm in Java](http://www.baeldung.com/java-binary-search) -- [Introduction to Minimax Algorithm](http://www.baeldung.com/java-minimax-algorithm) -- [How to Calculate Levenshtein Distance in Java?](http://www.baeldung.com/java-levenshtein-distance) -- [How to Find the Kth Largest Element in Java](http://www.baeldung.com/java-kth-largest-element) -- [Multi-Swarm Optimization Algorithm in Java](http://www.baeldung.com/java-multi-swarm-algorithm) -- [String Search Algorithms for Large Texts](http://www.baeldung.com/java-full-text-search-algorithms) -- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters) -- [Find the Middle Element of a Linked List](http://www.baeldung.com/java-linked-list-middle-element) -- [Calculate Factorial in Java](https://www.baeldung.com/java-calculate-factorial) -- [Find Substrings That Are Palindromes in Java](https://www.baeldung.com/java-palindrome-substrings) -- [Find the Longest Substring without Repeating Characters](https://www.baeldung.com/java-longest-substring-without-repeated-characters) -- [Permutations of an Array in Java](https://www.baeldung.com/java-array-permutations) -- [Generate Combinations in Java](https://www.baeldung.com/java-combinations-algorithm) +This module contains articles about algorithms. Some classes of algorithms, e.g., [sorting](/../algorithms-sorting) and +[genetic algorithms](/../algorithms-genetic), have their own dedicated modules. + +### Relevant articles: + +- [Validating Input With Finite Automata in Java](https://www.baeldung.com/java-finite-automata) +- [Example of Hill Climbing Algorithm](https://www.baeldung.com/java-hill-climbing-algorithm) +- [Monte Carlo Tree Search for Tic-Tac-Toe Game](https://www.baeldung.com/java-monte-carlo-tree-search) +- [Binary Search Algorithm in Java](https://www.baeldung.com/java-binary-search) +- [Introduction to Minimax Algorithm](https://www.baeldung.com/java-minimax-algorithm) +- [How to Calculate Levenshtein Distance in Java?](https://www.baeldung.com/java-levenshtein-distance) +- [How to Find the Kth Largest Element in Java](https://www.baeldung.com/java-kth-largest-element) +- More articles: [[next -->]](/../algorithms-miscellaneous-2) diff --git a/algorithms-miscellaneous-2/.gitignore b/algorithms-miscellaneous-2/.gitignore deleted file mode 100644 index 30b2b7442c..0000000000 --- a/algorithms-miscellaneous-2/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/target/ -.settings/ -.classpath -.project \ No newline at end of file diff --git a/algorithms-miscellaneous-2/README.md b/algorithms-miscellaneous-2/README.md index 462644dddb..7560fc4fe7 100644 --- a/algorithms-miscellaneous-2/README.md +++ b/algorithms-miscellaneous-2/README.md @@ -1,19 +1,16 @@ -## Relevant articles: +## Algorithms - Miscellaneous -- [Dijkstra Algorithm in Java](http://www.baeldung.com/java-dijkstra) -- [Introduction to Cobertura](http://www.baeldung.com/cobertura) -- [Test a Linked List for Cyclicity](http://www.baeldung.com/java-linked-list-cyclicity) -- [Introduction to JGraphT](http://www.baeldung.com/jgrapht) -- [A Maze Solver in Java](http://www.baeldung.com/java-solve-maze) -- [Create a Sudoku Solver in Java](http://www.baeldung.com/java-sudoku) -- [Displaying Money Amounts in Words](http://www.baeldung.com/java-money-into-words) -- [A Collaborative Filtering Recommendation System in Java](http://www.baeldung.com/java-collaborative-filtering-recommendations) -- [Check If Two Rectangles Overlap In Java](https://www.baeldung.com/java-check-if-two-rectangles-overlap) -- [Calculate the Distance Between Two Points in Java](https://www.baeldung.com/java-distance-between-two-points) -- [Find the Intersection of Two Lines in Java](https://www.baeldung.com/java-intersection-of-two-lines) -- [Round Up to the Nearest Hundred](https://www.baeldung.com/java-round-up-nearest-hundred) -- [Calculate Percentage in Java](https://www.baeldung.com/java-calculate-percentage) -- [Converting Between Byte Arrays and Hexadecimal Strings in Java](https://www.baeldung.com/java-byte-arrays-hex-strings) -- [Convert Latitude and Longitude to a 2D Point in Java](https://www.baeldung.com/java-convert-latitude-longitude) -- [Reversing a Binary Tree in Java](https://www.baeldung.com/java-reversing-a-binary-tree) -- [Find If Two Numbers Are Relatively Prime in Java](https://www.baeldung.com/java-two-relatively-prime-numbers) +This module contains articles about algorithms. Some classes of algorithms, e.g., [sorting](/../algorithms-sorting) and +[genetic algorithms](/../algorithms-genetic), have their own dedicated modules. + +### Relevant articles: + +- [Dijkstra Shortest Path Algorithm in Java](https://www.baeldung.com/java-dijkstra) +- [Introduction to Cobertura](https://www.baeldung.com/cobertura) +- [Test a Linked List for Cyclicity](https://www.baeldung.com/java-linked-list-cyclicity) +- [Introduction to JGraphT](https://www.baeldung.com/jgrapht) +- [A Maze Solver in Java](https://www.baeldung.com/java-solve-maze) +- [Create a Sudoku Solver in Java](https://www.baeldung.com/java-sudoku) +- [Displaying Money Amounts in Words](https://www.baeldung.com/java-money-into-words) +- [A Collaborative Filtering Recommendation System in Java](https://www.baeldung.com/java-collaborative-filtering-recommendations) +- More articles: [[<-- prev]](/../algorithms-miscellaneous-1) [[next -->]](/../algorithms-miscellaneous-3) diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/Graph.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/Graph.java new file mode 100644 index 0000000000..8145c03e7a --- /dev/null +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/Graph.java @@ -0,0 +1,30 @@ +package com.baeldung.algorithms.astar; + +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + + +public class Graph { + private final Set nodes; + + private final Map> connections; + + public Graph(Set nodes, Map> connections) { + this.nodes = nodes; + this.connections = connections; + } + + public T getNode(String id) { + return nodes.stream() + .filter(node -> node.getId().equals(id)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("No node found with ID")); + } + + public Set getConnections(T node) { + return connections.get(node.getId()).stream() + .map(this::getNode) + .collect(Collectors.toSet()); + } +} diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/GraphNode.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/GraphNode.java new file mode 100644 index 0000000000..8d0539ead2 --- /dev/null +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/GraphNode.java @@ -0,0 +1,5 @@ +package com.baeldung.algorithms.astar; + +public interface GraphNode { + String getId(); +} diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/RouteFinder.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/RouteFinder.java new file mode 100644 index 0000000000..35458093c5 --- /dev/null +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/RouteFinder.java @@ -0,0 +1,66 @@ +package com.baeldung.algorithms.astar; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.PriorityQueue; +import java.util.Queue; +import java.util.stream.Collectors; + +public class RouteFinder { + private final Graph graph; + private final Scorer nextNodeScorer; + private final Scorer targetScorer; + + public RouteFinder(Graph graph, Scorer nextNodeScorer, Scorer targetScorer) { + this.graph = graph; + this.nextNodeScorer = nextNodeScorer; + this.targetScorer = targetScorer; + } + + public List findRoute(T from, T to) { + Map> allNodes = new HashMap<>(); + Queue openSet = new PriorityQueue<>(); + + RouteNode start = new RouteNode<>(from, null, 0d, targetScorer.computeCost(from, to)); + allNodes.put(from, start); + openSet.add(start); + + while (!openSet.isEmpty()) { + System.out.println("Open Set contains: " + openSet.stream().map(RouteNode::getCurrent).collect(Collectors.toSet())); + RouteNode next = openSet.poll(); + System.out.println("Looking at node: " + next); + if (next.getCurrent().equals(to)) { + System.out.println("Found our destination!"); + + List route = new ArrayList<>(); + RouteNode current = next; + do { + route.add(0, current.getCurrent()); + current = allNodes.get(current.getPrevious()); + } while (current != null); + + System.out.println("Route: " + route); + return route; + } + + graph.getConnections(next.getCurrent()).forEach(connection -> { + double newScore = next.getRouteScore() + nextNodeScorer.computeCost(next.getCurrent(), connection); + RouteNode nextNode = allNodes.getOrDefault(connection, new RouteNode<>(connection)); + allNodes.put(connection, nextNode); + + if (nextNode.getRouteScore() > newScore) { + nextNode.setPrevious(next.getCurrent()); + nextNode.setRouteScore(newScore); + nextNode.setEstimatedScore(newScore + targetScorer.computeCost(connection, to)); + openSet.add(nextNode); + System.out.println("Found a better route to node: " + nextNode); + } + }); + } + + throw new IllegalStateException("No route found"); + } + +} diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/RouteNode.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/RouteNode.java new file mode 100644 index 0000000000..842e50179d --- /dev/null +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/RouteNode.java @@ -0,0 +1,67 @@ +package com.baeldung.algorithms.astar; + +import java.util.StringJoiner; + +class RouteNode implements Comparable { + private final T current; + private T previous; + private double routeScore; + private double estimatedScore; + + RouteNode(T current) { + this(current, null, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); + } + + RouteNode(T current, T previous, double routeScore, double estimatedScore) { + this.current = current; + this.previous = previous; + this.routeScore = routeScore; + this.estimatedScore = estimatedScore; + } + + T getCurrent() { + return current; + } + + T getPrevious() { + return previous; + } + + double getRouteScore() { + return routeScore; + } + + double getEstimatedScore() { + return estimatedScore; + } + + void setPrevious(T previous) { + this.previous = previous; + } + + void setRouteScore(double routeScore) { + this.routeScore = routeScore; + } + + void setEstimatedScore(double estimatedScore) { + this.estimatedScore = estimatedScore; + } + + @Override + public int compareTo(RouteNode other) { + if (this.estimatedScore > other.estimatedScore) { + return 1; + } else if (this.estimatedScore < other.estimatedScore) { + return -1; + } else { + return 0; + } + } + + @Override + public String toString() { + return new StringJoiner(", ", RouteNode.class.getSimpleName() + "[", "]").add("current=" + current) + .add("previous=" + previous).add("routeScore=" + routeScore).add("estimatedScore=" + estimatedScore) + .toString(); + } +} diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/Scorer.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/Scorer.java new file mode 100644 index 0000000000..64eb1e546f --- /dev/null +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/Scorer.java @@ -0,0 +1,5 @@ +package com.baeldung.algorithms.astar; + +public interface Scorer { + double computeCost(T from, T to); +} diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/HaversineScorer.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/HaversineScorer.java new file mode 100644 index 0000000000..97564ee154 --- /dev/null +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/HaversineScorer.java @@ -0,0 +1,19 @@ +package com.baeldung.algorithms.astar.underground; + +import com.baeldung.algorithms.astar.Scorer; + +public class HaversineScorer implements Scorer { + @Override + public double computeCost(Station from, Station to) { + double R = 6372.8; // In kilometers + + double dLat = Math.toRadians(to.getLatitude() - from.getLatitude()); + double dLon = Math.toRadians(to.getLongitude() - from.getLongitude()); + double lat1 = Math.toRadians(from.getLatitude()); + double lat2 = Math.toRadians(to.getLatitude()); + + double a = Math.pow(Math.sin(dLat / 2),2) + Math.pow(Math.sin(dLon / 2),2) * Math.cos(lat1) * Math.cos(lat2); + double c = 2 * Math.asin(Math.sqrt(a)); + return R * c; + } +} diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/RouteFinderIntegrationTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/RouteFinderIntegrationTest.java new file mode 100644 index 0000000000..1e4ad56d94 --- /dev/null +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/RouteFinderIntegrationTest.java @@ -0,0 +1,643 @@ +package com.baeldung.algorithms.astar.underground; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.baeldung.algorithms.astar.Graph; +import com.baeldung.algorithms.astar.RouteFinder; +import org.junit.Before; +import org.junit.Test; + +public class RouteFinderIntegrationTest { + + private Graph underground; + + private RouteFinder routeFinder; + + @Before + public void setUp() throws Exception { + Set stations = new HashSet<>(); + Map> connections = new HashMap<>(); + + stations.add(new Station("1", "Acton Town", 51.5028, -0.2801)); + stations.add(new Station("2", "Aldgate", 51.5143, -0.0755)); + stations.add(new Station("3", "Aldgate East", 51.5154, -0.0726)); + stations.add(new Station("4", "All Saints", 51.5107, -0.013)); + stations.add(new Station("5", "Alperton", 51.5407, -0.2997)); + stations.add(new Station("6", "Amersham", 51.6736, -0.607)); + stations.add(new Station("7", "Angel", 51.5322, -0.1058)); + stations.add(new Station("8", "Archway", 51.5653, -0.1353)); + stations.add(new Station("9", "Arnos Grove", 51.6164, -0.1331)); + stations.add(new Station("10", "Arsenal", 51.5586, -0.1059)); + stations.add(new Station("11", "Baker Street", 51.5226, -0.1571)); + stations.add(new Station("12", "Balham", 51.4431, -0.1525)); + stations.add(new Station("13", "Bank", 51.5133, -0.0886)); + stations.add(new Station("14", "Barbican", 51.5204, -0.0979)); + stations.add(new Station("15", "Barking", 51.5396, 0.081)); + stations.add(new Station("16", "Barkingside", 51.5856, 0.0887)); + stations.add(new Station("17", "Barons Court", 51.4905, -0.2139)); + stations.add(new Station("18", "Bayswater", 51.5121, -0.1879)); + stations.add(new Station("19", "Beckton", 51.5148, 0.0613)); + stations.add(new Station("20", "Beckton Park", 51.5087, 0.055)); + stations.add(new Station("21", "Becontree", 51.5403, 0.127)); + stations.add(new Station("22", "Belsize Park", 51.5504, -0.1642)); + stations.add(new Station("23", "Bermondsey", 51.4979, -0.0637)); + stations.add(new Station("24", "Bethnal Green", 51.527, -0.0549)); + stations.add(new Station("25", "Blackfriars", 51.512, -0.1031)); + stations.add(new Station("26", "Blackhorse Road", 51.5867, -0.0417)); + stations.add(new Station("27", "Blackwall", 51.5079, -0.0066)); + stations.add(new Station("28", "Bond Street", 51.5142, -0.1494)); + stations.add(new Station("29", "Borough", 51.5011, -0.0943)); + stations.add(new Station("30", "Boston Manor", 51.4956, -0.325)); + stations.add(new Station("31", "Bounds Green", 51.6071, -0.1243)); + stations.add(new Station("32", "Bow Church", 51.5273, -0.0208)); + stations.add(new Station("33", "Bow Road", 51.5269, -0.0247)); + stations.add(new Station("34", "Brent Cross", 51.5766, -0.2136)); + stations.add(new Station("35", "Brixton", 51.4627, -0.1145)); + stations.add(new Station("36", "Bromley-By-Bow", 51.5248, -0.0119)); + stations.add(new Station("37", "Buckhurst Hill", 51.6266, 0.0471)); + stations.add(new Station("38", "Burnt Oak", 51.6028, -0.2641)); + stations.add(new Station("39", "Caledonian Road", 51.5481, -0.1188)); + stations.add(new Station("40", "Camden Town", 51.5392, -0.1426)); + stations.add(new Station("41", "Canada Water", 51.4982, -0.0502)); + stations.add(new Station("42", "Canary Wharf", 51.5051, -0.0209)); + stations.add(new Station("43", "Canning Town", 51.5147, 0.0082)); + stations.add(new Station("44", "Cannon Street", 51.5113, -0.0904)); + stations.add(new Station("45", "Canons Park", 51.6078, -0.2947)); + stations.add(new Station("46", "Chalfont & Latimer", 51.6679, -0.561)); + stations.add(new Station("47", "Chalk Farm", 51.5441, -0.1538)); + stations.add(new Station("48", "Chancery Lane", 51.5185, -0.1111)); + stations.add(new Station("49", "Charing Cross", 51.508, -0.1247)); + stations.add(new Station("50", "Chesham", 51.7052, -0.611)); + stations.add(new Station("51", "Chigwell", 51.6177, 0.0755)); + stations.add(new Station("52", "Chiswick Park", 51.4946, -0.2678)); + stations.add(new Station("53", "Chorleywood", 51.6543, -0.5183)); + stations.add(new Station("54", "Clapham Common", 51.4618, -0.1384)); + stations.add(new Station("55", "Clapham North", 51.4649, -0.1299)); + stations.add(new Station("56", "Clapham South", 51.4527, -0.148)); + stations.add(new Station("57", "Cockfosters", 51.6517, -0.1496)); + stations.add(new Station("58", "Colindale", 51.5955, -0.2502)); + stations.add(new Station("59", "Colliers Wood", 51.418, -0.1778)); + stations.add(new Station("60", "Covent Garden", 51.5129, -0.1243)); + stations.add(new Station("61", "Crossharbour & London Arena", 51.4957, -0.0144)); + stations.add(new Station("62", "Croxley", 51.647, -0.4412)); + stations.add(new Station("63", "Custom House", 51.5095, 0.0276)); + stations.add(new Station("64", "Cutty Sark", 51.4827, -0.0096)); + stations.add(new Station("65", "Cyprus", 51.5085, 0.064)); + stations.add(new Station("66", "Dagenham East", 51.5443, 0.1655)); + stations.add(new Station("67", "Dagenham Heathway", 51.5417, 0.1469)); + stations.add(new Station("68", "Debden", 51.6455, 0.0838)); + stations.add(new Station("69", "Deptford Bridge", 51.474, -0.0216)); + stations.add(new Station("70", "Devons Road", 51.5223, -0.0173)); + stations.add(new Station("71", "Dollis Hill", 51.552, -0.2387)); + stations.add(new Station("72", "Ealing Broadway", 51.5152, -0.3017)); + stations.add(new Station("73", "Ealing Common", 51.5101, -0.2882)); + stations.add(new Station("74", "Earl's Court", 51.492, -0.1973)); + stations.add(new Station("75", "Eastcote", 51.5765, -0.397)); + stations.add(new Station("76", "East Acton", 51.5168, -0.2474)); + stations.add(new Station("77", "East Finchley", 51.5874, -0.165)); + stations.add(new Station("78", "East Ham", 51.5394, 0.0518)); + stations.add(new Station("79", "East India", 51.5093, -0.0021)); + stations.add(new Station("80", "East Putney", 51.4586, -0.2112)); + stations.add(new Station("81", "Edgware", 51.6137, -0.275)); + stations.add(new Station("82", "Edgware Road (B)", 51.5199, -0.1679)); + stations.add(new Station("83", "Edgware Road (C)", 51.5203, -0.17)); + stations.add(new Station("84", "Elephant & Castle", 51.4943, -0.1001)); + stations.add(new Station("85", "Elm Park", 51.5496, 0.1977)); + stations.add(new Station("86", "Elverson Road", 51.4693, -0.0174)); + stations.add(new Station("87", "Embankment", 51.5074, -0.1223)); + stations.add(new Station("88", "Epping", 51.6937, 0.1139)); + stations.add(new Station("89", "Euston", 51.5282, -0.1337)); + stations.add(new Station("90", "Euston Square", 51.526, -0.1359)); + stations.add(new Station("91", "Fairlop", 51.596, 0.0912)); + stations.add(new Station("92", "Farringdon", 51.5203, -0.1053)); + stations.add(new Station("93", "Finchley Central", 51.6012, -0.1932)); + stations.add(new Station("94", "Finchley Road", 51.5472, -0.1803)); + stations.add(new Station("95", "Finsbury Park", 51.5642, -0.1065)); + stations.add(new Station("96", "Fulham Broadway", 51.4804, -0.195)); + stations.add(new Station("97", "Gallions Reach", 51.5096, 0.0716)); + stations.add(new Station("98", "Gants Hill", 51.5765, 0.0663)); + stations.add(new Station("99", "Gloucester Road", 51.4945, -0.1829)); + stations.add(new Station("100", "Golders Green", 51.5724, -0.1941)); + stations.add(new Station("101", "Goldhawk Road", 51.5018, -0.2267)); + stations.add(new Station("102", "Goodge Street", 51.5205, -0.1347)); + stations.add(new Station("103", "Grange Hill", 51.6132, 0.0923)); + stations.add(new Station("104", "Great Portland Street", 51.5238, -0.1439)); + stations.add(new Station("105", "Greenford", 51.5423, -0.3456)); + stations.add(new Station("106", "Greenwich", 51.4781, -0.0149)); + stations.add(new Station("107", "Green Park", 51.5067, -0.1428)); + stations.add(new Station("108", "Gunnersbury", 51.4915, -0.2754)); + stations.add(new Station("109", "Hainault", 51.603, 0.0933)); + stations.add(new Station("110", "Hammersmith", 51.4936, -0.2251)); + stations.add(new Station("111", "Hampstead", 51.5568, -0.178)); + stations.add(new Station("112", "Hanger Lane", 51.5302, -0.2933)); + stations.add(new Station("113", "Harlesden", 51.5362, -0.2575)); + stations.add(new Station("114", "Harrow & Wealdston", 51.5925, -0.3351)); + stations.add(new Station("115", "Harrow-on-the-Hill", 51.5793, -0.3366)); + stations.add(new Station("116", "Hatton Cross", 51.4669, -0.4227)); + stations.add(new Station("117", "Heathrow Terminals 1, 2 & 3", 51.4713, -0.4524)); + stations.add(new Station("118", "Heathrow Terminal 4", 51.4598, -0.4476)); + stations.add(new Station("119", "Hendon Central", 51.5829, -0.2259)); + stations.add(new Station("120", "Heron Quays", 51.5033, -0.0215)); + stations.add(new Station("121", "High Barnet", 51.6503, -0.1943)); + stations.add(new Station("122", "High Street Kensington", 51.5009, -0.1925)); + stations.add(new Station("123", "Highbury & Islington", 51.546, -0.104)); + stations.add(new Station("124", "Highgate", 51.5777, -0.1458)); + stations.add(new Station("125", "Hillingdon", 51.5538, -0.4499)); + stations.add(new Station("126", "Holborn", 51.5174, -0.12)); + stations.add(new Station("127", "Holland Park", 51.5075, -0.206)); + stations.add(new Station("128", "Holloway Road", 51.5526, -0.1132)); + stations.add(new Station("129", "Hornchurch", 51.5539, 0.2184)); + stations.add(new Station("130", "Hounslow Central", 51.4713, -0.3665)); + stations.add(new Station("131", "Hounslow East", 51.4733, -0.3564)); + stations.add(new Station("132", "Hounslow West", 51.4734, -0.3855)); + stations.add(new Station("133", "Hyde Park Corner", 51.5027, -0.1527)); + stations.add(new Station("134", "Ickenham", 51.5619, -0.4421)); + stations.add(new Station("135", "Island Gardens", 51.4871, -0.0101)); + stations.add(new Station("136", "Kennington", 51.4884, -0.1053)); + stations.add(new Station("137", "Kensal Green", 51.5304, -0.225)); + stations.add(new Station("138", "Kensington (Olympia)", 51.4983, -0.2106)); + stations.add(new Station("139", "Kentish Town", 51.5507, -0.1402)); + stations.add(new Station("140", "Kenton", 51.5816, -0.3162)); + stations.add(new Station("141", "Kew Gardens", 51.477, -0.285)); + stations.add(new Station("142", "Kilburn", 51.5471, -0.2047)); + stations.add(new Station("143", "Kilburn Park", 51.5351, -0.1939)); + stations.add(new Station("144", "Kingsbury", 51.5846, -0.2786)); + stations.add(new Station("145", "King's Cross St. Pancras", 51.5308, -0.1238)); + stations.add(new Station("146", "Knightsbridge", 51.5015, -0.1607)); + stations.add(new Station("147", "Ladbroke Grove", 51.5172, -0.2107)); + stations.add(new Station("148", "Lambeth North", 51.4991, -0.1115)); + stations.add(new Station("149", "Lancaster Gate", 51.5119, -0.1756)); + stations.add(new Station("150", "Latimer Road", 51.5139, -0.2172)); + stations.add(new Station("151", "Leicester Square", 51.5113, -0.1281)); + stations.add(new Station("152", "Lewisham", 51.4657, -0.0142)); + stations.add(new Station("153", "Leyton", 51.5566, -0.0053)); + stations.add(new Station("154", "Leytonstone", 51.5683, 0.0083)); + stations.add(new Station("155", "Limehouse", 51.5123, -0.0396)); + stations.add(new Station("156", "Liverpool Street", 51.5178, -0.0823)); + stations.add(new Station("157", "London Bridge", 51.5052, -0.0864)); + stations.add(new Station("158", "Loughton", 51.6412, 0.0558)); + stations.add(new Station("159", "Maida Vale", 51.53, -0.1854)); + stations.add(new Station("160", "Manor House", 51.5712, -0.0958)); + stations.add(new Station("161", "Mansion House", 51.5122, -0.094)); + stations.add(new Station("162", "Marble Arch", 51.5136, -0.1586)); + stations.add(new Station("163", "Marylebone", 51.5225, -0.1631)); + stations.add(new Station("164", "Mile End", 51.5249, -0.0332)); + stations.add(new Station("165", "Mill Hill East", 51.6082, -0.2103)); + stations.add(new Station("166", "Monument", 51.5108, -0.0863)); + stations.add(new Station("167", "Moorgate", 51.5186, -0.0886)); + stations.add(new Station("168", "Moor Park", 51.6294, -0.432)); + stations.add(new Station("169", "Morden", 51.4022, -0.1948)); + stations.add(new Station("170", "Mornington Crescent", 51.5342, -0.1387)); + stations.add(new Station("171", "Mudchute", 51.4902, -0.0145)); + stations.add(new Station("172", "Neasden", 51.5542, -0.2503)); + stations.add(new Station("173", "Newbury Park", 51.5756, 0.0899)); + stations.add(new Station("174", "New Cross", 51.4767, -0.0327)); + stations.add(new Station("175", "New Cross Gate", 51.4757, -0.0402)); + stations.add(new Station("176", "Northfields", 51.4995, -0.3142)); + stations.add(new Station("177", "Northolt", 51.5483, -0.3687)); + stations.add(new Station("178", "Northwick Park", 51.5784, -0.3184)); + stations.add(new Station("179", "Northwood", 51.6111, -0.424)); + stations.add(new Station("180", "Northwood Hills", 51.6004, -0.4092)); + stations.add(new Station("181", "North Acton", 51.5237, -0.2597)); + stations.add(new Station("182", "North Ealing", 51.5175, -0.2887)); + stations.add(new Station("183", "North Greenwich", 51.5005, 0.0039)); + stations.add(new Station("184", "North Harrow", 51.5846, -0.3626)); + stations.add(new Station("185", "North Wembley", 51.5621, -0.3034)); + stations.add(new Station("186", "Notting Hill Gate", 51.5094, -0.1967)); + stations.add(new Station("187", "Oakwood", 51.6476, -0.1318)); + stations.add(new Station("188", "Old Street", 51.5263, -0.0873)); + stations.add(new Station("189", "Osterley", 51.4813, -0.3522)); + stations.add(new Station("190", "Oval", 51.4819, -0.113)); + stations.add(new Station("191", "Oxford Circus", 51.515, -0.1415)); + stations.add(new Station("192", "Paddington", 51.5154, -0.1755)); + stations.add(new Station("193", "Park Royal", 51.527, -0.2841)); + stations.add(new Station("194", "Parsons Green", 51.4753, -0.2011)); + stations.add(new Station("195", "Perivale", 51.5366, -0.3232)); + stations.add(new Station("196", "Picadilly Circus", 51.5098, -0.1342)); + stations.add(new Station("197", "Pimlico", 51.4893, -0.1334)); + stations.add(new Station("198", "Pinner", 51.5926, -0.3805)); + stations.add(new Station("199", "Plaistow", 51.5313, 0.0172)); + stations.add(new Station("200", "Poplar", 51.5077, -0.0173)); + stations.add(new Station("201", "Preston Road", 51.572, -0.2954)); + stations.add(new Station("202", "Prince Regent", 51.5093, 0.0336)); + stations.add(new Station("203", "Pudding Mill Lane", 51.5343, -0.0139)); + stations.add(new Station("204", "Putney Bridge", 51.4682, -0.2089)); + stations.add(new Station("205", "Queen's Park", 51.5341, -0.2047)); + stations.add(new Station("206", "Queensbury", 51.5942, -0.2861)); + stations.add(new Station("207", "Queensway", 51.5107, -0.1877)); + stations.add(new Station("208", "Ravenscourt Park", 51.4942, -0.2359)); + stations.add(new Station("209", "Rayners Lane", 51.5753, -0.3714)); + stations.add(new Station("210", "Redbridge", 51.5763, 0.0454)); + stations.add(new Station("211", "Regent's Park", 51.5234, -0.1466)); + stations.add(new Station("212", "Richmond", 51.4633, -0.3013)); + stations.add(new Station("213", "Rickmansworth", 51.6404, -0.4733)); + stations.add(new Station("214", "Roding Valley", 51.6171, 0.0439)); + stations.add(new Station("215", "Rotherhithe", 51.501, -0.0525)); + stations.add(new Station("216", "Royal Albert", 51.5084, 0.0465)); + stations.add(new Station("217", "Royal Oak", 51.519, -0.188)); + stations.add(new Station("218", "Royal Victoria", 51.5091, 0.0181)); + stations.add(new Station("219", "Ruislip", 51.5715, -0.4213)); + stations.add(new Station("220", "Ruislip Gardens", 51.5606, -0.4103)); + stations.add(new Station("221", "Ruislip Manor", 51.5732, -0.4125)); + stations.add(new Station("222", "Russell Square", 51.523, -0.1244)); + stations.add(new Station("223", "Seven Sisters", 51.5822, -0.0749)); + stations.add(new Station("224", "Shadwell", 51.5117, -0.056)); + stations.add(new Station("225", "Shepherd's Bush (C)", 51.5046, -0.2187)); + stations.add(new Station("226", "Shepherd's Bush (H)", 51.5058, -0.2265)); + stations.add(new Station("227", "Shoreditch", 51.5227, -0.0708)); + stations.add(new Station("228", "Sloane Square", 51.4924, -0.1565)); + stations.add(new Station("229", "Snaresbrook", 51.5808, 0.0216)); + stations.add(new Station("230", "Southfields", 51.4454, -0.2066)); + stations.add(new Station("231", "Southgate", 51.6322, -0.128)); + stations.add(new Station("232", "Southwark", 51.501, -0.1052)); + stations.add(new Station("233", "South Ealing", 51.5011, -0.3072)); + stations.add(new Station("234", "South Harrow", 51.5646, -0.3521)); + stations.add(new Station("235", "South Kensington", 51.4941, -0.1738)); + stations.add(new Station("236", "South Kenton", 51.5701, -0.3081)); + stations.add(new Station("237", "South Quay", 51.5007, -0.0191)); + stations.add(new Station("238", "South Ruislip", 51.5569, -0.3988)); + stations.add(new Station("239", "South Wimbledon", 51.4154, -0.1919)); + stations.add(new Station("240", "South Woodford", 51.5917, 0.0275)); + stations.add(new Station("241", "Stamford Brook", 51.495, -0.2459)); + stations.add(new Station("242", "Stanmore", 51.6194, -0.3028)); + stations.add(new Station("243", "Stepney Green", 51.5221, -0.047)); + stations.add(new Station("244", "Stockwell", 51.4723, -0.123)); + stations.add(new Station("245", "Stonebridge Park", 51.5439, -0.2759)); + stations.add(new Station("246", "Stratford", 51.5416, -0.0042)); + stations.add(new Station("247", "St. James's Park", 51.4994, -0.1335)); + stations.add(new Station("248", "St. John's Wood", 51.5347, -0.174)); + stations.add(new Station("249", "St. Paul's", 51.5146, -0.0973)); + stations.add(new Station("250", "Sudbury Hill", 51.5569, -0.3366)); + stations.add(new Station("251", "Sudbury Town", 51.5507, -0.3156)); + stations.add(new Station("252", "Surrey Quays", 51.4933, -0.0478)); + stations.add(new Station("253", "Swiss Cottage", 51.5432, -0.1738)); + stations.add(new Station("254", "Temple", 51.5111, -0.1141)); + stations.add(new Station("255", "Theydon Bois", 51.6717, 0.1033)); + stations.add(new Station("256", "Tooting Bec", 51.4361, -0.1598)); + stations.add(new Station("257", "Tooting Broadway", 51.4275, -0.168)); + stations.add(new Station("258", "Tottenham Court Road", 51.5165, -0.131)); + stations.add(new Station("259", "Tottenham Hale", 51.5882, -0.0594)); + stations.add(new Station("260", "Totteridge & Whetstone", 51.6302, -0.1791)); + stations.add(new Station("261", "Tower Gateway", 51.5106, -0.0743)); + stations.add(new Station("262", "Tower Hill", 51.5098, -0.0766)); + stations.add(new Station("263", "Tufnell Park", 51.5567, -0.1374)); + stations.add(new Station("264", "Turnham Green", 51.4951, -0.2547)); + stations.add(new Station("265", "Turnpike Lane", 51.5904, -0.1028)); + stations.add(new Station("266", "Upminster", 51.559, 0.251)); + stations.add(new Station("267", "Upminster Bridge", 51.5582, 0.2343)); + stations.add(new Station("268", "Upney", 51.5385, 0.1014)); + stations.add(new Station("269", "Upton Park", 51.5352, 0.0343)); + stations.add(new Station("270", "Uxbridge", 51.5463, -0.4786)); + stations.add(new Station("271", "Vauxhall", 51.4861, -0.1253)); + stations.add(new Station("272", "Victoria", 51.4965, -0.1447)); + stations.add(new Station("273", "Walthamstow Central", 51.583, -0.0195)); + stations.add(new Station("274", "Wanstead", 51.5775, 0.0288)); + stations.add(new Station("275", "Wapping", 51.5043, -0.0558)); + stations.add(new Station("276", "Warren Street", 51.5247, -0.1384)); + stations.add(new Station("277", "Warwick Avenue", 51.5235, -0.1835)); + stations.add(new Station("278", "Waterloo", 51.5036, -0.1143)); + stations.add(new Station("279", "Watford", 51.6573, -0.4177)); + stations.add(new Station("280", "Wembley Central", 51.5519, -0.2963)); + stations.add(new Station("281", "Wembley Park", 51.5635, -0.2795)); + stations.add(new Station("282", "Westbourne Park", 51.521, -0.2011)); + stations.add(new Station("283", "Westferry", 51.5097, -0.0265)); + stations.add(new Station("284", "Westminster", 51.501, -0.1254)); + stations.add(new Station("285", "West Acton", 51.518, -0.2809)); + stations.add(new Station("286", "West Brompton", 51.4872, -0.1953)); + stations.add(new Station("287", "West Finchley", 51.6095, -0.1883)); + stations.add(new Station("288", "West Ham", 51.5287, 0.0056)); + stations.add(new Station("289", "West Hampstead", 51.5469, -0.1906)); + stations.add(new Station("290", "West Harrow", 51.5795, -0.3533)); + stations.add(new Station("291", "West India Quay", 51.507, -0.0203)); + stations.add(new Station("292", "West Kensington", 51.4907, -0.2065)); + stations.add(new Station("293", "West Ruislip", 51.5696, -0.4376)); + stations.add(new Station("294", "Whitechapel", 51.5194, -0.0612)); + stations.add(new Station("295", "White City", 51.512, -0.2239)); + stations.add(new Station("296", "Willesden Green", 51.5492, -0.2215)); + stations.add(new Station("297", "Willesden Junction", 51.5326, -0.2478)); + stations.add(new Station("298", "Wimbledon", 51.4214, -0.2064)); + stations.add(new Station("299", "Wimbledon Park", 51.4343, -0.1992)); + stations.add(new Station("300", "Woodford", 51.607, 0.0341)); + stations.add(new Station("301", "Woodside Park", 51.6179, -0.1856)); + stations.add(new Station("302", "Wood Green", 51.5975, -0.1097)); + + connections.put("1", Stream.of("52","73","73","233","264").collect(Collectors.toSet())); + connections.put("2", Stream.of("156","262","156").collect(Collectors.toSet())); + connections.put("3", Stream.of("262","294","156","294").collect(Collectors.toSet())); + connections.put("4", Stream.of("70","200").collect(Collectors.toSet())); + connections.put("5", Stream.of("193","251").collect(Collectors.toSet())); + connections.put("6", Stream.of("46").collect(Collectors.toSet())); + connections.put("7", Stream.of("145","188").collect(Collectors.toSet())); + connections.put("8", Stream.of("124","263").collect(Collectors.toSet())); + connections.put("9", Stream.of("31","231").collect(Collectors.toSet())); + connections.put("10", Stream.of("95","128").collect(Collectors.toSet())); + connections.put("11", Stream.of("163","211","83","104","83","104","28","248","94","104").collect(Collectors.toSet())); + connections.put("12", Stream.of("56","256").collect(Collectors.toSet())); + connections.put("13", Stream.of("156","249","224","157","167","278").collect(Collectors.toSet())); + connections.put("14", Stream.of("92","167","92","167","92","167").collect(Collectors.toSet())); + connections.put("15", Stream.of("78","268","78").collect(Collectors.toSet())); + connections.put("16", Stream.of("91","173").collect(Collectors.toSet())); + connections.put("17", Stream.of("110","292","74","110").collect(Collectors.toSet())); + connections.put("18", Stream.of("186","192","186","192").collect(Collectors.toSet())); + connections.put("19", Stream.of("97").collect(Collectors.toSet())); + connections.put("20", Stream.of("65","216").collect(Collectors.toSet())); + connections.put("21", Stream.of("67","268").collect(Collectors.toSet())); + connections.put("22", Stream.of("47","111").collect(Collectors.toSet())); + connections.put("23", Stream.of("41","157").collect(Collectors.toSet())); + connections.put("24", Stream.of("156","164").collect(Collectors.toSet())); + connections.put("25", Stream.of("161","254","161","254").collect(Collectors.toSet())); + connections.put("26", Stream.of("259","273").collect(Collectors.toSet())); + connections.put("27", Stream.of("79","200").collect(Collectors.toSet())); + connections.put("28", Stream.of("162","191","11","107").collect(Collectors.toSet())); + connections.put("29", Stream.of("84","157").collect(Collectors.toSet())); + connections.put("30", Stream.of("176","189").collect(Collectors.toSet())); + connections.put("31", Stream.of("9","302").collect(Collectors.toSet())); + connections.put("32", Stream.of("70","203").collect(Collectors.toSet())); + connections.put("33", Stream.of("36","164","36","164").collect(Collectors.toSet())); + connections.put("34", Stream.of("100","119").collect(Collectors.toSet())); + connections.put("35", Stream.of("244").collect(Collectors.toSet())); + connections.put("36", Stream.of("33","288","33","288").collect(Collectors.toSet())); + connections.put("37", Stream.of("158","300").collect(Collectors.toSet())); + connections.put("38", Stream.of("58","81").collect(Collectors.toSet())); + connections.put("39", Stream.of("128","145").collect(Collectors.toSet())); + connections.put("40", Stream.of("47","89","139","170").collect(Collectors.toSet())); + connections.put("41", Stream.of("215","252","23","42").collect(Collectors.toSet())); + connections.put("42", Stream.of("120","291","41","183").collect(Collectors.toSet())); + connections.put("43", Stream.of("79","218","183","288").collect(Collectors.toSet())); + connections.put("44", Stream.of("161","166","161","166").collect(Collectors.toSet())); + connections.put("45", Stream.of("206","242").collect(Collectors.toSet())); + connections.put("46", Stream.of("6","50","53").collect(Collectors.toSet())); + connections.put("47", Stream.of("22","40").collect(Collectors.toSet())); + connections.put("48", Stream.of("126","249").collect(Collectors.toSet())); + connections.put("49", Stream.of("87","196","87","151").collect(Collectors.toSet())); + connections.put("50", Stream.of("46").collect(Collectors.toSet())); + connections.put("51", Stream.of("103","214").collect(Collectors.toSet())); + connections.put("52", Stream.of("1","264").collect(Collectors.toSet())); + connections.put("53", Stream.of("46","213").collect(Collectors.toSet())); + connections.put("54", Stream.of("55","56").collect(Collectors.toSet())); + connections.put("55", Stream.of("54","244").collect(Collectors.toSet())); + connections.put("56", Stream.of("12","54").collect(Collectors.toSet())); + connections.put("57", Stream.of("187").collect(Collectors.toSet())); + connections.put("58", Stream.of("38","119").collect(Collectors.toSet())); + connections.put("59", Stream.of("239","257").collect(Collectors.toSet())); + connections.put("60", Stream.of("126","151").collect(Collectors.toSet())); + connections.put("61", Stream.of("171","237").collect(Collectors.toSet())); + connections.put("62", Stream.of("168","279").collect(Collectors.toSet())); + connections.put("63", Stream.of("202","218").collect(Collectors.toSet())); + connections.put("64", Stream.of("106","135").collect(Collectors.toSet())); + connections.put("65", Stream.of("20","97").collect(Collectors.toSet())); + connections.put("66", Stream.of("67","85").collect(Collectors.toSet())); + connections.put("67", Stream.of("21","66").collect(Collectors.toSet())); + connections.put("68", Stream.of("158","255").collect(Collectors.toSet())); + connections.put("69", Stream.of("86","106").collect(Collectors.toSet())); + connections.put("70", Stream.of("4","32").collect(Collectors.toSet())); + connections.put("71", Stream.of("172","296").collect(Collectors.toSet())); + connections.put("72", Stream.of("285","73").collect(Collectors.toSet())); + connections.put("73", Stream.of("72","1","1","182").collect(Collectors.toSet())); + connections.put("74", Stream.of("99","122","138","286","292","17","99").collect(Collectors.toSet())); + connections.put("75", Stream.of("209","221","209","221").collect(Collectors.toSet())); + connections.put("76", Stream.of("181","295").collect(Collectors.toSet())); + connections.put("77", Stream.of("93","124").collect(Collectors.toSet())); + connections.put("78", Stream.of("15","269","15","269").collect(Collectors.toSet())); + connections.put("79", Stream.of("27","43").collect(Collectors.toSet())); + connections.put("80", Stream.of("204","230").collect(Collectors.toSet())); + connections.put("81", Stream.of("38").collect(Collectors.toSet())); + connections.put("82", Stream.of("163","192").collect(Collectors.toSet())); + connections.put("83", Stream.of("11","192","192","11","192").collect(Collectors.toSet())); + connections.put("84", Stream.of("148","29","136").collect(Collectors.toSet())); + connections.put("85", Stream.of("66","129").collect(Collectors.toSet())); + connections.put("86", Stream.of("69","152").collect(Collectors.toSet())); + connections.put("87", Stream.of("49","278","254","284","254","284","49","278").collect(Collectors.toSet())); + connections.put("88", Stream.of("255").collect(Collectors.toSet())); + connections.put("89", Stream.of("40","145","170","276","145","276").collect(Collectors.toSet())); + connections.put("90", Stream.of("104","145","104","145","104","145").collect(Collectors.toSet())); + connections.put("91", Stream.of("16","109").collect(Collectors.toSet())); + connections.put("92", Stream.of("14","145","14","145","14","145").collect(Collectors.toSet())); + connections.put("93", Stream.of("77","165","287").collect(Collectors.toSet())); + connections.put("94", Stream.of("253","289","11","281").collect(Collectors.toSet())); + connections.put("95", Stream.of("10","160","123","223").collect(Collectors.toSet())); + connections.put("96", Stream.of("194","286").collect(Collectors.toSet())); + connections.put("97", Stream.of("19","65").collect(Collectors.toSet())); + connections.put("98", Stream.of("173","210").collect(Collectors.toSet())); + connections.put("99", Stream.of("122","235","74","235","74","235").collect(Collectors.toSet())); + connections.put("100", Stream.of("34","111").collect(Collectors.toSet())); + connections.put("101", Stream.of("110","226").collect(Collectors.toSet())); + connections.put("102", Stream.of("258","276").collect(Collectors.toSet())); + connections.put("103", Stream.of("51","109").collect(Collectors.toSet())); + connections.put("104", Stream.of("11","90","11","90","11","90").collect(Collectors.toSet())); + connections.put("105", Stream.of("177","195").collect(Collectors.toSet())); + connections.put("106", Stream.of("64","69").collect(Collectors.toSet())); + connections.put("107", Stream.of("28","284","133","196","191","272").collect(Collectors.toSet())); + connections.put("108", Stream.of("141","264").collect(Collectors.toSet())); + connections.put("109", Stream.of("91","103").collect(Collectors.toSet())); + connections.put("110", Stream.of("17","208","101","17","264").collect(Collectors.toSet())); + connections.put("111", Stream.of("22","100").collect(Collectors.toSet())); + connections.put("112", Stream.of("181","195").collect(Collectors.toSet())); + connections.put("113", Stream.of("245","297").collect(Collectors.toSet())); + connections.put("114", Stream.of("140").collect(Collectors.toSet())); + connections.put("115", Stream.of("178","184","290").collect(Collectors.toSet())); + connections.put("116", Stream.of("117","118","132").collect(Collectors.toSet())); + connections.put("117", Stream.of("116","118").collect(Collectors.toSet())); + connections.put("118", Stream.of("116","117").collect(Collectors.toSet())); + connections.put("119", Stream.of("34","58").collect(Collectors.toSet())); + connections.put("120", Stream.of("42","237").collect(Collectors.toSet())); + connections.put("121", Stream.of("260").collect(Collectors.toSet())); + connections.put("122", Stream.of("99","186","74","186").collect(Collectors.toSet())); + connections.put("123", Stream.of("95","145").collect(Collectors.toSet())); + connections.put("124", Stream.of("8","77").collect(Collectors.toSet())); + connections.put("125", Stream.of("134","270","134","270").collect(Collectors.toSet())); + connections.put("126", Stream.of("48","258","60","222").collect(Collectors.toSet())); + connections.put("127", Stream.of("186","225").collect(Collectors.toSet())); + connections.put("128", Stream.of("10","39").collect(Collectors.toSet())); + connections.put("129", Stream.of("85","267").collect(Collectors.toSet())); + connections.put("130", Stream.of("131","132").collect(Collectors.toSet())); + connections.put("131", Stream.of("130","189").collect(Collectors.toSet())); + connections.put("132", Stream.of("116","130").collect(Collectors.toSet())); + connections.put("133", Stream.of("107","146").collect(Collectors.toSet())); + connections.put("134", Stream.of("125","219","125","219").collect(Collectors.toSet())); + connections.put("135", Stream.of("64","171").collect(Collectors.toSet())); + connections.put("136", Stream.of("84","190","278").collect(Collectors.toSet())); + connections.put("137", Stream.of("205","297").collect(Collectors.toSet())); + connections.put("138", Stream.of("74").collect(Collectors.toSet())); + connections.put("139", Stream.of("40","263").collect(Collectors.toSet())); + connections.put("140", Stream.of("114","236").collect(Collectors.toSet())); + connections.put("141", Stream.of("108","212").collect(Collectors.toSet())); + connections.put("142", Stream.of("289","296").collect(Collectors.toSet())); + connections.put("143", Stream.of("159","205").collect(Collectors.toSet())); + connections.put("144", Stream.of("206","281").collect(Collectors.toSet())); + connections.put("145", Stream.of("90","92","90","92","90","92","7","89","39","222","89","123").collect(Collectors.toSet())); + connections.put("146", Stream.of("133","235").collect(Collectors.toSet())); + connections.put("147", Stream.of("150","282").collect(Collectors.toSet())); + connections.put("148", Stream.of("84","278").collect(Collectors.toSet())); + connections.put("149", Stream.of("162","207").collect(Collectors.toSet())); + connections.put("150", Stream.of("147","226").collect(Collectors.toSet())); + connections.put("151", Stream.of("49","258","60","196").collect(Collectors.toSet())); + connections.put("152", Stream.of("86").collect(Collectors.toSet())); + connections.put("153", Stream.of("154","246").collect(Collectors.toSet())); + connections.put("154", Stream.of("153","229","274").collect(Collectors.toSet())); + connections.put("155", Stream.of("224","283").collect(Collectors.toSet())); + connections.put("156", Stream.of("13","24","2","167","3","167","2","167").collect(Collectors.toSet())); + connections.put("157", Stream.of("23","232","13","29").collect(Collectors.toSet())); + connections.put("158", Stream.of("37","68").collect(Collectors.toSet())); + connections.put("159", Stream.of("143","277").collect(Collectors.toSet())); + connections.put("160", Stream.of("95","265").collect(Collectors.toSet())); + connections.put("161", Stream.of("25","44","25","44").collect(Collectors.toSet())); + connections.put("162", Stream.of("28","149").collect(Collectors.toSet())); + connections.put("163", Stream.of("11","82").collect(Collectors.toSet())); + connections.put("164", Stream.of("24","246","33","243","33","243").collect(Collectors.toSet())); + connections.put("165", Stream.of("93").collect(Collectors.toSet())); + connections.put("166", Stream.of("44","262","44","262").collect(Collectors.toSet())); + connections.put("167", Stream.of("14","156","14","156","14","156","13","188").collect(Collectors.toSet())); + connections.put("168", Stream.of("62","179","213").collect(Collectors.toSet())); + connections.put("169", Stream.of("239").collect(Collectors.toSet())); + connections.put("170", Stream.of("40","89").collect(Collectors.toSet())); + connections.put("171", Stream.of("61","135").collect(Collectors.toSet())); + connections.put("172", Stream.of("71","281").collect(Collectors.toSet())); + connections.put("173", Stream.of("16","98").collect(Collectors.toSet())); + connections.put("174", Stream.of("252").collect(Collectors.toSet())); + connections.put("175", Stream.of("252").collect(Collectors.toSet())); + connections.put("176", Stream.of("30","233").collect(Collectors.toSet())); + connections.put("177", Stream.of("105","238").collect(Collectors.toSet())); + connections.put("178", Stream.of("115","201").collect(Collectors.toSet())); + connections.put("179", Stream.of("168","180").collect(Collectors.toSet())); + connections.put("180", Stream.of("179","198").collect(Collectors.toSet())); + connections.put("181", Stream.of("76","112","285").collect(Collectors.toSet())); + connections.put("182", Stream.of("73","193").collect(Collectors.toSet())); + connections.put("183", Stream.of("42","43").collect(Collectors.toSet())); + connections.put("184", Stream.of("115","198").collect(Collectors.toSet())); + connections.put("185", Stream.of("236","280").collect(Collectors.toSet())); + connections.put("186", Stream.of("127","207","18","122","18","122").collect(Collectors.toSet())); + connections.put("187", Stream.of("57","231").collect(Collectors.toSet())); + connections.put("188", Stream.of("7","167").collect(Collectors.toSet())); + connections.put("189", Stream.of("30","131").collect(Collectors.toSet())); + connections.put("190", Stream.of("136","244").collect(Collectors.toSet())); + connections.put("191", Stream.of("196","211","28","258","107","276").collect(Collectors.toSet())); + connections.put("192", Stream.of("82","277","18","83","18","83","83","217").collect(Collectors.toSet())); + connections.put("193", Stream.of("5","182").collect(Collectors.toSet())); + connections.put("194", Stream.of("96","204").collect(Collectors.toSet())); + connections.put("195", Stream.of("105","112").collect(Collectors.toSet())); + connections.put("196", Stream.of("49","191","107","151").collect(Collectors.toSet())); + connections.put("197", Stream.of("271","272").collect(Collectors.toSet())); + connections.put("198", Stream.of("180","184").collect(Collectors.toSet())); + connections.put("199", Stream.of("269","288","269","288").collect(Collectors.toSet())); + connections.put("200", Stream.of("4","27","283","291").collect(Collectors.toSet())); + connections.put("201", Stream.of("178","281").collect(Collectors.toSet())); + connections.put("202", Stream.of("63","216").collect(Collectors.toSet())); + connections.put("203", Stream.of("32","246").collect(Collectors.toSet())); + connections.put("204", Stream.of("80","194").collect(Collectors.toSet())); + connections.put("205", Stream.of("137","143").collect(Collectors.toSet())); + connections.put("206", Stream.of("45","144").collect(Collectors.toSet())); + connections.put("207", Stream.of("149","186").collect(Collectors.toSet())); + connections.put("208", Stream.of("110","241").collect(Collectors.toSet())); + connections.put("209", Stream.of("75","290","75","234").collect(Collectors.toSet())); + connections.put("210", Stream.of("98","274").collect(Collectors.toSet())); + connections.put("211", Stream.of("11","191").collect(Collectors.toSet())); + connections.put("212", Stream.of("141").collect(Collectors.toSet())); + connections.put("213", Stream.of("53","168").collect(Collectors.toSet())); + connections.put("214", Stream.of("51","300").collect(Collectors.toSet())); + connections.put("215", Stream.of("41","275").collect(Collectors.toSet())); + connections.put("216", Stream.of("20","202").collect(Collectors.toSet())); + connections.put("217", Stream.of("192","282").collect(Collectors.toSet())); + connections.put("218", Stream.of("43","63").collect(Collectors.toSet())); + connections.put("219", Stream.of("134","221","134","221").collect(Collectors.toSet())); + connections.put("220", Stream.of("238","293").collect(Collectors.toSet())); + connections.put("221", Stream.of("75","219","75","219").collect(Collectors.toSet())); + connections.put("222", Stream.of("126","145").collect(Collectors.toSet())); + connections.put("223", Stream.of("95","259").collect(Collectors.toSet())); + connections.put("224", Stream.of("13","155","261","275","294").collect(Collectors.toSet())); + connections.put("225", Stream.of("127","295").collect(Collectors.toSet())); + connections.put("226", Stream.of("101","150").collect(Collectors.toSet())); + connections.put("227", Stream.of("294").collect(Collectors.toSet())); + connections.put("228", Stream.of("235","272","235","272").collect(Collectors.toSet())); + connections.put("229", Stream.of("154","240").collect(Collectors.toSet())); + connections.put("230", Stream.of("80","299").collect(Collectors.toSet())); + connections.put("231", Stream.of("9","187").collect(Collectors.toSet())); + connections.put("232", Stream.of("157","278").collect(Collectors.toSet())); + connections.put("233", Stream.of("1","176").collect(Collectors.toSet())); + connections.put("234", Stream.of("209","250").collect(Collectors.toSet())); + connections.put("235", Stream.of("99","228","99","228","99","146").collect(Collectors.toSet())); + connections.put("236", Stream.of("140","185").collect(Collectors.toSet())); + connections.put("237", Stream.of("61","120").collect(Collectors.toSet())); + connections.put("238", Stream.of("177","220").collect(Collectors.toSet())); + connections.put("239", Stream.of("59","169").collect(Collectors.toSet())); + connections.put("240", Stream.of("229","300").collect(Collectors.toSet())); + connections.put("241", Stream.of("208","264").collect(Collectors.toSet())); + connections.put("242", Stream.of("45").collect(Collectors.toSet())); + connections.put("243", Stream.of("164","294","164","294").collect(Collectors.toSet())); + connections.put("244", Stream.of("55","190","35","271").collect(Collectors.toSet())); + connections.put("245", Stream.of("113","280").collect(Collectors.toSet())); + connections.put("246", Stream.of("153","164","203","288").collect(Collectors.toSet())); + connections.put("247", Stream.of("272","284","272","284").collect(Collectors.toSet())); + connections.put("248", Stream.of("11","253").collect(Collectors.toSet())); + connections.put("249", Stream.of("13","48").collect(Collectors.toSet())); + connections.put("250", Stream.of("234","251").collect(Collectors.toSet())); + connections.put("251", Stream.of("5","250").collect(Collectors.toSet())); + connections.put("252", Stream.of("41","174","175").collect(Collectors.toSet())); + connections.put("253", Stream.of("94","248").collect(Collectors.toSet())); + connections.put("254", Stream.of("25","87","25","87").collect(Collectors.toSet())); + connections.put("255", Stream.of("68","88").collect(Collectors.toSet())); + connections.put("256", Stream.of("12","257").collect(Collectors.toSet())); + connections.put("257", Stream.of("59","256").collect(Collectors.toSet())); + connections.put("258", Stream.of("126","191","102","151").collect(Collectors.toSet())); + connections.put("259", Stream.of("26","223").collect(Collectors.toSet())); + connections.put("260", Stream.of("121","301").collect(Collectors.toSet())); + connections.put("261", Stream.of("224").collect(Collectors.toSet())); + connections.put("262", Stream.of("2","166","3","166").collect(Collectors.toSet())); + connections.put("263", Stream.of("8","139").collect(Collectors.toSet())); + connections.put("264", Stream.of("52","108","241","1","110").collect(Collectors.toSet())); + connections.put("265", Stream.of("160","302").collect(Collectors.toSet())); + connections.put("266", Stream.of("267").collect(Collectors.toSet())); + connections.put("267", Stream.of("129","266").collect(Collectors.toSet())); + connections.put("268", Stream.of("15","21").collect(Collectors.toSet())); + connections.put("269", Stream.of("78","199","78","199").collect(Collectors.toSet())); + connections.put("270", Stream.of("125","125").collect(Collectors.toSet())); + connections.put("271", Stream.of("197","244").collect(Collectors.toSet())); + connections.put("272", Stream.of("228","247","228","247","107","197").collect(Collectors.toSet())); + connections.put("273", Stream.of("26").collect(Collectors.toSet())); + connections.put("274", Stream.of("154","210").collect(Collectors.toSet())); + connections.put("275", Stream.of("215","224").collect(Collectors.toSet())); + connections.put("276", Stream.of("89","102","89","191").collect(Collectors.toSet())); + connections.put("277", Stream.of("159","192").collect(Collectors.toSet())); + connections.put("278", Stream.of("87","148","232","284","87","136","13").collect(Collectors.toSet())); + connections.put("279", Stream.of("62").collect(Collectors.toSet())); + connections.put("280", Stream.of("185","245").collect(Collectors.toSet())); + connections.put("281", Stream.of("144","172","94","201").collect(Collectors.toSet())); + connections.put("282", Stream.of("147","217").collect(Collectors.toSet())); + connections.put("283", Stream.of("155","200","291").collect(Collectors.toSet())); + connections.put("284", Stream.of("87","247","87","247","107","278").collect(Collectors.toSet())); + connections.put("285", Stream.of("72","181").collect(Collectors.toSet())); + connections.put("286", Stream.of("74","96").collect(Collectors.toSet())); + connections.put("287", Stream.of("93","301").collect(Collectors.toSet())); + connections.put("288", Stream.of("36","199","36","199","43","246").collect(Collectors.toSet())); + connections.put("289", Stream.of("94","142").collect(Collectors.toSet())); + connections.put("290", Stream.of("115","209").collect(Collectors.toSet())); + connections.put("291", Stream.of("42","200","283").collect(Collectors.toSet())); + connections.put("292", Stream.of("17","74").collect(Collectors.toSet())); + connections.put("293", Stream.of("220").collect(Collectors.toSet())); + connections.put("294", Stream.of("3","243","224","227","3","243").collect(Collectors.toSet())); + connections.put("295", Stream.of("76","225").collect(Collectors.toSet())); + connections.put("296", Stream.of("71","142").collect(Collectors.toSet())); + connections.put("297", Stream.of("113","137").collect(Collectors.toSet())); + connections.put("298", Stream.of("299").collect(Collectors.toSet())); + connections.put("299", Stream.of("230","298").collect(Collectors.toSet())); + connections.put("300", Stream.of("37","214","240").collect(Collectors.toSet())); + connections.put("301", Stream.of("260","287").collect(Collectors.toSet())); + connections.put("302", Stream.of("31","265").collect(Collectors.toSet())); + + underground = new Graph<>(stations, connections); + routeFinder = new RouteFinder<>(underground, new HaversineScorer(), new HaversineScorer()); + } + + @Test + public void findRoute() { + List route = routeFinder.findRoute(underground.getNode("74"), underground.getNode("7")); + + System.out.println(route.stream().map(Station::getName).collect(Collectors.toList())); + } +} diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/Station.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/Station.java new file mode 100644 index 0000000000..59bd8d62c2 --- /dev/null +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/Station.java @@ -0,0 +1,42 @@ +package com.baeldung.algorithms.astar.underground; + +import java.util.StringJoiner; + +import com.baeldung.algorithms.astar.GraphNode; + +public class Station implements GraphNode { + private final String id; + private final String name; + private final double latitude; + private final double longitude; + + public Station(String id, String name, double latitude, double longitude) { + this.id = id; + this.name = name; + this.latitude = latitude; + this.longitude = longitude; + } + + @Override + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public String toString() { + return new StringJoiner(", ", Station.class.getSimpleName() + "[", "]").add("id='" + id + "'") + .add("name='" + name + "'").add("latitude=" + latitude).add("longitude=" + longitude).toString(); + } +} diff --git a/algorithms-miscellaneous-2/src/test/resources/graph.png b/algorithms-miscellaneous-2/src/test/resources/graph.png index 7165a51782..12af62c131 100644 Binary files a/algorithms-miscellaneous-2/src/test/resources/graph.png and b/algorithms-miscellaneous-2/src/test/resources/graph.png differ diff --git a/algorithms-miscellaneous-3/README.md b/algorithms-miscellaneous-3/README.md index ce0fde0415..93426b3e0d 100644 --- a/algorithms-miscellaneous-3/README.md +++ b/algorithms-miscellaneous-3/README.md @@ -1,10 +1,21 @@ +## Algorithms - Miscellaneous + +This module contains articles about algorithms. Some classes of algorithms, e.g., [sorting](/algorithms-sorting) and +[genetic algorithms](/algorithms-genetic), have their own dedicated modules. + ## Relevant Articles: - [Java Two Pointer Technique](https://www.baeldung.com/java-two-pointer-technique) - [Implementing Simple State Machines with Java Enums](https://www.baeldung.com/java-enum-simple-state-machine) -- [Converting Between Roman and Arabic Numerals in Java](http://www.baeldung.com/java-convert-roman-arabic) -- [Practical Java Examples of the Big O Notation](http://www.baeldung.com/java-algorithm-complexity) +- [Converting Between Roman and Arabic Numerals in Java](https://www.baeldung.com/java-convert-roman-arabic) +- [Practical Java Examples of the Big O Notation](https://www.baeldung.com/java-algorithm-complexity) - [Checking If a List Is Sorted in Java](https://www.baeldung.com/java-check-if-list-sorted) - [Checking if a Java Graph has a Cycle](https://www.baeldung.com/java-graph-has-a-cycle) - [A Guide to the Folding Technique in Java](https://www.baeldung.com/folding-hashing-technique) - [Creating a Triangle with for Loops in Java](https://www.baeldung.com/java-print-triangle) +- [Efficient Word Frequency Calculator in Java](https://www.baeldung.com/java-word-frequency) +- [Interpolation Search in Java](https://www.baeldung.com/java-interpolation-search) +- [The K-Means Clustering Algorithm in Java](https://www.baeldung.com/java-k-means-clustering-algorithm) +- [Creating a Custom Annotation in Java](https://www.baeldung.com/java-custom-annotation) +- [Breadth-First Search Algorithm in Java](https://www.baeldung.com/java-breadth-first-search) +- More articles: [[<-- prev]](/algorithms-miscellaneous-2) [[next -->]](/algorithms-miscellaneous-4) diff --git a/algorithms-miscellaneous-3/pom.xml b/algorithms-miscellaneous-3/pom.xml index 5999d33c86..67923d37d7 100644 --- a/algorithms-miscellaneous-3/pom.xml +++ b/algorithms-miscellaneous-3/pom.xml @@ -54,6 +54,21 @@ 1.1.0 test + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + @@ -73,5 +88,7 @@ 4.3 28.0-jre 2.6.0 + 1.19 + 1.19 \ No newline at end of file diff --git a/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithm.java b/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithm.java new file mode 100644 index 0000000000..9d301f9578 --- /dev/null +++ b/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithm.java @@ -0,0 +1,54 @@ +package com.baeldung.algorithms.breadthfirstsearch; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; + +public class BreadthFirstSearchAlgorithm { + + private static final Logger LOGGER = LoggerFactory.getLogger(BreadthFirstSearchAlgorithm.class); + + public static Optional> search(T value, Tree root) { + Queue> queue = new ArrayDeque<>(); + queue.add(root); + + Tree currentNode; + while (!queue.isEmpty()) { + currentNode = queue.remove(); + LOGGER.info("Visited node with value: {}", currentNode.getValue()); + + if (currentNode.getValue().equals(value)) { + return Optional.of(currentNode); + } else { + queue.addAll(currentNode.getChildren()); + } + } + + return Optional.empty(); + } + + public static Optional> search(T value, Node start) { + Queue> queue = new ArrayDeque<>(); + queue.add(start); + + Node currentNode; + Set> alreadyVisited = new HashSet<>(); + + while (!queue.isEmpty()) { + currentNode = queue.remove(); + LOGGER.info("Visited node with value: {}", currentNode.getValue()); + + if (currentNode.getValue().equals(value)) { + return Optional.of(currentNode); + } else { + alreadyVisited.add(currentNode); + queue.addAll(currentNode.getNeighbors()); + queue.removeAll(alreadyVisited); + } + } + + return Optional.empty(); + } + +} diff --git a/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/breadthfirstsearch/Node.java b/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/breadthfirstsearch/Node.java new file mode 100644 index 0000000000..54a589ae26 --- /dev/null +++ b/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/breadthfirstsearch/Node.java @@ -0,0 +1,31 @@ +package com.baeldung.algorithms.breadthfirstsearch; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class Node { + + private T value; + private Set> neighbors; + + public Node(T value) { + this.value = value; + this.neighbors = new HashSet<>(); + } + + public T getValue() { + return value; + } + + public Set> getNeighbors() { + return Collections.unmodifiableSet(neighbors); + } + + public void connect(Node node) { + if (this == node) throw new IllegalArgumentException("Can't connect node to itself"); + this.neighbors.add(node); + node.neighbors.add(this); + } + +} diff --git a/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/breadthfirstsearch/Tree.java b/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/breadthfirstsearch/Tree.java new file mode 100644 index 0000000000..842d2837ff --- /dev/null +++ b/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/breadthfirstsearch/Tree.java @@ -0,0 +1,34 @@ +package com.baeldung.algorithms.breadthfirstsearch; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class Tree { + + private T value; + private List> children; + + private Tree(T value) { + this.value = value; + this.children = new ArrayList<>(); + } + + public static Tree of(T value) { + return new Tree<>(value); + } + + public T getValue() { + return value; + } + + public List> getChildren() { + return Collections.unmodifiableList(children); + } + + public Tree addChild(T value) { + Tree newChild = new Tree<>(value); + children.add(newChild); + return newChild; + } +} diff --git a/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorter.java b/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorter.java deleted file mode 100644 index 4d885a6b3a..0000000000 --- a/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorter.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.baeldung.bucketsort; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -public class IntegerBucketSorter implements Sorter { - - private final Comparator comparator; - - public IntegerBucketSorter(Comparator comparator) { - this.comparator = comparator; - } - - public IntegerBucketSorter() { - comparator = Comparator.naturalOrder(); - } - - public List sort(List arrayToSort) { - - List> buckets = splitIntoUnsortedBuckets(arrayToSort); - - for(List bucket : buckets){ - bucket.sort(comparator); - } - - return concatenateSortedBuckets(buckets); - } - - private List concatenateSortedBuckets(List> buckets){ - List sortedArray = new ArrayList<>(); - int index = 0; - for(List bucket : buckets){ - for(int number : bucket){ - sortedArray.add(index++, number); - } - } - return sortedArray; - } - - private List> splitIntoUnsortedBuckets(List initialList){ - - final int[] codes = createHashes(initialList); - - List> buckets = new ArrayList<>(codes[1]); - for(int i = 0; i < codes[1]; i++) buckets.add(new ArrayList<>()); - - //distribute the data - for (int i : initialList) { - buckets.get(hash(i, codes)).add(i); - } - return buckets; - - } - - private int[] createHashes(List input){ - int m = input.get(0); - for (int i = 1; i < input.size(); i++) { - if (m < input.get(i)) { - m = input.get(i); - } - } - return new int[]{m, (int) Math.sqrt(input.size())}; - } - - private static int hash(int i, int[] code) { - return (int) ((double) i / code[0] * (code[1] - 1)); - } - -} diff --git a/algorithms-miscellaneous-3/src/test/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithmUnitTest.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithmUnitTest.java new file mode 100644 index 0000000000..aa22fc5353 --- /dev/null +++ b/algorithms-miscellaneous-3/src/test/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithmUnitTest.java @@ -0,0 +1,86 @@ +package com.baeldung.algorithms.breadthfirstsearch; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +class BreadthFirstSearchAlgorithmUnitTest { + + private Tree root; + private Tree rootFirstChild; + private Tree depthMostChild; + private Tree rootSecondChild; + + private Node start; + private Node firstNeighbor; + private Node firstNeighborNeighbor; + private Node secondNeighbor; + + @Test + void givenTree_whenSearchTen_thenRoot() { + initTree(); + assertThat(BreadthFirstSearchAlgorithm.search(10, root)).isPresent().contains(root); + } + + @Test + void givenTree_whenSearchThree_thenDepthMostValue() { + initTree(); + assertThat(BreadthFirstSearchAlgorithm.search(3, root)).isPresent().contains(depthMostChild); + } + + @Test + void givenTree_whenSearchFour_thenRootSecondChild() { + initTree(); + assertThat(BreadthFirstSearchAlgorithm.search(4, root)).isPresent().contains(rootSecondChild); + } + + @Test + void givenTree_whenSearchFive_thenNotFound() { + initTree(); + assertThat(BreadthFirstSearchAlgorithm.search(5, root)).isEmpty(); + } + + private void initTree() { + root = Tree.of(10); + rootFirstChild = root.addChild(2); + depthMostChild = rootFirstChild.addChild(3); + rootSecondChild = root.addChild(4); + } + + @Test + void givenNode_whenSearchTen_thenStart() { + initNode(); + assertThat(BreadthFirstSearchAlgorithm.search(10, firstNeighborNeighbor)).isPresent().contains(start); + } + + @Test + void givenNode_whenSearchThree_thenNeighborNeighbor() { + initNode(); + assertThat(BreadthFirstSearchAlgorithm.search(3, firstNeighborNeighbor)).isPresent().contains(firstNeighborNeighbor); + } + + @Test + void givenNode_whenSearchFour_thenSecondNeighbor() { + initNode(); + assertThat(BreadthFirstSearchAlgorithm.search(4, firstNeighborNeighbor)).isPresent().contains(secondNeighbor); + } + + @Test + void givenNode_whenSearchFive_thenNotFound() { + initNode(); + assertThat(BreadthFirstSearchAlgorithm.search(5, firstNeighborNeighbor)).isEmpty(); + } + + private void initNode() { + start = new Node<>(10); + firstNeighbor = new Node<>(2); + start.connect(firstNeighbor); + + firstNeighborNeighbor = new Node<>(3); + firstNeighbor.connect(firstNeighborNeighbor); + firstNeighborNeighbor.connect(start); + + secondNeighbor = new Node<>(4); + start.connect(secondNeighbor); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterStatistics.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterStatistics.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterStatistics.java rename to algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterStatistics.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUnitTest.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUnitTest.java rename to algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUtil.java b/algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUtil.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/counter/CounterUtil.java rename to algorithms-miscellaneous-3/src/test/java/com/baeldung/counter/CounterUtil.java diff --git a/algorithms-miscellaneous-4/README.md b/algorithms-miscellaneous-4/README.md new file mode 100644 index 0000000000..df2eafb733 --- /dev/null +++ b/algorithms-miscellaneous-4/README.md @@ -0,0 +1,14 @@ +## Algorithms - Miscellaneous + +This module contains articles about algorithms. Some classes of algorithms, e.g., [sorting](https://github.com/eugenp/tutorials/blob/algorithms-sorting) and [genetic algorithms](https://github.com/eugenp/tutorials/blob/algorithms-genetic), have their own dedicated modules. + +### Relevant articles: + +- [Multi-Swarm Optimization Algorithm in Java](https://www.baeldung.com/java-multi-swarm-algorithm) +- [String Search Algorithms for Large Texts](https://www.baeldung.com/java-full-text-search-algorithms) +- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters) +- [Find the Middle Element of a Linked List](https://www.baeldung.com/java-linked-list-middle-element) +- [Find Substrings That Are Palindromes in Java](https://www.baeldung.com/java-palindrome-substrings) +- [Find the Longest Substring without Repeating Characters](https://www.baeldung.com/java-longest-substring-without-repeated-characters) +- [Permutations of an Array in Java](https://www.baeldung.com/java-array-permutations) +- More articles: [[<-- prev]](/algorithms-miscellaneous-3) [[next -->]](/algorithms-miscellaneous-5) diff --git a/algorithms-miscellaneous-4/pom.xml b/algorithms-miscellaneous-4/pom.xml new file mode 100644 index 0000000000..8fd8f807ba --- /dev/null +++ b/algorithms-miscellaneous-4/pom.xml @@ -0,0 +1,51 @@ + + 4.0.0 + algorithms-miscellaneous-4 + 0.0.1-SNAPSHOT + algorithms-miscellaneous-4 + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + com.google.guava + guava + ${guava.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + org.assertj + assertj-core + ${org.assertj.core.version} + test + + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + + + + + 3.9.0 + 27.0.1-jre + + + \ No newline at end of file diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/middleelementlookup/MiddleElementLookup.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/middleelementlookup/MiddleElementLookup.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/middleelementlookup/MiddleElementLookup.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/middleelementlookup/MiddleElementLookup.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/middleelementlookup/Node.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/middleelementlookup/Node.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/middleelementlookup/Node.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/middleelementlookup/Node.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Constants.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/Constants.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Constants.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/Constants.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/FitnessFunction.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/FitnessFunction.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/FitnessFunction.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/FitnessFunction.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Multiswarm.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/Multiswarm.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Multiswarm.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/Multiswarm.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Particle.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/Particle.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Particle.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/Particle.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Swarm.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/Swarm.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/multiswarm/Swarm.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/multiswarm/Swarm.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/permutation/Permutation.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/permutation/Permutation.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/permutation/Permutation.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/permutation/Permutation.java diff --git a/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/smallestinteger/SmallestMissingPositiveInteger.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/smallestinteger/SmallestMissingPositiveInteger.java new file mode 100644 index 0000000000..b08eea2a66 --- /dev/null +++ b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/smallestinteger/SmallestMissingPositiveInteger.java @@ -0,0 +1,37 @@ +package com.baeldung.algorithms.smallestinteger; + +import java.util.Arrays; + +public class SmallestMissingPositiveInteger { + public static int searchInSortedArray(int[] input) { + for (int i = 0; i < input.length; i++) { + if (i != input[i]) { + return i; + } + } + + return input.length; + } + + public static int searchInUnsortedArraySortingFirst(int[] input) { + Arrays.sort(input); + return searchInSortedArray(input); + } + + public static int searchInUnsortedArrayBooleanArray(int[] input) { + boolean[] flags = new boolean[input.length]; + for (int number : input) { + if (number < flags.length) { + flags[number] = true; + } + } + + for (int i = 0; i < flags.length; i++) { + if (!flags[i]) { + return i; + } + } + + return flags.length; + } +} diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/EnglishAlphabetLetters.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/string/EnglishAlphabetLetters.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/EnglishAlphabetLetters.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/string/EnglishAlphabetLetters.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/LongestSubstringNonRepeatingCharacters.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/string/LongestSubstringNonRepeatingCharacters.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/LongestSubstringNonRepeatingCharacters.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/string/LongestSubstringNonRepeatingCharacters.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/SubstringPalindrome.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/string/SubstringPalindrome.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/SubstringPalindrome.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/string/SubstringPalindrome.java diff --git a/algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/search/StringSearchAlgorithms.java b/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/string/search/StringSearchAlgorithms.java similarity index 100% rename from algorithms-miscellaneous-1/src/main/java/com/baeldung/algorithms/string/search/StringSearchAlgorithms.java rename to algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/string/search/StringSearchAlgorithms.java diff --git a/autovalue/src/main/resources/logback.xml b/algorithms-miscellaneous-4/src/main/resources/logback.xml similarity index 100% rename from autovalue/src/main/resources/logback.xml rename to algorithms-miscellaneous-4/src/main/resources/logback.xml diff --git a/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/MiddleElementLookupUnitTest.java b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/MiddleElementLookupUnitTest.java similarity index 100% rename from algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/MiddleElementLookupUnitTest.java rename to algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/MiddleElementLookupUnitTest.java diff --git a/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/StringSearchAlgorithmsUnitTest.java b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/StringSearchAlgorithmsUnitTest.java similarity index 100% rename from algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/StringSearchAlgorithmsUnitTest.java rename to algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/StringSearchAlgorithmsUnitTest.java diff --git a/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/multiswarm/LolFitnessFunction.java b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/multiswarm/LolFitnessFunction.java similarity index 100% rename from algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/multiswarm/LolFitnessFunction.java rename to algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/multiswarm/LolFitnessFunction.java diff --git a/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/multiswarm/MultiswarmUnitTest.java b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/multiswarm/MultiswarmUnitTest.java similarity index 100% rename from algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/multiswarm/MultiswarmUnitTest.java rename to algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/multiswarm/MultiswarmUnitTest.java diff --git a/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/smallestinteger/SmallestMissingPositiveIntegerUnitTest.java b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/smallestinteger/SmallestMissingPositiveIntegerUnitTest.java new file mode 100644 index 0000000000..8bb7151b41 --- /dev/null +++ b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/smallestinteger/SmallestMissingPositiveIntegerUnitTest.java @@ -0,0 +1,88 @@ +package com.baeldung.algorithms.smallestinteger; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +class SmallestMissingPositiveIntegerUnitTest { + @Test + void givenArrayWithThreeMissing_whenSearchInSortedArray_thenThree() { + int[] input = new int[] {0, 1, 2, 4, 5}; + + int result = SmallestMissingPositiveInteger.searchInSortedArray(input); + + assertThat(result).isEqualTo(3); + } + + @Test + void givenArrayWithOneAndThreeMissing_whenSearchInSortedArray_thenOne() { + int[] input = new int[] {0, 2, 4, 5}; + + int result = SmallestMissingPositiveInteger.searchInSortedArray(input); + + assertThat(result).isEqualTo(1); + } + + @Test + void givenArrayWithoutMissingInteger_whenSearchInSortedArray_thenArrayLength() { + int[] input = new int[] {0, 1, 2, 3, 4, 5}; + + int result = SmallestMissingPositiveInteger.searchInSortedArray(input); + + assertThat(result).isEqualTo(input.length); + } + + @Test + void givenArrayWithThreeMissing_whenSearchInUnsortedArraySortingFirst_thenThree() { + int[] input = new int[] {1, 4, 0, 5, 2}; + + int result = SmallestMissingPositiveInteger.searchInUnsortedArraySortingFirst(input); + + assertThat(result).isEqualTo(3); + } + + @Test + void givenArrayWithOneAndThreeMissing_whenSearchInUnsortedArraySortingFirst_thenOne() { + int[] input = new int[] {4, 2, 0, 5}; + + int result = SmallestMissingPositiveInteger.searchInUnsortedArraySortingFirst(input); + + assertThat(result).isEqualTo(1); + } + + @Test + void givenArrayWithoutMissingInteger_whenSearchInUnsortedArraySortingFirst_thenArrayLength() { + int[] input = new int[] {4, 5, 1, 3, 0, 2}; + + int result = SmallestMissingPositiveInteger.searchInUnsortedArraySortingFirst(input); + + assertThat(result).isEqualTo(input.length); + } + + @Test + void givenArrayWithThreeMissing_whenSearchInUnsortedArrayBooleanArray_thenThree() { + int[] input = new int[] {1, 4, 0, 5, 2}; + + int result = SmallestMissingPositiveInteger.searchInUnsortedArrayBooleanArray(input); + + assertThat(result).isEqualTo(3); + } + + @Test + void givenArrayWithOneAndThreeMissing_whenSearchInUnsortedArrayBooleanArray_thenOne() { + int[] input = new int[] {4, 2, 0, 5}; + + int result = SmallestMissingPositiveInteger.searchInUnsortedArrayBooleanArray(input); + + assertThat(result).isEqualTo(1); + } + + @Test + void givenArrayWithoutMissingInteger_whenSearchInUnsortedArrayBooleanArray_thenArrayLength() { + int[] input = new int[] {4, 5, 1, 3, 0, 2}; + + int result = SmallestMissingPositiveInteger.searchInUnsortedArrayBooleanArray(input); + + assertThat(result).isEqualTo(input.length); + } +} \ No newline at end of file diff --git a/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/string/EnglishAlphabetLettersUnitTest.java b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/string/EnglishAlphabetLettersUnitTest.java similarity index 100% rename from algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/string/EnglishAlphabetLettersUnitTest.java rename to algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/string/EnglishAlphabetLettersUnitTest.java diff --git a/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/string/LongestSubstringNonRepeatingCharactersUnitTest.java b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/string/LongestSubstringNonRepeatingCharactersUnitTest.java similarity index 100% rename from algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/string/LongestSubstringNonRepeatingCharactersUnitTest.java rename to algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/string/LongestSubstringNonRepeatingCharactersUnitTest.java diff --git a/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/string/SubstringPalindromeUnitTest.java b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/string/SubstringPalindromeUnitTest.java similarity index 100% rename from algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/string/SubstringPalindromeUnitTest.java rename to algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/string/SubstringPalindromeUnitTest.java diff --git a/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/support/MayFailRule.java b/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/support/MayFailRule.java similarity index 100% rename from algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/support/MayFailRule.java rename to algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/support/MayFailRule.java diff --git a/algorithms-miscellaneous-5/README.md b/algorithms-miscellaneous-5/README.md new file mode 100644 index 0000000000..598fbab8b5 --- /dev/null +++ b/algorithms-miscellaneous-5/README.md @@ -0,0 +1,12 @@ +## Algorithms - Miscellaneous + +This module contains articles about algorithms. Some classes of algorithms, e.g., [sorting](/../algorithms-sorting) and +[genetic algorithms](/../algorithms-genetic), have their own dedicated modules. + +### Relevant articles: + +- [Converting Between Byte Arrays and Hexadecimal Strings in Java](https://www.baeldung.com/java-byte-arrays-hex-strings) +- [Reversing a Binary Tree in Java](https://www.baeldung.com/java-reversing-a-binary-tree) +- [Find If Two Numbers Are Relatively Prime in Java](https://www.baeldung.com/java-two-relatively-prime-numbers) +- [Knapsack Problem Implementation in Java](https://www.baeldung.com/java-knapsack) +- More articles: [[<-- prev]](/../algorithms-miscellaneous-4) diff --git a/algorithms-miscellaneous-5/pom.xml b/algorithms-miscellaneous-5/pom.xml new file mode 100644 index 0000000000..98a7f33474 --- /dev/null +++ b/algorithms-miscellaneous-5/pom.xml @@ -0,0 +1,64 @@ + + 4.0.0 + algorithms-miscellaneous-5 + 0.0.1-SNAPSHOT + algorithms-miscellaneous-5 + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + commons-codec + commons-codec + ${commons-codec.version} + + + org.apache.commons + commons-math3 + ${commons-math3.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + pl.allegro.finance + tradukisto + ${tradukisto.version} + + + + org.assertj + assertj-core + ${org.assertj.core.version} + test + + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + + + + + 1.0.1 + 3.9.0 + 1.11 + 3.6.1 + + + \ No newline at end of file diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/BalancedBinaryTree.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/BalancedBinaryTree.java new file mode 100644 index 0000000000..84180473e2 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/BalancedBinaryTree.java @@ -0,0 +1,33 @@ +package com.baeldung.algorithms.balancedbinarytree; + +public class BalancedBinaryTree { + + public static boolean isBalanced(Tree tree) { + return isBalancedRecursive(tree, -1).isBalanced; + } + + private static Result isBalancedRecursive(Tree tree, int depth) { + if (tree == null) { + return new Result(true, -1); + } + + Result leftSubtreeResult = isBalancedRecursive(tree.left(), depth + 1); + Result rightSubtreeResult = isBalancedRecursive(tree.right(), depth + 1); + + boolean isBalanced = Math.abs(leftSubtreeResult.height - rightSubtreeResult.height) <= 1; + boolean subtreesAreBalanced = leftSubtreeResult.isBalanced && rightSubtreeResult.isBalanced; + int height = Math.max(leftSubtreeResult.height, rightSubtreeResult.height) + 1; + + return new Result(isBalanced && subtreesAreBalanced, height); + } + + private static final class Result { + private final boolean isBalanced; + private final int height; + + private Result(boolean isBalanced, int height) { + this.isBalanced = isBalanced; + this.height = height; + } + } +} diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/Tree.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/Tree.java new file mode 100644 index 0000000000..8e091408c9 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/Tree.java @@ -0,0 +1,34 @@ +package com.baeldung.algorithms.balancedbinarytree; + +public class Tree { + private final int value; + private final Tree left; + private final Tree right; + + public Tree(int value, Tree left, Tree right) { + this.value = value; + this.left = left; + this.right = right; + } + + public int value() { + return value; + } + + public Tree left() { + return left; + } + + public Tree right() { + return right; + } + + @Override + public String toString() { + return String.format("[%s, %s, %s]", + value, + left == null ? "null" : left.toString(), + right == null ? "null" : right.toString() + ); + } +} diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/binarygap/BinaryGap.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/binarygap/BinaryGap.java new file mode 100644 index 0000000000..e31e9870a0 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/binarygap/BinaryGap.java @@ -0,0 +1,17 @@ +package com.baeldung.algorithms.binarygap; + +public class BinaryGap { + static int calculateBinaryGap(int n) { + return calculateBinaryGap(n >>> Integer.numberOfTrailingZeros(n), 0, 0); + } + + static int calculateBinaryGap(int n, int current, int maximum) { + if (n == 0) { + return maximum; + } else if ((n & 1) == 0) { + return calculateBinaryGap(n >>> 1, current + 1, maximum); + } else { + return calculateBinaryGap(n >>> 1, 0, Math.max(maximum, current)); + } + } +} diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/caesarcipher/CaesarCipher.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/caesarcipher/CaesarCipher.java new file mode 100644 index 0000000000..5ee913d251 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/caesarcipher/CaesarCipher.java @@ -0,0 +1,83 @@ +package com.baeldung.algorithms.caesarcipher; + +import org.apache.commons.math3.stat.inference.ChiSquareTest; + +import java.util.Arrays; +import java.util.stream.IntStream; + +public class CaesarCipher { + private static final char LETTER_A = 'a'; + private static final char LETTER_Z = 'z'; + private static final int ALPHABET_SIZE = LETTER_Z - LETTER_A + 1; + private static final double[] ENGLISH_LETTERS_PROBABILITIES = {0.073, 0.009, 0.030, 0.044, 0.130, 0.028, 0.016, 0.035, 0.074, 0.002, 0.003, 0.035, 0.025, 0.078, 0.074, 0.027, 0.003, 0.077, 0.063, 0.093, 0.027, 0.013, 0.016, 0.005, 0.019, 0.001}; + + public String cipher(String message, int offset) { + StringBuilder result = new StringBuilder(); + + for (char character : message.toCharArray()) { + if (character != ' ') { + int originalAlphabetPosition = character - LETTER_A; + int newAlphabetPosition = (originalAlphabetPosition + offset) % ALPHABET_SIZE; + char newCharacter = (char) (LETTER_A + newAlphabetPosition); + result.append(newCharacter); + } else { + result.append(character); + } + } + + return result.toString(); + } + + public String decipher(String message, int offset) { + return cipher(message, ALPHABET_SIZE - (offset % ALPHABET_SIZE)); + } + + public int breakCipher(String message) { + return probableOffset(chiSquares(message)); + } + + private double[] chiSquares(String message) { + double[] expectedLettersFrequencies = expectedLettersFrequencies(message.length()); + + double[] chiSquares = new double[ALPHABET_SIZE]; + + for (int offset = 0; offset < chiSquares.length; offset++) { + String decipheredMessage = decipher(message, offset); + long[] lettersFrequencies = observedLettersFrequencies(decipheredMessage); + double chiSquare = new ChiSquareTest().chiSquare(expectedLettersFrequencies, lettersFrequencies); + chiSquares[offset] = chiSquare; + } + + return chiSquares; + } + + private long[] observedLettersFrequencies(String message) { + return IntStream.rangeClosed(LETTER_A, LETTER_Z) + .mapToLong(letter -> countLetter((char) letter, message)) + .toArray(); + } + + private long countLetter(char letter, String message) { + return message.chars() + .filter(character -> character == letter) + .count(); + } + + private double[] expectedLettersFrequencies(int messageLength) { + return Arrays.stream(ENGLISH_LETTERS_PROBABILITIES) + .map(probability -> probability * messageLength) + .toArray(); + } + + private int probableOffset(double[] chiSquares) { + int probableOffset = 0; + for (int offset = 0; offset < chiSquares.length; offset++) { + System.out.println(String.format("Chi-Square for offset %d: %.2f", offset, chiSquares[offset])); + if (chiSquares[offset] < chiSquares[probableOffset]) { + probableOffset = offset; + } + } + + return probableOffset; + } +} diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java similarity index 100% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java rename to algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/conversion/HexStringConverter.java diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/knapsack/Knapsack.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/knapsack/Knapsack.java new file mode 100644 index 0000000000..61c3f05a95 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/knapsack/Knapsack.java @@ -0,0 +1,36 @@ +package com.baeldung.algorithms.knapsack; + +public class Knapsack { + + public int knapsackRec(int[] w, int[] v, int n, int W) { + if (n <= 0) { + return 0; + } else if (w[n - 1] > W) { + return knapsackRec(w, v, n - 1, W); + } else { + return Math.max(knapsackRec(w, v, n - 1, W), v[n - 1] + knapsackRec(w, v, n - 1, W - w[n - 1])); + } + } + + public int knapsackDP(int[] w, int[] v, int n, int W) { + if (n <= 0 || W <= 0) { + return 0; + } + + int[][] m = new int[n + 1][W + 1]; + for (int j = 0; j <= W; j++) { + m[0][j] = 0; + } + + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= W; j++) { + if (w[i - 1] > j) { + m[i][j] = m[i - 1][j]; + } else { + m[i][j] = Math.max(m[i - 1][j], m[i - 1][j - w[i - 1]] + v[i - 1]); + } + } + } + return m[n][W]; + } +} diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/relativelyprime/RelativelyPrime.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/relativelyprime/RelativelyPrime.java similarity index 100% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/relativelyprime/RelativelyPrime.java rename to algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/relativelyprime/RelativelyPrime.java diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/reversingtree/TreeNode.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/reversingtree/TreeNode.java similarity index 100% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/reversingtree/TreeNode.java rename to algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/reversingtree/TreeNode.java diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/reversingtree/TreeReverser.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/reversingtree/TreeReverser.java similarity index 100% rename from algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/reversingtree/TreeReverser.java rename to algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/reversingtree/TreeReverser.java diff --git a/java-dates/src/main/resources/logback.xml b/algorithms-miscellaneous-5/src/main/resources/logback.xml similarity index 100% rename from java-dates/src/main/resources/logback.xml rename to algorithms-miscellaneous-5/src/main/resources/logback.xml diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/BalancedBinaryTreeUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/BalancedBinaryTreeUnitTest.java new file mode 100644 index 0000000000..25f313f991 --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/BalancedBinaryTreeUnitTest.java @@ -0,0 +1,26 @@ +package com.baeldung.algorithms.balancedbinarytree; + +import org.junit.Test; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertFalse; + +public class BalancedBinaryTreeUnitTest extends BinaryTreeDataProvider { + + @Test + public void givenBalancedTrees_whenCallingIsBalanced_ShouldReturnTrue() { + for (Tree tree : balancedTrees()) { + assertTrue(toString(tree) + " should be balanced", BalancedBinaryTree.isBalanced(tree)); + } + } + + @Test + public void givenUnbalancedTrees_whenCallingIsBalanced_ShouldReturnFalse() { + for (Tree tree : unbalancedTrees()) { + assertFalse(toString(tree) + " should not be balanced", BalancedBinaryTree.isBalanced(tree)); + } + } + + private String toString(Tree tree) { + return tree != null ? tree.toString() : "null"; + } +} diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/BinaryTreeDataProvider.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/BinaryTreeDataProvider.java new file mode 100644 index 0000000000..3f4318afbc --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/BinaryTreeDataProvider.java @@ -0,0 +1,69 @@ +package com.baeldung.algorithms.balancedbinarytree; + +import java.util.Arrays; +import java.util.Collection; + +class BinaryTreeDataProvider { + + static Collection balancedTrees() { + return Arrays.asList( + null, + leaf(1), + tree(1, leaf(2), leaf(3)), + tree( + 1, + leaf(2), + tree(3, leaf(4), null) + ), + tree( + 1, + tree( + 2, + tree(3, leaf(4), null), + leaf(5) + ), + tree( + 6, + leaf(7), + tree(8, null, leaf(9)) + ) + ) + ); + } + + static Collection unbalancedTrees() { + return Arrays.asList( + tree( + 1, + tree(2, leaf(3), null), + null + ), + tree( + 1, + tree( + 2, + tree(3, leaf(4), leaf(5)), + null + ), + tree(6, leaf(7), null) + ), + tree( + 1, + tree(2, leaf(3), null), + tree( + 4, + tree(5, leaf(6), leaf(7)), + null + ) + ) + ); + } + + private static Tree leaf(int value) { + return new Tree(value, null, null); + } + + private static Tree tree(int value, Tree left, Tree right) { + return new Tree(value, left, right); + } +} diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/binarygap/BinaryGapUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/binarygap/BinaryGapUnitTest.java new file mode 100644 index 0000000000..304d36e2bb --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/binarygap/BinaryGapUnitTest.java @@ -0,0 +1,34 @@ +package com.baeldung.algorithms.binarygap; + +import static com.baeldung.algorithms.binarygap.BinaryGap.calculateBinaryGap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class BinaryGapUnitTest { + + @Test public void givenNoOccurrenceOfBoundedZeros_whenCalculateBinaryGap_thenOutputCorrectResult() { + + int result = calculateBinaryGap(63); + assertEquals(0, result); + } + + @Test public void givenTrailingZeros_whenCalculateBinaryGap_thenOutputCorrectResult() { + + int result = calculateBinaryGap(40); + assertEquals(1, result); + } + + @Test public void givenSingleOccurrenceOfBoundedZeros_whenCalculateBinaryGap_thenOutputCorrectResult() { + + int result = calculateBinaryGap(9); + assertEquals(2, result); + } + + @Test public void givenMultipleOccurrenceOfBoundedZeros_whenCalculateBinaryGap_thenOutputCorrectResult() { + + int result = calculateBinaryGap(145); + assertEquals(3, result); + } + +} diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/caesarcipher/CaesarCipherUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/caesarcipher/CaesarCipherUnitTest.java new file mode 100644 index 0000000000..c3a22a8978 --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/caesarcipher/CaesarCipherUnitTest.java @@ -0,0 +1,83 @@ +package com.baeldung.algorithms.caesarcipher; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +class CaesarCipherUnitTest { + private static final String SENTENCE = "he told me i could never teach a llama to drive"; + private static final String SENTENCE_SHIFTED_THREE = "kh wrog ph l frxog qhyhu whdfk d oodpd wr gulyh"; + private static final String SENTENCE_SHIFTED_TEN = "ro dyvn wo s myevn xofob dokmr k vvkwk dy nbsfo"; + + private CaesarCipher algorithm = new CaesarCipher(); + + @Test + void givenSentenceAndShiftThree_whenCipher_thenCipheredMessageWithoutOverflow() { + String cipheredSentence = algorithm.cipher(SENTENCE, 3); + + assertThat(cipheredSentence) + .isEqualTo(SENTENCE_SHIFTED_THREE); + } + + @Test + void givenSentenceAndShiftTen_whenCipher_thenCipheredMessageWithOverflow() { + String cipheredSentence = algorithm.cipher(SENTENCE, 10); + + assertThat(cipheredSentence) + .isEqualTo(SENTENCE_SHIFTED_TEN); + } + + @Test + void givenSentenceAndShiftThirtySix_whenCipher_thenCipheredLikeTenMessageWithOverflow() { + String cipheredSentence = algorithm.cipher(SENTENCE, 36); + + assertThat(cipheredSentence) + .isEqualTo(SENTENCE_SHIFTED_TEN); + } + + @Test + void givenSentenceShiftedThreeAndShiftThree_whenDecipher_thenOriginalSentenceWithoutOverflow() { + String decipheredSentence = algorithm.decipher(SENTENCE_SHIFTED_THREE, 3); + + assertThat(decipheredSentence) + .isEqualTo(SENTENCE); + } + + @Test + void givenSentenceShiftedTenAndShiftTen_whenDecipher_thenOriginalSentenceWithOverflow() { + String decipheredSentence = algorithm.decipher(SENTENCE_SHIFTED_TEN, 10); + + assertThat(decipheredSentence) + .isEqualTo(SENTENCE); + } + + @Test + void givenSentenceShiftedTenAndShiftThirtySix_whenDecipher_thenOriginalSentenceWithOverflow() { + String decipheredSentence = algorithm.decipher(SENTENCE_SHIFTED_TEN, 36); + + assertThat(decipheredSentence) + .isEqualTo(SENTENCE); + } + + @Test + void givenSentenceShiftedThree_whenBreakCipher_thenOriginalSentence() { + int offset = algorithm.breakCipher(SENTENCE_SHIFTED_THREE); + + assertThat(offset) + .isEqualTo(3); + + assertThat(algorithm.decipher(SENTENCE_SHIFTED_THREE, offset)) + .isEqualTo(SENTENCE); + } + + @Test + void givenSentenceShiftedTen_whenBreakCipher_thenOriginalSentence() { + int offset = algorithm.breakCipher(SENTENCE_SHIFTED_TEN); + + assertThat(offset) + .isEqualTo(10); + + assertThat(algorithm.decipher(SENTENCE_SHIFTED_TEN, offset)) + .isEqualTo(SENTENCE); + } +} \ No newline at end of file diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java similarity index 100% rename from algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java rename to algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/conversion/ByteArrayConverterUnitTest.java diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/knapsack/KnapsackUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/knapsack/KnapsackUnitTest.java new file mode 100644 index 0000000000..b168e6b1eb --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/knapsack/KnapsackUnitTest.java @@ -0,0 +1,44 @@ +package com.baeldung.algorithms.knapsack; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class KnapsackUnitTest { + + @Test + public void givenWeightsandValues_whenCalculateMax_thenOutputCorrectResult() { + final int[] w = new int[] { 23, 26, 20, 18, 32, 27, 29, 26, 30, 27 }; + final int[] v = new int[] { 505, 352, 458, 220, 354, 414, 498, 545, 473, 543 }; + final int n = 10; + final int W = 67; + final Knapsack knapsack = new Knapsack(); + + assertEquals(1270, knapsack.knapsackRec(w, v, n, W)); + assertEquals(1270, knapsack.knapsackDP(w, v, n, W)); + } + + @Test + public void givenZeroItems_whenCalculateMax_thenOutputZero() { + final int[] w = new int[] {}; + final int[] v = new int[] {}; + final int n = 0; + final int W = 67; + final Knapsack knapsack = new Knapsack(); + + assertEquals(0, knapsack.knapsackRec(w, v, n, W)); + assertEquals(0, knapsack.knapsackDP(w, v, n, W)); + } + + @Test + public void givenZeroWeightLimit_whenCalculateMax_thenOutputZero() { + final int[] w = new int[] { 23, 26, 20, 18, 32, 27, 29, 26, 30, 27 }; + final int[] v = new int[] { 505, 352, 458, 220, 354, 414, 498, 545, 473, 543 }; + final int n = 10; + final int W = 0; + final Knapsack knapsack = new Knapsack(); + + assertEquals(0, knapsack.knapsackRec(w, v, n, W)); + assertEquals(0, knapsack.knapsackDP(w, v, n, W)); + } +} diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/relativelyprime/RelativelyPrimeUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/relativelyprime/RelativelyPrimeUnitTest.java similarity index 100% rename from algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/relativelyprime/RelativelyPrimeUnitTest.java rename to algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/relativelyprime/RelativelyPrimeUnitTest.java diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/reversingtree/TreeReverserUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/reversingtree/TreeReverserUnitTest.java similarity index 100% rename from algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/reversingtree/TreeReverserUnitTest.java rename to algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/reversingtree/TreeReverserUnitTest.java diff --git a/algorithms-sorting/README.md b/algorithms-sorting/README.md index 968d51aecf..15a5ec6e02 100644 --- a/algorithms-sorting/README.md +++ b/algorithms-sorting/README.md @@ -1,9 +1,20 @@ -## Relevant articles: +## Algorithms - Sorting -- [Bubble Sort in Java](http://www.baeldung.com/java-bubble-sort) +This module contains articles about sorting algorithms. + +### Relevant articles: + +- [Bubble Sort in Java](https://www.baeldung.com/java-bubble-sort) - [Merge Sort in Java](https://www.baeldung.com/java-merge-sort) - [Quicksort Algorithm Implementation in Java](https://www.baeldung.com/java-quicksort) - [Insertion Sort in Java](https://www.baeldung.com/java-insertion-sort) - [Heap Sort in Java](https://www.baeldung.com/java-heap-sort) - [Shell Sort in Java](https://www.baeldung.com/java-shell-sort) - [Counting Sort in Java](https://www.baeldung.com/java-counting-sort) +- [Sorting Strings by Contained Numbers in Java](https://www.baeldung.com/java-sort-strings-contained-numbers) +- [How an In-Place Sorting Algorithm Works](https://www.baeldung.com/java-in-place-sorting) +- [Selection Sort in Java](https://www.baeldung.com/java-selection-sort) +- [Sorting Strings by Contained Numbers in Java](https://www.baeldung.com/java-sort-strings-contained-numbers) +- [Radix Sort in Java](https://www.baeldung.com/java-radix-sort) +- [Sorting a String Alphabetically in Java](https://www.baeldung.com/java-sort-string-alphabetically) +- [Bucket Sort in Java](https://www.baeldung.com/java-bucket-sort) diff --git a/algorithms-sorting/pom.xml b/algorithms-sorting/pom.xml index b25adf05a8..5bb19a8069 100644 --- a/algorithms-sorting/pom.xml +++ b/algorithms-sorting/pom.xml @@ -28,6 +28,12 @@ ${lombok.version} provided + + org.junit.jupiter + junit-jupiter-api + ${junit-jupiter-api.version} + test + org.assertj assertj-core @@ -52,6 +58,7 @@ 3.6.1 3.9.0 1.11 + 5.3.1 \ No newline at end of file diff --git a/algorithms-sorting/src/main/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorter.java b/algorithms-sorting/src/main/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorter.java new file mode 100644 index 0000000000..002d4997f4 --- /dev/null +++ b/algorithms-sorting/src/main/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorter.java @@ -0,0 +1,68 @@ +package com.baeldung.bucketsort; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.LinkedList; +import java.util.List; + +public class IntegerBucketSorter implements Sorter { + + private final Comparator comparator; + + public IntegerBucketSorter(Comparator comparator) { + this.comparator = comparator; + } + + public IntegerBucketSorter() { + comparator = Comparator.naturalOrder(); + } + + public List sort(List arrayToSort) { + + List> buckets = splitIntoUnsortedBuckets(arrayToSort); + + for(List bucket : buckets){ + bucket.sort(comparator); + } + + return concatenateSortedBuckets(buckets); + } + + private List concatenateSortedBuckets(List> buckets){ + List sortedArray = new LinkedList<>(); + for(List bucket : buckets){ + sortedArray.addAll(bucket); + } + return sortedArray; + } + + private List> splitIntoUnsortedBuckets(List initialList){ + + final int max = findMax(initialList); + final int numberOfBuckets = (int) Math.sqrt(initialList.size()); + + List> buckets = new ArrayList<>(); + for(int i = 0; i < numberOfBuckets; i++) buckets.add(new ArrayList<>()); + + //distribute the data + for (int i : initialList) { + buckets.get(hash(i, max, numberOfBuckets)).add(i); + } + return buckets; + + } + + private int findMax(List input){ + int m = Integer.MIN_VALUE; + for (int i : input){ + m = Math.max(i, m); + } + return m; + } + + private static int hash(int i, int max, int numberOfBuckets) { + return (int) ((double) i / max * (numberOfBuckets - 1)); + } + + +} diff --git a/algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/bucketsort/Sorter.java b/algorithms-sorting/src/main/java/com/baeldung/algorithms/bucketsort/Sorter.java similarity index 100% rename from algorithms-miscellaneous-3/src/main/java/com/baeldung/algorithms/bucketsort/Sorter.java rename to algorithms-sorting/src/main/java/com/baeldung/algorithms/bucketsort/Sorter.java diff --git a/java-strings/src/main/java/com/baeldung/string/sorting/AnagramValidator.java b/algorithms-sorting/src/main/java/com/baeldung/algorithms/stringsort/AnagramValidator.java similarity index 93% rename from java-strings/src/main/java/com/baeldung/string/sorting/AnagramValidator.java rename to algorithms-sorting/src/main/java/com/baeldung/algorithms/stringsort/AnagramValidator.java index c4f684383d..67b5e5facc 100644 --- a/java-strings/src/main/java/com/baeldung/string/sorting/AnagramValidator.java +++ b/algorithms-sorting/src/main/java/com/baeldung/algorithms/stringsort/AnagramValidator.java @@ -1,4 +1,4 @@ -package com.baeldung.string.sorting; +package com.baeldung.algorithms.stringsort; import java.util.Arrays; diff --git a/algorithms-miscellaneous-3/src/test/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorterUnitTest.java b/algorithms-sorting/src/test/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorterUnitTest.java similarity index 100% rename from algorithms-miscellaneous-3/src/test/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorterUnitTest.java rename to algorithms-sorting/src/test/java/com/baeldung/algorithms/bucketsort/IntegerBucketSorterUnitTest.java diff --git a/java-strings/src/test/java/com/baeldung/string/sorting/AnagramValidatorUnitTest.java b/algorithms-sorting/src/test/java/com/baeldung/algorithms/stringsort/AnagramValidatorUnitTest.java similarity index 86% rename from java-strings/src/test/java/com/baeldung/string/sorting/AnagramValidatorUnitTest.java rename to algorithms-sorting/src/test/java/com/baeldung/algorithms/stringsort/AnagramValidatorUnitTest.java index 07d31c7187..25fc274dd8 100644 --- a/java-strings/src/test/java/com/baeldung/string/sorting/AnagramValidatorUnitTest.java +++ b/algorithms-sorting/src/test/java/com/baeldung/algorithms/stringsort/AnagramValidatorUnitTest.java @@ -1,12 +1,10 @@ -package com.baeldung.string.sorting; +package com.baeldung.algorithms.stringsort; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.assertFalse; - import org.junit.jupiter.api.Test; -import com.baeldung.string.sorting.AnagramValidator; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class AnagramValidatorUnitTest { diff --git a/java-strings/src/test/java/com/baeldung/string/sorting/SortStringUnitTest.java b/algorithms-sorting/src/test/java/com/baeldung/algorithms/stringsort/SortStringUnitTest.java similarity index 94% rename from java-strings/src/test/java/com/baeldung/string/sorting/SortStringUnitTest.java rename to algorithms-sorting/src/test/java/com/baeldung/algorithms/stringsort/SortStringUnitTest.java index 90d1dad554..226de64f07 100644 --- a/java-strings/src/test/java/com/baeldung/string/sorting/SortStringUnitTest.java +++ b/algorithms-sorting/src/test/java/com/baeldung/algorithms/stringsort/SortStringUnitTest.java @@ -1,9 +1,9 @@ -package com.baeldung.string.sorting; - -import java.util.Arrays; +package com.baeldung.algorithms.stringsort; import org.junit.jupiter.api.Test; +import java.util.Arrays; + import static org.assertj.core.api.Assertions.assertThat; class SortStringUnitTest { diff --git a/animal-sniffer-mvn-plugin/README.md b/animal-sniffer-mvn-plugin/README.md index 4c7c381da4..52e319b399 100644 --- a/animal-sniffer-mvn-plugin/README.md +++ b/animal-sniffer-mvn-plugin/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Animal Sniffer Maven Plugin -[Introduction to Animal Sniffer Maven Plugin](http://www.baeldung.com/maven-animal-sniffer) +This module contains articles about the Animal Sniffer Maven Plugin + +### Relevant articles: + +[Introduction to Animal Sniffer Maven Plugin](https://www.baeldung.com/maven-animal-sniffer) diff --git a/animal-sniffer-mvn-plugin/pom.xml b/animal-sniffer-mvn-plugin/pom.xml index 55e37e2ec4..fd8f6d3d8c 100644 --- a/animal-sniffer-mvn-plugin/pom.xml +++ b/animal-sniffer-mvn-plugin/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung animal-sniffer-mvn-plugin 1.0-SNAPSHOT animal-sniffer-mvn-plugin diff --git a/annotations/README.md b/annotations/README.md new file mode 100644 index 0000000000..ec4005fc5e --- /dev/null +++ b/annotations/README.md @@ -0,0 +1,7 @@ +## Annotations + +This module contains articles about Java annotations + +### Relevant Articles: + +- [Java Annotation Processing and Creating a Builder](https://www.baeldung.com/java-annotation-processing-builder) diff --git a/annotations/readme.md b/annotations/readme.md deleted file mode 100644 index 2b052803e6..0000000000 --- a/annotations/readme.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [Java Annotation Processing and Creating a Builder](http://www.baeldung.com/java-annotation-processing-builder) diff --git a/antlr/README.md b/antlr/README.md index 419d9ddfbb..1f394125c6 100644 --- a/antlr/README.md +++ b/antlr/README.md @@ -1,3 +1,7 @@ +## ANTLR + +This module contains articles about ANTLR + ### Relevant Articles: -- [Java with ANTLR](http://www.baeldung.com/java-antlr) +- [Java with ANTLR](https://www.baeldung.com/java-antlr) diff --git a/apache-avro/README.md b/apache-avro/README.md index 32d84ecc76..b338e8e565 100644 --- a/apache-avro/README.md +++ b/apache-avro/README.md @@ -1,2 +1,6 @@ +## Apache Avro + +This module contains articles about Apache Avro + ### Relevant Articles: -- [Guide to Apache Avro](http://www.baeldung.com/java-apache-avro) +- [Guide to Apache Avro](https://www.baeldung.com/java-apache-avro) diff --git a/apache-avro/pom.xml b/apache-avro/pom.xml index e6fb4d24ff..6baae9c541 100644 --- a/apache-avro/pom.xml +++ b/apache-avro/pom.xml @@ -14,12 +14,6 @@ - - junit - junit - ${junit.version} - test - org.slf4j slf4j-simple @@ -46,15 +40,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - ${compiler-plugin.version} - - ${java.version} - ${java.version} - - org.apache.avro avro-maven-plugin @@ -79,8 +64,6 @@ - UTF-8 - 3.5 1.8.2 1.7.25 diff --git a/apache-bval/README.md b/apache-bval/README.md index 80ea149993..e856810378 100644 --- a/apache-bval/README.md +++ b/apache-bval/README.md @@ -1,2 +1,7 @@ +## Apache BVal + +This module contains articles about Apache BVal + ### Relevant Articles: -- [Intro to Apache BVal](http://www.baeldung.com/apache-bval) + +- [Intro to Apache BVal](https://www.baeldung.com/apache-bval) diff --git a/apache-curator/README.md b/apache-curator/README.md index 9bda573292..4fef6a138e 100644 --- a/apache-curator/README.md +++ b/apache-curator/README.md @@ -1,3 +1,7 @@ +## Apache Curator + +This module contains articles about Apache Curator + ### Relevant Articles: -- [Introduction to Apache Curator](http://www.baeldung.com/apache-curator) +- [Introduction to Apache Curator](https://www.baeldung.com/apache-curator) diff --git a/apache-cxf/README.md b/apache-cxf/README.md index d03999dce3..f825b85bb3 100644 --- a/apache-cxf/README.md +++ b/apache-cxf/README.md @@ -1,6 +1,10 @@ +## Apache CXF + +This module contains articles about Apache CXF + ## Relevant Articles: -- [Introduction to Apache CXF Aegis Data Binding](http://www.baeldung.com/aegis-data-binding-in-apache-cxf) -- [Apache CXF Support for RESTful Web Services](http://www.baeldung.com/apache-cxf-rest-api) -- [A Guide to Apache CXF with Spring](http://www.baeldung.com/apache-cxf-with-spring) -- [Introduction to Apache CXF](http://www.baeldung.com/introduction-to-apache-cxf) +- [Introduction to Apache CXF Aegis Data Binding](https://www.baeldung.com/aegis-data-binding-in-apache-cxf) +- [Apache CXF Support for RESTful Web Services](https://www.baeldung.com/apache-cxf-rest-api) +- [A Guide to Apache CXF with Spring](https://www.baeldung.com/apache-cxf-with-spring) +- [Introduction to Apache CXF](https://www.baeldung.com/introduction-to-apache-cxf) - [Server-Sent Events (SSE) In JAX-RS](https://www.baeldung.com/java-ee-jax-rs-sse) diff --git a/apache-fop/README.md b/apache-fop/README.md index 1e734a5f36..2adc593026 100644 --- a/apache-fop/README.md +++ b/apache-fop/README.md @@ -1,5 +1,5 @@ -========= +## Apache FOP -## Core Java Cookbooks and Examples +This module contains articles about Apache FOP ### Relevant Articles: diff --git a/apache-fop/pom.xml b/apache-fop/pom.xml index 879eb4f111..150756d51d 100644 --- a/apache-fop/pom.xml +++ b/apache-fop/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung apache-fop 0.1-SNAPSHOT apache-fop diff --git a/apache-fop/src/test/resources/input.xml b/apache-fop/src/test/resources/input.xml deleted file mode 100644 index a8266f3f5c..0000000000 --- a/apache-fop/src/test/resources/input.xml +++ /dev/null @@ -1,1674 +0,0 @@ - -
- - Bootstrap a Web Application with Spring 4 - - - - - - Return to Content - - - - - - Contents - - - Table of Contents - - - 1. Overview - - - 2. The Maven pom.xml - - - 3. The Java based Web Configuration - - - 4. Conclusion - - - If you're new here, you may want to get my "REST APIs with Spring" eBook. Thanks for visiting! - - - -
- <anchor xml:id="Table_of_Contents"/><emphasis role="bold">Table of Contents</emphasis> - - - 1. Overview - - - 2. The Maven pom.xml - - -     2.1. Justification of the cglib dependency - - -     2.2. The cglib dependency in Spring 3.2 and beyond - - - 3. The Java based web configuration - - -    3.1. The web.xml - - - 4. Conclusion - - -
- <anchor xml:id="dbdoclet.1_Overview"/><emphasis role="bold">1. Overview</emphasis> - The tutorial illustrates how to Bootstrap a Web Application with Spring and also discusses how to make the jump from XML to Java without having to completely migrate the entire XML configuration. -
-
- <anchor xml:id="dbdoclet.2_The_Maven_pomxml"/><emphasis role="bold">2. The Maven pom.xml</emphasis> - <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> - <groupId>org</groupId> - <artifactId>rest</artifactId> - <version>0.0.1-SNAPSHOT</version> - <packaging>war</packaging> - - <dependencies> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <artifactId>commons-logging</artifactId> - <groupId>commons-logging</groupId> - </exclusion> - </exclusions> - </dependency> - - </dependencies> - - <build> - <finalName>rest</finalName> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.1</version> - <configuration> - <source>1.6</source> - <target>1.6</target> - <encoding>UTF-8</encoding> - </configuration> - </plugin> - </plugins> - </build> - - <properties> - <spring.version>4.0.5.RELEASE</spring.version> - </properties> - -</project> -
- <emphasis role="bold">2.1. The cglib dependency before Spring 3.2</emphasis> - You may wonder why cglib is a dependency – it turns out there is a valid reason to include it – the entire configuration cannot function without it. If removed, Spring will throw: - Caused by: java.lang.IllegalStateException: CGLIB is required to process @Configuration classes. Either add CGLIB to the classpath or remove the following @Configuration bean definitions - The reason this happens is explained by the way Spring deals with @Configuration classes. These classes are effectively beans, and because of this they need to be aware of the Context, and respect scope and other bean semantics. This is achieved by dynamically creating a cglib proxy with this awareness for each @Configuration class, hence the cglib dependency. - Also, because of this, there are a few restrictions for Configuration annotated classes: - - - Configuration classes should not be final - - - They should have a constructor with no arguments - - -
-
- <emphasis role="bold">2.2. The cglib dependency in Spring 3.2 and beyond</emphasis> - Starting with Spring 3.2, it is no longer necessary to add cglib as an explicit dependency. This is because Spring is in now inlining cglib – which will ensure that all class based proxying functionality will work out of the box with Spring 3.2. - The new cglib code is placed under the Spring package: org.springframework.cglib (replacing the original net.sf.cglib). The reason for the package change is to avoid conflicts with any cglib versions already existing on the classpath. - Also, the new cglib 3.0 is now used, upgraded from the older 2.2 dependency (see this JIRA issue for more details). - Finally, now that Spring 4.0 is out in the wild, changes like this one (removing the cglib dependency) are to be expected with Java 8 just around the corner – you can watch this Spring Jira to keep track of the Spring support, and the Java 8 Resources page to keep tabs on the that. -
-
-
- <anchor xml:id="dbdoclet.3_The_Java_based_Web_Configuration"/><emphasis role="bold">3. The Java based Web Configuration</emphasis> - @Configuration -@ImportResource( { "classpath*:/rest_config.xml" } ) -@ComponentScan( basePackages = "org.rest" ) -@PropertySource({ "classpath:rest.properties", "classpath:web.properties" }) -public class AppConfig{ - - @Bean -   public static PropertySourcesPlaceholderConfigurer properties() { -   return new PropertySourcesPlaceholderConfigurer(); -   } -} - First, the @Configuration annotation – this is the main artifact used by the Java based Spring configuration; it is itself meta-annotated with @Component, which makes the annotated classes standard beans and as such, also candidates for component scanning. The main purpose of @Configuration classes is to be sources of bean definitions for the Spring IoC Container. For a more detailed description, see the official docs. - Then, @ImportResource is used to import the existing XML based Spring configuration. This may be configuration which is still being migrated from XML to Java, or simply legacy configuration that you wish to keep. Either way, importing it into the Container is essential for a successful migration, allowing small steps without to much risk. The equivalent XML annotation that is replaced is: - <import resource=”classpath*:/rest_config.xml” /> - Moving on to @ComponentScan – this configures the component scanning directive, effectively replacing the XML: - <context:component-scan base-package="org.rest" /> - As of Spring 3.1, the @Configuration are excluded from classpath scanning by default – see this JIRA issue. Before Spring 3.1 though, these classes should have been excluded explicitly: - excludeFilters = { @ComponentScan.Filter( Configuration.class ) } - The @Configuration classes should not be autodiscovered because they are already specified and used by the Container – allowing them to be rediscovered and introduced into the Spring context will result in the following error: - Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name ‘webConfig’ for bean class [org.rest.spring.AppConfig] conflicts with existing, non-compatible bean definition of same name and class [org.rest.spring.AppConfig] - And finally, using the @Bean annotation to configure the properties support – PropertySourcesPlaceholderConfigurer is initialized in a @Bean annotated method, indicating it will produce a Spring bean managed by the Container. This new configuration has replaced the following XML: - <context:property-placeholder -location="classpath:persistence.properties, classpath:web.properties" -ignore-unresolvable="true"/> - For a more in depth discussion on why it was necessary to manually register the PropertySourcesPlaceholderConfigurer bean, see the Properties with Spring Tutorial. -
- <emphasis role="bold">3.1. The web.xml</emphasis> - <?xml version="1.0" encoding="UTF-8"?> -<web-app xmlns=" - http://java.sun.com/xml/ns/javaee" -     xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" -     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -    xsi:schemaLocation=" - http://java.sun.com/xml/ns/javaee - http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" -    id="rest" version="3.0"> - - <context-param> - <param-name>contextClass</param-name> - <param-value> - org.springframework.web.context.support.AnnotationConfigWebApplicationContext - </param-value> - </context-param> - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value>org.rest.spring.root</param-value> - </context-param> - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - - <servlet> - <servlet-name>rest</servlet-name> - <servlet-class> - org.springframework.web.servlet.DispatcherServlet - </servlet-class> - <init-param> - <param-name>contextClass</param-name> - <param-value> - org.springframework.web.context.support.AnnotationConfigWebApplicationContext - </param-value> - </init-param> - <init-param> - <param-name>contextConfigLocation</param-name> - <param-value>org.rest.spring.rest</param-value> - </init-param> - <load-on-startup>1</load-on-startup> - </servlet> - <servlet-mapping> - <servlet-name>rest</servlet-name> - <url-pattern>/api/*</url-pattern> - </servlet-mapping> - - <welcome-file-list> - <welcome-file /> - </welcome-file-list> - -</web-app> - First, the root context is defined and configured to use AnnotationConfigWebApplicationContext instead of the default XmlWebApplicationContext. The newer AnnotationConfigWebApplicationContext accepts @Configuration annotated classes as input for the Container configuration and is needed in order to set up the Java based context. Unlike XmlWebApplicationContext, it assumes no default configuration class locations, so the “contextConfigLocation”init-param for the Servlet must be set. This will point to the java package where the @Configuration classes are located; the fully qualified name(s) of the classes are also supported. - Next, the DispatcherServlet is configured to use the same kind of context, with the only difference that it’s loading configuration classes out of a different package. - Other than this, the web.xml doesn’t really change from a XML to a Java based configuration. -
-
-
- <anchor xml:id="dbdoclet.4_Conclusion"/><emphasis role="bold">4. Conclusion</emphasis> - The presented approach allows for a smooth migration of the Spring configuration from XML to Java, mixing the old and the new. This is important for older projects, which may have a lot of XML based configuration that cannot be migrated all at once. - This way, in a migration, the XML beans can be ported in small increments. - In the next article on REST with Spring, I cover setting up MVC in the project, configuration of the HTTP status codes, payload marshalling and content negotiation. - The implementation of this Bootstrap a Spring Web App Tutorial can be downloaded as a working sample project. - This is an Eclipse based project, so it should be easy to import and run as it is. - -   - - - - - - - - - java, Spring - - - - - - - - - - - © 2014 Baeldung. All Rights Reserved. - - - - - - - -
-
-
- -
- - Build a REST API with Spring 4 and Java Config - - - - - - Return to Content - - - - - - Contents - - - Table of Contents - - - 1. Overview - - - 2. Understanding REST in Spring - - - 3. The Java configuration - - - 4. Testing the Spring context - - - 5. The Controller - - - 6. Mapping the HTTP response codes - - - 7. Additional Maven dependencies - - - 8. Conclusion - - - If you're new here, you may want to get my "REST APIs with Spring" eBook. Thanks for visiting! - - -   - -
- <anchor xml:id="Table_of_Contents"/><emphasis role="bold">Table of Contents</emphasis> - - - 1. Overview - - - 2. Understanding REST in Spring - - - 3. The Java configuration - - - 4. Testing the Spring context - - - 5. The Controller - - - 6. Mapping the HTTP response codes - - -     6.1. Unmapped requests - - -     6.2. Valid, mapped requests - - -     6.3. Client error - - -     6.4. Using @ExceptionHandler - - - 7. Additional Maven dependencies - - - 8. Conclusion - - -
- <anchor xml:id="dbdoclet.1_Overview"/><emphasis role="bold">1. Overview</emphasis> - This article shows how to set up REST in Spring – the Controller and HTTP response codes, configuration of payload marshalling and content negotiation. -
-
- <anchor xml:id="dbdoclet.2_Understanding_REST_in_Spring"/><emphasis role="bold">2. Understanding REST in Spring</emphasis> - The Spring framework supports 2 ways of creating RESTful services: - - - using MVC with ModelAndView - - - using HTTP message converters - - - The ModelAndView approach is older and much better documented, but also more verbose and configuration heavy. It tries to shoehorn the REST paradigm into the old model, which is not without problems. The Spring team understood this and provided first-class REST support starting with Spring 3.0. - The new approach, based on HttpMessageConverterand annotations, is much more lightweight and easy to implement. Configuration is minimal and it provides sensible defaults for what you would expect from a RESTful service. It is however newer and a a bit on the light side concerning documentation; what’s , the reference doesn’t go out of it’s way to make the distinction and the tradeoffs between the two approaches as clear as they should be. Nevertheless, this is the way RESTful services should be build after Spring 3.0. -
-
- <anchor xml:id="dbdoclet.3_The_Java_configuration"/><emphasis role="bold">3. The Java configuration</emphasis> - - @Configuration -@EnableWebMvc -public class WebConfig{ - // -} - The new @EnableWebMvc annotation does a number of useful things – specifically, in the case of REST, it detect the existence of Jackson and JAXB 2 on the classpath and automatically creates and registers default JSON and XML converters. The functionality of the annotation is equivalent to the XML version: - <mvc:annotation-driven /> - This is a shortcut, and though it may be useful in many situations, it’s not perfect. When more complex configuration is needed, remove the annotation and extend WebMvcConfigurationSupport directly. -
-
- <anchor xml:id="dbdoclet.4_Testing_the_Spring_context"/><emphasis role="bold">4. Testing the Spring context</emphasis> - Starting with Spring 3.1, we get first-class testing support for @Configuration classes: - @RunWith( SpringJUnit4ClassRunner.class ) -@ContextConfiguration( classes = { ApplicationConfig.class, PersistenceConfig.class }, - loader = AnnotationConfigContextLoader.class ) -public class SpringTest{ - - @Test - public void whenSpringContextIsInstantiated_thenNoExceptions(){ - // When - } -} - The Java configuration classes are simply specified with the @ContextConfiguration annotation and the new AnnotationConfigContextLoader loads the bean definitions from the @Configuration classes. - Notice that the WebConfig configuration class was not included in the test because it needs to run in a Servlet context, which is not provided. -
-
- <anchor xml:id="dbdoclet.5_The_Controller"/><emphasis role="bold">5. The Controller</emphasis> - The @Controller is the central artifact in the entire Web Tier of the RESTful API. For the purpose of this post, the controller is modeling a simple REST resource – Foo: - @Controller -@RequestMapping( value = "/foos" ) -class FooController{ - - @Autowired - IFooService service; - - @RequestMapping( method = RequestMethod.GET ) - @ResponseBody - public List< Foo > findAll(){ - return service.findAll(); - } - - @RequestMapping( value = "/{id}", method = RequestMethod.GET ) - @ResponseBody - public Foo findOne( @PathVariable( "id" ) Long id ){ - return RestPreconditions.checkFound( service.findOne( id ) ); - } - - @RequestMapping( method = RequestMethod.POST ) - @ResponseStatus( HttpStatus.CREATED ) - @ResponseBody - public Long create( @RequestBody Foo resource ){ - Preconditions.checkNotNull( resource ); - return service.create( resource ); - } - - @RequestMapping( value = "/{id}", method = RequestMethod.PUT ) - @ResponseStatus( HttpStatus.OK ) - public void update( @PathVariable( "id" ) Long id, @RequestBody Foo resource ){ - Preconditions.checkNotNull( resource ); - RestPreconditions.checkNotNull( service.getById( resource.getId() ) ); - service.update( resource ); - } - - @RequestMapping( value = "/{id}", method = RequestMethod.DELETE ) - @ResponseStatus( HttpStatus.OK ) - public void delete( @PathVariable( "id" ) Long id ){ - service.deleteById( id ); - } - -} - You may have noticed I’m using a very simple, guava style RestPreconditions utility: - public class RestPreconditions { - public static <T> T checkFound(final T resource) { - if (resource == null) { - throw new MyResourceNotFoundException(); - } - return resource; - } -} - The Controller implementation is non-public – this is because it doesn’t need to be. Usually the controller is the last in the chain of dependencies – it receives HTTP requests from the Spring front controller (the DispathcerServlet) and simply delegate them forward to a service layer. If there is no use case where the controller has to be injected or manipulated through a direct reference, then I prefer not to declare it as public. - The request mappings are straightforward – as with any controller, the actual value of the mapping as well as the HTTP method are used to determine the target method for the request. @RequestBody will bind the parameters of the method to the body of the HTTP request, whereas @ResponseBody does the same for the response and return type. They also ensure that the resource will be marshalled and unmarshalled using the correct HTTP converter. Content negotiation will take place to choose which one of the active converters will be used, based mostly on the Accept header, although other HTTP headers may be used to determine the representation as well. -
-
- <anchor xml:id="dbdoclet.6_Mapping_the_HTTP_response_codes"/><emphasis role="bold">6. Mapping the HTTP response codes</emphasis> - The status codes of the HTTP response are one of the most important parts of the REST service, and the subject can quickly become very complex. Getting these right can be what makes or breaks the service. -
- <emphasis role="bold">6.1. Unmapped requests</emphasis> - If Spring MVC receives a request which doesn’t have a mapping, it considers the request not to be allowed and returns a 405 METHOD NOT ALLOWED back to the client. It is also good practice to include the Allow HTTP header when returning a 405 to the client, in order to specify which operations are allowed. This is the standard behavior of Spring MVC and does not require any additional configuration. -
-
- <emphasis role="bold">6.2. Valid, mapped requests</emphasis> - For any request that does have a mapping, Spring MVC considers the request valid and responds with 200 OK if no other status code is specified otherwise. It is because of this that controller declares different @ResponseStatus for the create, update and delete actions but not for get, which should indeed return the default 200 OK. -
-
- <emphasis role="bold">6.3. Client error</emphasis> - In case of a client error, custom exceptions are defined and mapped to the appropriate error codes. Simply throwing these exceptions from any of the layers of the web tier will ensure Spring maps the corresponding status code on the HTTP response. - @ResponseStatus( value = HttpStatus.BAD_REQUEST ) -public class BadRequestException extends RuntimeException{ - // -} -@ResponseStatus( value = HttpStatus.NOT_FOUND ) -public class ResourceNotFoundException extends RuntimeException{ - // -} - These exceptions are part of the REST API and, as such, should only be used in the appropriate layers corresponding to REST; if for instance a DAO/DAL layer exist, it should not use the exceptions directly. Note also that these are not checked exceptions but runtime exceptions – in line with Spring practices and idioms. -
-
- <emphasis role="bold">6.4. Using @ExceptionHandler</emphasis> - Another option to map custom exceptions on specific status codes is to use the @ExceptionHandler annotation in the controller. The problem with that approach is that the annotation only applies to the controller in which it is defined, not to the entire Spring Container, which means that it needs to be declared in each controller individually. This quickly becomes cumbersome, especially in more complex applications which many controllers. There are a few JIRA issues opened with Spring at this time to handle this and other related limitations: SPR-8124, SPR-7278, SPR-8406. -
-
-
- <anchor xml:id="dbdoclet.7_Additional_Maven_dependencies"/><emphasis role="bold">7. Additional Maven dependencies</emphasis><emphasis role="bold"></emphasis> - In addition to the spring-webmvc dependency required for the standard web application, we’ll need to set up content marshalling and unmarshalling for the REST API: - <dependencies> - <dependency> -   <groupId>com.fasterxml.jackson.core</groupId> -    <artifactId>jackson-databind</artifactId> -   <version>${jackson.version}</version> - </dependency> - <dependency> - <groupId>javax.xml.bind</groupId> - <artifactId>jaxb-api</artifactId> - <version>${jaxb-api.version}</version> - <scope>runtime</scope> - </dependency> -</dependencies> - -<properties> - <jackson.version>2.4.0</jackson.version> - <jaxb-api.version>2.2.11</jaxb-api.version> -</properties> - These are the libraries used to convert the representation of the REST resource to either JSON or XML. -
-
- <anchor xml:id="dbdoclet.8_Conclusion"/><emphasis role="bold">8. Conclusion</emphasis> - This tutorial illustrated how to implement and configure a REST Service using Spring 4 and Java based configuration, discussing HTTP response codes, basic Content Negotiation and marshaling. - In the next articles of the series I will focus on Discoverability of the API, advanced content negotiation and working with additional representations of a Resource. - The implementation of this Spring REST API Tutorial can be downloaded as a working sample project. - This is an Eclipse based project, so it should be easy to import and run as it is. - - - - - - - - - - java, REST, Spring, testing - - - - - - - - - - - © 2014 Baeldung. All Rights Reserved. - - - - - - - - - -
-
-
- -
- - Spring Security for a REST API - - - - - - Return to Content - - - - - - Contents - - - Table of Contents - - - 1. Overview - - - 2. Spring Security in the web.xml - - - 3. The Security Configuration - - - 4. Maven and other trouble - - - 5. Conclusion - - - - - -
- <anchor xml:id="Table_of_Contents"/><emphasis role="bold">Table of Contents</emphasis> - - - 1. Overview - - - 2. Introducing Spring Security in the web.xml - - - 3. The Security Configuration - - -     3.1. The basics - - -     3.2. The Entry Point - - -     3.3. The Login - - -     3.4. Authentication should return 200 instead of 301 - - -     3.5. Failed Authentication should return 401 instead of 302 - - -     3.6. The Authentication Manager and Provider - - -     3.7. Finally – Authentication against the running REST Service - - - 4. Maven and other trouble - - - 5. Conclusion - - -
- <anchor xml:id="dbdoclet.1_Overview"/><emphasis role="bold">1. Overview</emphasis> - This tutorial shows how to Secure a REST Service using Spring and Spring Security 3.1 with Java based configuration. The article will focus on how to set up the Security Configuration specifically for the REST API using a Login and Cookie approach. -
-
- <anchor xml:id="dbdoclet.2_Spring_Security_in_the_webxml"/><emphasis role="bold">2. Spring Security in the web.xml</emphasis> - The architecture of Spring Security is based entirely on Servlet Filters and, as such, comes before Spring MVC in regards to the processing of HTTP requests. Keeping this in mind, to begin with, a filter needs to be declared in the web.xml of the application: - <filter> - <filter-name>springSecurityFilterChain</filter-name> - <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> -</filter> -<filter-mapping> - <filter-name>springSecurityFilterChain</filter-name> - <url-pattern>/*</url-pattern> -</filter-mapping> - The filter must necessarily be named ‘springSecurityFilterChain’  to match the default bean created by Spring Security in the container. - Note that the defined filter is not the actual class implementing the security logic but a DelegatingFilterProxy with the purpose of delegating the Filter’s methods to an internal bean. This is done so that the target bean can still benefit from the Spring context lifecycle and flexibility. - The URL pattern used to configure the Filter is /* even though the entire web service is mapped to /api/* so that the security configuration has the option to secure other possible mappings as well, if required. -
-
- <anchor xml:id="dbdoclet.3_The_Security_Configuration"/><emphasis role="bold">3. The Security Configuration</emphasis> - <?xml version="1.0" encoding="UTF-8"?> -<beans:beans - xmlns="http://www.springframework.org/schema/security" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:beans="http://www.springframework.org/schema/beans" - xmlns:sec="http://www.springframework.org/schema/security" - xsi:schemaLocation=" - http://www.springframework.org/schema/security - http://www.springframework.org/schema/security/spring-security-3.2.xsd - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"> - - <http entry-point-ref="restAuthenticationEntryPoint"> - <intercept-url pattern="/api/admin/**" access="ROLE_ADMIN"/> - - <form-login - authentication-success-handler-ref="mySuccessHandler" - authentication-failure-handler-ref="myFailureHandler" - /> - - <logout /> - </http> - - <beans:bean id="mySuccessHandler" - class="org.rest.security.MySavedRequestAwareAuthenticationSuccessHandler"/> - <beans:bean id="myFailureHandler" - class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler"/> - - <authentication-manager alias="authenticationManager"> - <authentication-provider> - <user-service> - <user name="temporary" password="temporary" authorities="ROLE_ADMIN"/> - <user name="user" password="user" authorities="ROLE_USER"/> - </user-service> - </authentication-provider> - </authentication-manager> - -</beans:beans> - Most of the configuration is done using the security namespace – for this to be enabled, the schema locations must be defined and pointed to the correct 3.1 or 3.2 XSD versions. The namespace is designed so that it expresses the common uses of Spring Security while still providing hooks raw beans to accommodate more advanced scenarios. >> Signup for my upcoming Video Course on Building a REST API with Spring 4 -
- <emphasis role="bold">3.1. The <http> element</emphasis> - The <http> element is the main container element for HTTP security configuration. In the current implementation, it only secured a single mapping: /api/admin/**. Note that the mapping is relative to the root context of the web application, not to the rest Servlet; this is because the entire security configuration lives in the root Spring context and not in the child context of the Servlet. -
-
- <emphasis role="bold">3.2. The Entry Point</emphasis> - In a standard web application, the authentication process may be automatically triggered when the client tries to access a secured resource without being authenticated – this is usually done by redirecting to a login page so that the user can enter credentials. However, for a REST Web Service this behavior doesn’t make much sense – Authentication should only be done by a request to the correct URI and all other requests should simply fail with a 401 UNAUTHORIZED status code if the user is not authenticated. - Spring Security handles this automatic triggering of the authentication process with the concept of an Entry Point – this is a required part of the configuration, and can be injected via the entry-point-ref attribute of the <http> element. Keeping in mind that this functionality doesn’t make sense in the context of the REST Service, the new custom entry point is defined to simply return 401 whenever it is triggered: - @Component( "restAuthenticationEntryPoint" ) -public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint{ - - @Override - public void commence( HttpServletRequest request, HttpServletResponse response, - AuthenticationException authException ) throws IOException{ - response.sendError( HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized" ); - } -} - A quick sidenote here is that the 401 is sent without the WWW-Authenticate header, as required by the HTTP Spec – we can of course set the value manually if we need to. -
-
- <emphasis role="bold">3.3. The Login Form for REST</emphasis> - There are multiple ways to do Authentication for a REST API – one of the default Spring Security provides is Form Login – which uses an authentication processing filter – org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter. - The <form-login> element will create this filter and will also allow us to set our custom authentication success handler on it. This can also be done manually by using the <custom-filter> element to register a filter at the position FORM_LOGIN_FILTER – but the namespace support is flexible enough. - Note that for a standard web application, the auto-config attribute of the <http> element is shorthand syntax for some useful security configuration. While this may be appropriate for some very simple configurations, it doesn’t fit and should not be used for a REST API. -
-
- <emphasis role="bold">3.4. Authentication should return 200 instead of 301</emphasis> - By default, form login will answer a successful authentication request with a 301 MOVED PERMANENTLY status code; this makes sense in the context of an actual login form which needs to redirect after login. For a RESTful web service however, the desired response for a successful authentication should be 200 OK. - This is done by injecting a custom authentication success handler in the form login filter, to replace the default one. The new handler implements the exact same login as the default org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler with one notable difference – the redirect logic is removed: - public class MySavedRequestAwareAuthenticationSuccessHandler - extends SimpleUrlAuthenticationSuccessHandler { - - private RequestCache requestCache = new HttpSessionRequestCache(); - - @Override - public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, - Authentication authentication) throws ServletException, IOException { - SavedRequest savedRequest = requestCache.getRequest(request, response); - - if (savedRequest == null) { - clearAuthenticationAttributes(request); - return; - } - String targetUrlParam = getTargetUrlParameter(); - if (isAlwaysUseDefaultTargetUrl() || - (targetUrlParam != null && - StringUtils.hasText(request.getParameter(targetUrlParam)))) { - requestCache.removeRequest(request, response); - clearAuthenticationAttributes(request); - return; - } - - clearAuthenticationAttributes(request); - } - - public void setRequestCache(RequestCache requestCache) { - this.requestCache = requestCache; - } -} -
-
- <emphasis role="bold">3.5. Failed Authentication should return 401 instead of 302</emphasis> - Similarly – we configured the authentication failure handler – same way we did with the success handler. - Luckily – in this case, we don’t need to actually define a new class for this handler – the standard implementation – SimpleUrlAuthenticationFailureHandler – does just fine. - The only difference is that – now that we’re defining this explicitly in our XML config – it’s not going to get a default defaultFailureUrl from Spring – and so it won’t redirect. -
-
- <emphasis role="bold">3.6. The Authentication Manager and Provider</emphasis> - The authentication process uses an in-memory provider to perform authentication – this is meant to simplify the configuration as a production implementation of these artifacts is outside the scope of this post. -
-
- <emphasis role="bold">3.7 Finally – Authentication against the running REST Service</emphasis> - Now let’s see how we can authenticate against the REST API – the URL for login is /j_spring_security_check – and a simple curl command performing login would be: - curl -i -X POST -d j_username=user -d j_password=userPass -http://localhost:8080/spring-security-rest/j_spring_security_check - This request will return the Cookie which will then be used by any subsequent request against the REST Service. - We can use curl to authentication and store the cookie it receives in a file: - curl -i -X POST -d j_username=user -d j_password=userPass -c /opt/cookies.txt -http://localhost:8080/spring-security-rest/j_spring_security_check - Then we can use the cookie from the file to do further authenticated requests: - curl -i --header "Accept:application/json" -X GET -b /opt/cookies.txt -http://localhost:8080/spring-security-rest/api/foos - This authenticated request will correctly result in a 200 OK: - HTTP/1.1 200 OK -Server: Apache-Coyote/1.1 -Content-Type: application/json;charset=UTF-8 -Transfer-Encoding: chunked -Date: Wed, 24 Jul 2013 20:31:13 GMT - -[{"id":0,"name":"JbidXc"}] -
-
-
- <anchor xml:id="dbdoclet.4_Maven_and_other_trouble"/><emphasis role="bold">4. Maven and other trouble</emphasis> - The Spring core dependencies necessary for a web application and for the REST Service have been discussed in detail. For security, we’ll need to add: spring-security-web and spring-security-config – all of these have also been covered in the Maven for Spring Security tutorial. - It’s worth paying close attention to the way Maven will resolve the older Spring dependencies – the resolution strategy will start causing problems once the security artifacts are added to the pom. To address this problem, some of the core dependencies will need to be overridden in order to keep them at the right version. -
-
- <anchor xml:id="dbdoclet.5_Conclusion"/><emphasis role="bold">5. Conclusion</emphasis> - This post covered the basic security configuration and implementation for a RESTful Service using Spring Security 3.1, discussing the web.xml, the security configuration, the HTTP status codes for the authentication process and the Maven resolution of the security artifacts. - The implementation of this Spring Security REST Tutorial can be downloaded as a working sample project.This is an Eclipse based project, so it should be easy to import and run as it is. - - - - - - - - - - REST, security, Spring - - - - - - - - - - - © 2014 Baeldung. All Rights Reserved. - - - - - - - - - -
-
-
- -
- - Spring Security Basic Authentication - - - - - - Return to Content - - - - - - Contents - - - 1. Overview - - - 2. The Spring Security Configuration - - - 3. Consuming The Secured Application - - - 4. Further Configuration – The Entry Point - - - 5. The Maven Dependencies - - - 6. Conclusion - - - If you're new here, you may want to get my "REST APIs with Spring" eBook. Thanks for visiting! - - - -
- <anchor xml:id="dbdoclet.1_Overview"/><emphasis role="bold">1. Overview</emphasis> - This tutorial shows how to set up, configure and customize Basic Authentication with Spring. We’re going to built on top of the simple Spring MVC example, and secure the UI of the MVC application with the Basic Auth mechanism provided by Spring Security. -
- <anchor xml:id="dbdoclet.2_The_Spring_Security_Configuration"/><emphasis role="bold">2. The Spring Security Configuration</emphasis> - The Configuration for Spring Security is still XML: - <?xml version="1.0" encoding="UTF-8"?> -<beans:beans xmlns="http://www.springframework.org/schema/security" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:beans="http://www.springframework.org/schema/beans" - xsi:schemaLocation=" - http://www.springframework.org/schema/security - http://www.springframework.org/schema/security/spring-security-3.1.xsd - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"> - - <http use-expressions="true"> - <intercept-url pattern="/**" access="isAuthenticated()" /> - - <http-basic /> - </http> - - <authentication-manager> - <authentication-provider> - <user-service> - <user name="user1" password="user1Pass" authorities="ROLE_USER" /> - </user-service> - </authentication-provider> - </authentication-manager> - -</beans:beans> - This is one of the last pieces of configuration in Spring that still need XML – Java Configuration for Spring Security is still a work in progress. - What is relevant here is the <http-basic> element inside the main <http> element of the configuration – this is enough to enable Basic Authentication for the entire application. The Authentication Manager is not the focus of this tutorial, so we are using an in memory manager with the user and password defined in plaintext. - The web.xml of the web application enabling Spring Security has already been discussed in the Spring Logout tutorial. -
-
- <anchor xml:id="dbdoclet.3_Consuming_The_Secured_Application"/><emphasis role="bold">3. Consuming The Secured Application</emphasis> - The curl command is our go to tool for consuming the secured application. - First, let’s try to request the /homepage.html without providing any security credentials: - curl -i http://localhost:8080/spring-security-mvc-basic-auth/homepage.html - We get back the expected 401 Unauthorized and the Authentication Challenge: - HTTP/1.1 401 Unauthorized -Server: Apache-Coyote/1.1 -Set-Cookie: JSESSIONID=E5A8D3C16B65A0A007CFAACAEEE6916B; Path=/spring-security-mvc-basic-auth/; HttpOnly -WWW-Authenticate: Basic realm="Spring Security Application" -Content-Type: text/html;charset=utf-8 -Content-Length: 1061 -Date: Wed, 29 May 2013 15:14:08 GMT - The browser would interpret this challenge and prompt us for credentials with a simple dialog, but since we’re using curl, this isn’t the case. - Now, let’s request the same resource – the homepage – but provide the credentials to access it as well: - curl -i --user user1:user1Pass http://localhost:8080/spring-security-mvc-basic-auth/homepage.html - Now, the response from the server is 200 OK along with a Cookie: - HTTP/1.1 200 OK -Server: Apache-Coyote/1.1 -Set-Cookie: JSESSIONID=301225C7AE7C74B0892887389996785D; Path=/spring-security-mvc-basic-auth/; HttpOnly -Content-Type: text/html;charset=ISO-8859-1 -Content-Language: en-US -Content-Length: 90 -Date: Wed, 29 May 2013 15:19:38 GMT - From the browser, the application can be consumed normally – the only difference is that a login page is no longer a hard requirement since all browsers support Basic Authentication and use a dialog to prompt the user for credentials. -
-
- <anchor xml:id="dbdoclet.4_Further_Configuration_8211_The_Entry_Point"/><emphasis role="bold">4. Further Configuration – </emphasis><emphasis role="bold">The Entry Point</emphasis> - By default, the BasicAuthenticationEntryPoint provisioned by Spring Security returns a full html page for a 401 Unauthorized response back to the client. This html representation of the error renders well in a browser, but it not well suited for other scenarios, such as a REST API where a json representation may be preferred. - The namespace is flexible enough for this new requirement as well – to address this – the entry point can be overridden: - <http-basic entry-point-ref="myBasicAuthenticationEntryPoint" /> - The new entry point is defined as a standard bean: - @Component -public class MyBasicAuthenticationEntryPoint extends BasicAuthenticationEntryPoint { - - @Override - public void commence - (HttpServletRequest request, HttpServletResponse response, AuthenticationException authEx) - throws IOException, ServletException { - response.addHeader("WWW-Authenticate", "Basic realm=\"" + getRealmName() + "\""); - response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); - PrintWriter writer = response.getWriter(); - writer.println("HTTP Status 401 - " + authEx.getMessage()); - } - - @Override - public void afterPropertiesSet() throws Exception { - setRealmName("Baeldung"); - super.afterPropertiesSet(); - } -} - By writing directly to the HTTP Response we now have full control over the format of the response body. -
-
- <anchor xml:id="dbdoclet.5_The_Maven_Dependencies"/><emphasis role="bold">5. The Maven Dependencies</emphasis> - The Maven dependencies for Spring Security have been discussed before in the Spring Security with Maven article – we will need both spring-security-web and spring-security-config available at runtime. -
-
- <anchor xml:id="dbdoclet.6_Conclusion"/><emphasis role="bold">6. Conclusion</emphasis> - In this example we secured an MVC application with Spring Security and Basic Authentication. We discussed the XML configuration and we consumed the application with simple curl commands. Finally took control of the exact error message format – moving from the standard HTML error page to a custom text or json format. - The implementation of this Spring tutorial can be found in the github project – this is an Eclipse based project, so it should be easy to import and run as it is. When the project runs locally, the sample html can be accessed at: - http://localhost:8080/spring-security-mvc-basic-auth/homepage.html - - - - - - - - - - security, Spring - - - - - - - - - - - © 2014 Baeldung. All Rights Reserved. - - - - - - - -
-
-
- -
- - Spring Security Digest Authentication - - - - - - Return to Content - - - - - - Contents - - - 1. Overview - - - 2. The Security XML Configuration - - - 3. Consuming the Secured Application - - - 4. The Maven Dependencies - - - 5. Conclusion - - - If you're new here, you may want to get my "REST APIs with Spring" eBook. Thanks for visiting! - - - -
- <anchor xml:id="dbdoclet.1_Overview"/><emphasis role="bold">1. Overview</emphasis> - This tutorial shows how to set up, configure and customize Digest Authentication with Spring. Similar to the previous article covering Basic Authentication, we’re going to built on top of the Spring MVC tutorial, and secure the application with the Digest Auth mechanism provided by Spring Security. -
- <anchor xml:id="dbdoclet.2_The_Security_XML_Configuration"/><emphasis role="bold">2. The Security XML Configuration</emphasis> - First thing to understand about the configuration is that, while Spring Security does have full out of the box support for the Digest authentication mechanism, this support is not as well integrated into the namespace as Basic Authentication was. - In this case, we need to manually define the raw beans that are going to make up the security configuration – the DigestAuthenticationFilter and the DigestAuthenticationEntryPoint: - <?xml version="1.0" encoding="UTF-8"?> -<beans:beans xmlns="http://www.springframework.org/schema/security" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:beans="http://www.springframework.org/schema/beans" - xsi:schemaLocation=" - http://www.springframework.org/schema/security - http://www.springframework.org/schema/security/spring-security-3.1.xsd - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"> - -    <beans:bean id="digestFilter" - class="org.springframework.security.web.authentication.www.DigestAuthenticationFilter"> -        <beans:property name="userDetailsService" ref="userService" /> -        <beans:property name="authenticationEntryPoint" ref="digestEntryPoint" /> -    </beans:bean> -    <beans:bean id="digestEntryPoint"  - class="org.springframework.security.web.authentication.www.DigestAuthenticationEntryPoint"> -        <beans:property name="realmName" value="Contacts Realm via Digest Authentication" /> -        <beans:property name="key" value="acegi" /> -    </beans:bean> - - <!-- the security namespace configuration --> - <http use-expressions="true" entry-point-ref="digestEntryPoint"> - <intercept-url pattern="/**" access="isAuthenticated()" /> - - <custom-filter ref="digestFilter" after="BASIC_AUTH_FILTER" /> - </http> - - <authentication-manager> - <authentication-provider> - <user-service id="userService"> - <user name="user1" password="user1Pass" authorities="ROLE_USER" /> - </user-service> - </authentication-provider> - </authentication-manager> - -</beans:beans> - Next, we need to integrate these beans into the overall security configuration – and in this case, the namespace is still flexible enough to allow us to do that. - The first part of this is pointing to the custom entry point bean, via the entry-point-ref attribute of the main <http> element. - The second part is adding the newly defined digest filter into the security filter chain. Since this filter is functionally equivalent to the BasicAuthenticationFilter, we are using the same relative position in the chain – this is specified by the BASIC_AUTH_FILTER alias in the overall Spring Security Standard Filters. - Finally, notice that the Digest Filter is configured to point to the user service bean – and here, the namespace is again very useful as it allows us to specify a bean name for the default user service created by the <user-service> element: - <user-service id="userService"> -
-
- <anchor xml:id="dbdoclet.3_Consuming_the_Secured_Application"/><emphasis role="bold">3. Consuming the Secured Application</emphasis> - We’re going to be using the curl command to consume the secured application and understand how a client can interact with it. - Let’s start by requesting the homepage – without providing security credentials in the request: - curl -i http://localhost/spring-security-mvc-digest-auth/homepage.html - As expected, we get back a response with a 401 Unauthorized status code: - HTTP/1.1 401 Unauthorized -Server: Apache-Coyote/1.1 -Set-Cookie: JSESSIONID=CF0233C...; Path=/spring-security-mvc-digest-auth/; HttpOnly -WWW-Authenticate: Digest realm="Contacts Realm via Digest Authentication", qop="auth", - nonce="MTM3MzYzODE2NTg3OTo3MmYxN2JkOWYxZTc4MzdmMzBiN2Q0YmY0ZTU0N2RkZg==" -Content-Type: text/html;charset=utf-8 -Content-Length: 1061 -Date: Fri, 12 Jul 2013 14:04:25 GMT - If this request were sent by the browser, the authentication challenge would prompt the user for credentials using a simple user/password dialog. - Let’s now provide the correct credentials and send the request again: - curl -i --digest --user - user1:user1Pass http://localhost/spring-security-mvc-digest-auth/homepage.html - Notice that we are enabling Digest Authentication for the curl command via the –digest flag. - The first response from the server will be the same – the 401 Unauthorized – but the challenge will now be interpreted and acted upon by a second request – which will succeed with a 200 OK: - HTTP/1.1 401 Unauthorized -Server: Apache-Coyote/1.1 -Set-Cookie: JSESSIONID=A961E0D...; Path=/spring-security-mvc-digest-auth/; HttpOnly -WWW-Authenticate: Digest realm="Contacts Realm via Digest Authentication", qop="auth", - nonce="MTM3MzYzODgyOTczMTo3YjM4OWQzMGU0YTgwZDg0YmYwZjRlZWJjMDQzZWZkOA==" -Content-Type: text/html;charset=utf-8 -Content-Length: 1061 -Date: Fri, 12 Jul 2013 14:15:29 GMT - -HTTP/1.1 200 OK -Server: Apache-Coyote/1.1 -Set-Cookie: JSESSIONID=55F996B...; Path=/spring-security-mvc-digest-auth/; HttpOnly -Content-Type: text/html;charset=ISO-8859-1 -Content-Language: en-US -Content-Length: 90 -Date: Fri, 12 Jul 2013 14:15:29 GMT - -<html> -<head></head> - -<body> - <h1>This is the homepage</h1> -</body> -</html> - A final note on this interaction is that a client can preemptively send the correct Authorization header with the first request, and thus entirely avoid the server security challenge and the second request. -
-
- <anchor xml:id="dbdoclet.4_The_Maven_Dependencies"/><emphasis role="bold">4. The Maven Dependencies</emphasis> - The security dependencies are discussed in depth in the Spring Security Maven tutorial. In short, we will need to define spring-security-web and spring-security-config as dependencies in our pom.xml. -
-
- <anchor xml:id="dbdoclet.5_Conclusion"/><emphasis role="bold">5. Conclusion</emphasis> - In this tutorial we introduce security into a simple Spring MVC project by leveraging the Digest Authentication support in the framework. - The implementation of these examples can be found in the github project – this is an Eclipse based project, so it should be easy to import and run as it is. - When the project runs locally, the homepage html can be accessed at (or, with minimal Tomcat configuration, on port 80): - http://localhost:8080/spring-security-mvc-digest-auth/homepage.html - Finally, there is no reason an application needs to choose between Basic and Digest authentication – both can be set up simultaneously on the same URI structure, in such a way that the client can pick between the two mechanisms when consuming the web application. - - - - - - - - - - security, Spring - - - - - - - - - - - © 2014 Baeldung. All Rights Reserved. - - - - - - - -
-
-
- -
- - Basic and Digest Authentication for a REST Service with Spring Security - - - - - - Return to Content - - - - - - Contents - - - Table of Contents - - - 1. Overview - - - 2. Configuration of Basic Authentication - - - 3. Configuration of Digest Authentication - - - 4. Supporting both authentication protocols in the same RESTful service - - - 5. Testing both scenarios - - - 6. Conclusion - - - If you're new here, you may want to get my "REST APIs with Spring" eBook. Thanks for visiting! - - - -
- <anchor xml:id="Table_of_Contents"/><emphasis role="bold">Table of Contents</emphasis> - - - 1. Overview - - - 2. Configuration of Basic Authentication - - -     2.1. Satisfying the stateless constraint – getting rid of sessions - - - 3. Configuration of Digest Authentication - - - 4. Supporting both authentication protocols in the same RESTful service - - -     4.1. Anonymous request - - -     4.2. Request with authentication credentials - - - 5. Testing both scenarios - - - 6. Conclusion - - -
- <anchor xml:id="dbdoclet.1_Overview"/><emphasis role="bold">1. Overview</emphasis> - This article discusses how to set up both Basic and Digest Authentication on the same URI structure of a REST API. In a previous article, we discussed another method of securing the REST Service – form based authentication, so Basic and Digest authentication is the natural alternative, as well as the more RESTful one. -
-
- <anchor xml:id="dbdoclet.2_Configuration_of_Basic_Authentication"/><emphasis role="bold">2. Configuration of Basic Authentication</emphasis> - The main reason that form based authentication is not ideal for a RESTful Service is that Spring Security will make use of Sessions – this is of course state on the server, so the statelessness constraints in REST is practically ignored. - We’ll start by setting up Basic Authentication – first we remove the old custom entry point and filter from the main <http> security element: - <http create-session="stateless"> - <intercept-url pattern="/api/admin/**" access="ROLE_ADMIN" /> - - <http-basic /> -</http> - Note how support for basic authentication has been added with a single configuration line – <http-basic /> – which handles the creation and wiring of both the BasicAuthenticationFilter and the BasicAuthenticationEntryPoint. -
- <emphasis role="bold">2.1. Satisfying the stateless constraint – getting rid of sessions</emphasis> - One of the main constraints of the RESTful architectural style is that the client-server communication is fully stateless, as the original dissertation reads: -
-     5.1.3 Stateless - We next add a constraint to the client-server interaction: communication must be stateless in nature, as in the client-stateless-server (CSS) style of Section 3.4.3 (Figure 5-3), such that each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server. Session state is therefore kept entirely on the client. -
- The concept of Session on the server is one with a long history in Spring Security, and removing it entirely has been difficult until now, especially when configuration was done by using the namespace. However, Spring Security 3.1 augments the namespace configuration with a new stateless option for session creation, which effectively guarantees that no session will be created or used by Spring. What this new option does is completely removes all session related filters from the security filter chain, ensuring that authentication is performed for each request. -
-
-
- <anchor xml:id="dbdoclet.3_Configuration_of_Digest_Authentication"/><emphasis role="bold">3. Configuration of Digest Authentication</emphasis> - Starting with the previous configuration, the filter and entry point necessary to set up digest authentication will be defined as beans. Then, the digest entry point will override the one created by <http-basic> behind the scenes. Finally, the custom digest filter will be introduced in the security filter chain using the after semantics of the security namespace to position it directly after the basic authentication filter. - <http create-session="stateless" entry-point-ref="digestEntryPoint"> - <intercept-url pattern="/api/admin/**" access="ROLE_ADMIN" /> - - <http-basic /> - <custom-filter ref="digestFilter" after="BASIC_AUTH_FILTER" /> -</http> - -<beans:bean id="digestFilter" class= - "org.springframework.security.web.authentication.www.DigestAuthenticationFilter"> - <beans:property name="userDetailsService" ref="userService" /> - <beans:property name="authenticationEntryPoint" ref="digestEntryPoint" /> -</beans:bean> - -<beans:bean id="digestEntryPoint" class= - "org.springframework.security.web.authentication.www.DigestAuthenticationEntryPoint"> - <beans:property name="realmName" value="Contacts Realm via Digest Authentication"/> - <beans:property name="key" value="acegi" /> -</beans:bean> - -<authentication-manager> - <authentication-provider> - <user-service id="userService"> - <user name="eparaschiv" password="eparaschiv" authorities="ROLE_ADMIN" /> - <user name="user" password="user" authorities="ROLE_USER" /> - </user-service> - </authentication-provider> -</authentication-manager> - Unfortunately there is no support in the security namespace to automatically configure the digest authentication the way basic authentication can be configured with <http-basic>. Because of that, the necessary beans had to be defined and wired manually into the security configuration. -
-
- <anchor xml:id="dbdoclet.4_Supporting_both_authentication_protocols_in_the_same_RESTful_service"/><emphasis role="bold">4. Supporting both authentication protocols in the same RESTful service</emphasis> - Basic or Digest authentication alone can be easily implemented in Spring Security 3.x; it is supporting both of them for the same RESTful web service, on the same URI mappings that introduces a new level of complexity into the configuration and testing of the service. -
- <emphasis role="bold">4.1. Anonymous request</emphasis> - With both basic and digest filters in the security chain, the way a anonymous request – a request containing no authentication credentials (Authorization HTTP header) – is processed by Spring Security is – the two authentication filters will find no credentials and will continue execution of the filter chain. Then, seeing how the request wasn’t authenticated, an AccessDeniedException is thrown and caught in the ExceptionTranslationFilter, which commences the digest entry point, prompting the client for credentials. - The responsibilities of both the basic and digest filters are very narrow – they will continue to execute the security filter chain if they are unable to identify the type of authentication credentials in the request. It is because of this that Spring Security can have the flexibility to be configured with support for multiple authentication protocols on the same URI. - When a request is made containing the correct authentication credentials – either basic or digest – that protocol will be rightly used. However, for an anonymous request, the client will get prompted only for digest authentication credentials. This is because the digest entry point is configured as the main and single entry point of the Spring Security chain; as such digest authentication can be considered the default. -
-
- <emphasis role="bold">4.2. Request with authentication credentials</emphasis> - A request with credentials for Basic authentication will be identified by the Authorization header starting with the prefix “Basic”. When processing such a request, the credentials will be decoded in the basic authentication filter and the request will be authorized. Similarly, a request with credentials for Digest authentication will use the prefix “Digest”  for it’s Authorization header. -
-
-
- <anchor xml:id="dbdoclet.5_Testing_both_scenarios"/><emphasis role="bold">5. Testing both scenarios</emphasis> - The tests will consume the REST service by creating a new resource after authenticating with either basic or digest: - @Test -public void givenAuthenticatedByBasicAuth_whenAResourceIsCreated_then201IsReceived(){ - // Given - // When - Response response = given() - .auth().preemptive().basic( ADMIN_USERNAME, ADMIN_PASSWORD ) - .contentType( HttpConstants.MIME_JSON ).body( new Foo( randomAlphabetic( 6 ) ) ) - .post( paths.getFooURL() ); - - // Then - assertThat( response.getStatusCode(), is( 201 ) ); -} -@Test -public void givenAuthenticatedByDigestAuth_whenAResourceIsCreated_then201IsReceived(){ - // Given - // When - Response response = given() - .auth().digest( ADMIN_USERNAME, ADMIN_PASSWORD ) - .contentType( HttpConstants.MIME_JSON ).body( new Foo( randomAlphabetic( 6 ) ) ) - .post( paths.getFooURL() ); - - // Then - assertThat( response.getStatusCode(), is( 201 ) ); -} - Note that the test using basic authentication adds credentials to the request preemptively, regardless if the server has challenged for authentication or not. This is to ensure that the server doesn’t need to challenge the client for credentials, because if it did, the challenge would be for Digest credentials, since that is the default. -
-
- <anchor xml:id="dbdoclet.6_Conclusion"/><emphasis role="bold">6. Conclusion</emphasis> - This article covered the configuration and implementation of both Basic and Digest authentication for a RESTful service, using mostly Spring Security 3.0 namespace support as well as some new features added by Spring Security 3.1. - For the full implementation, check out the github project. - - - - - - - - - - REST, security, Spring - - - - - - - - - - - © 2014 Baeldung. All Rights Reserved. - - - - - - - -
-
-
diff --git a/apache-fop/src/test/resources/output_herold.pdf b/apache-fop/src/test/resources/output_herold.pdf deleted file mode 100644 index 1d23de7b61..0000000000 Binary files a/apache-fop/src/test/resources/output_herold.pdf and /dev/null differ diff --git a/apache-fop/src/test/resources/output_html2fo.pdf b/apache-fop/src/test/resources/output_html2fo.pdf deleted file mode 100644 index 7c2b4a0c51..0000000000 Binary files a/apache-fop/src/test/resources/output_html2fo.pdf and /dev/null differ diff --git a/apache-fop/src/test/resources/output_jtidy.pdf b/apache-fop/src/test/resources/output_jtidy.pdf deleted file mode 100644 index 1d9456122c..0000000000 Binary files a/apache-fop/src/test/resources/output_jtidy.pdf and /dev/null differ diff --git a/apache-geode/README.md b/apache-geode/README.md index 2f04418825..86629f7a82 100644 --- a/apache-geode/README.md +++ b/apache-geode/README.md @@ -1,3 +1,7 @@ +## Apache Geode + +This module contains articles about Apache Geode + ### Relevant Articles: - [A Quick Guide to Apache Geode](https://www.baeldung.com/apache-geode) diff --git a/apache-geode/pom.xml b/apache-geode/pom.xml index 15c7e04d29..195dfadd20 100644 --- a/apache-geode/pom.xml +++ b/apache-geode/pom.xml @@ -19,25 +19,7 @@ geode-core ${geode.core}
- - junit - junit - ${junit.version} -
- - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - 1.6.0 diff --git a/apache-meecrowave/README.md b/apache-meecrowave/README.md index 42b93a383e..d360af13af 100644 --- a/apache-meecrowave/README.md +++ b/apache-meecrowave/README.md @@ -1,3 +1,7 @@ +## Apache Meecrowave + +This module contains articles about Apache Meecrowave + ### Relevant Articles: -================================ -- [Building a Microservice with Apache Meecrowave](http://www.baeldung.com/apache-meecrowave) + +- [Building a Microservice with Apache Meecrowave](https://www.baeldung.com/apache-meecrowave) \ No newline at end of file diff --git a/apache-meecrowave/pom.xml b/apache-meecrowave/pom.xml index 4eb1094f94..51c6514992 100644 --- a/apache-meecrowave/pom.xml +++ b/apache-meecrowave/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung apache-meecrowave 0.0.1 apache-meecrowave @@ -38,13 +37,6 @@ ${meecrowave-junit.version} test
- - - junit - junit - ${junit.version} - test - diff --git a/apache-olingo/README.md b/apache-olingo/README.md index bfbdc97700..2f4e86d5a2 100644 --- a/apache-olingo/README.md +++ b/apache-olingo/README.md @@ -1,3 +1,8 @@ -## Relevant articles: +## Apache Olingo + +This module contains articles about Apache Olingo + +### Relevant articles: - [OData Protocol Guide](https://www.baeldung.com/odata) +- [Intro to OData with Olingo](https://www.baeldung.com/olingo) diff --git a/apache-olingo/olingo2/pom.xml b/apache-olingo/olingo2/pom.xml index 727e6ca484..95b123efbc 100644 --- a/apache-olingo/olingo2/pom.xml +++ b/apache-olingo/olingo2/pom.xml @@ -5,7 +5,6 @@ 4.0.0 org.baeldung.examples.olingo2 olingo2 - 0.0.1-SNAPSHOT olingo2 Sample Olingo 2 Project diff --git a/apache-opennlp/README.md b/apache-opennlp/README.md index 2e9fa0e384..4b1fa36540 100644 --- a/apache-opennlp/README.md +++ b/apache-opennlp/README.md @@ -1,3 +1,7 @@ +## Apache OpenNLP + +This module contains articles about Apache OpenNLP + ### Relevant Articles -- [Intro to Apache OpenNLP](http://www.baeldung.com/apache-open-nlp) +- [Intro to Apache OpenNLP](https://www.baeldung.com/apache-open-nlp) diff --git a/apache-poi/README.md b/apache-poi/README.md index 862981991d..b7b8bf5f6a 100644 --- a/apache-poi/README.md +++ b/apache-poi/README.md @@ -1,4 +1,8 @@ +## Apache POI + +This module contains articles about Apache POI + ### Relevant Articles: -- [Microsoft Word Processing in Java with Apache POI](http://www.baeldung.com/java-microsoft-word-with-apache-poi) -- [Working with Microsoft Excel in Java](http://www.baeldung.com/java-microsoft-excel) -- [Creating a MS PowerPoint Presentation in Java](http://www.baeldung.com/apache-poi-slideshow) +- [Microsoft Word Processing in Java with Apache POI](https://www.baeldung.com/java-microsoft-word-with-apache-poi) +- [Working with Microsoft Excel in Java](https://www.baeldung.com/java-microsoft-excel) +- [Creating a MS PowerPoint Presentation in Java](https://www.baeldung.com/apache-poi-slideshow) diff --git a/apache-pulsar/README.md b/apache-pulsar/README.md index 2970bc3d88..c44849a490 100644 --- a/apache-pulsar/README.md +++ b/apache-pulsar/README.md @@ -1,3 +1,7 @@ +## Apache Pulsar + +This module contains articles about Apache Pulsar + ### Relevant Articles: - [Introduction to Apache Pulsar](https://www.baeldung.com/apache-pulsar) diff --git a/apache-pulsar/pom.xml b/apache-pulsar/pom.xml index 8a0882dae1..fdd9ae1e95 100644 --- a/apache-pulsar/pom.xml +++ b/apache-pulsar/pom.xml @@ -24,8 +24,6 @@ - 1.8 - 1.8 - 2.1.1-incubating + 2.1.1-incubating diff --git a/apache-shiro/README.md b/apache-shiro/README.md index bc3480b266..ed63c569da 100644 --- a/apache-shiro/README.md +++ b/apache-shiro/README.md @@ -1,2 +1,9 @@ -### Relevant articles -- [Introduction to Apache Shiro](http://www.baeldung.com/apache-shiro) +## Apache Shiro + +This module contains articles about Apache Shiro + +### Relevant articles: + +- [Introduction to Apache Shiro](https://www.baeldung.com/apache-shiro) +- [Permissions-Based Access Control with Apache Shiro](https://www.baeldung.com/apache-shiro-access-control) + diff --git a/apache-solrj/README.md b/apache-solrj/README.md index 7a32becb64..803db393e9 100644 --- a/apache-solrj/README.md +++ b/apache-solrj/README.md @@ -1,4 +1,7 @@ -## Apache Solrj Tutorials Project +## Apache Solrj -### Relevant Articles -- [Guide to Solr in Java with Apache Solrj](http://www.baeldung.com/apache-solrj) +This module contains articles about Apache Solrj + +### Relevant Articles: + +- [Guide to Solr in Java with Apache Solrj](https://www.baeldung.com/apache-solrj) \ No newline at end of file diff --git a/apache-solrj/pom.xml b/apache-solrj/pom.xml index 1227fdca46..b19ceb1e48 100644 --- a/apache-solrj/pom.xml +++ b/apache-solrj/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung apache-solrj 0.0.1-SNAPSHOT apache-solrj diff --git a/apache-spark/README.md b/apache-spark/README.md index a4dce212b4..52313d66bf 100644 --- a/apache-spark/README.md +++ b/apache-spark/README.md @@ -1,4 +1,10 @@ -### Relevant articles +## Apache Spark -- [Introduction to Apache Spark](http://www.baeldung.com/apache-spark) +This module contains articles about Apache Spark + +### Relevant articles: + +- [Introduction to Apache Spark](https://www.baeldung.com/apache-spark) - [Building a Data Pipeline with Kafka, Spark Streaming and Cassandra](https://www.baeldung.com/kafka-spark-data-pipeline) +- [Machine Learning with Spark MLlib](https://www.baeldung.com/spark-mlib-machine-learning) + diff --git a/apache-spark/pom.xml b/apache-spark/pom.xml index 3df81e5aee..41fd51d9fd 100644 --- a/apache-spark/pom.xml +++ b/apache-spark/pom.xml @@ -2,7 +2,6 @@ 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"> 4.0.0 - com.baeldung apache-spark 1.0-SNAPSHOT apache-spark @@ -59,15 +58,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - - maven-assembly-plugin @@ -95,7 +85,6 @@ 2.3.0 2.3.0 1.5.2 - 3.2 diff --git a/apache-thrift/README.md b/apache-thrift/README.md index d8b9195dcc..4508939de6 100644 --- a/apache-thrift/README.md +++ b/apache-thrift/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Apache Thrift -- [Working with Apache Thrift](http://www.baeldung.com/apache-thrift) +This module contains articles about Apache Thrift + +### Relevant articles: + +- [Working with Apache Thrift](https://www.baeldung.com/apache-thrift) diff --git a/apache-tika/README.md b/apache-tika/README.md index b92a7bebf1..690e55edc3 100644 --- a/apache-tika/README.md +++ b/apache-tika/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Apache Tika -- [Content Analysis with Apache Tika](http://www.baeldung.com/apache-tika) +This module contains articles about Apache Tika + +### Relevant articles: + +- [Content Analysis with Apache Tika](https://www.baeldung.com/apache-tika) diff --git a/apache-velocity/README.md b/apache-velocity/README.md index 53c67f847e..d539d79efc 100644 --- a/apache-velocity/README.md +++ b/apache-velocity/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Apache Velocity -- [Introduction to Apache Velocity](http://www.baeldung.com/apache-velocity) +This module contains articles about Apache Velocity + +### Relevant articles: + +- [Introduction to Apache Velocity](https://www.baeldung.com/apache-velocity) diff --git a/apache-velocity/pom.xml b/apache-velocity/pom.xml index 24ab0b861d..b370b11cc1 100644 --- a/apache-velocity/pom.xml +++ b/apache-velocity/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung 0.1-SNAPSHOT apache-velocity apache-velocity diff --git a/apache-zookeeper/README.md b/apache-zookeeper/README.md index 6bddcfd5a8..cda1cd6d73 100644 --- a/apache-zookeeper/README.md +++ b/apache-zookeeper/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Apache Zookeeper -- [Getting Started with Java and Zookeeper](http://www.baeldung.com/java-zookeeper) +This module contains articles about Apache Zookeeper + +### Relevant articles: + +- [Getting Started with Java and Zookeeper](https://www.baeldung.com/java-zookeeper) diff --git a/asciidoctor/README.md b/asciidoctor/README.md index 2124907e87..87b1ec833c 100644 --- a/asciidoctor/README.md +++ b/asciidoctor/README.md @@ -1,4 +1,8 @@ -### Relevant articles +## Asciidoctor -- [Generating a Book with Asciidoctor](http://www.baeldung.com/asciidoctor-book) -- [Introduction to Asciidoctor in Java](http://www.baeldung.com/asciidoctor) +This module contains articles about Asciidoctor + +### Relevant articles: + +- [Generating a Book with Asciidoctor](https://www.baeldung.com/asciidoctor-book) +- [Introduction to Asciidoctor in Java](https://www.baeldung.com/asciidoctor) diff --git a/asm/README.md b/asm/README.md index 50d9c34324..e10cdc45bd 100644 --- a/asm/README.md +++ b/asm/README.md @@ -1,3 +1,7 @@ +## ASM + +This module contains articles about ASM + ### Relevant Articles: -- [A Guide to Java Bytecode Manipulation with ASM](http://www.baeldung.com/java-asm) +- [A Guide to Java Bytecode Manipulation with ASM](https://www.baeldung.com/java-asm) diff --git a/atomix/README.md b/atomix/README.md index fb22eec8dc..217fced82a 100644 --- a/atomix/README.md +++ b/atomix/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Atomix -- [Introduction to Atomix](http://www.baeldung.com/atomix) +This module contains articles about Atomix + +### Relevant articles: + +- [Introduction to Atomix](https://www.baeldung.com/atomix) diff --git a/autovalue/README.md b/autovalue/README.md deleted file mode 100644 index f33ff6899f..0000000000 --- a/autovalue/README.md +++ /dev/null @@ -1,4 +0,0 @@ -### Relevant Articles: -- [Introduction to AutoValue](http://www.baeldung.com/introduction-to-autovalue) -- [Introduction to AutoFactory](http://www.baeldung.com/autofactory) -- [Google AutoService](https://www.baeldung.com/google-autoservice) diff --git a/autovalue/pom.xml b/autovalue/pom.xml deleted file mode 100644 index a10e8ef055..0000000000 --- a/autovalue/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - 4.0.0 - com.baeldung - autovalue - 1.0 - autovalue - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - com.google.auto.value - auto-value - ${auto-value.version} - - - com.google.auto.factory - auto-factory - ${auto-factory.version} - - - com.google.guava - guava - - - - - com.google.auto.service - auto-service - ${auto-service.version} - true - - - - com.google.inject - guice - ${guice.version} - - - - - 1.3 - 1.0-beta5 - 1.0-rc5 - 4.2.0 - - - diff --git a/aws-lambda/README.md b/aws-lambda/README.md index 921b699bdd..2fbdaace10 100644 --- a/aws-lambda/README.md +++ b/aws-lambda/README.md @@ -1,3 +1,7 @@ +## AWS Lambda + +This module contains articles about AWS Lambda + ### Relevant Articles: -- [Using AWS Lambda with API Gateway](http://www.baeldung.com/aws-lambda-api-gateway) -- [Introduction to AWS Serverless Application Model](http://www.baeldung.com/aws-serverless) +- [Using AWS Lambda with API Gateway](https://www.baeldung.com/aws-lambda-api-gateway) +- [Introduction to AWS Serverless Application Model](https://www.baeldung.com/aws-serverless) diff --git a/aws-lambda/pom.xml b/aws-lambda/pom.xml index c799718e61..1f3c31f87c 100644 --- a/aws-lambda/pom.xml +++ b/aws-lambda/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - com.baeldung aws-lambda 0.1.0-SNAPSHOT aws-lambda @@ -88,7 +87,6 @@ 1.1.1 - 20180130 2.5 1.3.0 1.2.0 diff --git a/aws/README.md b/aws/README.md index d14ea8a75e..9e4ca8b699 100644 --- a/aws/README.md +++ b/aws/README.md @@ -1,11 +1,15 @@ +## AWS + +This module contains articles about AWS + ### Relevant articles -- [AWS Lambda Using DynamoDB With Java](http://www.baeldung.com/aws-lambda-dynamodb-java) -- [AWS S3 with Java](http://www.baeldung.com/aws-s3-java) -- [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda) -- [Managing EC2 Instances in Java](http://www.baeldung.com/ec2-java) -- [Multipart Uploads in Amazon S3 with Java](http://www.baeldung.com/aws-s3-multipart-upload) -- [Integration Testing with a Local DynamoDB Instance](http://www.baeldung.com/dynamodb-local-integration-tests) -- [Using the JetS3t Java Client With Amazon S3](http://www.baeldung.com/jets3t-amazon-s3) -- [Managing Amazon SQS Queues in Java](http://www.baeldung.com/aws-queues-java) +- [AWS Lambda Using DynamoDB With Java](https://www.baeldung.com/aws-lambda-dynamodb-java) +- [AWS S3 with Java](https://www.baeldung.com/aws-s3-java) +- [AWS Lambda With Java](https://www.baeldung.com/java-aws-lambda) +- [Managing EC2 Instances in Java](https://www.baeldung.com/ec2-java) +- [Multipart Uploads in Amazon S3 with Java](https://www.baeldung.com/aws-s3-multipart-upload) +- [Integration Testing with a Local DynamoDB Instance](https://www.baeldung.com/dynamodb-local-integration-tests) +- [Using the JetS3t Java Client With Amazon S3](https://www.baeldung.com/jets3t-amazon-s3) +- [Managing Amazon SQS Queues in Java](https://www.baeldung.com/aws-queues-java) - [Guide to AWS Aurora RDS with Java](https://www.baeldung.com/aws-aurora-rds-java) diff --git a/aws/pom.xml b/aws/pom.xml index 75d5aac1eb..45a30f96ba 100644 --- a/aws/pom.xml +++ b/aws/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung aws 0.1.0-SNAPSHOT aws diff --git a/axon/README.md b/axon/README.md index f1ae5d00d8..069102fc3a 100644 --- a/axon/README.md +++ b/axon/README.md @@ -1,3 +1,7 @@ +## Axon + +This module contains articles about Axon + ### Relevant articles -- [A Guide to the Axon Framework](http://www.baeldung.com/axon-cqrs-event-sourcing) +- [A Guide to the Axon Framework](https://www.baeldung.com/axon-cqrs-event-sourcing) diff --git a/axon/pom.xml b/axon/pom.xml index 3d30cceb83..21e21f0ef2 100644 --- a/axon/pom.xml +++ b/axon/pom.xml @@ -30,7 +30,6 @@ org.springframework.boot spring-boot-autoconfigure - ${spring-boot.version} compile diff --git a/azure/README.md b/azure/README.md index ae8c443660..4da8481502 100644 --- a/azure/README.md +++ b/azure/README.md @@ -1,4 +1,8 @@ +## Azure + +This module contains articles about Azure + ### Relevant Articles: -- [Deploy a Spring Boot App to Azure](http://www.baeldung.com/spring-boot-azure) +- [Deploy a Spring Boot App to Azure](https://www.baeldung.com/spring-boot-azure) diff --git a/azure/pom.xml b/azure/pom.xml index 270b3e4829..3d9c296748 100644 --- a/azure/pom.xml +++ b/azure/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - com.baeldung azure 0.1 azure diff --git a/bazel/README.md b/bazel/README.md index d1f8f1af5b..af4f901f49 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -1,3 +1,7 @@ -## Relevant Articles: +## Bazel + +This module contains articles about Bazel + +### Relevant Articles: - [Building Java Applications with Bazel](https://www.baeldung.com/bazel-build-tool) diff --git a/bazel/bazelapp/pom.xml b/bazel/bazelapp/pom.xml index 9c9fb59619..e56cc06ef4 100644 --- a/bazel/bazelapp/pom.xml +++ b/bazel/bazelapp/pom.xml @@ -16,14 +16,17 @@ com.baeldung bazelgreeting - 1.0.0-SNAPSHOT + ${bazelgreeting.version} org.apache.commons commons-lang3 - 3.9 + ${commons-lang3.version} + + 1.0.0-SNAPSHOT + \ No newline at end of file diff --git a/blade/README.md b/blade/README.md index 1f2a00ed3f..202494330f 100644 --- a/blade/README.md +++ b/blade/README.md @@ -1,5 +1,5 @@ ### Relevant Articles: -- [Blade – A Complete Guidebook](http://www.baeldung.com/blade) +- [Blade – A Complete Guidebook](https://www.baeldung.com/blade) Run Integration Tests with `mvn integration-test` diff --git a/blade/pom.xml b/blade/pom.xml index 37615bed01..6f8a78852d 100644 --- a/blade/pom.xml +++ b/blade/pom.xml @@ -3,19 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - - com.baeldung blade - 1.0.0-SNAPSHOT blade - - - - - - - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + @@ -45,12 +40,6 @@ - - junit - junit - ${junit.version} - test - org.assertj assertj-core @@ -79,20 +68,6 @@ sample-blade-app - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - 3 - true - - **/*LiveTest.java - - - - org.apache.maven.plugins maven-failsafe-plugin @@ -172,34 +147,19 @@ - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${maven.compiler.source} - ${maven.compiler.target} - UTF-8 - - - 1.8 - 1.8 2.0.14.RELEASE 4.2.1 3.8.1 1.18.4 - 4.12 4.5.6 4.5.6 4.4.10 3.11.1 3.0.0-M3 0.7 - 2.21.0 - 3.7.0 diff --git a/bootique/README.md b/bootique/README.md index 2ef898fcf7..0d4076201e 100644 --- a/bootique/README.md +++ b/bootique/README.md @@ -1,2 +1,6 @@ +## Bootique + +This module contains articles about Bootique + ### Relevant Articles: -- [Introduction to Bootique](http://www.baeldung.com/bootique) +- [Introduction to Bootique](https://www.baeldung.com/bootique) diff --git a/bootique/pom.xml b/bootique/pom.xml index 4dd9ba4833..7601321b99 100644 --- a/bootique/pom.xml +++ b/bootique/pom.xml @@ -42,12 +42,6 @@ bootique-test test - - junit - junit - ${junit.version} - test - diff --git a/cas/README.md b/cas/README.md new file mode 100644 index 0000000000..16775a8a02 --- /dev/null +++ b/cas/README.md @@ -0,0 +1,7 @@ +## CAS + +This module contains articles about the Central Authentication Service (CAS) + +### Relevant Articles: + +- [CAS SSO With Spring Security](baeldung.com/spring-security-cas-sso) \ No newline at end of file diff --git a/cas/cas-server/pom.xml b/cas/cas-server/pom.xml index 98f5f10493..8a1e602114 100644 --- a/cas/cas-server/pom.xml +++ b/cas/cas-server/pom.xml @@ -198,7 +198,6 @@ 0.0.4 2.6 - 3.3 0.3.0 1.1.0 diff --git a/cdi/README.md b/cdi/README.md index bfb635be9e..13169698a2 100644 --- a/cdi/README.md +++ b/cdi/README.md @@ -1,5 +1,9 @@ +## CDI + +This module contains articles about Contexts and Dependency Injection (CDI) + ### Relevant Articles: -- [CDI Interceptor vs Spring AspectJ](http://www.baeldung.com/cdi-interceptor-vs-spring-aspectj) -- [An Introduction to CDI (Contexts and Dependency Injection) in Java](http://www.baeldung.com/java-ee-cdi) +- [CDI Interceptor vs Spring AspectJ](https://www.baeldung.com/cdi-interceptor-vs-spring-aspectj) +- [An Introduction to CDI (Contexts and Dependency Injection) in Java](https://www.baeldung.com/java-ee-cdi) - [Introduction to the Event Notification Model in CDI 2.0](https://www.baeldung.com/cdi-event-notification) diff --git a/cdi/pom.xml b/cdi/pom.xml index c98ad57495..809622a5db 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -36,12 +36,6 @@ ${assertj-core.version} test - - junit - junit - ${junit.version} - test - org.springframework spring-context diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java b/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java index 4896408502..dc0bdeb951 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/application/BootstrappingApplication.java @@ -1,15 +1,16 @@ -package com.baeldung.cdi.cdi2observers.application; - -import com.baeldung.cdi.cdi2observers.events.ExampleEvent; -import javax.enterprise.inject.se.SeContainer; -import javax.enterprise.inject.se.SeContainerInitializer; - -public class BootstrappingApplication { - - public static void main(String... args) { - SeContainerInitializer containerInitializer = SeContainerInitializer.newInstance(); - try (SeContainer container = containerInitializer.initialize()) { - container.getBeanManager().fireEvent(new ExampleEvent("Welcome to Baeldung!")); - } - } -} +package com.baeldung.cdi2observers.application; + +import com.baeldung.cdi2observers.events.ExampleEvent; + +import javax.enterprise.inject.se.SeContainer; +import javax.enterprise.inject.se.SeContainerInitializer; + +public class BootstrappingApplication { + + public static void main(String... args) { + SeContainerInitializer containerInitializer = SeContainerInitializer.newInstance(); + try (SeContainer container = containerInitializer.initialize()) { + container.getBeanManager().fireEvent(new ExampleEvent("Welcome to Baeldung!")); + } + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java index a2329d2ef1..9adfad4d39 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEvent.java @@ -1,14 +1,14 @@ -package com.baeldung.cdi.cdi2observers.events; - -public class ExampleEvent { - - private final String eventMessage; - - public ExampleEvent(String eventMessage) { - this.eventMessage = eventMessage; - } - - public String getEventMessage() { - return eventMessage; - } -} +package com.baeldung.cdi2observers.events; + +public class ExampleEvent { + + private final String eventMessage; + + public ExampleEvent(String eventMessage) { + this.eventMessage = eventMessage; + } + + public String getEventMessage() { + return eventMessage; + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java index f37030778a..5a0aa0b5e3 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/events/ExampleEventSource.java @@ -1,14 +1,14 @@ -package com.baeldung.cdi.cdi2observers.events; - -import javax.enterprise.event.Event; -import javax.inject.Inject; - -public class ExampleEventSource { - - @Inject - Event exampleEvent; - - public void fireEvent() { - exampleEvent.fireAsync(new ExampleEvent("Welcome to Baeldung!")); - } -} +package com.baeldung.cdi2observers.events; + +import javax.enterprise.event.Event; +import javax.inject.Inject; + +public class ExampleEventSource { + + @Inject + Event exampleEvent; + + public void fireEvent() { + exampleEvent.fireAsync(new ExampleEvent("Welcome to Baeldung!")); + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java b/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java index 34520c2b3d..3af48af13f 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/observers/AnotherExampleEventObserver.java @@ -1,12 +1,13 @@ -package com.baeldung.cdi.cdi2observers.observers; - -import com.baeldung.cdi.cdi2observers.events.ExampleEvent; -import javax.annotation.Priority; -import javax.enterprise.event.Observes; - -public class AnotherExampleEventObserver { - - public String onEvent(@Observes @Priority(2) ExampleEvent event) { - return event.getEventMessage(); - } -} +package com.baeldung.cdi2observers.observers; + +import com.baeldung.cdi2observers.events.ExampleEvent; + +import javax.annotation.Priority; +import javax.enterprise.event.Observes; + +public class AnotherExampleEventObserver { + + public String onEvent(@Observes @Priority(2) ExampleEvent event) { + return event.getEventMessage(); + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java b/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java index b3522b2ad0..33fdc43bbb 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/observers/ExampleEventObserver.java @@ -1,13 +1,13 @@ -package com.baeldung.cdi.cdi2observers.observers; - -import com.baeldung.cdi.cdi2observers.events.ExampleEvent; -import com.baeldung.cdi.cdi2observers.services.TextService; -import javax.annotation.Priority; -import javax.enterprise.event.Observes; - -public class ExampleEventObserver { - - public String onEvent(@Observes @Priority(1) ExampleEvent event, TextService textService) { - return textService.parseText(event.getEventMessage()); - } -} +package com.baeldung.cdi2observers.observers; + +import com.baeldung.cdi2observers.events.ExampleEvent; +import com.baeldung.cdi2observers.services.TextService; +import javax.annotation.Priority; +import javax.enterprise.event.Observes; + +public class ExampleEventObserver { + + public String onEvent(@Observes @Priority(1) ExampleEvent event, TextService textService) { + return textService.parseText(event.getEventMessage()); + } +} diff --git a/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java b/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java index 47788a0657..eabe031223 100644 --- a/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java +++ b/cdi/src/main/java/com/baeldung/cdi2observers/services/TextService.java @@ -1,8 +1,8 @@ -package com.baeldung.cdi.cdi2observers.services; - -public class TextService { - - public String parseText(String text) { - return text.toUpperCase(); - } -} +package com.baeldung.cdi2observers.services; + +public class TextService { + + public String parseText(String text) { + return text.toUpperCase(); + } +} diff --git a/cdi/src/main/resources/META-INF/beans.xml b/cdi/src/main/resources/META-INF/beans.xml index d41b35e7d9..144e9e567f 100644 --- a/cdi/src/main/resources/META-INF/beans.xml +++ b/cdi/src/main/resources/META-INF/beans.xml @@ -1,7 +1,8 @@ - + + xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" + bean-discovery-mode="all"> com.baeldung.interceptor.AuditedInterceptor diff --git a/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java b/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java index deecf13f9a..1b976144aa 100644 --- a/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java +++ b/cdi/src/test/java/com/baeldung/test/cdi2observers/tests/TextServiceUnitTest.java @@ -1,14 +1,15 @@ -package com.baeldung.cdi.cdi2observers.tests; - -import com.baeldung.cdi.cdi2observers.services.TextService; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; - -public class TextServiceUnitTest { - - @Test - public void givenTextServiceInstance_whenCalledparseText_thenCorrect() { - TextService textService = new TextService(); - assertThat(textService.parseText("Baeldung")).isEqualTo("BAELDUNG"); - } -} +package com.baeldung.test.cdi2observers.tests; + +import com.baeldung.cdi2observers.services.TextService; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class TextServiceUnitTest { + + @Test + public void givenTextServiceInstance_whenCalledparseText_thenCorrect() { + TextService textService = new TextService(); + assertThat(textService.parseText("Baeldung")).isEqualTo("BAELDUNG"); + } +} diff --git a/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java b/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java index caf2ed32b5..b22f189373 100644 --- a/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java +++ b/cdi/src/test/java/com/baeldung/test/dependencyinjection/TimeLoggerFactoryUnitTest.java @@ -6,7 +6,6 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; public class TimeLoggerFactoryUnitTest { - @Test public void givenTimeLoggerFactory_whenCalledgetTimeLogger_thenOneAssertion() { TimeLoggerFactory timeLoggerFactory = new TimeLoggerFactory(); diff --git a/checker-plugin/README.md b/checker-plugin/README.md index f4534b09e8..59dc2878a2 100644 --- a/checker-plugin/README.md +++ b/checker-plugin/README.md @@ -1,3 +1,7 @@ +## Checker Plugin + +This module contains articles about the Checker Plugin + ### Relevant articles -- [The Checker Framework – Pluggable Type Systems for Java](http://www.baeldung.com/checker-framework) +- [The Checker Framework – Pluggable Type Systems for Java](https://www.baeldung.com/checker-framework) diff --git a/checker-plugin/pom.xml b/checker-plugin/pom.xml index 08408366a4..63def4dbdc 100644 --- a/checker-plugin/pom.xml +++ b/checker-plugin/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung checker-plugin 1.0-SNAPSHOT checker-plugin diff --git a/cloud-foundry-uaa/README.md b/cloud-foundry-uaa/README.md index b2f382cad1..f7707a04e2 100644 --- a/cloud-foundry-uaa/README.md +++ b/cloud-foundry-uaa/README.md @@ -1,3 +1,7 @@ -### Revelant Articles +## Cloud Foundry UAA + +This module contains articles about Cloud Foundry UAA + +### Relevant Articles: - [A Quick Guide To Using Cloud Foundry UAA](https://www.baeldung.com/cloud-foundry-uaa) diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml b/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml index c6de00dbe9..fe1b919905 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml +++ b/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml @@ -4,7 +4,6 @@ 4.0.0 com.example cf-uaa-oauth2-client - 0.0.1-SNAPSHOT uaa-client-webapp Demo project for Spring Boot diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml b/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml index 56fb23e9d8..7cd47bb7b3 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml +++ b/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml @@ -4,7 +4,6 @@ 4.0.0 com.baeldung.cfuaa cf-uaa-oauth2-resource-server - 0.0.1-SNAPSHOT cf-uaa-oauth2-resource-server Demo project for Spring Boot diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java b/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java index c08f17d8d8..75d8507451 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java +++ b/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java @@ -18,7 +18,7 @@ public class CFUAAOAuth2ResourceServerRestController { @GetMapping("/read") public String read(JwtAuthenticationToken jwtAuthenticationToken) { - return "Hello write: " + jwtAuthenticationToken.getTokenAttributes(); + return "Hello read: " + jwtAuthenticationToken.getTokenAttributes(); } @GetMapping("/write") diff --git a/code-generation/README.md b/code-generation/README.md new file mode 100644 index 0000000000..289a336f99 --- /dev/null +++ b/code-generation/README.md @@ -0,0 +1,9 @@ +## Code Generation + +This module contains articles about automatic code generation + +### Relevant Articles: + +- [Introduction to AutoValue](https://www.baeldung.com/introduction-to-autovalue) +- [Introduction to AutoFactory](https://www.baeldung.com/autofactory) +- [Google AutoService](https://www.baeldung.com/google-autoservice) diff --git a/code-generation/pom.xml b/code-generation/pom.xml new file mode 100644 index 0000000000..91ce0a4639 --- /dev/null +++ b/code-generation/pom.xml @@ -0,0 +1,58 @@ + + 4.0.0 + code-generation + 1.0 + code-generation + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + com.google.auto.value + auto-value-annotations + ${auto-value.version} + + + com.google.auto.value + auto-value + ${auto-value.version} + provided + + + com.google.auto.factory + auto-factory + ${auto-factory.version} + + + com.google.guava + guava + + + + + com.google.auto.service + auto-service + ${auto-service.version} + true + + + + com.google.inject + guice + ${guice.version} + + + + + 1.6.6 + 1.0-beta6 + 1.0-rc6 + 4.2.0 + + + diff --git a/autovalue/src/main/java/com/baeldung/autofactory/App.java b/code-generation/src/main/java/com/baeldung/autofactory/App.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/App.java rename to code-generation/src/main/java/com/baeldung/autofactory/App.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/CustomStorage.java b/code-generation/src/main/java/com/baeldung/autofactory/CustomStorage.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/CustomStorage.java rename to code-generation/src/main/java/com/baeldung/autofactory/CustomStorage.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/custom/AbstractFactory.java b/code-generation/src/main/java/com/baeldung/autofactory/custom/AbstractFactory.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/custom/AbstractFactory.java rename to code-generation/src/main/java/com/baeldung/autofactory/custom/AbstractFactory.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/custom/CustomPhone.java b/code-generation/src/main/java/com/baeldung/autofactory/custom/CustomPhone.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/custom/CustomPhone.java rename to code-generation/src/main/java/com/baeldung/autofactory/custom/CustomPhone.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/custom/SmartPhone.java b/code-generation/src/main/java/com/baeldung/autofactory/custom/SmartPhone.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/custom/SmartPhone.java rename to code-generation/src/main/java/com/baeldung/autofactory/custom/SmartPhone.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/model/Camera.java b/code-generation/src/main/java/com/baeldung/autofactory/model/Camera.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/model/Camera.java rename to code-generation/src/main/java/com/baeldung/autofactory/model/Camera.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/model/ClassicPhone.java b/code-generation/src/main/java/com/baeldung/autofactory/model/ClassicPhone.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/model/ClassicPhone.java rename to code-generation/src/main/java/com/baeldung/autofactory/model/ClassicPhone.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/model/Phone.java b/code-generation/src/main/java/com/baeldung/autofactory/model/Phone.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/model/Phone.java rename to code-generation/src/main/java/com/baeldung/autofactory/model/Phone.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/modules/SonyCameraModule.java b/code-generation/src/main/java/com/baeldung/autofactory/modules/SonyCameraModule.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/modules/SonyCameraModule.java rename to code-generation/src/main/java/com/baeldung/autofactory/modules/SonyCameraModule.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/provided/IntermediateAssembler.java b/code-generation/src/main/java/com/baeldung/autofactory/provided/IntermediateAssembler.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/provided/IntermediateAssembler.java rename to code-generation/src/main/java/com/baeldung/autofactory/provided/IntermediateAssembler.java diff --git a/autovalue/src/main/java/com/baeldung/autofactory/provider/SonyCameraProvider.java b/code-generation/src/main/java/com/baeldung/autofactory/provider/SonyCameraProvider.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autofactory/provider/SonyCameraProvider.java rename to code-generation/src/main/java/com/baeldung/autofactory/provider/SonyCameraProvider.java diff --git a/autovalue/src/main/java/com/baeldung/autoservice/BingTranslationServiceProvider.java b/code-generation/src/main/java/com/baeldung/autoservice/BingTranslationServiceProvider.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autoservice/BingTranslationServiceProvider.java rename to code-generation/src/main/java/com/baeldung/autoservice/BingTranslationServiceProvider.java diff --git a/autovalue/src/main/java/com/baeldung/autoservice/GoogleTranslationServiceProvider.java b/code-generation/src/main/java/com/baeldung/autoservice/GoogleTranslationServiceProvider.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autoservice/GoogleTranslationServiceProvider.java rename to code-generation/src/main/java/com/baeldung/autoservice/GoogleTranslationServiceProvider.java diff --git a/autovalue/src/main/java/com/baeldung/autoservice/TranslationService.java b/code-generation/src/main/java/com/baeldung/autoservice/TranslationService.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autoservice/TranslationService.java rename to code-generation/src/main/java/com/baeldung/autoservice/TranslationService.java diff --git a/autovalue/src/main/java/com/baeldung/autovalue/AutoValueMoney.java b/code-generation/src/main/java/com/baeldung/autovalue/AutoValueMoney.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autovalue/AutoValueMoney.java rename to code-generation/src/main/java/com/baeldung/autovalue/AutoValueMoney.java diff --git a/autovalue/src/main/java/com/baeldung/autovalue/AutoValueMoneyWithBuilder.java b/code-generation/src/main/java/com/baeldung/autovalue/AutoValueMoneyWithBuilder.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autovalue/AutoValueMoneyWithBuilder.java rename to code-generation/src/main/java/com/baeldung/autovalue/AutoValueMoneyWithBuilder.java diff --git a/autovalue/src/main/java/com/baeldung/autovalue/Foo.java b/code-generation/src/main/java/com/baeldung/autovalue/Foo.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autovalue/Foo.java rename to code-generation/src/main/java/com/baeldung/autovalue/Foo.java diff --git a/autovalue/src/main/java/com/baeldung/autovalue/ImmutableMoney.java b/code-generation/src/main/java/com/baeldung/autovalue/ImmutableMoney.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autovalue/ImmutableMoney.java rename to code-generation/src/main/java/com/baeldung/autovalue/ImmutableMoney.java diff --git a/autovalue/src/main/java/com/baeldung/autovalue/MutableMoney.java b/code-generation/src/main/java/com/baeldung/autovalue/MutableMoney.java similarity index 100% rename from autovalue/src/main/java/com/baeldung/autovalue/MutableMoney.java rename to code-generation/src/main/java/com/baeldung/autovalue/MutableMoney.java diff --git a/code-generation/src/main/java/com/baeldung/autovalue/Person.java b/code-generation/src/main/java/com/baeldung/autovalue/Person.java new file mode 100644 index 0000000000..a5fb684596 --- /dev/null +++ b/code-generation/src/main/java/com/baeldung/autovalue/Person.java @@ -0,0 +1,38 @@ +package com.baeldung.autovalue; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import com.google.auto.value.AutoValue; + +@AutoValue +public abstract class Person { + + public abstract String name(); + + public abstract List favoriteMovies(); + + public static Builder builder() { + return new AutoValue_Person.Builder(); + } + + @AutoValue.Builder + public static abstract class Builder { + + public abstract Builder name(String value); + + public abstract Builder favoriteMovies(List value); + + abstract List favoriteMovies(); + + abstract Person autoBuild(); + + public Person build() { + List favoriteMovies = favoriteMovies(); + List copy = Collections.unmodifiableList(new ArrayList<>(favoriteMovies)); + favoriteMovies(copy); + return autoBuild(); + } + } +} diff --git a/java-streams/src/main/resources/logback.xml b/code-generation/src/main/resources/logback.xml similarity index 100% rename from java-streams/src/main/resources/logback.xml rename to code-generation/src/main/resources/logback.xml diff --git a/autovalue/src/test/java/com/baeldung/autoservice/TranslationServiceUnitTest.java b/code-generation/src/test/java/com/baeldung/autoservice/TranslationServiceUnitTest.java similarity index 100% rename from autovalue/src/test/java/com/baeldung/autoservice/TranslationServiceUnitTest.java rename to code-generation/src/test/java/com/baeldung/autoservice/TranslationServiceUnitTest.java diff --git a/autovalue/src/test/java/com/baeldung/autovalue/MoneyUnitTest.java b/code-generation/src/test/java/com/baeldung/autovalue/MoneyUnitTest.java similarity index 100% rename from autovalue/src/test/java/com/baeldung/autovalue/MoneyUnitTest.java rename to code-generation/src/test/java/com/baeldung/autovalue/MoneyUnitTest.java diff --git a/code-generation/src/test/java/com/baeldung/autovalue/PersonUnitTest.java b/code-generation/src/test/java/com/baeldung/autovalue/PersonUnitTest.java new file mode 100644 index 0000000000..fce12edafe --- /dev/null +++ b/code-generation/src/test/java/com/baeldung/autovalue/PersonUnitTest.java @@ -0,0 +1,37 @@ +package com.baeldung.autovalue; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; + +/** + * Unit Test which verifies that the {@link Person} value object creates defensive copies of its favoriteMovies list. + */ +public class PersonUnitTest { + + @Test + public void givenNewPerson_whenModifyOriginalList_thenValueObjectIsNotAlsoModified() { + // GIVEN new Person + List originalFavoriteMoviesList = new ArrayList(); + originalFavoriteMoviesList.add("Training Day"); + originalFavoriteMoviesList.add("Fast and the Furious"); + Person person = Person.builder() + .name("Dan") + .favoriteMovies(originalFavoriteMoviesList) + .build(); + + // WHEN modify original list + originalFavoriteMoviesList.add("Friday"); + + // THEN Person remains unaffected + assertFalse(person.favoriteMovies() + .contains("Friday")); + assertEquals(2, person.favoriteMovies() + .size()); + } + +} diff --git a/core-groovy-2/README.md b/core-groovy-2/README.md index 1211dae76d..95a00a1f5b 100644 --- a/core-groovy-2/README.md +++ b/core-groovy-2/README.md @@ -1,11 +1,16 @@ -# Groovy +# Core Groovy 2 + +This module contains articles about core Groovy concepts ## Relevant articles: -- [String Matching in Groovy](http://www.baeldung.com/) - [Template Engines in Groovy](https://www.baeldung.com/groovy-template-engines) - [Groovy def Keyword](https://www.baeldung.com/groovy-def-keyword) - [Pattern Matching in Strings in Groovy](https://www.baeldung.com/groovy-pattern-matching) - [Working with XML in Groovy](https://www.baeldung.com/groovy-xml) - [Integrating Groovy into Java Applications](https://www.baeldung.com/groovy-java-applications) - [Concatenate Strings with Groovy](https://www.baeldung.com/groovy-concatenate-strings) +- [Metaprogramming in Groovy](https://www.baeldung.com/groovy-metaprogramming) +- [A Quick Guide to Working with Web Services in Groovy](https://www.baeldung.com/groovy-web-services) +- [Categories in Groovy](https://www.baeldung.com/groovy-categories) +- [[<-- Prev]](/core-groovy) diff --git a/core-groovy-2/pom.xml b/core-groovy-2/pom.xml index 91e31d4cba..08526bac9a 100644 --- a/core-groovy-2/pom.xml +++ b/core-groovy-2/pom.xml @@ -181,10 +181,8 @@ 2.4.0 1.1-groovy-2.4 1.1.3 - 3.8.1 1.2.3 2.5.7 - UTF-8 diff --git a/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy b/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy new file mode 100644 index 0000000000..479c39699f --- /dev/null +++ b/core-groovy-2/src/main/groovy/com/baeldung/category/BaeldungCategory.groovy @@ -0,0 +1,17 @@ +package com.baeldung.category; + +class BaeldungCategory { + + public static String capitalize(String self) { + String capitalizedStr = self; + if (self.size() > 0) { + capitalizedStr = self.substring(0, 1).toUpperCase() + self.substring(1); + } + return capitalizedStr + } + + public static double toThePower(Number self, Number exponent) { + return Math.pow(self, exponent); + } + +} diff --git a/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy b/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy new file mode 100644 index 0000000000..ccf2ed519b --- /dev/null +++ b/core-groovy-2/src/main/groovy/com/baeldung/category/NumberCategory.groovy @@ -0,0 +1,17 @@ +package com.baeldung.category; + +import groovy.lang.Category + +@Category(Number) +class NumberCategory { + + public Number cube() { + return this*this*this + } + + public int divideWithRoundUp(BigDecimal divisor, boolean isRoundUp) { + def mathRound = isRoundUp ? BigDecimal.ROUND_UP : BigDecimal.ROUND_DOWN + return (int)new BigDecimal(this).divide(divisor, 0, mathRound) + } + +} diff --git a/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy new file mode 100644 index 0000000000..a1f67b1e2e --- /dev/null +++ b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy @@ -0,0 +1,101 @@ +package com.baeldung.category + +import groovy.time.* +import java.text.SimpleDateFormat +import groovy.xml.* +import groovy.xml.dom.* +import com.baeldung.category.BaeldungCategory +import com.baeldung.category.NumberCategory + +class CategoryUnitTest extends GroovyTestCase { + + void test_whenUsingTimeCategory_thenOperationOnDate() { + def jan_1_2019 = new Date("01/01/2019") + use (TimeCategory) { + assert jan_1_2019 + 10.seconds == new Date("01/01/2019 00:00:10") + + assert jan_1_2019 + 20.minutes == new Date("01/01/2019 00:20:00") + + assert jan_1_2019 + 2.hours == new Date("01/01/2019 02:00:00") + + assert jan_1_2019 - 1.day == new Date("12/31/2018") + + assert jan_1_2019 + 2.weeks == new Date("01/15/2019") + + assert jan_1_2019 - 2.months == new Date("11/01/2018") + + assert jan_1_2019 + 3.years == new Date("01/01/2022") + } + } + + void test_whenUsingTimeCategory_thenOperationOnNumber() { + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy") + use (TimeCategory) { + assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days) + + sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss") + assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes) + assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours) + } + } + + void test_whenUsingDOMCategory_thenOperationOnXML() { + + def baeldungArticlesText = """ + +
+ An Intro to the Java Debug Interface (JDI) + A quick and practical overview of Java Debug Interface. +
+
+ A Quick Guide to Working with Web Services in Groovy + Learn how to work with Web Services in Groovy. +
+
+""" + def baeldungArticlesDom = DOMBuilder.newInstance().parseText(baeldungArticlesText) + + def root = baeldungArticlesDom.documentElement + + use (DOMCategory) { + assert root.article.size() == 2 + + def articles = root.article + + assert articles[0].title.text() == "An Intro to the Java Debug Interface (JDI)" + assert articles[1].desc.text() == "Learn how to work with Web Services in Groovy." + + def articleNode3 = root.appendNode(new QName("article"), ["core-java": "false"]) + + articleNode3.appendNode("title", "Metaprogramming in Groovy") + articleNode3.appendNode("desc", "Explore the concept of runtime and compile-time metaprogramming in Groovy") + + assert root.article.size() == 3 + + assert root.article[2].title.text() == "Metaprogramming in Groovy" + } + } + + void test_whenUsingBaeldungCategory_thenCapitalizeString() { + use (BaeldungCategory) { + assert "norman".capitalize() == "Norman" + } + } + + void test_whenUsingBaeldungCategory_thenOperationsOnNumber() { + use (BaeldungCategory) { + assert 50.toThePower(2) == 2500 + assert 2.4.toThePower(4) == 33.1776 + } + } + + void test_whenUsingNumberCategory_thenOperationsOnNumber() { + use (NumberCategory) { + assert 3.cube() == 27 + assert 25.divideWithRoundUp(6, true) == 5 + assert 120.23.divideWithRoundUp(6.1, true) == 20 + assert 150.9.divideWithRoundUp(12.1, false) == 12 + } + } + +} diff --git a/core-groovy-collections/README.md b/core-groovy-collections/README.md index aeba8933be..aae8be508e 100644 --- a/core-groovy-collections/README.md +++ b/core-groovy-collections/README.md @@ -1,6 +1,10 @@ -# Groovy +## Core Groovy Collections + +This module contains articles about Groovy core collections ## Relevant articles: - [Maps in Groovy](https://www.baeldung.com/groovy-maps) - +- [Finding Elements in Collections in Groovy](https://www.baeldung.com/groovy-collections-find-elements) +- [Lists in Groovy](https://www.baeldung.com/groovy-lists) +- [A Quick Guide to Iterating a Map in Groovy](https://www.baeldung.com/groovy-map-iterating) diff --git a/core-groovy-collections/src/test/groovy/com/baeldung/find/ListFindUnitTest.groovy b/core-groovy-collections/src/test/groovy/com/baeldung/find/ListFindUnitTest.groovy new file mode 100644 index 0000000000..82a2138be4 --- /dev/null +++ b/core-groovy-collections/src/test/groovy/com/baeldung/find/ListFindUnitTest.groovy @@ -0,0 +1,58 @@ +package com.baeldung.find + +import com.baeldung.find.Person +import org.junit.Test + +import static org.junit.Assert.* + +class ListFindUnitTest { + + private final personList = [ + new Person("Regina", "Fitzpatrick", 25), + new Person("Abagail", "Ballard", 26), + new Person("Lucian", "Walter", 30), + ] + + @Test + void whenListContainsElement_thenCheckReturnsTrue() { + def list = ['a', 'b', 'c'] + + assertTrue(list.indexOf('a') > -1) + assertTrue(list.contains('a')) + } + + @Test + void whenListContainsElement_thenCheckWithMembershipOperatorReturnsTrue() { + def list = ['a', 'b', 'c'] + + assertTrue('a' in list) + } + + @Test + void givenListOfPerson_whenUsingStreamMatching_thenShouldEvaluateList() { + assertTrue(personList.stream().anyMatch {it.age > 20}) + assertFalse(personList.stream().allMatch {it.age < 30}) + } + + @Test + void givenListOfPerson_whenUsingCollectionMatching_thenShouldEvaluateList() { + assertTrue(personList.any {it.age > 20}) + assertFalse(personList.every {it.age < 30}) + } + + @Test + void givenListOfPerson_whenUsingStreamFind_thenShouldReturnMatchingElements() { + assertTrue(personList.stream().filter {it.age > 20}.findAny().isPresent()) + assertFalse(personList.stream().filter {it.age > 30}.findAny().isPresent()) + assertTrue(personList.stream().filter {it.age > 20}.findAll().size() == 3) + assertTrue(personList.stream().filter {it.age > 30}.findAll().isEmpty()) + } + + @Test + void givenListOfPerson_whenUsingCollectionFind_thenShouldReturnMatchingElements() { + assertNotNull(personList.find {it.age > 20}) + assertNull(personList.find {it.age > 30}) + assertTrue(personList.findAll {it.age > 20}.size() == 3) + assertTrue(personList.findAll {it.age > 30}.isEmpty()) + } +} diff --git a/core-groovy-collections/src/test/groovy/com/baeldung/find/MapFindUnitTest.groovy b/core-groovy-collections/src/test/groovy/com/baeldung/find/MapFindUnitTest.groovy new file mode 100644 index 0000000000..16e231182b --- /dev/null +++ b/core-groovy-collections/src/test/groovy/com/baeldung/find/MapFindUnitTest.groovy @@ -0,0 +1,76 @@ +package com.baeldung.find + +import com.baeldung.find.Person +import org.junit.Test + +import static org.junit.Assert.* + +class MapFindUnitTest { + + private final personMap = [ + Regina : new Person("Regina", "Fitzpatrick", 25), + Abagail: new Person("Abagail", "Ballard", 26), + Lucian : new Person("Lucian", "Walter", 30) + ] + + @Test + void whenMapContainsKeyElement_thenCheckReturnsTrue() { + def map = [a: 'd', b: 'e', c: 'f'] + + assertTrue(map.containsKey('a')) + assertFalse(map.containsKey('e')) + assertTrue(map.containsValue('e')) + } + + @Test + void whenMapContainsKeyElement_thenCheckByMembershipReturnsTrue() { + def map = [a: 'd', b: 'e', c: 'f'] + + assertTrue('a' in map) + assertFalse('f' in map) + } + + @Test + void whenMapContainsFalseBooleanValues_thenCheckReturnsFalse() { + def map = [a: true, b: false, c: null] + + assertTrue(map.containsKey('b')) + assertTrue('a' in map) + assertFalse('b' in map) + assertFalse('c' in map) + } + + @Test + void givenMapOfPerson_whenUsingStreamMatching_thenShouldEvaluateMap() { + assertTrue(personMap.keySet().stream().anyMatch {it == "Regina"}) + assertFalse(personMap.keySet().stream().allMatch {it == "Albert"}) + assertFalse(personMap.values().stream().allMatch {it.age < 30}) + assertTrue(personMap.entrySet().stream().anyMatch {it.key == "Abagail" && it.value.lastname == "Ballard"}) + } + + @Test + void givenMapOfPerson_whenUsingCollectionMatching_thenShouldEvaluateMap() { + assertTrue(personMap.keySet().any {it == "Regina"}) + assertFalse(personMap.keySet().every {it == "Albert"}) + assertFalse(personMap.values().every {it.age < 30}) + assertTrue(personMap.any {firstname, person -> firstname == "Abagail" && person.lastname == "Ballard"}) + } + + @Test + void givenMapOfPerson_whenUsingCollectionFind_thenShouldReturnElements() { + assertNotNull(personMap.find {it.key == "Abagail" && it.value.lastname == "Ballard"}) + assertTrue(personMap.findAll {it.value.age > 20}.size() == 3) + } + + @Test + void givenMapOfPerson_whenUsingStreamFind_thenShouldReturnElements() { + assertTrue( + personMap.entrySet().stream() + .filter {it.key == "Abagail" && it.value.lastname == "Ballard"} + .findAny().isPresent()) + assertTrue( + personMap.entrySet().stream() + .filter {it.value.age > 20} + .findAll().size() == 3) + } +} diff --git a/core-groovy/src/main/groovy/com/baeldung/Person.groovy b/core-groovy-collections/src/test/groovy/com/baeldung/find/Person.groovy similarity index 96% rename from core-groovy/src/main/groovy/com/baeldung/Person.groovy rename to core-groovy-collections/src/test/groovy/com/baeldung/find/Person.groovy index 6a009aeee0..e65826363a 100644 --- a/core-groovy/src/main/groovy/com/baeldung/Person.groovy +++ b/core-groovy-collections/src/test/groovy/com/baeldung/find/Person.groovy @@ -1,4 +1,4 @@ -package com.baeldung +package com.baeldung.find class Person { private String firstname diff --git a/core-groovy-collections/src/test/groovy/com/baeldung/find/SetFindUnitTest.groovy b/core-groovy-collections/src/test/groovy/com/baeldung/find/SetFindUnitTest.groovy new file mode 100644 index 0000000000..d2d03d5427 --- /dev/null +++ b/core-groovy-collections/src/test/groovy/com/baeldung/find/SetFindUnitTest.groovy @@ -0,0 +1,16 @@ +package com.baeldung.find + +import org.junit.Test + +import static org.junit.Assert.assertTrue + +class SetFindUnitTest { + + @Test + void whenSetContainsElement_thenCheckReturnsTrue() { + def set = ['a', 'b', 'c'] as Set + + assertTrue(set.contains('a')) + assertTrue('a' in set) + } +} \ No newline at end of file diff --git a/core-groovy-collections/src/test/groovy/com/baeldung/iteratemap/IterateMapUnitTest.groovy b/core-groovy-collections/src/test/groovy/com/baeldung/iteratemap/IterateMapUnitTest.groovy new file mode 100644 index 0000000000..970203ce85 --- /dev/null +++ b/core-groovy-collections/src/test/groovy/com/baeldung/iteratemap/IterateMapUnitTest.groovy @@ -0,0 +1,87 @@ +package com.baeldung.iteratemap + +import com.baeldung.find.Person +import org.junit.Test + +import static org.junit.Assert.* + +class IterateMapUnitTest { + + @Test + void whenUsingEach_thenMapIsIterated() { + def map = [ + 'FF0000' : 'Red', + '00FF00' : 'Lime', + '0000FF' : 'Blue', + 'FFFF00' : 'Yellow' + ] + + map.each { println "Hex Code: $it.key = Color Name: $it.value" } + } + + @Test + void whenUsingEachWithEntry_thenMapIsIterated() { + def map = [ + 'E6E6FA' : 'Lavender', + 'D8BFD8' : 'Thistle', + 'DDA0DD' : 'Plum', + ] + + map.each { entry -> println "Hex Code: $entry.key = Color Name: $entry.value" } + } + + @Test + void whenUsingEachWithKeyAndValue_thenMapIsIterated() { + def map = [ + '000000' : 'Black', + 'FFFFFF' : 'White', + '808080' : 'Gray' + ] + + map.each { key, val -> + println "Hex Code: $key = Color Name $val" + } + } + + @Test + void whenUsingEachWithIndexAndEntry_thenMapIsIterated() { + def map = [ + '800080' : 'Purple', + '4B0082' : 'Indigo', + '6A5ACD' : 'Slate Blue' + ] + + map.eachWithIndex { entry, index -> + def indent = ((index == 0 || index % 2 == 0) ? " " : "") + println "$indent Hex Code: $entry.key = Color Name: $entry.value" + } + } + + @Test + void whenUsingEachWithIndexAndKeyAndValue_thenMapIsIterated() { + def map = [ + 'FFA07A' : 'Light Salmon', + 'FF7F50' : 'Coral', + 'FF6347' : 'Tomato', + 'FF4500' : 'Orange Red' + ] + + map.eachWithIndex { key, val, index -> + def indent = ((index == 0 || index % 2 == 0) ? " " : "") + println "$indent Hex Code: $key = Color Name: $val" + } + } + + @Test + void whenUsingForLoop_thenMapIsIterated() { + def map = [ + '2E8B57' : 'Seagreen', + '228B22' : 'Forest Green', + '008000' : 'Green' + ] + + for (entry in map) { + println "Hex Code: $entry.key = Color Name: $entry.value" + } + } +} diff --git a/core-groovy-collections/src/test/groovy/com/baeldung/lists/ListUnitTest.groovy b/core-groovy-collections/src/test/groovy/com/baeldung/lists/ListUnitTest.groovy new file mode 100644 index 0000000000..e4c0a0c177 --- /dev/null +++ b/core-groovy-collections/src/test/groovy/com/baeldung/lists/ListUnitTest.groovy @@ -0,0 +1,173 @@ +package com.baeldung.lists + +import static groovy.test.GroovyAssert.* +import org.junit.Test + +class ListUnitTest { + + @Test + void testCreateList() { + + def list = [1, 2, 3] + assertNotNull(list) + + def listMix = ['A', "b", 1, true] + assertTrue(listMix == ['A', "b", 1, true]) + + def linkedList = [1, 2, 3] as LinkedList + assertTrue(linkedList instanceof LinkedList) + + ArrayList arrList = [1, 2, 3] + assertTrue(arrList.class == ArrayList) + + def copyList = new ArrayList(arrList) + assertTrue(copyList == arrList) + + def cloneList = arrList.clone() + assertTrue(cloneList == arrList) + } + + @Test + void testCreateEmptyList() { + + def emptyList = [] + assertTrue(emptyList.size() == 0) + } + + @Test + void testCompareTwoLists() { + + def list1 = [5, 6.0, 'p'] + def list2 = [5, 6.0, 'p'] + assertTrue(list1 == list2) + } + + @Test + void testGetItemsFromList(){ + + def list = ["Hello", "World"] + + assertTrue(list.get(1) == "World") + assertTrue(list[1] == "World") + assertTrue(list[-1] == "World") + assertTrue(list.getAt(1) == "World") + assertTrue(list.getAt(-2) == "Hello") + } + + @Test + void testAddItemsToList() { + + def list = [] + + list << 1 + list.add("Apple") + assertTrue(list == [1, "Apple"]) + + list[2] = "Box" + list[4] = true + assertTrue(list == [1, "Apple", "Box", null, true]) + + list.add(1, 6.0) + assertTrue(list == [1, 6.0, "Apple", "Box", null, true]) + + def list2 = [1, 2] + list += list2 + list += 12 + assertTrue(list == [1, 6.0, "Apple", "Box", null, true, 1, 2, 12]) + } + + @Test + void testUpdateItemsInList() { + + def list =[1, "Apple", 80, "App"] + list[1] = "Box" + list.set(2,90) + assertTrue(list == [1, "Box", 90, "App"]) + } + + @Test + void testRemoveItemsFromList(){ + + def list = [1, 2, 3, 4, 5, 5, 6, 6, 7] + + list.remove(3) + assertTrue(list == [1, 2, 3, 5, 5, 6, 6, 7]) + + list.removeElement(5) + assertTrue(list == [1, 2, 3, 5, 6, 6, 7]) + + assertTrue(list - 6 == [1, 2, 3, 5, 7]) + } + + @Test + void testIteratingOnAList(){ + + def list = [1, "App", 3, 4] + list.each{ println it * 2} + + list.eachWithIndex{ it, i -> println "$i : $it" } + } + + @Test + void testCollectingToAnotherList(){ + + def list = ["Kay", "Henry", "Justin", "Tom"] + assertTrue(list.collect{"Hi " + it} == ["Hi Kay", "Hi Henry", "Hi Justin", "Hi Tom"]) + } + + @Test + void testJoinItemsInAList(){ + assertTrue(["One", "Two", "Three"].join(",") == "One,Two,Three") + } + + @Test + void testFilteringOnLists(){ + def filterList = [2, 1, 3, 4, 5, 6, 76] + + assertTrue(filterList.find{it > 3} == 4) + + assertTrue(filterList.findAll{it > 3} == [4, 5, 6, 76]) + + assertTrue(filterList.findAll{ it instanceof Number} == [2, 1, 3, 4, 5, 6, 76]) + + assertTrue(filterList.grep( Number )== [2, 1, 3, 4, 5, 6, 76]) + + assertTrue(filterList.grep{ it> 6 }== [76]) + + def conditionList = [2, 1, 3, 4, 5, 6, 76] + + assertFalse(conditionList.every{ it < 6}) + + assertTrue(conditionList.any{ it%2 == 0}) + + } + + @Test + void testGetUniqueItemsInAList(){ + assertTrue([1, 3, 3, 4].toUnique() == [1, 3, 4]) + + def uniqueList = [1, 3, 3, 4] + uniqueList.unique() + assertTrue(uniqueList == [1, 3, 4]) + + assertTrue(["A", "B", "Ba", "Bat", "Cat"].toUnique{ it.size()} == ["A", "Ba", "Bat"]) + } + + @Test + void testSorting(){ + + assertTrue([1, 2, 1, 0].sort() == [0, 1, 1, 2]) + Comparator mc = {a,b -> a == b? 0: a < b? 1 : -1} + + def list = [1, 2, 1, 0] + list.sort(mc) + assertTrue(list == [2, 1, 1, 0]) + + def strList = ["na", "ppp", "as"] + assertTrue(strList.max() == "ppp") + + Comparator minc = {a,b -> a == b? 0: a < b? -1 : 1} + def numberList = [3, 2, 0, 7] + assertTrue(numberList.min(minc) == 0) + } +} \ No newline at end of file diff --git a/core-groovy-collections/src/test/groovy/com/baeldung/map/MapTest.groovy b/core-groovy-collections/src/test/groovy/com/baeldung/map/MapTest.groovy deleted file mode 100644 index c6105eb1c4..0000000000 --- a/core-groovy-collections/src/test/groovy/com/baeldung/map/MapTest.groovy +++ /dev/null @@ -1,148 +0,0 @@ -package com.baeldung.map; - -import static groovy.test.GroovyAssert.* -import org.junit.Test - -class MapTest{ - - @Test - void createMap() { - - def emptyMap = [:] - assertNotNull(emptyMap) - - assertTrue(emptyMap instanceof java.util.LinkedHashMap) - - def map = [name:"Jerry", age: 42, city: "New York"] - assertTrue(map.size() == 3) - } - - @Test - void addItemsToMap() { - - def map = [name:"Jerry"] - - map["age"] = 42 - - map.city = "New York" - - def hobbyLiteral = "hobby" - def hobbyMap = [(hobbyLiteral): "Singing"] - map.putAll(hobbyMap) - - assertTrue(map == [name:"Jerry", age: 42, city: "New York", hobby:"Singing"]) - assertTrue(hobbyMap.hobby == "Singing") - assertTrue(hobbyMap[hobbyLiteral] == "Singing") - - map.plus([1:20]) // returns new map - - map << [2:30] - - } - - @Test - void getItemsFromMap() { - - def map = [name:"Jerry", age: 42, city: "New York", hobby:"Singing"] - - assertTrue(map["name"] == "Jerry") - - assertTrue(map.name == "Jerry") - - def propertyAge = "age" - assertTrue(map[propertyAge] == 42) - } - - @Test - void removeItemsFromMap() { - - def map = [1:20, a:30, 2:42, 4:34, ba:67, 6:39, 7:49] - - def minusMap = map.minus([2:42, 4:34]); - assertTrue(minusMap == [1:20, a:30, ba:67, 6:39, 7:49]) - - minusMap.removeAll{it -> it.key instanceof String} - assertTrue( minusMap == [ 1:20, 6:39, 7:49]) - - minusMap.retainAll{it -> it.value %2 == 0} - assertTrue( minusMap == [1:20]) - } - - @Test - void iteratingOnMaps(){ - def map = [name:"Jerry", age: 42, city: "New York", hobby:"Singing"] - - map.each{ entry -> println "$entry.key: $entry.value" } - - map.eachWithIndex{ entry, i -> println "$i $entry.key: $entry.value" } - - map.eachWithIndex{ key, value, i -> println "$i $key: $value" } - } - - @Test - void filteringAndSearchingMaps(){ - def map = [name:"Jerry", age: 42, city: "New York", hobby:"Singing"] - - assertTrue(map.find{ it.value == "New York"}.key == "city") - - assertTrue(map.findAll{ it.value == "New York"} == [city : "New York"]) - - map.grep{it.value == "New York"}.each{ it -> assertTrue(it.key == "city" && it.value == "New York")} - - assertTrue(map.every{it -> it.value instanceof String} == false) - - assertTrue(map.any{it -> it.value instanceof String} == true) - } - - @Test - void collect(){ - - def map = [1: [name:"Jerry", age: 42, city: "New York"], - 2: [name:"Long", age: 25, city: "New York"], - 3: [name:"Dustin", age: 29, city: "New York"], - 4: [name:"Dustin", age: 34, city: "New York"]] - - def names = map.collect{entry -> entry.value.name} // returns only list - assertTrue(names == ["Jerry", "Long", "Dustin", "Dustin"]) - - def uniqueNames = map.collect([] as HashSet){entry -> entry.value.name} - assertTrue(uniqueNames == ["Jerry", "Long", "Dustin"] as Set) - - def idNames = map.collectEntries{key, value -> [key, value.name]} - assertTrue(idNames == [1:"Jerry", 2: "Long", 3:"Dustin", 4: "Dustin"]) - - def below30Names = map.findAll{it.value.age < 30}.collect{key, value -> value.name} - assertTrue(below30Names == ["Long", "Dustin"]) - - - } - - @Test - void group(){ - def map = [1:20, 2: 40, 3: 11, 4: 93] - - def subMap = map.groupBy{it.value % 2} - println subMap - assertTrue(subMap == [0:[1:20, 2:40 ], 1:[3:11, 4:93]]) - - def keySubMap = map.subMap([1, 2]) - assertTrue(keySubMap == [1:20, 2:40]) - - } - - @Test - void sorting(){ - def map = [ab:20, a: 40, cb: 11, ba: 93] - - def naturallyOrderedMap = map.sort() - assertTrue([a:40, ab:20, ba:93, cb:11] == naturallyOrderedMap) - - def compSortedMap = map.sort({ k1, k2 -> k1 <=> k2 } as Comparator) - assertTrue([a:40, ab:20, ba:93, cb:11] == compSortedMap) - - def cloSortedMap = map.sort({ it1, it2 -> it1.value <=> it1.value }) - assertTrue([cb:11, ab:20, a:40, ba:93] == cloSortedMap) - - } - -} diff --git a/core-groovy-collections/src/test/groovy/com/baeldung/maps/MapTest.groovy b/core-groovy-collections/src/test/groovy/com/baeldung/maps/MapTest.groovy new file mode 100644 index 0000000000..deb552c420 --- /dev/null +++ b/core-groovy-collections/src/test/groovy/com/baeldung/maps/MapTest.groovy @@ -0,0 +1,148 @@ +package com.baeldung.maps; + +import static groovy.test.GroovyAssert.* +import org.junit.Test + +class MapTest{ + + @Test + void createMap() { + + def emptyMap = [:] + assertNotNull(emptyMap) + + assertTrue(emptyMap instanceof java.util.LinkedHashMap) + + def map = [name:"Jerry", age: 42, city: "New York"] + assertTrue(map.size() == 3) + } + + @Test + void addItemsToMap() { + + def map = [name:"Jerry"] + + map["age"] = 42 + + map.city = "New York" + + def hobbyLiteral = "hobby" + def hobbyMap = [(hobbyLiteral): "Singing"] + map.putAll(hobbyMap) + + assertTrue(map == [name:"Jerry", age: 42, city: "New York", hobby:"Singing"]) + assertTrue(hobbyMap.hobby == "Singing") + assertTrue(hobbyMap[hobbyLiteral] == "Singing") + + map.plus([1:20]) // returns new map + + map << [2:30] + + } + + @Test + void getItemsFromMap() { + + def map = [name:"Jerry", age: 42, city: "New York", hobby:"Singing"] + + assertTrue(map["name"] == "Jerry") + + assertTrue(map.name == "Jerry") + + def propertyAge = "age" + assertTrue(map[propertyAge] == 42) + } + + @Test + void removeItemsFromMap() { + + def map = [1:20, a:30, 2:42, 4:34, ba:67, 6:39, 7:49] + + def minusMap = map.minus([2:42, 4:34]); + assertTrue(minusMap == [1:20, a:30, ba:67, 6:39, 7:49]) + + minusMap.removeAll{it -> it.key instanceof String} + assertTrue( minusMap == [ 1:20, 6:39, 7:49]) + + minusMap.retainAll{it -> it.value %2 == 0} + assertTrue( minusMap == [1:20]) + } + + @Test + void iteratingOnMaps(){ + def map = [name:"Jerry", age: 42, city: "New York", hobby:"Singing"] + + map.each{ entry -> println "$entry.key: $entry.value" } + + map.eachWithIndex{ entry, i -> println "$i $entry.key: $entry.value" } + + map.eachWithIndex{ key, value, i -> println "$i $key: $value" } + } + + @Test + void filteringAndSearchingMaps(){ + def map = [name:"Jerry", age: 42, city: "New York", hobby:"Singing"] + + assertTrue(map.find{ it.value == "New York"}.key == "city") + + assertTrue(map.findAll{ it.value == "New York"} == [city : "New York"]) + + map.grep{it.value == "New York"}.each{ it -> assertTrue(it.key == "city" && it.value == "New York")} + + assertTrue(map.every{it -> it.value instanceof String} == false) + + assertTrue(map.any{it -> it.value instanceof String} == true) + } + + @Test + void collect(){ + + def map = [1: [name:"Jerry", age: 42, city: "New York"], + 2: [name:"Long", age: 25, city: "New York"], + 3: [name:"Dustin", age: 29, city: "New York"], + 4: [name:"Dustin", age: 34, city: "New York"]] + + def names = map.collect{entry -> entry.value.name} // returns only list + assertTrue(names == ["Jerry", "Long", "Dustin", "Dustin"]) + + def uniqueNames = map.collect([] as HashSet){entry -> entry.value.name} + assertTrue(uniqueNames == ["Jerry", "Long", "Dustin"] as Set) + + def idNames = map.collectEntries{key, value -> [key, value.name]} + assertTrue(idNames == [1:"Jerry", 2: "Long", 3:"Dustin", 4: "Dustin"]) + + def below30Names = map.findAll{it.value.age < 30}.collect{key, value -> value.name} + assertTrue(below30Names == ["Long", "Dustin"]) + + + } + + @Test + void group(){ + def map = [1:20, 2: 40, 3: 11, 4: 93] + + def subMap = map.groupBy{it.value % 2} + println subMap + assertTrue(subMap == [0:[1:20, 2:40 ], 1:[3:11, 4:93]]) + + def keySubMap = map.subMap([1, 2]) + assertTrue(keySubMap == [1:20, 2:40]) + + } + + @Test + void sorting(){ + def map = [ab:20, a: 40, cb: 11, ba: 93] + + def naturallyOrderedMap = map.sort() + assertTrue([a:40, ab:20, ba:93, cb:11] == naturallyOrderedMap) + + def compSortedMap = map.sort({ k1, k2 -> k1 <=> k2 } as Comparator) + assertTrue([a:40, ab:20, ba:93, cb:11] == compSortedMap) + + def cloSortedMap = map.sort({ it1, it2 -> it1.value <=> it1.value }) + assertTrue([cb:11, ab:20, a:40, ba:93] == cloSortedMap) + + } + +} diff --git a/core-groovy/README.md b/core-groovy/README.md index 321c37be8d..25a0aece3a 100644 --- a/core-groovy/README.md +++ b/core-groovy/README.md @@ -1,15 +1,15 @@ -# Groovy +# Core Groovy + +This module contains articles about core Groovy concepts ## Relevant articles: -- [JDBC with Groovy](http://www.baeldung.com/jdbc-groovy) -- [Working with JSON in Groovy](http://www.baeldung.com/groovy-json) +- [JDBC with Groovy](https://www.baeldung.com/jdbc-groovy) +- [Working with JSON in Groovy](https://www.baeldung.com/groovy-json) - [Reading a File in Groovy](https://www.baeldung.com/groovy-file-read) - [Types of Strings in Groovy](https://www.baeldung.com/groovy-strings) -- [A Quick Guide to Iterating a Map in Groovy](https://www.baeldung.com/groovy-map-iterating) - [An Introduction to Traits in Groovy](https://www.baeldung.com/groovy-traits) - [Closures in Groovy](https://www.baeldung.com/groovy-closures) -- [Finding Elements in Collections in Groovy](https://www.baeldung.com/groovy-collections-find-elements) -- [Lists in Groovy](https://www.baeldung.com/groovy-lists) - [Converting a String to a Date in Groovy](https://www.baeldung.com/groovy-string-to-date) -- [Guide to I/O in Groovy](https://www.baeldung.com/groovy-io) \ No newline at end of file +- [Guide to I/O in Groovy](https://www.baeldung.com/groovy-io) +- [[More -->]](/core-groovy-2) \ No newline at end of file diff --git a/core-groovy/pom.xml b/core-groovy/pom.xml index 029e5460ab..80d6f8d2d5 100644 --- a/core-groovy/pom.xml +++ b/core-groovy/pom.xml @@ -109,9 +109,6 @@ 1.0.0 - - - 2.5.6 2.5.6 2.5.6 diff --git a/core-groovy/src/test/groovy/com/baeldung/lists/ListTest.groovy b/core-groovy/src/test/groovy/com/baeldung/lists/ListTest.groovy deleted file mode 100644 index 7771028132..0000000000 --- a/core-groovy/src/test/groovy/com/baeldung/lists/ListTest.groovy +++ /dev/null @@ -1,173 +0,0 @@ -package com.baeldung.groovy.lists - -import static groovy.test.GroovyAssert.* -import org.junit.Test - -class ListTest{ - - @Test - void testCreateList() { - - def list = [1, 2, 3] - assertNotNull(list) - - def listMix = ['A', "b", 1, true] - assertTrue(listMix == ['A', "b", 1, true]) - - def linkedList = [1, 2, 3] as LinkedList - assertTrue(linkedList instanceof LinkedList) - - ArrayList arrList = [1, 2, 3] - assertTrue(arrList.class == ArrayList) - - def copyList = new ArrayList(arrList) - assertTrue(copyList == arrList) - - def cloneList = arrList.clone() - assertTrue(cloneList == arrList) - } - - @Test - void testCreateEmptyList() { - - def emptyList = [] - assertTrue(emptyList.size() == 0) - } - - @Test - void testCompareTwoLists() { - - def list1 = [5, 6.0, 'p'] - def list2 = [5, 6.0, 'p'] - assertTrue(list1 == list2) - } - - @Test - void testGetItemsFromList(){ - - def list = ["Hello", "World"] - - assertTrue(list.get(1) == "World") - assertTrue(list[1] == "World") - assertTrue(list[-1] == "World") - assertTrue(list.getAt(1) == "World") - assertTrue(list.getAt(-2) == "Hello") - } - - @Test - void testAddItemsToList() { - - def list = [] - - list << 1 - list.add("Apple") - assertTrue(list == [1, "Apple"]) - - list[2] = "Box" - list[4] = true - assertTrue(list == [1, "Apple", "Box", null, true]) - - list.add(1, 6.0) - assertTrue(list == [1, 6.0, "Apple", "Box", null, true]) - - def list2 = [1, 2] - list += list2 - list += 12 - assertTrue(list == [1, 6.0, "Apple", "Box", null, true, 1, 2, 12]) - } - - @Test - void testUpdateItemsInList() { - - def list =[1, "Apple", 80, "App"] - list[1] = "Box" - list.set(2,90) - assertTrue(list == [1, "Box", 90, "App"]) - } - - @Test - void testRemoveItemsFromList(){ - - def list = [1, 2, 3, 4, 5, 5, 6, 6, 7] - - list.remove(3) - assertTrue(list == [1, 2, 3, 5, 5, 6, 6, 7]) - - list.removeElement(5) - assertTrue(list == [1, 2, 3, 5, 6, 6, 7]) - - assertTrue(list - 6 == [1, 2, 3, 5, 7]) - } - - @Test - void testIteratingOnAList(){ - - def list = [1, "App", 3, 4] - list.each{ println it * 2} - - list.eachWithIndex{ it, i -> println "$i : $it" } - } - - @Test - void testCollectingToAnotherList(){ - - def list = ["Kay", "Henry", "Justin", "Tom"] - assertTrue(list.collect{"Hi " + it} == ["Hi Kay", "Hi Henry", "Hi Justin", "Hi Tom"]) - } - - @Test - void testJoinItemsInAList(){ - assertTrue(["One", "Two", "Three"].join(",") == "One,Two,Three") - } - - @Test - void testFilteringOnLists(){ - def filterList = [2, 1, 3, 4, 5, 6, 76] - - assertTrue(filterList.find{it > 3} == 4) - - assertTrue(filterList.findAll{it > 3} == [4, 5, 6, 76]) - - assertTrue(filterList.findAll{ it instanceof Number} == [2, 1, 3, 4, 5, 6, 76]) - - assertTrue(filterList.grep( Number )== [2, 1, 3, 4, 5, 6, 76]) - - assertTrue(filterList.grep{ it> 6 }== [76]) - - def conditionList = [2, 1, 3, 4, 5, 6, 76] - - assertFalse(conditionList.every{ it < 6}) - - assertTrue(conditionList.any{ it%2 == 0}) - - } - - @Test - void testGetUniqueItemsInAList(){ - assertTrue([1, 3, 3, 4].toUnique() == [1, 3, 4]) - - def uniqueList = [1, 3, 3, 4] - uniqueList.unique() - assertTrue(uniqueList == [1, 3, 4]) - - assertTrue(["A", "B", "Ba", "Bat", "Cat"].toUnique{ it.size()} == ["A", "Ba", "Bat"]) - } - - @Test - void testSorting(){ - - assertTrue([1, 2, 1, 0].sort() == [0, 1, 1, 2]) - Comparator mc = {a,b -> a == b? 0: a < b? 1 : -1} - - def list = [1, 2, 1, 0] - list.sort(mc) - assertTrue(list == [2, 1, 1, 0]) - - def strList = ["na", "ppp", "as"] - assertTrue(strList.max() == "ppp") - - Comparator minc = {a,b -> a == b? 0: a < b? -1 : 1} - def numberList = [3, 2, 0, 7] - assertTrue(numberList.min(minc) == 0) - } -} \ No newline at end of file diff --git a/core-groovy/src/test/groovy/com/baeldung/lists/ListUnitTest.groovy b/core-groovy/src/test/groovy/com/baeldung/lists/ListUnitTest.groovy deleted file mode 100644 index 9617c099ce..0000000000 --- a/core-groovy/src/test/groovy/com/baeldung/lists/ListUnitTest.groovy +++ /dev/null @@ -1,58 +0,0 @@ -package com.baeldung.lists - -import com.baeldung.Person -import org.junit.Test - -import static org.junit.Assert.* - -class ListUnitTest { - - private final personList = [ - new Person("Regina", "Fitzpatrick", 25), - new Person("Abagail", "Ballard", 26), - new Person("Lucian", "Walter", 30), - ] - - @Test - void whenListContainsElement_thenCheckReturnsTrue() { - def list = ['a', 'b', 'c'] - - assertTrue(list.indexOf('a') > -1) - assertTrue(list.contains('a')) - } - - @Test - void whenListContainsElement_thenCheckWithMembershipOperatorReturnsTrue() { - def list = ['a', 'b', 'c'] - - assertTrue('a' in list) - } - - @Test - void givenListOfPerson_whenUsingStreamMatching_thenShouldEvaluateList() { - assertTrue(personList.stream().anyMatch {it.age > 20}) - assertFalse(personList.stream().allMatch {it.age < 30}) - } - - @Test - void givenListOfPerson_whenUsingCollectionMatching_thenShouldEvaluateList() { - assertTrue(personList.any {it.age > 20}) - assertFalse(personList.every {it.age < 30}) - } - - @Test - void givenListOfPerson_whenUsingStreamFind_thenShouldReturnMatchingElements() { - assertTrue(personList.stream().filter {it.age > 20}.findAny().isPresent()) - assertFalse(personList.stream().filter {it.age > 30}.findAny().isPresent()) - assertTrue(personList.stream().filter {it.age > 20}.findAll().size() == 3) - assertTrue(personList.stream().filter {it.age > 30}.findAll().isEmpty()) - } - - @Test - void givenListOfPerson_whenUsingCollectionFind_thenShouldReturnMatchingElements() { - assertNotNull(personList.find {it.age > 20}) - assertNull(personList.find {it.age > 30}) - assertTrue(personList.findAll {it.age > 20}.size() == 3) - assertTrue(personList.findAll {it.age > 30}.isEmpty()) - } -} diff --git a/core-groovy/src/test/groovy/com/baeldung/map/MapTest.groovy b/core-groovy/src/test/groovy/com/baeldung/map/MapTest.groovy deleted file mode 100644 index f1d528207f..0000000000 --- a/core-groovy/src/test/groovy/com/baeldung/map/MapTest.groovy +++ /dev/null @@ -1,148 +0,0 @@ -package com.baeldung.groovy.map; - -import static groovy.test.GroovyAssert.* -import org.junit.Test - -class MapTest{ - - @Test - void createMap() { - - def emptyMap = [:] - assertNotNull(emptyMap) - - assertTrue(emptyMap instanceof java.util.LinkedHashMap) - - def map = [name:"Jerry", age: 42, city: "New York"] - assertTrue(map.size() == 3) - } - - @Test - void addItemsToMap() { - - def map = [name:"Jerry"] - - map["age"] = 42 - - map.city = "New York" - - def hobbyLiteral = "hobby" - def hobbyMap = [(hobbyLiteral): "Singing"] - map.putAll(hobbyMap) - - assertTrue(map == [name:"Jerry", age: 42, city: "New York", hobby:"Singing"]) - assertTrue(hobbyMap.hobby == "Singing") - assertTrue(hobbyMap[hobbyLiteral] == "Singing") - - map.plus([1:20]) // returns new map - - map << [2:30] - - } - - @Test - void getItemsFromMap() { - - def map = [name:"Jerry", age: 42, city: "New York", hobby:"Singing"] - - assertTrue(map["name"] == "Jerry") - - assertTrue(map.name == "Jerry") - - def propertyAge = "age" - assertTrue(map[propertyAge] == 42) - } - - @Test - void removeItemsFromMap() { - - def map = [1:20, a:30, 2:42, 4:34, ba:67, 6:39, 7:49] - - def minusMap = map.minus([2:42, 4:34]); - assertTrue(minusMap == [1:20, a:30, ba:67, 6:39, 7:49]) - - minusMap.removeAll{it -> it.key instanceof String} - assertTrue( minusMap == [ 1:20, 6:39, 7:49]) - - minusMap.retainAll{it -> it.value %2 == 0} - assertTrue( minusMap == [1:20]) - } - - @Test - void iteratingOnMaps(){ - def map = [name:"Jerry", age: 42, city: "New York", hobby:"Singing"] - - map.each{ entry -> println "$entry.key: $entry.value" } - - map.eachWithIndex{ entry, i -> println "$i $entry.key: $entry.value" } - - map.eachWithIndex{ key, value, i -> println "$i $key: $value" } - } - - @Test - void filteringAndSearchingMaps(){ - def map = [name:"Jerry", age: 42, city: "New York", hobby:"Singing"] - - assertTrue(map.find{ it.value == "New York"}.key == "city") - - assertTrue(map.findAll{ it.value == "New York"} == [city : "New York"]) - - map.grep{it.value == "New York"}.each{ it -> assertTrue(it.key == "city" && it.value == "New York")} - - assertTrue(map.every{it -> it.value instanceof String} == false) - - assertTrue(map.any{it -> it.value instanceof String} == true) - } - - @Test - void collect(){ - - def map = [1: [name:"Jerry", age: 42, city: "New York"], - 2: [name:"Long", age: 25, city: "New York"], - 3: [name:"Dustin", age: 29, city: "New York"], - 4: [name:"Dustin", age: 34, city: "New York"]] - - def names = map.collect{entry -> entry.value.name} // returns only list - assertTrue(names == ["Jerry", "Long", "Dustin", "Dustin"]) - - def uniqueNames = map.collect([] as HashSet){entry -> entry.value.name} - assertTrue(uniqueNames == ["Jerry", "Long", "Dustin"] as Set) - - def idNames = map.collectEntries{key, value -> [key, value.name]} - assertTrue(idNames == [1:"Jerry", 2: "Long", 3:"Dustin", 4: "Dustin"]) - - def below30Names = map.findAll{it.value.age < 30}.collect{key, value -> value.name} - assertTrue(below30Names == ["Long", "Dustin"]) - - - } - - @Test - void group(){ - def map = [1:20, 2: 40, 3: 11, 4: 93] - - def subMap = map.groupBy{it.value % 2} - println subMap - assertTrue(subMap == [0:[1:20, 2:40 ], 1:[3:11, 4:93]]) - - def keySubMap = map.subMap([1, 2]) - assertTrue(keySubMap == [1:20, 2:40]) - - } - - @Test - void sorting(){ - def map = [ab:20, a: 40, cb: 11, ba: 93] - - def naturallyOrderedMap = map.sort() - assertTrue([a:40, ab:20, ba:93, cb:11] == naturallyOrderedMap) - - def compSortedMap = map.sort({ k1, k2 -> k1 <=> k2 } as Comparator) - assertTrue([a:40, ab:20, ba:93, cb:11] == compSortedMap) - - def cloSortedMap = map.sort({ it1, it2 -> it1.value <=> it1.value }) - assertTrue([cb:11, ab:20, a:40, ba:93] == cloSortedMap) - - } - -} diff --git a/core-groovy/src/test/groovy/com/baeldung/map/MapUnitTest.groovy b/core-groovy/src/test/groovy/com/baeldung/map/MapUnitTest.groovy deleted file mode 100644 index 0d6bbed04b..0000000000 --- a/core-groovy/src/test/groovy/com/baeldung/map/MapUnitTest.groovy +++ /dev/null @@ -1,154 +0,0 @@ -package com.baeldung.map - -import com.baeldung.Person -import org.junit.Test - -import static org.junit.Assert.* - -class MapUnitTest { - - private final personMap = [ - Regina : new Person("Regina", "Fitzpatrick", 25), - Abagail: new Person("Abagail", "Ballard", 26), - Lucian : new Person("Lucian", "Walter", 30) - ] - - @Test - void whenUsingEach_thenMapIsIterated() { - def map = [ - 'FF0000' : 'Red', - '00FF00' : 'Lime', - '0000FF' : 'Blue', - 'FFFF00' : 'Yellow' - ] - - map.each { println "Hex Code: $it.key = Color Name: $it.value" } - } - - @Test - void whenUsingEachWithEntry_thenMapIsIterated() { - def map = [ - 'E6E6FA' : 'Lavender', - 'D8BFD8' : 'Thistle', - 'DDA0DD' : 'Plum', - ] - - map.each { entry -> println "Hex Code: $entry.key = Color Name: $entry.value" } - } - - @Test - void whenUsingEachWithKeyAndValue_thenMapIsIterated() { - def map = [ - '000000' : 'Black', - 'FFFFFF' : 'White', - '808080' : 'Gray' - ] - - map.each { key, val -> - println "Hex Code: $key = Color Name $val" - } - } - - @Test - void whenUsingEachWithIndexAndEntry_thenMapIsIterated() { - def map = [ - '800080' : 'Purple', - '4B0082' : 'Indigo', - '6A5ACD' : 'Slate Blue' - ] - - map.eachWithIndex { entry, index -> - def indent = ((index == 0 || index % 2 == 0) ? " " : "") - println "$indent Hex Code: $entry.key = Color Name: $entry.value" - } - } - - @Test - void whenUsingEachWithIndexAndKeyAndValue_thenMapIsIterated() { - def map = [ - 'FFA07A' : 'Light Salmon', - 'FF7F50' : 'Coral', - 'FF6347' : 'Tomato', - 'FF4500' : 'Orange Red' - ] - - map.eachWithIndex { key, val, index -> - def indent = ((index == 0 || index % 2 == 0) ? " " : "") - println "$indent Hex Code: $key = Color Name: $val" - } - } - - @Test - void whenUsingForLoop_thenMapIsIterated() { - def map = [ - '2E8B57' : 'Seagreen', - '228B22' : 'Forest Green', - '008000' : 'Green' - ] - - for (entry in map) { - println "Hex Code: $entry.key = Color Name: $entry.value" - } - } - - @Test - void whenMapContainsKeyElement_thenCheckReturnsTrue() { - def map = [a: 'd', b: 'e', c: 'f'] - - assertTrue(map.containsKey('a')) - assertFalse(map.containsKey('e')) - assertTrue(map.containsValue('e')) - } - - @Test - void whenMapContainsKeyElement_thenCheckByMembershipReturnsTrue() { - def map = [a: 'd', b: 'e', c: 'f'] - - assertTrue('a' in map) - assertFalse('f' in map) - } - - @Test - void whenMapContainsFalseBooleanValues_thenCheckReturnsFalse() { - def map = [a: true, b: false, c: null] - - assertTrue(map.containsKey('b')) - assertTrue('a' in map) - assertFalse('b' in map) - assertFalse('c' in map) - } - - @Test - void givenMapOfPerson_whenUsingStreamMatching_thenShouldEvaluateMap() { - assertTrue(personMap.keySet().stream().anyMatch {it == "Regina"}) - assertFalse(personMap.keySet().stream().allMatch {it == "Albert"}) - assertFalse(personMap.values().stream().allMatch {it.age < 30}) - assertTrue(personMap.entrySet().stream().anyMatch {it.key == "Abagail" && it.value.lastname == "Ballard"}) - } - - @Test - void givenMapOfPerson_whenUsingCollectionMatching_thenShouldEvaluateMap() { - assertTrue(personMap.keySet().any {it == "Regina"}) - assertFalse(personMap.keySet().every {it == "Albert"}) - assertFalse(personMap.values().every {it.age < 30}) - assertTrue(personMap.any {firstname, person -> firstname == "Abagail" && person.lastname == "Ballard"}) - } - - @Test - void givenMapOfPerson_whenUsingCollectionFind_thenShouldReturnElements() { - assertNotNull(personMap.find {it.key == "Abagail" && it.value.lastname == "Ballard"}) - assertTrue(personMap.findAll {it.value.age > 20}.size() == 3) - } - - @Test - void givenMapOfPerson_whenUsingStreamFind_thenShouldReturnElements() { - assertTrue( - personMap.entrySet().stream() - .filter {it.key == "Abagail" && it.value.lastname == "Ballard"} - .findAny().isPresent()) - assertTrue( - personMap.entrySet().stream() - .filter {it.value.age > 20} - .findAll().size() == 3) - } -} diff --git a/core-groovy/src/test/groovy/com/baeldung/set/SetUnitTest.groovy b/core-groovy/src/test/groovy/com/baeldung/set/SetUnitTest.groovy deleted file mode 100644 index 1248c9ac91..0000000000 --- a/core-groovy/src/test/groovy/com/baeldung/set/SetUnitTest.groovy +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.set - -import org.junit.Test - -import static org.junit.Assert.assertTrue - -class SetUnitTest { - - @Test - void whenSetContainsElement_thenCheckReturnsTrue() { - def set = ['a', 'b', 'c'] as Set - - assertTrue(set.contains('a')) - assertTrue('a' in set) - } -} \ No newline at end of file diff --git a/core-java-modules/README.md b/core-java-modules/README.md index 9ce6057f32..fa77846b45 100644 --- a/core-java-modules/README.md +++ b/core-java-modules/README.md @@ -1,6 +1,9 @@ +## Core Java Modules + +This module contains modules about core Java + ## Relevant articles: - [Multi-Module Maven Application with Java Modules](https://www.baeldung.com/maven-multi-module-project-java-jpms) -- [Guide to Java FileChannel](https://www.baeldung.com/java-filechannel) - [Understanding the NumberFormatException in Java](https://www.baeldung.com/java-number-format-exception) - [Will an Error Be Caught by Catch Block in Java?](https://www.baeldung.com/java-error-catch) diff --git a/core-java-modules/core-java-10/README.md b/core-java-modules/core-java-10/README.md index 8fb4f8a7dd..2b57ec9064 100644 --- a/core-java-modules/core-java-10/README.md +++ b/core-java-modules/core-java-10/README.md @@ -1,3 +1,6 @@ +## Core Java 10 + +This module contains articles about Java 10 core features ### Relevant Articles: diff --git a/core-java-modules/core-java-11/README.md b/core-java-modules/core-java-11/README.md index 11c7d9d388..514f24a4ae 100644 --- a/core-java-modules/core-java-11/README.md +++ b/core-java-modules/core-java-11/README.md @@ -1,3 +1,7 @@ +## Core Java 11 + +This module contains articles about Java 11 core features + ### Relevant articles - [Java 11 Single File Source Code](https://www.baeldung.com/java-single-file-source-code) diff --git a/core-java-modules/core-java-11/pom.xml b/core-java-modules/core-java-11/pom.xml index 4d950bdf8d..81917b6397 100644 --- a/core-java-modules/core-java-11/pom.xml +++ b/core-java-modules/core-java-11/pom.xml @@ -29,6 +29,27 @@ ${assertj.version} test + + org.openjdk.jmh + jmh-core + ${jmh.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh.version} + provided + + + org.eclipse.collections + eclipse-collections + 10.0.0 + + + org.eclipse.collections + eclipse-collections-api + 10.0.0 + @@ -42,6 +63,42 @@ ${maven.compiler.target.version} + + org.apache.maven.plugins + maven-shade-plugin + 3.2.1 + + + package + + shade + + + ${uberjar.name} + + + org.openjdk.jmh.Main + + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + @@ -50,6 +107,7 @@ 11 27.1-jre 3.11.1 + benchmarks + 1.22 -
diff --git a/core-java-modules/core-java-11/src/main/java/com/baeldung/benchmark/IntegerListFilter.java b/core-java-modules/core-java-11/src/main/java/com/baeldung/benchmark/IntegerListFilter.java new file mode 100644 index 0000000000..5961d2d297 --- /dev/null +++ b/core-java-modules/core-java-11/src/main/java/com/baeldung/benchmark/IntegerListFilter.java @@ -0,0 +1,70 @@ +package com.baeldung.benchmark; + +import org.eclipse.collections.api.list.MutableList; +import org.eclipse.collections.api.list.primitive.IntList; +import org.eclipse.collections.api.list.primitive.MutableIntList; +import org.eclipse.collections.impl.factory.primitive.IntLists; +import org.eclipse.collections.impl.list.mutable.FastList; +import org.eclipse.collections.impl.list.mutable.primitive.IntArrayList; +import org.openjdk.jmh.annotations.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.PrimitiveIterator; +import java.util.Random; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +@State(Scope.Benchmark) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.SECONDS) +@Fork(2) +public class IntegerListFilter { + + private List jdkIntList; + private MutableList ecMutableList; + private IntList ecIntList; + private ExecutorService executor; + + @Setup + public void setup() { + PrimitiveIterator.OfInt iterator = new Random(1L).ints(-10000, 10000).iterator(); + ecMutableList = FastList.newWithNValues(1_000_000, iterator::nextInt); + jdkIntList = new ArrayList<>(1_000_000); + jdkIntList.addAll(ecMutableList); + ecIntList = ecMutableList.collectInt(i -> i, new IntArrayList(1_000_000)); + executor = Executors.newWorkStealingPool(); + } + + @Benchmark + public List jdkList() { + return jdkIntList.stream().filter(i -> i % 5 == 0).collect(Collectors.toList()); + } + + @Benchmark + public MutableList ecMutableList() { + return ecMutableList.select(i -> i % 5 == 0); + } + + @Benchmark + public List jdkListParallel() { + return jdkIntList.parallelStream().filter(i -> i % 5 == 0).collect(Collectors.toList()); + } + + @Benchmark + public MutableList ecMutableListParallel() { + return ecMutableList.asParallel(executor, 100_000).select(i -> i % 5 == 0).toList(); + } + + @Benchmark + public IntList ecPrimitive() { + return this.ecIntList.select(i -> i % 5 == 0); + } + + @Benchmark + public IntList ecPrimitiveParallel() { + return this.ecIntList.primitiveParallelStream().filter(i -> i % 5 == 0).collect(IntLists.mutable::empty, MutableIntList::add, MutableIntList::addAll); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-11/src/main/java/com/baeldung/benchmark/IntegerListSum.java b/core-java-modules/core-java-11/src/main/java/com/baeldung/benchmark/IntegerListSum.java new file mode 100644 index 0000000000..cdb2accc0b --- /dev/null +++ b/core-java-modules/core-java-11/src/main/java/com/baeldung/benchmark/IntegerListSum.java @@ -0,0 +1,67 @@ +package com.baeldung.benchmark; + +import org.eclipse.collections.api.list.MutableList; +import org.eclipse.collections.api.list.primitive.IntList; +import org.eclipse.collections.impl.list.mutable.FastList; +import org.eclipse.collections.impl.list.mutable.primitive.IntArrayList; +import org.openjdk.jmh.annotations.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.PrimitiveIterator; +import java.util.Random; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +@State(Scope.Benchmark) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.SECONDS) +@Fork(2) +public class IntegerListSum { + + private List jdkIntList; + private MutableList ecMutableList; + private ExecutorService executor; + private IntList ecIntList; + + @Setup + public void setup() { + PrimitiveIterator.OfInt iterator = new Random(1L).ints(-10000, 10000).iterator(); + ecMutableList = FastList.newWithNValues(1_000_000, iterator::nextInt); + jdkIntList = new ArrayList<>(1_000_000); + jdkIntList.addAll(ecMutableList); + ecIntList = ecMutableList.collectInt(i -> i, new IntArrayList(1_000_000)); + executor = Executors.newWorkStealingPool(); + } + + @Benchmark + public long jdkList() { + return jdkIntList.stream().mapToLong(i -> i).sum(); + } + + @Benchmark + public long ecMutableList() { + return ecMutableList.sumOfInt(i -> i); + } + + @Benchmark + public long jdkListParallel() { + return jdkIntList.parallelStream().mapToLong(i -> i).sum(); + } + + @Benchmark + public long ecMutableListParallel() { + return ecMutableList.asParallel(executor, 100_000).sumOfInt(i -> i); + } + + @Benchmark + public long ecPrimitive() { + return this.ecIntList.sum(); + } + + @Benchmark + public long ecPrimitiveParallel() { + return this.ecIntList.primitiveParallelStream().sum(); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-11/src/test/java/com/baeldung/benchmark/IntegerListFilterUnitTest.java b/core-java-modules/core-java-11/src/test/java/com/baeldung/benchmark/IntegerListFilterUnitTest.java new file mode 100644 index 0000000000..bf68ef70e9 --- /dev/null +++ b/core-java-modules/core-java-11/src/test/java/com/baeldung/benchmark/IntegerListFilterUnitTest.java @@ -0,0 +1,33 @@ +package com.baeldung.benchmark; + +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + + +public class IntegerListFilterUnitTest { + + private IntegerListFilter integerListFilter; + + @Before + public void init() { + integerListFilter = new IntegerListFilter(); + integerListFilter.setup(); + } + + @Test + public void whenBenchmarkIsExecute_thenJDKListsMustBeOfSameSize() { + assertEquals(integerListFilter.jdkList().size(), integerListFilter.jdkListParallel().size()); + } + + @Test + public void whenBenchmarkIsExecute_thenMutableListsMustBeOfSameSize() { + assertEquals(integerListFilter.ecMutableList().size(), integerListFilter.ecMutableListParallel().size()); + } + + @Test + public void whenBenchmarkIsExecute_thenPrimitiveListsMustBeOfSameSize() { + assertEquals(integerListFilter.ecPrimitive().size(), integerListFilter.ecPrimitiveParallel().size()); + } +} diff --git a/core-java-modules/core-java-11/src/test/java/com/baeldung/benchmark/IntegerListSumUnitTest.java b/core-java-modules/core-java-11/src/test/java/com/baeldung/benchmark/IntegerListSumUnitTest.java new file mode 100644 index 0000000000..b375993ffa --- /dev/null +++ b/core-java-modules/core-java-11/src/test/java/com/baeldung/benchmark/IntegerListSumUnitTest.java @@ -0,0 +1,33 @@ +package com.baeldung.benchmark; + +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + + +public class IntegerListSumUnitTest { + + private IntegerListSum integerListSum; + + @Before + public void init() { + integerListSum = new IntegerListSum(); + integerListSum.setup(); + } + + @Test + public void whenBenchmarkIsExecute_thenJDKListsMustHaveSameValue() { + assertEquals(integerListSum.jdkList(), integerListSum.jdkListParallel()); + } + + @Test + public void whenBenchmarkIsExecute_thenMutableListsMustHaveSameValue() { + assertEquals(integerListSum.ecMutableList(), integerListSum.ecMutableListParallel()); + } + + @Test + public void whenBenchmarkIsExecute_thenPrimitiveListsMustHaveSameValue() { + assertEquals(integerListSum.ecPrimitive(), integerListSum.ecPrimitiveParallel()); + } +} diff --git a/core-java-modules/core-java-11/src/test/resources/sample.txt b/core-java-modules/core-java-11/src/test/resources/sample.txt new file mode 100644 index 0000000000..64be299017 --- /dev/null +++ b/core-java-modules/core-java-11/src/test/resources/sample.txt @@ -0,0 +1 @@ +Sample file content \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/README.md b/core-java-modules/core-java-8-2/README.md index d11510b2aa..9201add1d7 100644 --- a/core-java-modules/core-java-8-2/README.md +++ b/core-java-modules/core-java-8-2/README.md @@ -1,10 +1,11 @@ -========= +## Core Java 8 (part 2) -## Core Java 8 Cookbooks and Examples (part 2) +This module contains articles about Java 8 core features ### Relevant Articles: - [Anonymous Classes in Java](http://www.baeldung.com/) - [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) -- [Run JAR Application With Command Line Arguments](https://www.baeldung.com/java-run-jar-with-arguments) +- [Run a Java Application from the Command Line](https://www.baeldung.com/java-run-jar-with-arguments) - [Java 8 Stream skip() vs limit()](https://www.baeldung.com/java-stream-skip-vs-limit) - [Guide to Java BiFunction Interface](https://www.baeldung.com/java-bifunction-interface) +- [[<-- Prev]](/core-java-modules/core-java-8) \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/pom.xml b/core-java-modules/core-java-8-2/pom.xml index 07bb3b7543..269631e0dd 100644 --- a/core-java-modules/core-java-8-2/pom.xml +++ b/core-java-modules/core-java-8-2/pom.xml @@ -3,7 +3,6 @@ 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"> 4.0.0 - com.baeldung core-java-8-2 0.1.0-SNAPSHOT core-java-8-2 @@ -30,24 +29,7 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - UTF-8 - 1.8 - 1.8 64.2 3.12.2 diff --git a/core-java-modules/core-java-8/README.md b/core-java-modules/core-java-8/README.md index aee7121fb3..72bdafe5fa 100644 --- a/core-java-modules/core-java-8/README.md +++ b/core-java-modules/core-java-8/README.md @@ -1,37 +1,15 @@ -========= +## Core Java 8 -## Core Java 8 Cookbooks and Examples +This module contains articles about Java 8 core features ### Relevant Articles: -- [Guide to Java 8’s Collectors](http://www.baeldung.com/java-8-collectors) -- [New Features in Java 8](http://www.baeldung.com/java-8-new-features) -- [The Double Colon Operator in Java 8](http://www.baeldung.com/java-8-double-colon-operator) -- [Guide to Java 8 groupingBy Collector](http://www.baeldung.com/java-groupingby-collector) -- [Strategy Design Pattern in Java 8](http://www.baeldung.com/java-strategy-pattern) -- [Guide to Java 8 Comparator.comparing()](http://www.baeldung.com/java-8-comparator-comparing) -- [Guide To Java 8 Optional](http://www.baeldung.com/java-optional) -- [Guide to the Java 8 forEach](http://www.baeldung.com/foreach-java) -- [The Difference Between map() and flatMap()](http://www.baeldung.com/java-difference-map-and-flatmap) -- [Static and Default Methods in Interfaces in Java](http://www.baeldung.com/java-static-default-methods) -- [Efficient Word Frequency Calculator in Java](http://www.baeldung.com/java-word-frequency) -- [Introduction to Spliterator in Java](http://www.baeldung.com/java-spliterator) -- [Java 8 Math New Methods](http://www.baeldung.com/java-8-math) -- [Overview of Java Built-in Annotations](http://www.baeldung.com/java-default-annotations) -- [Finding Min/Max in an Array with Java](http://www.baeldung.com/java-array-min-max) -- [Internationalization and Localization in Java 8](http://www.baeldung.com/java-8-localization) -- [Java Optional – orElse() vs orElseGet()](http://www.baeldung.com/java-optional-or-else-vs-or-else-get) -- [Java 8 Unsigned Arithmetic Support](http://www.baeldung.com/java-unsigned-arithmetic) -- [Generalized Target-Type Inference in Java](http://www.baeldung.com/java-generalized-target-type-inference) -- [Overriding System Time for Testing in Java](http://www.baeldung.com/java-override-system-time) -- [Set the Time Zone of a Date in Java](https://www.baeldung.com/java-set-date-time-zone) -- [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance) -- [Java Primitives versus Objects](https://www.baeldung.com/java-primitives-vs-objects) -- [How to Use if/else Logic in Java 8 Streams](https://www.baeldung.com/java-8-streams-if-else-logic) -- [How to Replace Many if Statements in Java](https://www.baeldung.com/java-replace-if-statements) -- [Java @Override Annotation](https://www.baeldung.com/java-override) -- [Java @SuppressWarnings Annotation](https://www.baeldung.com/java-suppresswarnings) -- [Java @SafeVarargs Annotation](https://www.baeldung.com/java-safevarargs) -- [Java @Deprecated Annotation](https://www.baeldung.com/java-deprecated) -- [Java 8 Predicate Chain](https://www.baeldung.com/java-predicate-chain) -- [Creating a Custom Annotation in Java](https://www.baeldung.com/java-custom-annotation) -- [The Difference Between Collection.stream().forEach() and Collection.forEach()](https://www.baeldung.com/java-collection-stream-foreach) +- [New Features in Java 8](https://www.baeldung.com/java-8-new-features) +- [Guide to Java 8 groupingBy Collector](https://www.baeldung.com/java-groupingby-collector) +- [Strategy Design Pattern in Java 8](https://www.baeldung.com/java-strategy-pattern) +- [Guide to Java 8 Comparator.comparing()](https://www.baeldung.com/java-8-comparator-comparing) +- [Guide to the Java 8 forEach](https://www.baeldung.com/foreach-java) +- [Introduction to Spliterator in Java](https://www.baeldung.com/java-spliterator) +- [Finding Min/Max in an Array with Java](https://www.baeldung.com/java-array-min-max) +- [Internationalization and Localization in Java 8](https://www.baeldung.com/java-8-localization) +- [Generalized Target-Type Inference in Java](https://www.baeldung.com/java-generalized-target-type-inference) +- [[More -->]](/core-java-modules/core-java-8-2) diff --git a/core-java-modules/core-java-8/pom.xml b/core-java-modules/core-java-8/pom.xml index 6e547b7fad..074359ae54 100644 --- a/core-java-modules/core-java-8/pom.xml +++ b/core-java-modules/core-java-8/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-8 0.1.0-SNAPSHOT core-java-8 @@ -20,31 +19,11 @@ commons-collections4 ${commons-collections4.version} - - commons-io - commons-io - ${commons-io.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.apache.commons - commons-math3 - ${commons-math3.version} - log4j log4j ${log4j.version} - - commons-codec - commons-codec - ${commons-codec.version} - org.projectlombok lombok @@ -58,70 +37,6 @@ ${assertj.version} test - - com.jayway.awaitility - awaitility - ${avaitility.version} - test - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator.version} - - - org.openjdk.jmh - jmh-generator-bytecode - ${jmh-generator.version} - - - com.codepoetics - protonpack - ${protonpack.version} - - - io.vavr - vavr - ${vavr.version} - - - joda-time - joda-time - ${joda.version} - - - org.aspectj - aspectjrt - ${asspectj.version} - - - org.aspectj - aspectjweaver - ${asspectj.version} - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-api-mockito2 - ${powermock.version} - test - - - org.jmockit - jmockit - ${jmockit.version} - test - @@ -150,38 +65,15 @@ - - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar - - true - - - 3.6.1 4.1 - 4.01 - 1.10 - 0.9.0 - 1.13 - 2.10 3.6.1 - 1.8.9 - 2.0.0-RC.4 - 1.44 - 1.7.0 - 1.19 - 1.19 - 2.0.4.RELEASE - 2.22.1 + 2.0.4.RELEASE diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/java_8_features/groupingby/Tuple.java b/core-java-modules/core-java-8/src/main/java/com/baeldung/java_8_features/groupingby/Tuple.java index 7a9f62341e..82a84bb2d6 100644 --- a/core-java-modules/core-java-8/src/main/java/com/baeldung/java_8_features/groupingby/Tuple.java +++ b/core-java-modules/core-java-8/src/main/java/com/baeldung/java_8_features/groupingby/Tuple.java @@ -1,12 +1,12 @@ package com.baeldung.java_8_features.groupingby; -public class Tuple { +import java.util.Objects; + +public class Tuple { + private final BlogPostType type; + private final String author; - private BlogPostType type; - private String author; - public Tuple(BlogPostType type, String author) { - super(); this.type = type; this.author = author; } @@ -15,20 +15,27 @@ public class Tuple { return type; } - public void setType(BlogPostType type) { - this.type = type; - } - public String getAuthor() { return author; } - public void setAuthor(String author) { - this.author = author; + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Tuple tuple = (Tuple) o; + return type == tuple.type && author.equals(tuple.author); + } + + @Override + public int hashCode() { + return Objects.hash(type, author); } @Override public String toString() { - return "Tuple [type=" + type + ", author=" + author + ", getType()=" + getType() + ", getAuthor()=" + getAuthor() + ", getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString() + "]"; + return "Tuple{" + "type=" + type + ", author='" + author + '\'' + '}'; } } diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java_8_features/groupingby/Java8GroupingByCollectorUnitTest.java b/core-java-modules/core-java-8/src/test/java/com/baeldung/java_8_features/groupingby/Java8GroupingByCollectorUnitTest.java index 323586b85f..1da705294e 100644 --- a/core-java-modules/core-java-8/src/test/java/com/baeldung/java_8_features/groupingby/Java8GroupingByCollectorUnitTest.java +++ b/core-java-modules/core-java-8/src/test/java/com/baeldung/java_8_features/groupingby/Java8GroupingByCollectorUnitTest.java @@ -1,15 +1,32 @@ package com.baeldung.java_8_features.groupingby; -import com.baeldung.java_8_features.groupingby.BlogPost; -import com.baeldung.java_8_features.groupingby.BlogPostType; -import org.junit.Test; +import static java.util.Comparator.comparingInt; +import static java.util.stream.Collectors.averagingInt; +import static java.util.stream.Collectors.counting; +import static java.util.stream.Collectors.groupingBy; +import static java.util.stream.Collectors.groupingByConcurrent; +import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.mapping; +import static java.util.stream.Collectors.maxBy; +import static java.util.stream.Collectors.summarizingInt; +import static java.util.stream.Collectors.summingInt; +import static java.util.stream.Collectors.toList; +import static java.util.stream.Collectors.toSet; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; -import java.util.*; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.IntSummaryStatistics; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.concurrent.ConcurrentMap; -import static java.util.Comparator.comparingInt; -import static java.util.stream.Collectors.*; -import static org.junit.Assert.*; +import org.junit.Test; public class Java8GroupingByCollectorUnitTest { @@ -180,4 +197,19 @@ public class Java8GroupingByCollectorUnitTest { assertEquals(15, newsLikeStatistics.getMin()); } + @Test + public void givenAListOfPosts_whenGroupedByComplexMapKeyType_thenGetAMapBetweenTupleAndList() { + Map> postsPerTypeAndAuthor = posts.stream() + .collect(groupingBy(post -> new Tuple(post.getType(), post.getAuthor()))); + + List result = postsPerTypeAndAuthor.get(new Tuple(BlogPostType.GUIDE, "Author 1")); + + assertThat(result.size()).isEqualTo(1); + + BlogPost blogPost = result.get(0); + + assertThat(blogPost.getTitle()).isEqualTo("Programming guide"); + assertThat(blogPost.getType()).isEqualTo(BlogPostType.GUIDE); + assertThat(blogPost.getAuthor()).isEqualTo("Author 1"); + } } diff --git a/core-java-modules/core-java-9-improvements/README.md b/core-java-modules/core-java-9-improvements/README.md new file mode 100644 index 0000000000..b0baccba7f --- /dev/null +++ b/core-java-modules/core-java-9-improvements/README.md @@ -0,0 +1,17 @@ +## Core Java 9 + +This module contains articles about the improvements to core Java features introduced with Java 9. + +### Relevant Articles: + +- [New Stream Collectors in Java 9](http://www.baeldung.com/java9-stream-collectors) +- [Java 9 Optional API Additions](https://www.baeldung.com/java-9-optional) +- [Java 9 Convenience Factory Methods for Collections](https://www.baeldung.com/java-9-collections-factory-methods) +- [Java 9 Stream API Improvements](https://www.baeldung.com/java-9-stream-api) +- [Java 9 java.util.Objects Additions](https://www.baeldung.com/java-9-objects-new) +- [Java 9 CompletableFuture API Improvements](https://www.baeldung.com/java-9-completablefuture) + +#### Relevant articles not in this module: + +- [Java 9 Process API Improvements](https://www.baeldung.com/java-9-process-api) (see the [core-java-os](/core-java-os) module) + diff --git a/core-java-modules/core-java-9-improvements/pom.xml b/core-java-modules/core-java-9-improvements/pom.xml new file mode 100644 index 0000000000..aee289c79f --- /dev/null +++ b/core-java-modules/core-java-9-improvements/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + core-java-9 + 0.2-SNAPSHOT + core-java-9 + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + + + + + com.jayway.awaitility + awaitility + ${awaitility.version} + test + + + org.assertj + assertj-core + ${assertj.version} + test + + + com.google.guava + guava + ${guava.version} + + + org.junit.platform + junit-platform-runner + ${junit.platform.version} + test + + + + + core-java-9 + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + + apache.snapshots + http://repository.apache.org/snapshots/ + + + + + + 3.10.0 + 1.2.0 + 1.7.0 + 1.9 + 1.9 + 25.1-jre + + + diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/Java9OptionalTest.java b/core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/Java9OptionalTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/Java9OptionalTest.java rename to core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/Java9OptionalTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/concurrent/future/CompletableFutureUnitTest.java b/core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/concurrent/future/CompletableFutureUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/concurrent/future/CompletableFutureUnitTest.java rename to core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/concurrent/future/CompletableFutureUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/Java9ObjectsAPIUnitTest.java b/core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/Java9ObjectsAPIUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/Java9ObjectsAPIUnitTest.java rename to core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/Java9ObjectsAPIUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/collections/ListFactoryMethodsUnitTest.java b/core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/collections/ListFactoryMethodsUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/collections/ListFactoryMethodsUnitTest.java rename to core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/collections/ListFactoryMethodsUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/collections/MapFactoryMethodsUnitTest.java b/core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/collections/MapFactoryMethodsUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/collections/MapFactoryMethodsUnitTest.java rename to core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/collections/MapFactoryMethodsUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/collections/SetFactoryMethodsUnitTest.java b/core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/collections/SetFactoryMethodsUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/collections/SetFactoryMethodsUnitTest.java rename to core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/collections/SetFactoryMethodsUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/stream/CollectorImprovementUnitTest.java b/core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/stream/CollectorImprovementUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/stream/CollectorImprovementUnitTest.java rename to core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/stream/CollectorImprovementUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/stream/StreamFeaturesUnitTest.java b/core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/stream/StreamFeaturesUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/stream/StreamFeaturesUnitTest.java rename to core-java-modules/core-java-9-improvements/src/test/java/com/baeldung/java9/language/stream/StreamFeaturesUnitTest.java diff --git a/core-java-modules/core-java-9-jigsaw/README.md b/core-java-modules/core-java-9-jigsaw/README.md new file mode 100644 index 0000000000..b1a401d48c --- /dev/null +++ b/core-java-modules/core-java-9-jigsaw/README.md @@ -0,0 +1,11 @@ +## Core Java 9 + +This module contains articles about Project Jigsaw and the Java Platform Module System (JPMS), introduced with Java 9. + +### Relevant Articles: + +- [Introduction to Project Jigsaw](http://www.baeldung.com/project-jigsaw-java-modularity) +- [A Guide to Java 9 Modularity](https://www.baeldung.com/java-9-modularity) +- [Java 9 java.lang.Module API](https://www.baeldung.com/java-9-module-api) + + diff --git a/core-java-modules/core-java-9/compile-simple-modules.sh b/core-java-modules/core-java-9-jigsaw/compile-simple-modules.sh similarity index 100% rename from core-java-modules/core-java-9/compile-simple-modules.sh rename to core-java-modules/core-java-9-jigsaw/compile-simple-modules.sh diff --git a/core-java-modules/core-java-9/compile-student-client.bat b/core-java-modules/core-java-9-jigsaw/compile-student-client.bat similarity index 100% rename from core-java-modules/core-java-9/compile-student-client.bat rename to core-java-modules/core-java-9-jigsaw/compile-student-client.bat diff --git a/core-java-modules/core-java-9/compile-student-model.bat b/core-java-modules/core-java-9-jigsaw/compile-student-model.bat similarity index 100% rename from core-java-modules/core-java-9/compile-student-model.bat rename to core-java-modules/core-java-9-jigsaw/compile-student-model.bat diff --git a/core-java-modules/core-java-9/compile-student-service-dbimpl.bat b/core-java-modules/core-java-9-jigsaw/compile-student-service-dbimpl.bat similarity index 100% rename from core-java-modules/core-java-9/compile-student-service-dbimpl.bat rename to core-java-modules/core-java-9-jigsaw/compile-student-service-dbimpl.bat diff --git a/core-java-modules/core-java-9/compile-student-service.bat b/core-java-modules/core-java-9-jigsaw/compile-student-service.bat similarity index 100% rename from core-java-modules/core-java-9/compile-student-service.bat rename to core-java-modules/core-java-9-jigsaw/compile-student-service.bat diff --git a/core-java-modules/core-java-9-jigsaw/pom.xml b/core-java-modules/core-java-9-jigsaw/pom.xml new file mode 100644 index 0000000000..8194ae9d00 --- /dev/null +++ b/core-java-modules/core-java-9-jigsaw/pom.xml @@ -0,0 +1,35 @@ + + 4.0.0 + core-java-9-jigsaw + 0.2-SNAPSHOT + core-java-9 + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + + + + core-java-9-jigsaw + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + 1.9 + 1.9 + + + diff --git a/core-java-modules/core-java-9/run-simple-module-app.sh b/core-java-modules/core-java-9-jigsaw/run-simple-module-app.sh similarity index 100% rename from core-java-modules/core-java-9/run-simple-module-app.sh rename to core-java-modules/core-java-9-jigsaw/run-simple-module-app.sh diff --git a/core-java-modules/core-java-9/run-student-client.bat b/core-java-modules/core-java-9-jigsaw/run-student-client.bat similarity index 100% rename from core-java-modules/core-java-9/run-student-client.bat rename to core-java-modules/core-java-9-jigsaw/run-student-client.bat diff --git a/core-java-modules/core-java-9/run-student-client.sh b/core-java-modules/core-java-9-jigsaw/run-student-client.sh similarity index 100% rename from core-java-modules/core-java-9/run-student-client.sh rename to core-java-modules/core-java-9-jigsaw/run-student-client.sh diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.student.client/com/baeldung/student/client/StudentClient.java b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.client/com/baeldung/student/client/StudentClient.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.student.client/com/baeldung/student/client/StudentClient.java rename to core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.client/com/baeldung/student/client/StudentClient.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.student.client/module-info.java b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.client/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.student.client/module-info.java rename to core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.client/module-info.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.student.model/com/baeldung/student/model/Student.java b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.model/com/baeldung/student/model/Student.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.student.model/com/baeldung/student/model/Student.java rename to core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.model/com/baeldung/student/model/Student.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.student.model/module-info.java b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.model/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.student.model/module-info.java rename to core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.model/module-info.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.student.service.dbimpl/com/baeldung/student/service/dbimpl/StudentDbService.java b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service.dbimpl/com/baeldung/student/service/dbimpl/StudentDbService.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.student.service.dbimpl/com/baeldung/student/service/dbimpl/StudentDbService.java rename to core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service.dbimpl/com/baeldung/student/service/dbimpl/StudentDbService.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.student.service.dbimpl/module-info.java b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service.dbimpl/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.student.service.dbimpl/module-info.java rename to core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service.dbimpl/module-info.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.student.service/com/baeldung/student/service/StudentService.java b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service/com/baeldung/student/service/StudentService.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.student.service/com/baeldung/student/service/StudentService.java rename to core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service/com/baeldung/student/service/StudentService.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.student.service/module-info.java b/core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.student.service/module-info.java rename to core-java-modules/core-java-9-jigsaw/src/modules/com.baeldung.student.service/module-info.java diff --git a/core-java-modules/core-java-9/src/simple-modules/hello.modules/com/baeldung/modules/hello/HelloInterface.java b/core-java-modules/core-java-9-jigsaw/src/simple-modules/hello.modules/com/baeldung/modules/hello/HelloInterface.java similarity index 100% rename from core-java-modules/core-java-9/src/simple-modules/hello.modules/com/baeldung/modules/hello/HelloInterface.java rename to core-java-modules/core-java-9-jigsaw/src/simple-modules/hello.modules/com/baeldung/modules/hello/HelloInterface.java diff --git a/core-java-modules/core-java-9/src/simple-modules/hello.modules/com/baeldung/modules/hello/HelloModules.java b/core-java-modules/core-java-9-jigsaw/src/simple-modules/hello.modules/com/baeldung/modules/hello/HelloModules.java similarity index 100% rename from core-java-modules/core-java-9/src/simple-modules/hello.modules/com/baeldung/modules/hello/HelloModules.java rename to core-java-modules/core-java-9-jigsaw/src/simple-modules/hello.modules/com/baeldung/modules/hello/HelloModules.java diff --git a/core-java-modules/core-java-9/src/simple-modules/hello.modules/module-info.java b/core-java-modules/core-java-9-jigsaw/src/simple-modules/hello.modules/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/simple-modules/hello.modules/module-info.java rename to core-java-modules/core-java-9-jigsaw/src/simple-modules/hello.modules/module-info.java diff --git a/core-java-modules/core-java-9/src/simple-modules/main.app/com/baeldung/modules/main/MainApp.java b/core-java-modules/core-java-9-jigsaw/src/simple-modules/main.app/com/baeldung/modules/main/MainApp.java similarity index 100% rename from core-java-modules/core-java-9/src/simple-modules/main.app/com/baeldung/modules/main/MainApp.java rename to core-java-modules/core-java-9-jigsaw/src/simple-modules/main.app/com/baeldung/modules/main/MainApp.java diff --git a/core-java-modules/core-java-9/src/simple-modules/main.app/module-info.java b/core-java-modules/core-java-9-jigsaw/src/simple-modules/main.app/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/simple-modules/main.app/module-info.java rename to core-java-modules/core-java-9-jigsaw/src/simple-modules/main.app/module-info.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/modules/ModuleAPIUnitTest.java b/core-java-modules/core-java-9-jigsaw/src/test/java/com/baeldung/java9/modules/ModuleAPIUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/modules/ModuleAPIUnitTest.java rename to core-java-modules/core-java-9-jigsaw/src/test/java/com/baeldung/java9/modules/ModuleAPIUnitTest.java diff --git a/core-java-modules/core-java-9-new-features/README.md b/core-java-modules/core-java-9-new-features/README.md new file mode 100644 index 0000000000..d547b9a221 --- /dev/null +++ b/core-java-modules/core-java-9-new-features/README.md @@ -0,0 +1,14 @@ +## Core Java 9 + +This module contains articles about core Java features that have been introduced in Java 9. + +### Relevant Articles: + +- [Java 9 New Features](https://www.baeldung.com/new-java-9) +- [Java 9 Variable Handles Demystified](http://www.baeldung.com/java-variable-handles) +- [Exploring the New HTTP Client in Java 9 and 11](http://www.baeldung.com/java-9-http-client) +- [Multi-Release Jar Files](https://www.baeldung.com/java-multi-release-jar) +- [Ahead of Time Compilation (AoT)](https://www.baeldung.com/ahead-of-time-compilation) +- [Introduction to Java 9 StackWalking API](https://www.baeldung.com/java-9-stackwalking-api) +- [Java 9 Platform Logging API](https://www.baeldung.com/java-9-logging-api) +- [Java 9 Reactive Streams](https://www.baeldung.com/java-9-reactive-streams) diff --git a/core-java-modules/core-java-9/compile-aot.sh b/core-java-modules/core-java-9-new-features/compile-aot.sh similarity index 100% rename from core-java-modules/core-java-9/compile-aot.sh rename to core-java-modules/core-java-9-new-features/compile-aot.sh diff --git a/core-java-modules/core-java-9/compile-httpclient.bat b/core-java-modules/core-java-9-new-features/compile-httpclient.bat similarity index 100% rename from core-java-modules/core-java-9/compile-httpclient.bat rename to core-java-modules/core-java-9-new-features/compile-httpclient.bat diff --git a/core-java-modules/core-java-9/compile-modules.sh b/core-java-modules/core-java-9-new-features/compile-modules.sh similarity index 100% rename from core-java-modules/core-java-9/compile-modules.sh rename to core-java-modules/core-java-9-new-features/compile-modules.sh diff --git a/core-java-modules/core-java-9/logging.sh b/core-java-modules/core-java-9-new-features/logging.sh similarity index 100% rename from core-java-modules/core-java-9/logging.sh rename to core-java-modules/core-java-9-new-features/logging.sh diff --git a/core-java-modules/core-java-9/mods/logback.xml b/core-java-modules/core-java-9-new-features/mods/logback.xml similarity index 100% rename from core-java-modules/core-java-9/mods/logback.xml rename to core-java-modules/core-java-9-new-features/mods/logback.xml diff --git a/core-java-modules/core-java-9-new-features/pom.xml b/core-java-modules/core-java-9-new-features/pom.xml new file mode 100644 index 0000000000..cfdbb285d4 --- /dev/null +++ b/core-java-modules/core-java-9-new-features/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + core-java-9-new-features + 0.2-SNAPSHOT + core-java-9 + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + + + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.junit.platform + junit-platform-runner + ${junit.platform.version} + test + + + + + core-java-9-new-features + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + + apache.snapshots + http://repository.apache.org/snapshots/ + + + + + + 3.10.0 + 1.2.0 + 1.9 + 1.9 + + + diff --git a/core-java-modules/core-java-9/run-aot.sh b/core-java-modules/core-java-9-new-features/run-aot.sh similarity index 100% rename from core-java-modules/core-java-9/run-aot.sh rename to core-java-modules/core-java-9-new-features/run-aot.sh diff --git a/core-java-modules/core-java-9/run-httpclient.bat b/core-java-modules/core-java-9-new-features/run-httpclient.bat similarity index 100% rename from core-java-modules/core-java-9/run-httpclient.bat rename to core-java-modules/core-java-9-new-features/run-httpclient.bat diff --git a/core-java-modules/core-java-9/src/main/java/com/baeldung/java9/aot/JaotCompilation.java b/core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/aot/JaotCompilation.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java/com/baeldung/java9/aot/JaotCompilation.java rename to core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/aot/JaotCompilation.java diff --git a/core-java-modules/core-java-9/src/main/java/com/baeldung/java9/language/PrivateInterface.java b/core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/language/PrivateInterface.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java/com/baeldung/java9/language/PrivateInterface.java rename to core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/language/PrivateInterface.java diff --git a/core-java-modules/core-java-9/src/main/java/com/baeldung/java9/reactive/BaeldungBatchSubscriberImpl.java b/core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/reactive/BaeldungBatchSubscriberImpl.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java/com/baeldung/java9/reactive/BaeldungBatchSubscriberImpl.java rename to core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/reactive/BaeldungBatchSubscriberImpl.java diff --git a/core-java-modules/core-java-9/src/main/java/com/baeldung/java9/reactive/BaeldungSubscriberImpl.java b/core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/reactive/BaeldungSubscriberImpl.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java/com/baeldung/java9/reactive/BaeldungSubscriberImpl.java rename to core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/reactive/BaeldungSubscriberImpl.java diff --git a/core-java-modules/core-java-9/src/main/java/com/baeldung/java9/stackwalker/StackWalkerDemo.java b/core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/stackwalker/StackWalkerDemo.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java/com/baeldung/java9/stackwalker/StackWalkerDemo.java rename to core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/stackwalker/StackWalkerDemo.java diff --git a/core-java-modules/core-java-9/src/main/java/com/baeldung/java9/streams.reactive/EndSubscriber.java b/core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/streams.reactive/EndSubscriber.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java/com/baeldung/java9/streams.reactive/EndSubscriber.java rename to core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/streams.reactive/EndSubscriber.java diff --git a/core-java-modules/core-java-9/src/main/java/com/baeldung/java9/streams.reactive/TransformProcessor.java b/core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/streams.reactive/TransformProcessor.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java/com/baeldung/java9/streams.reactive/TransformProcessor.java rename to core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/java9/streams.reactive/TransformProcessor.java diff --git a/core-java-modules/core-java-9/src/main/java/com/baeldung/multireleaseapp/App.java b/core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/multireleaseapp/App.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java/com/baeldung/multireleaseapp/App.java rename to core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/multireleaseapp/App.java diff --git a/core-java-modules/core-java-9/src/main/java/com/baeldung/multireleaseapp/DateHelper.java b/core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/multireleaseapp/DateHelper.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java/com/baeldung/multireleaseapp/DateHelper.java rename to core-java-modules/core-java-9-new-features/src/main/java/com/baeldung/multireleaseapp/DateHelper.java diff --git a/core-java-modules/core-java-9/src/main/java9/com/baeldung/multireleaseapp/DateHelper.java b/core-java-modules/core-java-9-new-features/src/main/java9/com/baeldung/multireleaseapp/DateHelper.java similarity index 100% rename from core-java-modules/core-java-9/src/main/java9/com/baeldung/multireleaseapp/DateHelper.java rename to core-java-modules/core-java-9-new-features/src/main/java9/com/baeldung/multireleaseapp/DateHelper.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.httpclient/com/baeldung/httpclient/HttpClientExample.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.httpclient/com/baeldung/httpclient/HttpClientExample.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.httpclient/com/baeldung/httpclient/HttpClientExample.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.httpclient/com/baeldung/httpclient/HttpClientExample.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.httpclient/module-info.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.httpclient/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.httpclient/module-info.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.httpclient/module-info.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.logging.app/com/baeldung/logging/app/MainApp.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.app/com/baeldung/logging/app/MainApp.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.logging.app/com/baeldung/logging/app/MainApp.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.app/com/baeldung/logging/app/MainApp.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.logging.app/module-info.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.app/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.logging.app/module-info.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.app/module-info.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.logging.slf4j/com/baeldung/logging/slf4j/Slf4jLogger.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.slf4j/com/baeldung/logging/slf4j/Slf4jLogger.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.logging.slf4j/com/baeldung/logging/slf4j/Slf4jLogger.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.slf4j/com/baeldung/logging/slf4j/Slf4jLogger.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.logging.slf4j/com/baeldung/logging/slf4j/Slf4jLoggerFinder.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.slf4j/com/baeldung/logging/slf4j/Slf4jLoggerFinder.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.logging.slf4j/com/baeldung/logging/slf4j/Slf4jLoggerFinder.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.slf4j/com/baeldung/logging/slf4j/Slf4jLoggerFinder.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.logging.slf4j/module-info.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.slf4j/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.logging.slf4j/module-info.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging.slf4j/module-info.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.logging/com/baeldung/logging/ConsoleLogger.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging/com/baeldung/logging/ConsoleLogger.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.logging/com/baeldung/logging/ConsoleLogger.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging/com/baeldung/logging/ConsoleLogger.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.logging/com/baeldung/logging/CustomLoggerFinder.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging/com/baeldung/logging/CustomLoggerFinder.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.logging/com/baeldung/logging/CustomLoggerFinder.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging/com/baeldung/logging/CustomLoggerFinder.java diff --git a/core-java-modules/core-java-9/src/modules/com.baeldung.logging/module-info.java b/core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging/module-info.java similarity index 100% rename from core-java-modules/core-java-9/src/modules/com.baeldung.logging/module-info.java rename to core-java-modules/core-java-9-new-features/src/modules/com.baeldung.logging/module-info.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/MultiResultionImageUnitTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/MultiResultionImageUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/MultiResultionImageUnitTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/MultiResultionImageUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/OptionalToStreamUnitTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/OptionalToStreamUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/OptionalToStreamUnitTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/OptionalToStreamUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/httpclient/HttpClientTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/httpclient/HttpClientTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/httpclient/HttpClientTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/httpclient/HttpClientTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/httpclient/HttpRequestTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/httpclient/HttpRequestTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/httpclient/HttpRequestTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/httpclient/HttpRequestTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/httpclient/HttpResponseTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/httpclient/HttpResponseTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/httpclient/HttpResponseTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/httpclient/HttpResponseTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/DiamondUnitTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/language/DiamondUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/DiamondUnitTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/language/DiamondUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/PrivateInterfaceUnitTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/language/PrivateInterfaceUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/PrivateInterfaceUnitTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/language/PrivateInterfaceUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/TryWithResourcesUnitTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/language/TryWithResourcesUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/language/TryWithResourcesUnitTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/language/TryWithResourcesUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/reactive/BaeldungBatchSubscriberImplIntegrationTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/reactive/BaeldungBatchSubscriberImplIntegrationTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/reactive/BaeldungBatchSubscriberImplIntegrationTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/reactive/BaeldungBatchSubscriberImplIntegrationTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/reactive/BaeldungSubscriberImplIntegrationTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/reactive/BaeldungSubscriberImplIntegrationTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/reactive/BaeldungSubscriberImplIntegrationTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/reactive/BaeldungSubscriberImplIntegrationTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/stackwalker/StackWalkerDemoUnitTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/stackwalker/StackWalkerDemoUnitTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/stackwalker/StackWalkerDemoUnitTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/stackwalker/StackWalkerDemoUnitTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/streams.reactive/ReactiveStreamsTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/streams.reactive/ReactiveStreamsTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/streams.reactive/ReactiveStreamsTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/streams.reactive/ReactiveStreamsTest.java diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/varhandles/VariableHandlesTest.java b/core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/varhandles/VariableHandlesTest.java similarity index 100% rename from core-java-modules/core-java-9/src/test/java/com/baeldung/java9/varhandles/VariableHandlesTest.java rename to core-java-modules/core-java-9-new-features/src/test/java/com/baeldung/java9/varhandles/VariableHandlesTest.java diff --git a/core-java-modules/core-java-9-streams/README.md b/core-java-modules/core-java-9-streams/README.md new file mode 100644 index 0000000000..0ad8500689 --- /dev/null +++ b/core-java-modules/core-java-9-streams/README.md @@ -0,0 +1,6 @@ +## Core Java 9 streams + +This module contains articles about Java 9 streams + +### Relevant Articles: +- [How to Break from Java Stream forEach](https://www.baeldung.com/java-break-stream-foreach) diff --git a/core-java-modules/core-java-9-streams/pom.xml b/core-java-modules/core-java-9-streams/pom.xml new file mode 100644 index 0000000000..6e167caf9c --- /dev/null +++ b/core-java-modules/core-java-9-streams/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + core-java-9-streams + 0.1.0-SNAPSHOT + core-java-9-streams + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + + core-java-9-streams + + + src/main/resources + true + + + + + + + diff --git a/java-streams-2/src/main/java/com/baeldung/breakforeach/CustomForEach.java b/core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/CustomForEach.java similarity index 94% rename from java-streams-2/src/main/java/com/baeldung/breakforeach/CustomForEach.java rename to core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/CustomForEach.java index 1f8866b16c..357571f092 100644 --- a/java-streams-2/src/main/java/com/baeldung/breakforeach/CustomForEach.java +++ b/core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/CustomForEach.java @@ -1,4 +1,4 @@ -package com.baeldung.breakforeach; +package com.baeldung.streams.breakforeach; import java.util.Spliterator; import java.util.function.BiConsumer; diff --git a/java-streams-2/src/main/java/com/baeldung/breakforeach/CustomSpliterator.java b/core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/CustomSpliterator.java similarity index 95% rename from java-streams-2/src/main/java/com/baeldung/breakforeach/CustomSpliterator.java rename to core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/CustomSpliterator.java index cfe4bedac3..1844a3dc37 100644 --- a/java-streams-2/src/main/java/com/baeldung/breakforeach/CustomSpliterator.java +++ b/core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/CustomSpliterator.java @@ -1,4 +1,4 @@ -package com.baeldung.breakforeach; +package com.baeldung.streams.breakforeach; import java.util.Spliterator; import java.util.Spliterators; diff --git a/java-streams-2/src/main/java/com/baeldung/breakforeach/CustomTakeWhile.java b/core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/CustomTakeWhile.java similarity index 90% rename from java-streams-2/src/main/java/com/baeldung/breakforeach/CustomTakeWhile.java rename to core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/CustomTakeWhile.java index 05574f9ae6..1852df3d9c 100644 --- a/java-streams-2/src/main/java/com/baeldung/breakforeach/CustomTakeWhile.java +++ b/core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/CustomTakeWhile.java @@ -1,4 +1,4 @@ -package com.baeldung.breakforeach; +package com.baeldung.streams.breakforeach; import java.util.function.Predicate; import java.util.stream.Stream; diff --git a/java-streams-2/src/main/java/com/baeldung/breakforeach/TakeWhileExample.java b/core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/TakeWhileExample.java similarity index 94% rename from java-streams-2/src/main/java/com/baeldung/breakforeach/TakeWhileExample.java rename to core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/TakeWhileExample.java index 1838ae5fb7..3a16c9d691 100644 --- a/java-streams-2/src/main/java/com/baeldung/breakforeach/TakeWhileExample.java +++ b/core-java-modules/core-java-9-streams/src/main/java/com/baeldung/streams/breakforeach/TakeWhileExample.java @@ -1,4 +1,4 @@ -package com.baeldung.breakforeach; +package com.baeldung.streams.breakforeach; import java.util.List; import java.util.stream.Stream; diff --git a/java-streams-2/src/test/java/com/baeldung/breakforeach/BreakFromStreamForEachUnitTest.java b/core-java-modules/core-java-9-streams/src/test/java/com/baeldung/streams/breakforeach/BreakFromStreamForEachUnitTest.java similarity index 96% rename from java-streams-2/src/test/java/com/baeldung/breakforeach/BreakFromStreamForEachUnitTest.java rename to core-java-modules/core-java-9-streams/src/test/java/com/baeldung/streams/breakforeach/BreakFromStreamForEachUnitTest.java index 23653c0a39..66d293b3fa 100644 --- a/java-streams-2/src/test/java/com/baeldung/breakforeach/BreakFromStreamForEachUnitTest.java +++ b/core-java-modules/core-java-9-streams/src/test/java/com/baeldung/streams/breakforeach/BreakFromStreamForEachUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.breakforeach; +package com.baeldung.streams.breakforeach; import org.junit.Test; diff --git a/core-java-modules/core-java-9/README.md b/core-java-modules/core-java-9/README.md index 8b52ce79b4..94f480db67 100644 --- a/core-java-modules/core-java-9/README.md +++ b/core-java-modules/core-java-9/README.md @@ -1,33 +1,16 @@ -========= +## Core Java 9 -## Core Java 9 Examples - -[Java 9 New Features](http://www.baeldung.com/new-java-9) +This module contains articles about Java 9 core features ### Relevant Articles: -- [Java 9 New Features](https://www.baeldung.com/new-java-9) -- [New Stream Collectors in Java 9](http://www.baeldung.com/java9-stream-collectors) -- [Introduction to Project Jigsaw](http://www.baeldung.com/project-jigsaw-java-modularity) -- [Java 9 Variable Handles Demystified](http://www.baeldung.com/java-variable-handles) -- [Exploring the New HTTP Client in Java 9 and 11](http://www.baeldung.com/java-9-http-client) - [Method Handles in Java](http://www.baeldung.com/java-method-handles) - [Introduction to Chronicle Queue](http://www.baeldung.com/java-chronicle-queue) - [Optional orElse Optional](http://www.baeldung.com/java-optional-or-else-optional) - [Iterate Through a Range of Dates in Java](https://www.baeldung.com/java-iterate-date-range) - [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) - [Immutable Set in Java](https://www.baeldung.com/java-immutable-set) -- [Multi-Release Jar Files](https://www.baeldung.com/java-multi-release-jar) -- [Ahead of Time Compilation (AoT)](https://www.baeldung.com/ahead-of-time-compilation) -- [Java 9 Process API Improvements](https://www.baeldung.com/java-9-process-api) -- [Java 9 java.util.Objects Additions](https://www.baeldung.com/java-9-objects-new) -- [Java 9 Reactive Streams](https://www.baeldung.com/java-9-reactive-streams) -- [Java 9 Optional API Additions](https://www.baeldung.com/java-9-optional) -- [Java 9 CompletableFuture API Improvements](https://www.baeldung.com/java-9-completablefuture) -- [Introduction to Java 9 StackWalking API](https://www.baeldung.com/java-9-stackwalking-api) -- [Java 9 Convenience Factory Methods for Collections](https://www.baeldung.com/java-9-collections-factory-methods) -- [Java 9 Stream API Improvements](https://www.baeldung.com/java-9-stream-api) -- [A Guide to Java 9 Modularity](https://www.baeldung.com/java-9-modularity) -- [Java 9 java.lang.Module API](https://www.baeldung.com/java-9-module-api) -- [Java 9 Platform Logging API](https://www.baeldung.com/java-9-logging-api) - [Filtering a Stream of Optionals in Java](https://www.baeldung.com/java-filter-stream-of-optional) + +Note: also contains part of the code for the article +[How to Filter a Collection in Java](https://www.baeldung.com/java-collection-filtering). diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/README.MD b/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/README.MD deleted file mode 100644 index 2f44a2336b..0000000000 --- a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/README.MD +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Artiles: -- [Filtering a Stream of Optionals in Java](http://www.baeldung.com/java-filter-stream-of-optional) diff --git a/core-java-modules/core-java-annotations/README.md b/core-java-modules/core-java-annotations/README.md new file mode 100644 index 0000000000..93da3aea62 --- /dev/null +++ b/core-java-modules/core-java-annotations/README.md @@ -0,0 +1,12 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [Java @Override Annotation](https://www.baeldung.com/java-override) +- [Java @SuppressWarnings Annotation](https://www.baeldung.com/java-suppresswarnings) +- [Java @SafeVarargs Annotation](https://www.baeldung.com/java-safevarargs) +- [Java @Deprecated Annotation](https://www.baeldung.com/java-deprecated) +- [Overview of Java Built-in Annotations](https://www.baeldung.com/java-default-annotations) +- [Creating a Custom Annotation in Java](https://www.baeldung.com/java-custom-annotation) +- [Efficient Word Frequency Calculator in Java](https://www.baeldung.com/java-word-frequency) diff --git a/core-java-modules/core-java-annotations/pom.xml b/core-java-modules/core-java-annotations/pom.xml new file mode 100644 index 0000000000..92b5afbd47 --- /dev/null +++ b/core-java-modules/core-java-annotations/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + core-java-annotations + 0.1.0-SNAPSHOT + core-java-annotations + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + core-java-annotations + + + src/main/resources + true + + + + + diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithAnnotation.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithDeprecatedMethod.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSafeVarargs.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/ClassWithSuppressWarnings.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntConsumer.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntConsumer.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntConsumer.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntConsumer.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Interval.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Interval.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Interval.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Interval.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntervalUsage.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntervalUsage.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/IntervalUsage.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/IntervalUsage.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Intervals.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Intervals.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/Intervals.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/Intervals.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotation.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotation.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotation.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotation.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyAnnotationTarget.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperation.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperation.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperation.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperation.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperationImpl.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperationImpl.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/annotations/MyOperationImpl.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/annotations/MyOperationImpl.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Init.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Init.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Init.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Init.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonElement.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonElement.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonElement.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonElement.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializable.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializable.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializable.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializable.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializationException.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializationException.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/JsonSerializationException.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/JsonSerializationException.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/ObjectToJsonConverter.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Person.java b/core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Person.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/customannotations/Person.java rename to core-java-modules/core-java-annotations/src/main/java/com/baeldung/customannotations/Person.java diff --git a/java-strings-2/src/main/resources/logback.xml b/core-java-modules/core-java-annotations/src/main/resources/logback.xml similarity index 100% rename from java-strings-2/src/main/resources/logback.xml rename to core-java-modules/core-java-annotations/src/main/resources/logback.xml diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java b/core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java rename to core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java diff --git a/core-java-modules/core-java-arrays-2/.gitignore b/core-java-modules/core-java-arrays-2/.gitignore deleted file mode 100644 index 374c8bf907..0000000000 --- a/core-java-modules/core-java-arrays-2/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -*.class - -0.* - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* -.resourceCache - -# Packaged files # -*.jar -*.war -*.ear - -# Files generated by integration tests -backup-pom.xml -/bin/ -/temp - -#IntelliJ specific -.idea/ -*.iml \ No newline at end of file diff --git a/core-java-modules/core-java-arrays-2/README.MD b/core-java-modules/core-java-arrays-2/README.MD deleted file mode 100644 index f272f4d299..0000000000 --- a/core-java-modules/core-java-arrays-2/README.MD +++ /dev/null @@ -1,5 +0,0 @@ -## Relevant Articles - -- [Extending an Array’s Length](https://www.baeldung.com/java-array-add-element-at-the-end) -- [Checking If an Array Is Sorted in Java](https://www.baeldung.com/java-check-sorted-array) -- [Looping Diagonally Through a 2d Java Array](https://www.baeldung.com/java-loop-diagonal-array) diff --git a/core-java-modules/core-java-arrays-2/README.md b/core-java-modules/core-java-arrays-2/README.md new file mode 100644 index 0000000000..a78b3327b6 --- /dev/null +++ b/core-java-modules/core-java-arrays-2/README.md @@ -0,0 +1,16 @@ +## Core Java Arrays (Part 2) + +This module contains articles about Java arrays + +## Relevant Articles + +- [Extending an Array’s Length](https://www.baeldung.com/java-array-add-element-at-the-end) +- [Looping Diagonally Through a 2d Java Array](https://www.baeldung.com/java-loop-diagonal-array) +- [Converting Between Stream and Array in Java](https://www.baeldung.com/java-stream-to-array) +- [Convert a Float to a Byte Array in Java](https://www.baeldung.com/java-convert-float-to-byte-array) +- [Array Operations in Java](https://www.baeldung.com/java-common-array-operations) +- [Intersection Between two Integer Arrays](https://www.baeldung.com/java-array-intersection) +- [Removing an Element from an Array in Java](https://www.baeldung.com/java-array-remove-element) +- [Removing the First Element of an Array](https://www.baeldung.com/java-array-remove-first-element) +- [Adding an Element to a Java Array vs an ArrayList](https://www.baeldung.com/java-add-element-to-array-vs-list) +- [[<-- Prev]](/core-java-modules/core-java-arrays) diff --git a/core-java-modules/core-java-arrays-2/pom.xml b/core-java-modules/core-java-arrays-2/pom.xml index bfe8a349e1..a1da169f2f 100644 --- a/core-java-modules/core-java-arrays-2/pom.xml +++ b/core-java-modules/core-java-arrays-2/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-arrays-2 0.1.0-SNAPSHOT core-java-arrays-2 diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/AddElementToEndOfArray.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/AddElementToEndOfArray.java similarity index 100% rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/AddElementToEndOfArray.java rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/AddElementToEndOfArray.java diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java similarity index 100% rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/RemoveElementFromAnArray.java diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java similarity index 100% rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/conversions/FloatToByteArray.java diff --git a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/operations/ArrayOperations.java similarity index 83% rename from core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java rename to core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/operations/ArrayOperations.java index d8cc0afd61..4513dbf899 100644 --- a/core-java-modules/core-java-arrays/src/main/java/com/baeldung/array/operations/ArrayOperations.java +++ b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/array/operations/ArrayOperations.java @@ -1,19 +1,14 @@ package com.baeldung.array.operations; +import org.apache.commons.lang3.ArrayUtils; + import java.lang.reflect.Array; -import java.util.Arrays; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.Random; -import java.util.Set; +import java.util.*; import java.util.function.Function; import java.util.function.IntPredicate; import java.util.function.Predicate; import java.util.stream.Stream; -import org.apache.commons.lang3.ArrayUtils; - public class ArrayOperations { // Get the first and last item of an array @@ -197,15 +192,48 @@ public class ArrayOperations { return array[new Random().nextInt(array.length)]; } - public static Integer[] intersectionSimple(final Integer[] a, final Integer[] b){ - return Stream.of(a).filter(Arrays.asList(b)::contains).toArray(Integer[]::new); + public static Integer[] intersectionSimple(final Integer[] a, final Integer[] b) { + return Stream.of(a) + .filter(Arrays.asList(b)::contains) + .toArray(Integer[]::new); } - public static Integer[] intersectionSet(final Integer[] a, final Integer[] b){ - return Stream.of(a).filter(Arrays.asList(b)::contains).distinct().toArray(Integer[]::new); + public static Integer[] intersectionSet(final Integer[] a, final Integer[] b) { + return Stream.of(a) + .filter(Arrays.asList(b)::contains) + .distinct() + .toArray(Integer[]::new); } - public static Integer[] intersectionMultiSet(final Integer[] a, final Integer[] b){ - return Stream.of(a).filter(new LinkedList<>(Arrays.asList(b))::remove).toArray(Integer[]::new); + public static Integer[] intersectionMultiSet(final Integer[] a, final Integer[] b) { + return Stream.of(a) + .filter(new LinkedList<>(Arrays.asList(b))::remove) + .toArray(Integer[]::new); + } + + public static Integer[] addElementUsingPureJava(Integer[] srcArray, int elementToAdd) { + Integer[] destArray = new Integer[srcArray.length + 1]; + + for (int i = 0; i < srcArray.length; i++) { + destArray[i] = srcArray[i]; + } + + destArray[destArray.length - 1] = elementToAdd; + return destArray; + } + + public static int[] insertAnElementAtAGivenIndex(final int[] srcArray, int index, int newElement) { + int[] destArray = new int[srcArray.length + 1]; + int j = 0; + for (int i = 0; i < destArray.length - 1; i++) { + + if (i == index) { + destArray[i] = newElement; + } else { + destArray[i] = srcArray[j]; + j++; + } + } + return destArray; } } diff --git a/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/arraylist/operations/ArrayListOperations.java b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/arraylist/operations/ArrayListOperations.java new file mode 100644 index 0000000000..b2aed553da --- /dev/null +++ b/core-java-modules/core-java-arrays-2/src/main/java/com/baeldung/arraylist/operations/ArrayListOperations.java @@ -0,0 +1,23 @@ +package com.baeldung.arraylist.operations; + +import java.util.ArrayList; + +public class ArrayListOperations { + + public static Integer getAnIntegerElement(ArrayList anArrayList, int index) { + return anArrayList.get(index); + } + + public static void modifyAnIntegerElement(ArrayList anArrayList, int index, Integer newElement) { + anArrayList.set(index, newElement); + } + + public static void appendAnIntegerElement(ArrayList anArrayList, Integer newElement) { + anArrayList.add(newElement); + } + + public static void insertAnIntegerElementAtIndex(ArrayList anArrayList, int index, Integer newElement) { + anArrayList.add(index, newElement); + } + +} diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java similarity index 100% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/AddElementToEndOfArrayUnitTest.java diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java similarity index 91% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java index ea52cd17d9..567b870ef1 100644 --- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/RemoveElementFromAnArrayUnitTest.java @@ -1,13 +1,10 @@ package com.baeldung.array; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; - import org.apache.commons.lang3.ArrayUtils; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + class RemoveElementFromAnArrayUnitTest { private final RemoveElementFromAnArray sut = new RemoveElementFromAnArray(); diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java similarity index 80% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java index a2cd273f21..7656783052 100644 --- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/conversions/FloatToByteArrayUnitTest.java @@ -1,12 +1,10 @@ package com.baeldung.array.conversions; -import static com.baeldung.array.conversions.FloatToByteArray.byteArrayToFloat; -import static com.baeldung.array.conversions.FloatToByteArray.byteArrayToFloatWithByteBuffer; -import static com.baeldung.array.conversions.FloatToByteArray.floatToByteArray; -import static com.baeldung.array.conversions.FloatToByteArray.floatToByteArrayWithByteBuffer; +import org.junit.Test; + +import static com.baeldung.array.conversions.FloatToByteArray.*; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; -import org.junit.Test; public class FloatToByteArrayUnitTest { diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java similarity index 90% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java index a9c6d97d9f..ea9bf2c5a9 100644 --- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/ArrayOperationsUnitTest.java @@ -1,12 +1,11 @@ package com.baeldung.array.operations; -import static org.assertj.core.api.Assertions.assertThat; - import java.util.Arrays; - import org.assertj.core.api.Condition; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertArrayEquals; public class ArrayOperationsUnitTest { @@ -262,8 +261,7 @@ public class ArrayOperationsUnitTest { @Test public void whenMapIntArrayToString_thenReturnArray() { - String[] expectedArray = new String[] { "Value: 3", "Value: 5", "Value: 2", "Value: 5", "Value: 14", - "Value: 4" }; + String[] expectedArray = new String[] { "Value: 3", "Value: 5", "Value: 2", "Value: 5", "Value: 14", "Value: 4" }; String[] output = ArrayOperations.mapIntArrayToString(defaultIntArray); assertThat(output).containsExactly(expectedArray); @@ -313,13 +311,10 @@ public class ArrayOperationsUnitTest { int[] output5 = ArrayOperations.shuffleIntArray(defaultIntArray); int[] output6 = ArrayOperations.shuffleIntArray(defaultIntArray); - Condition atLeastOneArraysIsNotEqual = new Condition( - "at least one output should be different (order-wise)") { + Condition atLeastOneArraysIsNotEqual = new Condition("at least one output should be different (order-wise)") { @Override public boolean matches(int[] value) { - return !Arrays.equals(value, output) || !Arrays.equals(value, output2) || !Arrays.equals(value, output3) - || !Arrays.equals(value, output4) || !Arrays.equals(value, output5) - || !Arrays.equals(value, output6); + return !Arrays.equals(value, output) || !Arrays.equals(value, output2) || !Arrays.equals(value, output3) || !Arrays.equals(value, output4) || !Arrays.equals(value, output5) || !Arrays.equals(value, output6); } }; @@ -335,13 +330,10 @@ public class ArrayOperationsUnitTest { Integer[] output5 = ArrayOperations.shuffleObjectArray(defaultObjectArray); Integer[] output6 = ArrayOperations.shuffleObjectArray(defaultObjectArray); - Condition atLeastOneArraysIsNotEqual = new Condition( - "at least one output should be different (order-wise)") { + Condition atLeastOneArraysIsNotEqual = new Condition("at least one output should be different (order-wise)") { @Override public boolean matches(Integer[] value) { - return !Arrays.equals(value, output) || !Arrays.equals(value, output2) || !Arrays.equals(value, output3) - || !Arrays.equals(value, output4) || !Arrays.equals(value, output5) - || !Arrays.equals(value, output6); + return !Arrays.equals(value, output) || !Arrays.equals(value, output2) || !Arrays.equals(value, output3) || !Arrays.equals(value, output4) || !Arrays.equals(value, output5) || !Arrays.equals(value, output6); } }; @@ -362,4 +354,27 @@ public class ArrayOperationsUnitTest { assertThat(defaultObjectArray).contains(output); } + + @Test + public void givenSourceArrayAndElement_whenAddElementUsingPureJavaIsInvoked_thenNewElementMustBeAdded() { + Integer[] sourceArray = { 1, 2, 3, 4 }; + int elementToAdd = 5; + + Integer[] destArray = ArrayOperations.addElementUsingPureJava(sourceArray, elementToAdd); + + Integer[] expectedArray = { 1, 2, 3, 4, 5 }; + assertArrayEquals(expectedArray, destArray); + } + + @Test + public void whenInsertAnElementAtAGivenIndexCalled_thenShiftTheFollowingElementsAndInsertTheElementInArray() { + int[] expectedArray = { 1, 4, 2, 3, 0 }; + int[] anArray = new int[4]; + anArray[0] = 1; + anArray[1] = 2; + anArray[2] = 3; + int[] outputArray = ArrayOperations.insertAnElementAtAGivenIndex(anArray, 1, 4); + + assertThat(outputArray).containsExactly(expectedArray); + } } diff --git a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java similarity index 91% rename from core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java index 3c61060ea8..1560cc5701 100644 --- a/core-java-modules/core-java-arrays/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/operations/IntersectionUnitTest.java @@ -2,9 +2,7 @@ package com.baeldung.array.operations; import org.junit.jupiter.api.Test; -import static com.baeldung.array.operations.ArrayOperations.intersectionMultiSet; -import static com.baeldung.array.operations.ArrayOperations.intersectionSet; -import static com.baeldung.array.operations.ArrayOperations.intersectionSimple; +import static com.baeldung.array.operations.ArrayOperations.*; import static org.assertj.core.api.Assertions.assertThat; class IntersectionUnitTest { diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/removefirst/RemoveFirstElementUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/removefirst/RemoveFirstElementUnitTest.java similarity index 97% rename from core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/removefirst/RemoveFirstElementUnitTest.java rename to core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/removefirst/RemoveFirstElementUnitTest.java index f2b1bd9d88..83a97973f3 100644 --- a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/removefirst/RemoveFirstElementUnitTest.java +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/array/removefirst/RemoveFirstElementUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.list.removefirst; +package com.baeldung.array.removefirst; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; diff --git a/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/arraylist/operations/ArrayListOperationsUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/arraylist/operations/ArrayListOperationsUnitTest.java new file mode 100644 index 0000000000..1ec7645d8f --- /dev/null +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/arraylist/operations/ArrayListOperationsUnitTest.java @@ -0,0 +1,50 @@ +package com.baeldung.arraylist.operations; + +import java.util.ArrayList; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; + +public class ArrayListOperationsUnitTest { + + private ArrayList anArrayList; + + @BeforeEach + public void setupDefaults() { + anArrayList = new ArrayList<>(); + anArrayList.add(2); + anArrayList.add(3); + anArrayList.add(4); + } + + @Test + public void whenGetAnIntegerElementCalled_thenReturnTheIntegerElement() { + Integer output = ArrayListOperations.getAnIntegerElement(anArrayList, 1); + + assertThat(output).isEqualTo(3); + } + + @Test + public void whenModifyAnIntegerElementCalled_thenModifyTheIntegerElement() { + ArrayListOperations.modifyAnIntegerElement(anArrayList, 2, 5); + Integer output = ArrayListOperations.getAnIntegerElement(anArrayList, 2); + + assertThat(output).isEqualTo(5); + } + + @Test + public void whenAppendAnIntegerElementCalled_thenTheIntegerElementIsAppendedToArrayList() { + ArrayListOperations.appendAnIntegerElement(anArrayList, 6); + Integer output = ArrayListOperations.getAnIntegerElement(anArrayList, anArrayList.size() - 1); + + assertThat(output).isEqualTo(6); + } + + @Test + public void whenInsertAnIntegerAtIndexCalled_thenTheIntegerElementIsInseredToArrayList() { + ArrayListOperations.insertAnIntegerElementAtIndex(anArrayList, 1, 10); + Integer output = ArrayListOperations.getAnIntegerElement(anArrayList, 1); + + assertThat(output).isEqualTo(10); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-arrays/.gitignore b/core-java-modules/core-java-arrays/.gitignore deleted file mode 100644 index 374c8bf907..0000000000 --- a/core-java-modules/core-java-arrays/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -*.class - -0.* - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* -.resourceCache - -# Packaged files # -*.jar -*.war -*.ear - -# Files generated by integration tests -backup-pom.xml -/bin/ -/temp - -#IntelliJ specific -.idea/ -*.iml \ No newline at end of file diff --git a/core-java-modules/core-java-arrays/README.md b/core-java-modules/core-java-arrays/README.md index 45feff3edc..42fe3f83a1 100644 --- a/core-java-modules/core-java-arrays/README.md +++ b/core-java-modules/core-java-arrays/README.md @@ -1,19 +1,17 @@ -========= +## Core Java Arrays -## Core Java Arrays Cookbooks and Examples +This module contains articles about Java arrays ### Relevant Articles: -- [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy) -- [Check if a Java Array Contains a Value](http://www.baeldung.com/java-array-contains-value) -- [Initializing Arrays in Java](http://www.baeldung.com/java-initialize-array) -- [Guide to the java.util.Arrays Class](http://www.baeldung.com/java-util-arrays) -- [Multi-Dimensional Arrays In Java](http://www.baeldung.com/java-jagged-arrays) -- [Find Sum and Average in a Java Array](http://www.baeldung.com/java-array-sum-average) +- [How to Copy an Array in Java](https://www.baeldung.com/java-array-copy) +- [Check if a Java Array Contains a Value](https://www.baeldung.com/java-array-contains-value) +- [Initializing Arrays in Java](https://www.baeldung.com/java-initialize-array) +- [Guide to the java.util.Arrays Class](https://www.baeldung.com/java-util-arrays) +- [Multi-Dimensional Arrays In Java](https://www.baeldung.com/java-jagged-arrays) +- [Find Sum and Average in a Java Array](https://www.baeldung.com/java-array-sum-average) - [Arrays in Java: A Reference Guide](https://www.baeldung.com/java-arrays-guide) -- [How to Invert an Array in Java](http://www.baeldung.com/java-invert-array) -- [Array Operations in Java](http://www.baeldung.com/java-common-array-operations) -- [Intersection Between two Integer Arrays](https://www.baeldung.com/java-array-intersection) +- [Read and Write User Input in Java](https://www.baeldung.com/java-console-input-output) +- [How to Reverse an Array in Java](http://www.baeldung.com/java-invert-array) - [Sorting Arrays in Java](https://www.baeldung.com/java-sorting-arrays) -- [Convert a Float to a Byte Array in Java](https://www.baeldung.com/java-convert-float-to-byte-array) -- [Converting Between Stream and Array in Java](https://www.baeldung.com/java-stream-to-array) -- [Removing an Element from an Array in Java](https://www.baeldung.com/java-array-remove-element) +- [Checking If an Array Is Sorted in Java](https://www.baeldung.com/java-check-sorted-array) +- [[More -->]](/core-java-modules/core-java-arrays-2) diff --git a/core-java-modules/core-java-arrays/pom.xml b/core-java-modules/core-java-arrays/pom.xml index 23db608abc..ca4e262ff9 100644 --- a/core-java-modules/core-java-arrays/pom.xml +++ b/core-java-modules/core-java-arrays/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-arrays 0.1.0-SNAPSHOT core-java-arrays @@ -20,16 +19,6 @@ commons-lang3 ${commons-lang3.version} - - log4j - log4j - ${log4j.version} - - - org.slf4j - log4j-over-slf4j - ${org.slf4j.version} - org.assertj @@ -47,11 +36,6 @@ jmh-generator-annprocess ${jmh-generator-annprocess.version} - - org.springframework - spring-web - ${springframework.spring-web.version} - @@ -64,21 +48,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*LiveTest.java - **/*IntegrationTest.java - **/*IntTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - - true - - - org.apache.maven.plugins maven-dependency-plugin @@ -398,8 +367,6 @@ 3.10.0 - 2.21.0 - 4.3.4.RELEASE 3.0.0-M1 3.0.2 1.4.4 diff --git a/core-java-modules/core-java-collections-2/README.md b/core-java-modules/core-java-collections-2/README.md new file mode 100644 index 0000000000..de5daddb38 --- /dev/null +++ b/core-java-modules/core-java-collections-2/README.md @@ -0,0 +1,15 @@ +========= + +## Core Java Collections Cookbooks and Examples + +### Relevant Articles: +- [Removing Elements from Java Collections](https://www.baeldung.com/java-collection-remove-elements) +- [How to Filter a Collection in Java](https://www.baeldung.com/java-collection-filtering) +- [Join and Split Arrays and Collections in Java](https://www.baeldung.com/java-join-and-split) +- [Java – Combine Multiple Collections](https://www.baeldung.com/java-combine-multiple-collections) +- [Combining Different Types of Collections in Java](https://www.baeldung.com/java-combine-collections) +- [Shuffling Collections In Java](https://www.baeldung.com/java-shuffle-collection) +- [Sorting in Java](https://www.baeldung.com/java-sorting) +- [Getting the Size of an Iterable in Java](https://www.baeldung.com/java-iterable-size) +- [Java Null-Safe Streams from Collections](https://www.baeldung.com/java-null-safe-streams-from-collections) +- [Operating on and Removing an Item from Stream](https://www.baeldung.com/java-use-remove-item-stream) diff --git a/core-java-modules/core-java-collections-2/pom.xml b/core-java-modules/core-java-collections-2/pom.xml new file mode 100644 index 0000000000..217c1d9258 --- /dev/null +++ b/core-java-modules/core-java-collections-2/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + core-java-collections-2 + core-java-collections-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.eclipse.collections + eclipse-collections + ${eclipse.collections.version} + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + org.apache.commons + commons-exec + ${commons-exec.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.junit.platform + junit-platform-runner + ${junit.platform.version} + test + + + + + 7.1.0 + 4.1 + 3.11.1 + 1.2.0 + 1.3 + + diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningArrays.java similarity index 95% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningArrays.java index 2ad48033c0..5f63123f6a 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningArrays.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningArrays.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import java.util.Arrays; import java.util.stream.Stream; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningLists.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningLists.java index 3fdf672758..a45e9cdfe8 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningLists.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningLists.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import java.util.ArrayList; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningMaps.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningMaps.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningMaps.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningMaps.java index d8bbd01ed3..d4d21d0dad 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningMaps.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningMaps.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import java.util.Collection; import java.util.HashMap; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningSets.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningSets.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningSets.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningSets.java index 5f531c1d43..27a5681eee 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/combiningcollections/CombiningSets.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/combiningcollections/CombiningSets.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import java.util.Collection; import java.util.HashSet; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/CollectionUtilsCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/CollectionUtilsCollectionFilter.java similarity index 91% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/CollectionUtilsCollectionFilter.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/CollectionUtilsCollectionFilter.java index 58f9f6af54..de5158e147 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/CollectionUtilsCollectionFilter.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/CollectionUtilsCollectionFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/EclipseCollectionsCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/EclipseCollectionsCollectionFilter.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/EclipseCollectionsCollectionFilter.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/EclipseCollectionsCollectionFilter.java index 981d6ca241..a7b78b1f9b 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/EclipseCollectionsCollectionFilter.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/EclipseCollectionsCollectionFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/GuavaCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/GuavaCollectionFilter.java similarity index 91% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/GuavaCollectionFilter.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/GuavaCollectionFilter.java index 88338fd6d4..0a2a782c33 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/GuavaCollectionFilter.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/GuavaCollectionFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/StreamsCollectionFilter.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/StreamsCollectionFilter.java similarity index 95% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/StreamsCollectionFilter.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/StreamsCollectionFilter.java index f074f74199..a9fb8481e5 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/filtering/StreamsCollectionFilter.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/filtering/StreamsCollectionFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import java.util.Collection; import java.util.function.Predicate; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize/IterableSize.java similarity index 97% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize/IterableSize.java index 03864f16f2..b96e2bb571 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/iterable/IterableSize.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/iterablesize/IterableSize.java @@ -1,4 +1,4 @@ -package com.baeldung.java.iterable; +package com.baeldung.collections.iterablesize; import java.util.Collection; import java.util.stream.StreamSupport; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java similarity index 92% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java index 2405c26aac..ce5cbb39d6 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNull.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Collection; import java.util.stream.Stream; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java similarity index 92% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java index da767d4563..68d51c2d87 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainer.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Collection; import java.util.Optional; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java similarity index 91% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java index 0c10f1cebc..6c606ebedd 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheck.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Collection; import java.util.stream.Stream; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/CollectionRemoveIf.java similarity index 91% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/CollectionRemoveIf.java index 2f5e91596f..4089382376 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/CollectionRemoveIf.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/CollectionRemoveIf.java @@ -1,4 +1,4 @@ -package com.baeldung.removal; +package com.baeldung.collections.removal; import java.util.ArrayList; import java.util.Collection; diff --git a/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/Iterators.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/Iterators.java new file mode 100644 index 0000000000..d551b04eae --- /dev/null +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/Iterators.java @@ -0,0 +1,28 @@ +package com.baeldung.collections.removal; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +public class Iterators { + + public static void main(String args[]) { + Collection names = new ArrayList<>(); + names.add("John"); + names.add("Ana"); + names.add("Mary"); + names.add("Anthony"); + names.add("Mark"); + + Iterator i = names.iterator(); + + while (i.hasNext()) { + String e = i.next(); + if (e.startsWith("A")) { + i.remove(); + } + } + + System.out.println(String.join(",", names)); + } +} diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamFilterAndCollector.java similarity index 93% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamFilterAndCollector.java index bf6db68bae..e0dc75f428 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamFilterAndCollector.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamFilterAndCollector.java @@ -1,4 +1,4 @@ -package com.baeldung.removal; +package com.baeldung.collections.removal; import java.util.ArrayList; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamPartitioningBy.java similarity index 95% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java rename to core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamPartitioningBy.java index c77e996616..c01c334f01 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/StreamPartitioningBy.java +++ b/core-java-modules/core-java-collections-2/src/main/java/com/baeldung/collections/removal/StreamPartitioningBy.java @@ -1,4 +1,4 @@ -package com.baeldung.removal; +package com.baeldung.collections.removal; import java.util.ArrayList; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningArraysUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningArraysUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningArraysUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningArraysUnitTest.java index 3b80d773ad..312f5582ba 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningArraysUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningArraysUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import static org.junit.Assert.*; import org.junit.Test; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningListsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningListsUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningListsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningListsUnitTest.java index c5851d7daf..5443e56e5f 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningListsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningListsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningMapsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningMapsUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningMapsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningMapsUnitTest.java index 3fa9cc7dc4..644f178f80 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningMapsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningMapsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningSetsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningSetsUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningSetsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningSetsUnitTest.java index 330827bdc2..c9976eb6de 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/combiningcollections/CombiningSetsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/combiningcollections/CombiningSetsUnitTest.java @@ -1,5 +1,5 @@ -package com.baeldung.combiningcollections; +package com.baeldung.collections.combiningcollections; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/filtering/CollectionFiltersUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/filtering/CollectionFiltersUnitTest.java similarity index 98% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/java/filtering/CollectionFiltersUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/filtering/CollectionFiltersUnitTest.java index b30805d471..db387818b8 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/filtering/CollectionFiltersUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/filtering/CollectionFiltersUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.filtering; +package com.baeldung.collections.filtering; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/iterable/IterableSizeUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize/IterableSizeUnitTest.java similarity index 96% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/java/iterable/IterableSizeUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize/IterableSizeUnitTest.java index 4bc413dee0..35702a74b3 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/iterable/IterableSizeUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/iterablesize/IterableSizeUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.iterable; +package com.baeldung.collections.iterablesize; import static org.junit.Assert.assertEquals; diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/CollectionsJoinAndSplitJUnitTest.java similarity index 97% rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/CollectionsJoinAndSplitJUnitTest.java index c288cf499d..1904fd1587 100644 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/CollectionsJoinAndSplitJUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.collections; +package com.baeldung.collections.joinsplit; import java.util.ArrayList; import java.util.Collections; diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/JoinSplitCollectionsUnitTest.java similarity index 99% rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/JoinSplitCollectionsUnitTest.java index c594529f41..1fbe210ad4 100644 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/joinsplit/JoinSplitCollectionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.collections; +package com.baeldung.collections.joinsplit; import org.junit.Test; diff --git a/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java new file mode 100644 index 0000000000..ebef8d6875 --- /dev/null +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/multiplecollections/CombineMultipleCollectionsUnitTest.java @@ -0,0 +1,135 @@ +package com.baeldung.collections.multiplecollections; + +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.IterableUtils; +import org.junit.Assert; +import org.junit.Test; + +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static java.util.Arrays.asList; + +public class CombineMultipleCollectionsUnitTest { + + @Test + public void givenUsingJava8_whenConcatenatingUsingConcat_thenCorrect() { + Collection collectionA = asList("S", "T"); + Collection collectionB = asList("U", "V"); + Collection collectionC = asList("W", "X"); + + Stream combinedStream = Stream.concat(Stream.concat(collectionA.stream(), collectionB.stream()), collectionC.stream()); + Collection collectionCombined = combinedStream.collect(Collectors.toList()); + + Assert.assertEquals(asList("S", "T", "U", "V", "W", "X"), collectionCombined); + } + + @Test + public void givenUsingJava8_whenConcatenatingUsingflatMap_thenCorrect() { + Collection collectionA = asList("S", "T"); + Collection collectionB = asList("U", "V"); + + Stream combinedStream = Stream.of(collectionA, collectionB).flatMap(Collection::stream); + Collection collectionCombined = combinedStream.collect(Collectors.toList()); + + Assert.assertEquals(asList("S", "T", "U", "V"), collectionCombined); + } + + @Test + public void givenUsingGuava_whenConcatenatingUsingIterables_thenCorrect() { + Collection collectionA = asList("S", "T"); + Collection collectionB = asList("U", "V"); + + Iterable combinedIterables = Iterables.unmodifiableIterable(Iterables.concat(collectionA, collectionB)); + Collection collectionCombined = Lists.newArrayList(combinedIterables); + + Assert.assertEquals(asList("S", "T", "U", "V"), collectionCombined); + } + + @Test + public void givenUsingJava7_whenConcatenatingUsingIterables_thenCorrect() { + Collection collectionA = asList("S", "T"); + Collection collectionB = asList("U", "V"); + + Iterable combinedIterables = concat(collectionA, collectionB); + Collection collectionCombined = makeListFromIterable(combinedIterables); + Assert.assertEquals(Arrays.asList("S", "T", "U", "V"), collectionCombined); + } + + public static Iterable concat(Iterable i1, Iterable i2) { + return new Iterable() { + public Iterator iterator() { + return new Iterator() { + Iterator listIterator = i1.iterator(); + Boolean checkedHasNext; + E nextValue; + private boolean startTheSecond; + + void theNext() { + if (listIterator.hasNext()) { + checkedHasNext = true; + nextValue = listIterator.next(); + } else if (startTheSecond) + checkedHasNext = false; + else { + startTheSecond = true; + listIterator = i2.iterator(); + theNext(); + } + } + + public boolean hasNext() { + if (checkedHasNext == null) + theNext(); + return checkedHasNext; + } + + public E next() { + if (!hasNext()) + throw new NoSuchElementException(); + checkedHasNext = null; + return nextValue; + } + + public void remove() { + listIterator.remove(); + } + }; + } + }; + } + + public static List makeListFromIterable(Iterable iter) { + List list = new ArrayList<>(); + for (E item : iter) { + list.add(item); + } + return list; + } + + @Test + public void givenUsingApacheCommons_whenConcatenatingUsingUnion_thenCorrect() { + Collection collectionA = asList("S", "T"); + Collection collectionB = asList("U", "V"); + + Iterable combinedIterables = CollectionUtils.union(collectionA, collectionB); + Collection collectionCombined = Lists.newArrayList(combinedIterables); + + Assert.assertEquals(asList("S", "T", "U", "V"), collectionCombined); + } + + @Test + public void givenUsingApacheCommons_whenConcatenatingUsingChainedIterable_thenCorrect() { + Collection collectionA = asList("S", "T"); + Collection collectionB = asList("U", "V"); + + Iterable combinedIterables = IterableUtils.chainedIterable(collectionA, collectionB); + Collection collectionCombined = Lists.newArrayList(combinedIterables); + + Assert.assertEquals(asList("S", "T", "U", "V"), collectionCombined); + } +} diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java similarity index 95% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java index 875045946d..42cda7926c 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingCommonsEmptyIfNullUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Arrays; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java similarity index 95% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java index 402f1a6a19..666d5e7d04 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingJava8OptionalContainerUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Arrays; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java similarity index 95% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java index bb6152371d..2e8eeb35ad 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/nullsafecollectionstreams/NullSafeCollectionStreamsUsingNullDereferenceCheckUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.nullsafecollectionstreams; +package com.baeldung.collections.nullsafecollectionstreams; import java.util.Arrays; import java.util.Collection; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/removal/RemovalUnitTest.java similarity index 98% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/removal/RemovalUnitTest.java index 1b379f32de..998dbe6cca 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/removal/RemovalUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/removal/RemovalUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.removal; +package com.baeldung.collections.removal; import org.junit.Before; import org.junit.Test; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/shufflingcollections/ShufflingCollectionsUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/shufflingcollections/ShufflingCollectionsUnitTest.java similarity index 97% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/shufflingcollections/ShufflingCollectionsUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/shufflingcollections/ShufflingCollectionsUnitTest.java index d013907c9a..041e67ba7f 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/shufflingcollections/ShufflingCollectionsUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/shufflingcollections/ShufflingCollectionsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.shufflingcollections; +package com.baeldung.collections.shufflingcollections; import org.junit.Test; diff --git a/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/Employee.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/Employee.java new file mode 100644 index 0000000000..e838dbea18 --- /dev/null +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/Employee.java @@ -0,0 +1,62 @@ +package com.baeldung.collections.sorting; + +public class Employee implements Comparable { + + private String name; + private int age; + private double salary; + + public Employee(String name, int age, double salary) { + this.name = name; + this.age = age; + this.salary = salary; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public double getSalary() { + return salary; + } + + public void setSalary(double salary) { + this.salary = salary; + } + + @Override + public boolean equals(Object obj) { + return ((Employee) obj).getName() + .equals(getName()); + } + + @Override + public int compareTo(Object o) { + Employee e = (Employee) o; + return getName().compareTo(e.getName()); + } + + @Override + public String toString() { + return new StringBuffer().append("(") + .append(getName()) + .append(getAge()) + .append(",") + .append(getSalary()) + .append(")") + .toString(); + } + +} diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/JavaSortingUnitTest.java similarity index 99% rename from core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java rename to core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/JavaSortingUnitTest.java index ca9c9b4b5d..2505adcea7 100644 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/JavaSortingUnitTest.java +++ b/core-java-modules/core-java-collections-2/src/test/java/com/baeldung/collections/sorting/JavaSortingUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.sorting; +package com.baeldung.collections.sorting; import com.google.common.primitives.Ints; import org.apache.commons.lang3.ArrayUtils; diff --git a/core-java-modules/core-java-collections-3/README.md b/core-java-modules/core-java-collections-3/README.md new file mode 100644 index 0000000000..9218384640 --- /dev/null +++ b/core-java-modules/core-java-collections-3/README.md @@ -0,0 +1,11 @@ +========= + +## Core Java Collections Cookbooks and Examples + +### Relevant Articles: +- [Time Comparison of Arrays.sort(Object[]) and Arrays.sort(int[])](https://www.baeldung.com/arrays-sortobject-vs-sortint) +- [Java ArrayList vs Vector](https://www.baeldung.com/java-arraylist-vs-vector) +- [Differences Between HashMap and Hashtable](https://www.baeldung.com/hashmap-hashtable-differences) +- [Differences Between Collection.clear() and Collection.removeAll()](https://www.baeldung.com/java-collection-clear-vs-removeall) +- [Performance of contains() in a HashSet vs ArrayList](https://www.baeldung.com/java-hashset-arraylist-contains-performance) +- [Fail-Safe Iterator vs Fail-Fast Iterator](https://www.baeldung.com/java-fail-safe-vs-fail-fast-iterator) diff --git a/core-java-modules/core-java-collections-3/pom.xml b/core-java-modules/core-java-collections-3/pom.xml new file mode 100644 index 0000000000..84c7865e68 --- /dev/null +++ b/core-java-modules/core-java-collections-3/pom.xml @@ -0,0 +1,34 @@ + + 4.0.0 + core-java-collections-3 + 0.1.0-SNAPSHOT + core-java-collections-3 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.openjdk.jmh + jmh-core + ${openjdk.jmh.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + 1.19 + 3.11.1 + + diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArrayListBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/ArrayListBenchmark.java similarity index 98% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArrayListBenchmark.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/ArrayListBenchmark.java index 331ae8d908..7fcadf019c 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArrayListBenchmark.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/ArrayListBenchmark.java @@ -1,4 +1,4 @@ -package com.baeldung.performance; +package com.baeldung.collections.arraylistvsvector; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.runner.Runner; diff --git a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java new file mode 100644 index 0000000000..02f25a7558 --- /dev/null +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/Employee.java @@ -0,0 +1,55 @@ +package com.baeldung.collections.arraylistvsvector; + +public class Employee { + + private Long id; + private String name; + + public Employee(Long id, String name) { + this.name = name; + this.id = id; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Employee employee = (Employee) o; + + if (!id.equals(employee.id)) return false; + return name.equals(employee.name); + + } + + @Override + public int hashCode() { + int result = id.hashCode(); + result = 31 * result + name.hashCode(); + return result; + } + + @Override + public String toString() { + return "Employee{" + + "id=" + id + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/list/VectorExample.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/VectorExample.java similarity index 92% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/list/VectorExample.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/VectorExample.java index 7debc07911..e82e47cdbb 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/list/VectorExample.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/arraylistvsvector/VectorExample.java @@ -1,4 +1,4 @@ -package com.baeldung.java.list; +package com.baeldung.collections.arraylistvsvector; import java.util.Enumeration; import java.util.Iterator; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/CollectionsBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/CollectionsBenchmark.java similarity index 96% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/CollectionsBenchmark.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/CollectionsBenchmark.java index 921e1608ea..76edd10e92 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/CollectionsBenchmark.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/CollectionsBenchmark.java @@ -1,4 +1,4 @@ -package com.baeldung.performance; +package com.baeldung.collections.containsperformance; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.runner.Runner; diff --git a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java new file mode 100644 index 0000000000..6c60f8772c --- /dev/null +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/containsperformance/Employee.java @@ -0,0 +1,55 @@ +package com.baeldung.collections.containsperformance; + +public class Employee { + + private Long id; + private String name; + + public Employee(Long id, String name) { + this.name = name; + this.id = id; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Employee employee = (Employee) o; + + if (!id.equals(employee.id)) return false; + return name.equals(employee.name); + + } + + @Override + public int hashCode() { + int result = id.hashCode(); + result = 31 * result + name.hashCode(); + return result; + } + + @Override + public String toString() { + return "Employee{" + + "id=" + id + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/iterators/Iterators.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/iterators/Iterators.java new file mode 100644 index 0000000000..23e6bbda77 --- /dev/null +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/iterators/Iterators.java @@ -0,0 +1,80 @@ +package com.baeldung.collections.iterators; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Source code https://github.com/eugenp/tutorials + * + * @author Santosh Thakur + */ + +public class Iterators { + + public static int failFast1() { + ArrayList numbers = new ArrayList<>(); + + numbers.add(10); + numbers.add(20); + numbers.add(30); + numbers.add(40); + + Iterator iterator = numbers.iterator(); + while (iterator.hasNext()) { + Integer number = iterator.next(); + numbers.add(50); + } + + return numbers.size(); + } + + public static int failFast2() { + ArrayList numbers = new ArrayList<>(); + numbers.add(10); + numbers.add(20); + numbers.add(30); + numbers.add(40); + + Iterator iterator = numbers.iterator(); + while (iterator.hasNext()) { + if (iterator.next() == 30) { + // will not throw Exception + iterator.remove(); + } + } + + System.out.println("using iterator's remove method = " + numbers); + + iterator = numbers.iterator(); + while (iterator.hasNext()) { + if (iterator.next() == 40) { + // will throw Exception on + // next call of next() method + numbers.remove(2); + } + } + + return numbers.size(); + } + + public static int failSafe1() { + ConcurrentHashMap map = new ConcurrentHashMap<>(); + + map.put("First", 10); + map.put("Second", 20); + map.put("Third", 30); + map.put("Fourth", 40); + + Iterator iterator = map.keySet() + .iterator(); + + while (iterator.hasNext()) { + String key = iterator.next(); + map.put("Fifth", 50); + } + + return map.size(); + } + +} diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArraySortBenchmark.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/ArraySortBenchmark.java similarity index 97% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArraySortBenchmark.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/ArraySortBenchmark.java index b93f8e9cc2..1cd56aa29d 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/performance/ArraySortBenchmark.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/ArraySortBenchmark.java @@ -1,4 +1,4 @@ -package com.baeldung.performance; +package com.baeldung.collections.sortingcomparison; import java.util.Arrays; import java.util.concurrent.TimeUnit; diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/sort/CollectionsSortCompare.java b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/CollectionsSortCompare.java similarity index 94% rename from core-java-modules/core-java-collections/src/main/java/com/baeldung/java/sort/CollectionsSortCompare.java rename to core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/CollectionsSortCompare.java index 1eff522877..abe7a12a00 100644 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/java/sort/CollectionsSortCompare.java +++ b/core-java-modules/core-java-collections-3/src/main/java/com/baeldung/collections/sortingcomparison/CollectionsSortCompare.java @@ -1,4 +1,4 @@ -package com.baeldung.java.sort; +package com.baeldung.collections.sortingcomparison; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collection/ClearVsRemoveAllUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall/ClearVsRemoveAllUnitTest.java similarity index 95% rename from core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collection/ClearVsRemoveAllUnitTest.java rename to core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall/ClearVsRemoveAllUnitTest.java index 8b0a7ef0db..9cd9c6aa50 100644 --- a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collection/ClearVsRemoveAllUnitTest.java +++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/clearvsremoveall/ClearVsRemoveAllUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.collection; +package com.baeldung.collections.clearvsremoveall; import org.junit.jupiter.api.Test; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java similarity index 98% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java rename to core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java index 5218332d60..b00a7fd953 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java +++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/hashmapvshashtable/HashmapVsHashtableDifferenceUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.hashmapvshashtable; +package com.baeldung.collections.hashmapvshashtable; import static org.junit.Assert.assertEquals; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/iterators/IteratorsUnitTest.java b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/iterators/IteratorsUnitTest.java similarity index 77% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/iterators/IteratorsUnitTest.java rename to core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/iterators/IteratorsUnitTest.java index 36e1f4a83c..95cf590857 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/iterators/IteratorsUnitTest.java +++ b/core-java-modules/core-java-collections-3/src/test/java/com/baeldung/collections/iterators/IteratorsUnitTest.java @@ -1,8 +1,8 @@ -package com.baeldung.iterators; +package com.baeldung.collections.iterators; -import static com.baeldung.iterators.Iterators.failFast1; -import static com.baeldung.iterators.Iterators.failFast2; -import static com.baeldung.iterators.Iterators.failSafe1; +import static com.baeldung.collections.iterators.Iterators.failFast1; +import static com.baeldung.collections.iterators.Iterators.failFast2; +import static com.baeldung.collections.iterators.Iterators.failSafe1; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/core-java-modules/core-java-collections-array-list/README.md b/core-java-modules/core-java-collections-array-list/README.md index 3d1cdd5085..302ea82130 100644 --- a/core-java-modules/core-java-collections-array-list/README.md +++ b/core-java-modules/core-java-collections-array-list/README.md @@ -1,10 +1,12 @@ -========= +## Core Java Collections ArrayList -## Core Java Collections Array List Cookbooks and Examples +This module contains articles about the Java ArrayList collection ### Relevant Articles: - [Immutable ArrayList in Java](http://www.baeldung.com/java-immutable-list) - [Guide to the Java ArrayList](http://www.baeldung.com/java-arraylist) - [Add Multiple Items to an Java ArrayList](http://www.baeldung.com/java-add-items-array-list) - [ClassCastException: Arrays$ArrayList cannot be cast to ArrayList](https://www.baeldung.com/java-classcastexception-arrays-arraylist) -- [Multi Dimensional ArrayList in Java](https://www.baeldung.com/java-multi-dimensional-arraylist) \ No newline at end of file +- [Multi Dimensional ArrayList in Java](https://www.baeldung.com/java-multi-dimensional-arraylist) +- [Removing an Element From an ArrayList](https://www.baeldung.com/java-arraylist-remove-element) + diff --git a/core-java-modules/core-java-collections-array-list/pom.xml b/core-java-modules/core-java-collections-array-list/pom.xml index 95a5f3ea36..249103152a 100644 --- a/core-java-modules/core-java-collections-array-list/pom.xml +++ b/core-java-modules/core-java-collections-array-list/pom.xml @@ -19,28 +19,16 @@ commons-collections4 ${commons-collections4.version} - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - org.assertj assertj-core ${assertj.version} test - - org.projectlombok - lombok - ${lombok.version} - provided - 4.1 - 3.8.1 3.11.1 diff --git a/core-java-modules/core-java-collections-list-2/README.md b/core-java-modules/core-java-collections-list-2/README.md index 6192442edd..0d2da41b41 100644 --- a/core-java-modules/core-java-collections-list-2/README.md +++ b/core-java-modules/core-java-collections-list-2/README.md @@ -1,6 +1,6 @@ -========= +## Core Java Collections List (Part 2) -## Core Java Collections List Cookbooks and Examples +This module contains articles about the Java List collection ### Relevant Articles: - [Check If Two Lists are Equal in Java](http://www.baeldung.com/java-test-a-list-for-ordinality-and-equality) @@ -10,4 +10,6 @@ - [Java List Initialization in One Line](https://www.baeldung.com/java-init-list-one-line) - [Ways to Iterate Over a List in Java](https://www.baeldung.com/java-iterate-list) - [Flattening Nested Collections in Java](http://www.baeldung.com/java-flatten-nested-collections) -- [Intersection of Two Lists in Java](https://www.baeldung.com/java-lists-intersection) \ No newline at end of file +- [Intersection of Two Lists in Java](https://www.baeldung.com/java-lists-intersection) +- [Searching for a String in an ArrayList](https://www.baeldung.com/java-search-string-arraylist) +- [[<-- Prev]](/core-java-modules/core-java-collections-list)[[Next -->]](/core-java-modules/core-java-collections-list-3) diff --git a/core-java-modules/core-java-collections-list-2/pom.xml b/core-java-modules/core-java-collections-list-2/pom.xml index 727de0818a..9652a7d79f 100644 --- a/core-java-modules/core-java-collections-list-2/pom.xml +++ b/core-java-modules/core-java-collections-list-2/pom.xml @@ -19,11 +19,6 @@ commons-collections4 ${commons-collections4.version} - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - org.assertj assertj-core @@ -39,8 +34,7 @@ - 4.1 - 3.8.1 + 4.1 3.11.1 diff --git a/core-java-modules/core-java-collections-list-2/src/main/java/com/baeldung/findastring/FindAStringInGivenList.java b/core-java-modules/core-java-collections-list-2/src/main/java/com/baeldung/findastring/FindAStringInGivenList.java new file mode 100644 index 0000000000..67c62fe009 --- /dev/null +++ b/core-java-modules/core-java-collections-list-2/src/main/java/com/baeldung/findastring/FindAStringInGivenList.java @@ -0,0 +1,72 @@ +package com.baeldung.findastring; + +import com.google.common.base.Predicates; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import org.apache.commons.collections4.IterableUtils; +import org.apache.commons.collections4.IteratorUtils; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +public class FindAStringInGivenList { + + + public List findUsingLoopWithRegex(String search, List list) { + + List matches = new ArrayList(); + + String pattern = ".*"+search+".*"; + Pattern p = Pattern.compile(pattern); + + for(String str: list) { + if (p.matcher(str).matches()) { + matches.add(str); + } + } + + return matches; + } + + + public List findUsingLoop(String search, List list) { + + List matches = new ArrayList(); + + for(String str: list) { + if (str.contains(search)) { + matches.add(str); + } + } + + return matches; + } + + public List findUsingStream(String search, List list) { + + List matchingElements = + list.stream() + .filter(str -> str.trim().contains(search)) + .collect(Collectors.toList()); + + return matchingElements; + } + + public List findUsingGuava(String search, List list) { + Iterable result = Iterables.filter(list, Predicates.containsPattern(search)); + + return Lists.newArrayList(result.iterator()); + } + + public List findUsingCommonsCollection(String search, List list) { + Iterable result = IterableUtils.filteredIterable(list, new org.apache.commons.collections4.Predicate() { + public boolean evaluate(String listElement) { + return listElement.contains(search); + } + }); + + return IteratorUtils.toList(result.iterator()); + } + +} \ No newline at end of file diff --git a/core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/findastring/FindAStringInListUnitTest.java b/core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/findastring/FindAStringInListUnitTest.java new file mode 100644 index 0000000000..ff5ca21505 --- /dev/null +++ b/core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/findastring/FindAStringInListUnitTest.java @@ -0,0 +1,62 @@ +package com.baeldung.findastring; + +import java.util.ArrayList; +import java.util.List; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.Test; +public class FindAStringInListUnitTest { + + private static List list = new ArrayList<>(); + + static { + list.add("Jack and Jill"); + list.add("James and Sarah"); + list.add("Sam and Louise"); + list.add("Jack"); + list.add(""); + } + + private static FindAStringInGivenList findAStringInGivenList = new FindAStringInGivenList(); + + @Test + public void givenAString_whenFoundUsingLoopWithRegex_thenReturnList() { + List matchingElements = findAStringInGivenList.findUsingLoopWithRegex("Jack", list); + assertEquals(2, matchingElements.size()); + assertEquals("Jack and Jill", matchingElements.get(0)); + assertEquals("Jack", matchingElements.get(1)); + } + + @Test + public void givenAString_whenFoundUsingLoop_thenReturnList() { + List matchingElements = findAStringInGivenList.findUsingLoop("Jack", list); + assertEquals(2, matchingElements.size()); + assertEquals("Jack and Jill", matchingElements.get(0)); + assertEquals("Jack", matchingElements.get(1)); + } + + + @Test + public void givenAString_whenFoundUsingStream_thenReturnList(){ + List matchingElements = findAStringInGivenList.findUsingStream("Jack", list); + assertEquals(2, matchingElements.size()); + assertEquals("Jack and Jill", matchingElements.get(0)); + assertEquals("Jack", matchingElements.get(1)); + } + + @Test + public void givenAString_whenFoundUsingCommonsCollection_thenReturnList(){ + List matchingElements = findAStringInGivenList.findUsingCommonsCollection("Jack", list); + assertEquals(2, matchingElements.size()); + assertEquals("Jack and Jill", matchingElements.get(0)); + assertEquals("Jack", matchingElements.get(1)); + } + + @Test + public void givenAString_whenFoundUsingGuava_thenReturnList(){ + List matchingElements = findAStringInGivenList.findUsingGuava("Jack", list); + assertEquals(2, matchingElements.size()); + assertEquals("Jack and Jill", matchingElements.get(0)); + assertEquals("Jack", matchingElements.get(1)); + } + +} diff --git a/core-java-modules/core-java-collections-list-3/README.md b/core-java-modules/core-java-collections-list-3/README.md index 267996044c..3d4004de6f 100644 --- a/core-java-modules/core-java-collections-list-3/README.md +++ b/core-java-modules/core-java-collections-list-3/README.md @@ -1,6 +1,6 @@ -========= +## Core Java Collections List (Part 3) -## Core Java Collections List Cookbooks and Examples +This module contains articles about the Java List collection ### Relevant Articles: - [Collections.emptyList() vs. New List Instance](https://www.baeldung.com/java-collections-emptylist-new-list) @@ -9,3 +9,4 @@ - [List of Primitive Integer Values in Java](https://www.baeldung.com/java-list-primitive-int) - [Performance Comparison of Primitive Lists in Java](https://www.baeldung.com/java-list-primitive-performance) - [Filtering a Java Collection by a List](https://www.baeldung.com/java-filter-collection-by-list) +- [[<-- Prev]](/core-java-modules/core-java-collections-list-2) diff --git a/core-java-modules/core-java-collections-list-3/pom.xml b/core-java-modules/core-java-collections-list-3/pom.xml index 064b65d19e..dab5058cd3 100644 --- a/core-java-modules/core-java-collections-list-3/pom.xml +++ b/core-java-modules/core-java-collections-list-3/pom.xml @@ -19,23 +19,12 @@ commons-collections4 ${commons-collections4.version} - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - org.assertj assertj-core ${assertj.version} test - - org.projectlombok - lombok - ${lombok.version} - provided - net.sf.trove4j @@ -67,7 +56,6 @@ 4.1 - 3.8.1 3.11.1 3.0.2 8.1.0 diff --git a/core-java-modules/core-java-collections-list-3/src/main/java/com/baeldung/list/duplicatescounter/DuplicatesCounter.java b/core-java-modules/core-java-collections-list-3/src/main/java/com/baeldung/list/duplicatescounter/DuplicatesCounter.java new file mode 100644 index 0000000000..b5138eed7d --- /dev/null +++ b/core-java-modules/core-java-collections-list-3/src/main/java/com/baeldung/list/duplicatescounter/DuplicatesCounter.java @@ -0,0 +1,42 @@ +package com.baeldung.list.duplicatescounter; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Demo different approaches to get count of duplicated elements in an + * arrayList + */ +public class DuplicatesCounter { + + public static Map countByClassicalLoop(List inputList) { + Map resultMap = new HashMap<>(); + for (T element : inputList) { + if (resultMap.containsKey(element)) { + resultMap.put(element, resultMap.get(element) + 1L); + } else { + resultMap.put(element, 1L); + } + } + return resultMap; + } + + public static Map countByClassicalLoopWithMapCompute(List inputList) { + Map resultMap = new HashMap<>(); + for (T element : inputList) { + resultMap.compute(element, (k, v) -> v == null ? 1 : v + 1); + } + return resultMap; + } + + public static Map countByStreamToMap(List inputList) { + return inputList.stream().collect(Collectors.toMap(Function.identity(), v -> 1L, Long::sum)); + } + + public static Map countByStreamGroupBy(List inputList) { + return inputList.stream().collect(Collectors.groupingBy(k -> k, Collectors.counting())); + } +} diff --git a/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/collection/filtering/CollectionFilteringUnitTest.java b/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/collection/filtering/CollectionFilteringUnitTest.java index cbc7136192..d41c12cd23 100644 --- a/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/collection/filtering/CollectionFilteringUnitTest.java +++ b/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/collection/filtering/CollectionFilteringUnitTest.java @@ -33,9 +33,9 @@ public class CollectionFilteringUnitTest { for (Employee employee : originalList) { for (String name : nameFilter) { - if (employee.getName() - .equalsIgnoreCase(name)) { + if (employee.getName().equals(name)) { filteredList.add(employee); + //break; } } } diff --git a/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/list/duplicatescounter/DuplicatesCounterUnitTest.java b/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/list/duplicatescounter/DuplicatesCounterUnitTest.java new file mode 100644 index 0000000000..be9ccded9b --- /dev/null +++ b/core-java-modules/core-java-collections-list-3/src/test/java/com/baeldung/list/duplicatescounter/DuplicatesCounterUnitTest.java @@ -0,0 +1,55 @@ +package com.baeldung.list.duplicatescounter; + +import org.assertj.core.util.Lists; +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.data.MapEntry.entry; + +class DuplicatesCounterUnitTest { + + + private static List INPUT_LIST = Lists.list( + "expect1", + "expect2", "expect2", + "expect3", "expect3", "expect3", + "expect4", "expect4", "expect4", "expect4"); + + @Test + void givenInput_whenCountByClassicalLoop_thenGetResultMap() { + Map result = DuplicatesCounter.countByClassicalLoop(INPUT_LIST); + verifyResult(result); + } + + + @Test + void givenInput_whenCountByClassicalLoopWithMapCompute_thenGetResultMap() { + Map result = DuplicatesCounter.countByClassicalLoopWithMapCompute(INPUT_LIST); + verifyResult(result); + } + + @Test + void givenInput_whenCountByStreamToMap_thenGetResultMap() { + Map result = DuplicatesCounter.countByStreamToMap(INPUT_LIST); + verifyResult(result); + } + + @Test + void givenInput_whenCountByStreamGroupBy_thenGetResultMap() { + Map result = DuplicatesCounter.countByStreamGroupBy(INPUT_LIST); + verifyResult(result); + } + + private void verifyResult(Map resultMap) { + assertThat(resultMap) + .isNotEmpty().hasSize(4) + .containsExactly( + entry("expect1", 1L), + entry("expect2", 2L), + entry("expect3", 3L), + entry("expect4", 4L)); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-collections-list/README.md b/core-java-modules/core-java-collections-list/README.md index e83fcce5ff..ff7a9876a2 100644 --- a/core-java-modules/core-java-collections-list/README.md +++ b/core-java-modules/core-java-collections-list/README.md @@ -1,6 +1,6 @@ -========= +## Core Java Collections List -## Core Java Collections List Cookbooks and Examples +This module contains articles about the Java List collection ### Relevant Articles: - [Java – Get Random Item/Element From a List](http://www.baeldung.com/java-random-list-element) @@ -11,4 +11,5 @@ - [Remove the First Element from a List](http://www.baeldung.com/java-remove-first-element-from-list) - [How to Find an Element in a List with Java](http://www.baeldung.com/find-list-element-java) - [Finding Max/Min of a List or Collection](http://www.baeldung.com/java-collection-min-max) -- [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list) \ No newline at end of file +- [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list) +- [[Next -->]](/core-java-modules/core-java-collections-list-2) diff --git a/core-java-modules/core-java-collections-list/pom.xml b/core-java-modules/core-java-collections-list/pom.xml index 581505dc1e..c8e881110e 100644 --- a/core-java-modules/core-java-collections-list/pom.xml +++ b/core-java-modules/core-java-collections-list/pom.xml @@ -30,18 +30,11 @@ ${assertj.version} test - - org.projectlombok - lombok - ${lombok.version} - provided - 4.1 3.8.1 3.11.1 - 3.0.2 diff --git a/core-java-modules/core-java-collections-set/README.md b/core-java-modules/core-java-collections-set/README.md index 618b4e932c..2b34ef3449 100644 --- a/core-java-modules/core-java-collections-set/README.md +++ b/core-java-modules/core-java-collections-set/README.md @@ -1,6 +1,6 @@ -========= +## Core Java Collections Set -## Core Java Sets Cookbooks and Examples +This module contains articles about the Java Set collection ### Relevant Articles: - [Set Operations in Java](http://www.baeldung.com/set-operations-in-java) diff --git a/core-java-modules/core-java-collections-set/pom.xml b/core-java-modules/core-java-collections-set/pom.xml index 101ed79de0..1dd1e06ca1 100644 --- a/core-java-modules/core-java-collections-set/pom.xml +++ b/core-java-modules/core-java-collections-set/pom.xml @@ -14,11 +14,6 @@ - - com.google.guava - guava - ${guava.version} - org.apache.commons commons-collections4 @@ -38,7 +33,6 @@ 4.3 - 27.1-jre 2.8.5 \ No newline at end of file diff --git a/core-java-modules/core-java-collections/README.md b/core-java-modules/core-java-collections/README.md index b34293769d..340c2b286e 100644 --- a/core-java-modules/core-java-collections/README.md +++ b/core-java-modules/core-java-collections/README.md @@ -1,31 +1,16 @@ -========= +## Core Java Collections -## Core Java Collections Cookbooks and Examples +This module contains articles about Java collections ### Relevant Articles: -- [Java – Combine Multiple Collections](http://www.baeldung.com/java-combine-multiple-collections) -- [Collect a Java Stream to an Immutable Collection](http://www.baeldung.com/java-stream-immutable-collection) -- [Introduction to the Java ArrayDeque](http://www.baeldung.com/java-array-deque) -- [Getting the Size of an Iterable in Java](http://www.baeldung.com/java-iterable-size) -- [How to Filter a Collection in Java](http://www.baeldung.com/java-collection-filtering) -- [Removing the First Element of an Array](https://www.baeldung.com/java-array-remove-first-element) -- [Fail-Safe Iterator vs Fail-Fast Iterator](http://www.baeldung.com/java-fail-safe-vs-fail-fast-iterator) -- [Shuffling Collections In Java](http://www.baeldung.com/java-shuffle-collection) -- [An Introduction to Java.util.Hashtable Class](http://www.baeldung.com/java-hash-table) -- [Java Null-Safe Streams from Collections](https://www.baeldung.com/java-null-safe-streams-from-collections) +- [Collect a Java Stream to an Immutable Collection](https://www.baeldung.com/java-stream-immutable-collection) +- [Introduction to the Java ArrayDeque](https://www.baeldung.com/java-array-deque) +- [An Introduction to Java.util.Hashtable Class](https://www.baeldung.com/java-hash-table) - [Thread Safe LIFO Data Structure Implementations](https://www.baeldung.com/java-lifo-thread-safe) -- [Differences Between Collection.clear() and Collection.removeAll()](https://www.baeldung.com/java-collection-clear-vs-removeall) -- [Performance of contains() in a HashSet vs ArrayList](https://www.baeldung.com/java-hashset-arraylist-contains-performance) - [Time Complexity of Java Collections](https://www.baeldung.com/java-collections-complexity) -- [Operating on and Removing an Item from Stream](https://www.baeldung.com/java-use-remove-item-stream) -- [An Introduction to Synchronized Java Collections](https://www.baeldung.com/java-synchronized-collections) -- [Removing Elements from Java Collections](https://www.baeldung.com/java-collection-remove-elements) -- [Combining Different Types of Collections in Java](https://www.baeldung.com/java-combine-collections) -- [Sorting in Java](http://www.baeldung.com/java-sorting) -- [Join and Split Arrays and Collections in Java](http://www.baeldung.com/java-join-and-split) - [A Guide to EnumMap](https://www.baeldung.com/java-enum-map) -- [A Guide to Iterator in Java](http://www.baeldung.com/java-iterator) -- [Differences Between HashMap and Hashtable](https://www.baeldung.com/hashmap-hashtable-differences) -- [Java ArrayList vs Vector](https://www.baeldung.com/java-arraylist-vs-vector) +- [A Guide to Iterator in Java](https://www.baeldung.com/java-iterator) - [Defining a Char Stack in Java](https://www.baeldung.com/java-char-stack) -- [Time Comparison of Arrays.sort(Object[]) and Arrays.sort(int[])](https://www.baeldung.com/arrays-sortobject-vs-sortint) +- [Guide to the Java Queue Interface](https://www.baeldung.com/java-queue) +- [An Introduction to Synchronized Java Collections](https://www.baeldung.com/java-synchronized-collections) +- [[More -->]](/core-java-modules/core-java-collections-2) \ No newline at end of file diff --git a/core-java-modules/core-java-collections/pom.xml b/core-java-modules/core-java-collections/pom.xml index e5b89c3d16..62b42b53e7 100644 --- a/core-java-modules/core-java-collections/pom.xml +++ b/core-java-modules/core-java-collections/pom.xml @@ -14,33 +14,12 @@ - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.eclipse.collections - eclipse-collections - ${eclipse.collections.version} - org.assertj assertj-core ${assertj.version} test - - org.junit.platform - junit-platform-runner - ${junit.platform.version} - test - org.openjdk.jmh jmh-core @@ -51,28 +30,10 @@ jmh-generator-annprocess ${openjdk.jmh.version} - - org.apache.commons - commons-exec - ${commons-exec.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - 1.19 - 1.2.0 - 3.8.1 - 4.1 - 4.01 - 1.7.0 3.11.1 - 7.1.0 - 1.3 diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/iterators/Iterators.java b/core-java-modules/core-java-collections/src/main/java/com/baeldung/iterators/Iterators.java deleted file mode 100644 index 5e7cfdb54f..0000000000 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/iterators/Iterators.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.baeldung.iterators; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Source code https://github.com/eugenp/tutorials - * - * @author Santosh Thakur - */ - -public class Iterators { - - public static int failFast1() { - ArrayList numbers = new ArrayList<>(); - - numbers.add(10); - numbers.add(20); - numbers.add(30); - numbers.add(40); - - Iterator iterator = numbers.iterator(); - while (iterator.hasNext()) { - Integer number = iterator.next(); - numbers.add(50); - } - - return numbers.size(); - } - - public static int failFast2() { - ArrayList numbers = new ArrayList<>(); - numbers.add(10); - numbers.add(20); - numbers.add(30); - numbers.add(40); - - Iterator iterator = numbers.iterator(); - while (iterator.hasNext()) { - if (iterator.next() == 30) { - // will not throw Exception - iterator.remove(); - } - } - - System.out.println("using iterator's remove method = " + numbers); - - iterator = numbers.iterator(); - while (iterator.hasNext()) { - if (iterator.next() == 40) { - // will throw Exception on - // next call of next() method - numbers.remove(2); - } - } - - return numbers.size(); - } - - public static int failSafe1() { - ConcurrentHashMap map = new ConcurrentHashMap<>(); - - map.put("First", 10); - map.put("Second", 20); - map.put("Third", 30); - map.put("Fourth", 40); - - Iterator iterator = map.keySet() - .iterator(); - - while (iterator.hasNext()) { - String key = iterator.next(); - map.put("Fifth", 50); - } - - return map.size(); - } - -} diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java b/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java deleted file mode 100644 index 86b91b3fdc..0000000000 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/removal/Iterators.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.baeldung.removal; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -public class Iterators { - - public static void main(String args[]) { - Collection names = new ArrayList<>(); - names.add("John"); - names.add("Ana"); - names.add("Mary"); - names.add("Anthony"); - names.add("Mark"); - - Iterator i = names.iterator(); - - while (i.hasNext()) { - String e = i.next(); - if (e.startsWith("A")) { - i.remove(); - } - } - - System.out.println(String.join(",", names)); - } -} diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/Application.java b/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/Application.java new file mode 100644 index 0000000000..f974a24839 --- /dev/null +++ b/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/Application.java @@ -0,0 +1,18 @@ +package com.baeldung.synchronizedcollections; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.logging.Logger; + +public class Application { + + private static final Logger LOGGER = Logger.getLogger(Application.class.getName()); + + public static void main(String[] args) throws InterruptedException { + List syncCollection = Collections.synchronizedList(Arrays.asList(1, 2, 3, 4, 5, 6)); + synchronized (syncCollection) { + syncCollection.forEach((e) -> {LOGGER.info(e.toString());}); + } + } +} diff --git a/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/application/Application.java b/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/application/Application.java deleted file mode 100644 index 093308a34a..0000000000 --- a/core-java-modules/core-java-collections/src/main/java/com/baeldung/synchronizedcollections/application/Application.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.synchronizedcollections.application; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.logging.Logger; - -public class Application { - - private static final Logger LOGGER = Logger.getLogger(Application.class.getName()); - - public static void main(String[] args) throws InterruptedException { - List syncCollection = Collections.synchronizedList(Arrays.asList(1, 2, 3, 4, 5, 6)); - synchronized (syncCollection) { - syncCollection.forEach((e) -> {LOGGER.info(e.toString());}); - } - } -} diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java deleted file mode 100644 index d0d8c3923c..0000000000 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.baeldung.java.collections; - -import org.junit.Test; - -import java.util.*; -import java.util.concurrent.CopyOnWriteArrayList; - -import static java.util.Arrays.asList; -import static org.junit.Assert.assertEquals; - -public class ConcurrentModificationExceptionUnitTest { - - @Test - public void changingContentWithSetDoesNotThrowConcurrentModificationException() throws Exception { - ArrayList array = new ArrayList<>(asList(0, "one", 2, "three")); - - for (Object item : array) { - array.set(3, 3); - } - } - - @Test - public void removingElementUsingIteratorAPI() throws Exception { - List originalList = new ArrayList<>(asList("zero", "one", "two", "three")); - - Iterator iterator = originalList.iterator(); - - while (iterator.hasNext()) { - String next = iterator.next(); - if (Objects.equals(next, "one")) iterator.remove(); - } - - assertEquals(originalList, asList("zero", "two", "three")); - } - - @Test - public void modifyingContentAndIteratingUsingListIteratorAPI() throws Exception { - List originalList = new ArrayList<>(asList("zero", "one", "two", "three")); - - ListIterator iterator = originalList.listIterator(); - - while (iterator.hasNext()) { - String next = iterator.next(); - if (Objects.equals(next, "one")) { - iterator.set("another"); - } - - if (Objects.equals(next, "two")) { - iterator.remove(); - } - - if (Objects.equals(next, "three")) { - iterator.add("four"); - } - } - - assertEquals(originalList, asList("zero", "another", "three", "four")); - } - - @Test - public void removingElementUsingCopyAndListAPI() throws Exception { - List originalList = new ArrayList<>(asList("zero", "one", "two", "three")); - - List listCopy = new ArrayList<>(originalList); - - for (String next : listCopy) { - if (Objects.equals(next, "one")) originalList.remove(originalList.indexOf(next) - 1); - } - - assertEquals(originalList, asList("one", "two", "three")); - } - - @Test - public void copyOnWriteList() throws Exception { - List originalList = new CopyOnWriteArrayList<>(asList("zero", "one", "two", "three")); - - for (String next : originalList) { - if (Objects.equals(next, "one")) originalList.remove(originalList.indexOf(next) - 1); - } - - assertEquals(originalList, asList("one", "two", "three")); - } -} diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedCollectionUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedCollectionUnitTest.java similarity index 94% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedCollectionUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedCollectionUnitTest.java index fd84503226..29b1ab9e70 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedCollectionUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedCollectionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedListUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedListUnitTest.java similarity index 97% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedListUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedListUnitTest.java index 72354622ae..0e3c9cd217 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedListUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedListUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedMapUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedMapUnitTest.java similarity index 94% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedMapUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedMapUnitTest.java index 842e253e9e..9a4d80b403 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedMapUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedMapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.Collections; import java.util.HashMap; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSetUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSetUnitTest.java similarity index 93% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSetUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSetUnitTest.java index f88f58a55b..88fd343f56 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSetUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSetUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.Arrays; import java.util.Collections; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedMapUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedMapUnitTest.java similarity index 94% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedMapUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedMapUnitTest.java index 23933b2b4b..7cbfa9bfa9 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedMapUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedMapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.Collections; import java.util.Map; diff --git a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedSetUnitTest.java b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedSetUnitTest.java similarity index 94% rename from core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedSetUnitTest.java rename to core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedSetUnitTest.java index 3ce1e6ed26..98820665c1 100644 --- a/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/test/SynchronizedSortedSetUnitTest.java +++ b/core-java-modules/core-java-collections/src/test/java/com/baeldung/synchronizedcollections/SynchronizedSortedSetUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.synchronizedcollections.test; +package com.baeldung.synchronizedcollections; import java.util.Arrays; import java.util.Collections; diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java b/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java deleted file mode 100644 index d43075c925..0000000000 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.baeldung.java.collections; - -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; - -import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.collections4.IterableUtils; -import org.junit.Assert; -import org.junit.Test; - -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static java.util.Arrays.asList; - -public class CollectionsConcatenateUnitTest { - - @Test - public void givenUsingJava8_whenConcatenatingUsingConcat_thenCorrect() { - Collection collectionA = asList("S", "T"); - Collection collectionB = asList("U", "V"); - Collection collectionC = asList("W", "X"); - - Stream combinedStream = Stream.concat(Stream.concat(collectionA.stream(), collectionB.stream()), collectionC.stream()); - Collection collectionCombined = combinedStream.collect(Collectors.toList()); - - Assert.assertEquals(asList("S", "T", "U", "V", "W", "X"), collectionCombined); - } - - @Test - public void givenUsingJava8_whenConcatenatingUsingflatMap_thenCorrect() { - Collection collectionA = asList("S", "T"); - Collection collectionB = asList("U", "V"); - - Stream combinedStream = Stream.of(collectionA, collectionB).flatMap(Collection::stream); - Collection collectionCombined = combinedStream.collect(Collectors.toList()); - - Assert.assertEquals(asList("S", "T", "U", "V"), collectionCombined); - } - - @Test - public void givenUsingGuava_whenConcatenatingUsingIterables_thenCorrect() { - Collection collectionA = asList("S", "T"); - Collection collectionB = asList("U", "V"); - - Iterable combinedIterables = Iterables.unmodifiableIterable(Iterables.concat(collectionA, collectionB)); - Collection collectionCombined = Lists.newArrayList(combinedIterables); - - Assert.assertEquals(asList("S", "T", "U", "V"), collectionCombined); - } - - @Test - public void givenUsingJava7_whenConcatenatingUsingIterables_thenCorrect() { - Collection collectionA = asList("S", "T"); - Collection collectionB = asList("U", "V"); - - Iterable combinedIterables = concat(collectionA, collectionB); - Collection collectionCombined = makeListFromIterable(combinedIterables); - Assert.assertEquals(Arrays.asList("S", "T", "U", "V"), collectionCombined); - } - - public static Iterable concat(Iterable i1, Iterable i2) { - return new Iterable() { - public Iterator iterator() { - return new Iterator() { - Iterator listIterator = i1.iterator(); - Boolean checkedHasNext; - E nextValue; - private boolean startTheSecond; - - void theNext() { - if (listIterator.hasNext()) { - checkedHasNext = true; - nextValue = listIterator.next(); - } else if (startTheSecond) - checkedHasNext = false; - else { - startTheSecond = true; - listIterator = i2.iterator(); - theNext(); - } - } - - public boolean hasNext() { - if (checkedHasNext == null) - theNext(); - return checkedHasNext; - } - - public E next() { - if (!hasNext()) - throw new NoSuchElementException(); - checkedHasNext = null; - return nextValue; - } - - public void remove() { - listIterator.remove(); - } - }; - } - }; - } - - public static List makeListFromIterable(Iterable iter) { - List list = new ArrayList<>(); - for (E item : iter) { - list.add(item); - } - return list; - } - - @Test - public void givenUsingApacheCommons_whenConcatenatingUsingUnion_thenCorrect() { - Collection collectionA = asList("S", "T"); - Collection collectionB = asList("U", "V"); - - Iterable combinedIterables = CollectionUtils.union(collectionA, collectionB); - Collection collectionCombined = Lists.newArrayList(combinedIterables); - - Assert.assertEquals(asList("S", "T", "U", "V"), collectionCombined); - } - - @Test - public void givenUsingApacheCommons_whenConcatenatingUsingChainedIterable_thenCorrect() { - Collection collectionA = asList("S", "T"); - Collection collectionB = asList("U", "V"); - - Iterable combinedIterables = IterableUtils.chainedIterable(collectionA, collectionB); - Collection collectionCombined = Lists.newArrayList(combinedIterables); - - Assert.assertEquals(asList("S", "T", "U", "V"), collectionCombined); - } -} diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/README.md b/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/README.md deleted file mode 100644 index 317d81fae7..0000000000 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/collections/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles: -- [Join and Split Arrays and Collections in Java](http://www.baeldung.com/java-join-and-split) -- [Introduction to Java Servlets](http://www.baeldung.com/intro-to-servlets) diff --git a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java b/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java deleted file mode 100644 index 99af49c8d3..0000000000 --- a/core-java-modules/core-java-collections/src/test/java/org/baeldung/java/sorting/Employee.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.baeldung.java.sorting; - -public class Employee implements Comparable { - - private String name; - private int age; - private double salary; - - public Employee(String name, int age, double salary) { - this.name = name; - this.age = age; - this.salary = salary; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public double getSalary() { - return salary; - } - - public void setSalary(double salary) { - this.salary = salary; - } - - @Override - public boolean equals(Object obj) { - return ((Employee) obj).getName() - .equals(getName()); - } - - @Override - public int compareTo(Object o) { - Employee e = (Employee) o; - return getName().compareTo(e.getName()); - } - - @Override - public String toString() { - return new StringBuffer().append("(") - .append(getName()) - .append(getAge()) - .append(",") - .append(getSalary()) - .append(")") - .toString(); - } - -} diff --git a/core-java-modules/core-java-concurrency-advanced-2/README.md b/core-java-modules/core-java-concurrency-advanced-2/README.md new file mode 100644 index 0000000000..988ada9e4a --- /dev/null +++ b/core-java-modules/core-java-concurrency-advanced-2/README.md @@ -0,0 +1,19 @@ +========= + +## Core Java Concurrency Advanced Examples + +This module contains articles about advanced topics about multithreading with core Java. + +### Relevant Articles: +- [Semaphores in Java](https://www.baeldung.com/java-semaphore) +- [Daemon Threads in Java](https://www.baeldung.com/java-daemon-thread) +- [Priority-based Job Scheduling in Java](https://www.baeldung.com/java-priority-job-schedule) +- [Brief Introduction to Java Thread.yield()](https://www.baeldung.com/java-thread-yield) +- [Print Even and Odd Numbers Using 2 Threads](https://www.baeldung.com/java-even-odd-numbers-with-2-threads) +- [Java CyclicBarrier vs CountDownLatch](https://www.baeldung.com/java-cyclicbarrier-countdownlatch) +- [Guide to the Fork/Join Framework in Java](https://www.baeldung.com/java-fork-join) +- [Guide to ThreadLocalRandom in Java](https://www.baeldung.com/java-thread-local-random) +- [The Thread.join() Method in Java](https://www.baeldung.com/java-thread-join) +- [Passing Parameters to Java Threads](https://www.baeldung.com/java-thread-parameters) + +[[<-- previous]](/core-java-modules/core-java-concurrency-advanced)[[next -->]](/core-java-modules/core-java-concurrency-advanced-3) diff --git a/core-java-modules/core-java-concurrency-advanced-2/pom.xml b/core-java-modules/core-java-concurrency-advanced-2/pom.xml new file mode 100644 index 0000000000..cad492b1ea --- /dev/null +++ b/core-java-modules/core-java-concurrency-advanced-2/pom.xml @@ -0,0 +1,59 @@ + + 4.0.0 + com.baeldung + core-java-concurrency-advanced-2 + 0.1.0-SNAPSHOT + core-java-concurrency-advanced-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator-annprocess.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-concurrency-advanced-2 + + + src/main/resources + true + + + + + + 1.19 + 1.19 + + 3.6.1 + + + diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchCountExample.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchCountExample.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchCountExample.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchCountExample.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExample.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExample.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExample.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExample.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExample.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java similarity index 88% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java index 76b6198bc4..cf497687cc 100644 --- a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java +++ b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExample.java @@ -4,6 +4,7 @@ import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; public class CyclicBarrierResetExample { @@ -36,6 +37,11 @@ public class CyclicBarrierResetExample { }); } es.shutdown(); + try { + es.awaitTermination(1, TimeUnit.SECONDS); + } catch (InterruptedException e) { + e.printStackTrace(); + } return updateCount.get(); } diff --git a/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/daemon/NewThread.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/daemon/NewThread.java new file mode 100644 index 0000000000..370ce99c09 --- /dev/null +++ b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/daemon/NewThread.java @@ -0,0 +1,23 @@ +package com.baeldung.concurrent.daemon; + +public class NewThread extends Thread { + public void run() { + long startTime = System.currentTimeMillis(); + while (true) { + for (int i = 0; i < 10; i++) { + System.out.println(this.getName() + ": New Thread is running..." + i); + try { + //Wait for one sec so it doesn't print too fast + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + // prevent the Thread to run forever. It will finish it's execution after 2 seconds + if (System.currentTimeMillis() - startTime > 2000) { + Thread.currentThread().interrupt(); + break; + } + } + } +} diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddSemaphore.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddSemaphore.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddSemaphore.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddSemaphore.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddWaitNotify.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddWaitNotify.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddWaitNotify.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/evenandodd/PrintEvenOddWaitNotify.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/parameter/AverageCalculator.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/parameters/AverageCalculator.java similarity index 90% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/parameter/AverageCalculator.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/parameters/AverageCalculator.java index a548b5d4a7..f0997b30bd 100644 --- a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/parameter/AverageCalculator.java +++ b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/parameters/AverageCalculator.java @@ -1,4 +1,4 @@ -package com.baeldung.concurrent.parameter; +package com.baeldung.concurrent.parameters; import java.util.concurrent.Callable; import java.util.stream.IntStream; diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/parameter/ParameterizedThreadExample.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/parameters/ParameterizedThreadExample.java similarity index 95% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/parameter/ParameterizedThreadExample.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/parameters/ParameterizedThreadExample.java index 73c61f3fb1..177bf14dae 100644 --- a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/parameter/ParameterizedThreadExample.java +++ b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/parameters/ParameterizedThreadExample.java @@ -1,4 +1,4 @@ -package com.baeldung.concurrent.parameter; +package com.baeldung.concurrent.parameters; import java.util.concurrent.Callable; import java.util.stream.IntStream; diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/prioritytaskexecution/Job.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/prioritytaskexecution/Job.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/prioritytaskexecution/Job.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/prioritytaskexecution/Job.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/prioritytaskexecution/JobPriority.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/prioritytaskexecution/JobPriority.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/prioritytaskexecution/JobPriority.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/prioritytaskexecution/JobPriority.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/prioritytaskexecution/PriorityJobScheduler.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/prioritytaskexecution/PriorityJobScheduler.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/prioritytaskexecution/PriorityJobScheduler.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/prioritytaskexecution/PriorityJobScheduler.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/semaphores/CounterUsingMutex.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/semaphores/CounterUsingMutex.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/semaphores/CounterUsingMutex.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/semaphores/CounterUsingMutex.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/semaphores/DelayQueueUsingTimedSemaphore.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/semaphores/DelayQueueUsingTimedSemaphore.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/semaphores/DelayQueueUsingTimedSemaphore.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/semaphores/DelayQueueUsingTimedSemaphore.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/semaphores/LoginQueueUsingSemaphore.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/semaphores/LoginQueueUsingSemaphore.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/semaphores/LoginQueueUsingSemaphore.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/semaphores/LoginQueueUsingSemaphore.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/yield/ThreadYield.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/yield/ThreadYield.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/yield/ThreadYield.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/concurrent/yield/ThreadYield.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/forkjoin/CustomRecursiveAction.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/forkjoin/CustomRecursiveAction.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/forkjoin/CustomRecursiveAction.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/forkjoin/CustomRecursiveAction.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/forkjoin/CustomRecursiveTask.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/forkjoin/CustomRecursiveTask.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/forkjoin/CustomRecursiveTask.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/forkjoin/CustomRecursiveTask.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/forkjoin/util/PoolUtil.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/forkjoin/util/PoolUtil.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/forkjoin/util/PoolUtil.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/forkjoin/util/PoolUtil.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarkRunner.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarkRunner.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarkRunner.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarkRunner.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarker.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarker.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarker.java rename to core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarker.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchCountExampleUnitTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchCountExampleUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchCountExampleUnitTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchCountExampleUnitTest.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExampleUnitTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExampleUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExampleUnitTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCountExampleUnitTest.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierResetExampleUnitTest.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/daemon/DaemonThreadUnitTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/daemon/DaemonThreadUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/daemon/DaemonThreadUnitTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/daemon/DaemonThreadUnitTest.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/parameters/ParameterizedThreadUnitTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/parameters/ParameterizedThreadUnitTest.java similarity index 93% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/parameters/ParameterizedThreadUnitTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/parameters/ParameterizedThreadUnitTest.java index 21b374e609..4185d77dc3 100644 --- a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/parameters/ParameterizedThreadUnitTest.java +++ b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/parameters/ParameterizedThreadUnitTest.java @@ -1,14 +1,13 @@ -package com.baeldung.parameters; +package com.baeldung.concurrent.parameters; -import com.baeldung.concurrent.parameter.AverageCalculator; -import org.junit.Test; +import static org.junit.Assert.assertEquals; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.stream.IntStream; -import static org.junit.Assert.assertEquals; +import org.junit.Test; public class ParameterizedThreadUnitTest { diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/prioritytaskexecution/PriorityJobSchedulerUnitTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/prioritytaskexecution/PriorityJobSchedulerUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/prioritytaskexecution/PriorityJobSchedulerUnitTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/prioritytaskexecution/PriorityJobSchedulerUnitTest.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/semaphores/SemaphoresManualTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/semaphores/SemaphoresManualTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/concurrent/semaphores/SemaphoresManualTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/semaphores/SemaphoresManualTest.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/java8/Java8ForkJoinIntegrationTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/forkjoin/Java8ForkJoinIntegrationTest.java similarity index 98% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/java8/Java8ForkJoinIntegrationTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/forkjoin/Java8ForkJoinIntegrationTest.java index 6778fd782b..c469fe0195 100644 --- a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/java8/Java8ForkJoinIntegrationTest.java +++ b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/forkjoin/Java8ForkJoinIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java8; +package com.baeldung.forkjoin; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/thread/join/ThreadJoinUnitTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/thread/join/ThreadJoinUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/thread/join/ThreadJoinUnitTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/thread/join/ThreadJoinUnitTest.java diff --git a/core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/threadlocalrandom/ThreadLocalRandomIntegrationTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/threadlocalrandom/ThreadLocalRandomIntegrationTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/threadlocalrandom/ThreadLocalRandomIntegrationTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/threadlocalrandom/ThreadLocalRandomIntegrationTest.java diff --git a/core-java-modules/core-java-concurrency-advanced-3/README.md b/core-java-modules/core-java-concurrency-advanced-3/README.md new file mode 100644 index 0000000000..d1622b5fe1 --- /dev/null +++ b/core-java-modules/core-java-concurrency-advanced-3/README.md @@ -0,0 +1,9 @@ +========= + +## Core Java Concurrency Advanced Examples + +This module contains articles about advanced topics about multithreading with core Java. + +### Relevant Articles: + +[[<-- previous]](/core-java-modules/core-java-concurrency-advanced-2) diff --git a/core-java-modules/core-java-concurrency-advanced-3/pom.xml b/core-java-modules/core-java-concurrency-advanced-3/pom.xml new file mode 100644 index 0000000000..cc7b7b1e70 --- /dev/null +++ b/core-java-modules/core-java-concurrency-advanced-3/pom.xml @@ -0,0 +1,33 @@ + + 4.0.0 + com.baeldung + core-java-concurrency-advanced-3 + 0.1.0-SNAPSHOT + core-java-concurrency-advanced-3 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + + core-java-concurrency-advanced-3 + + + src/main/resources + true + + + + + + + + diff --git a/core-java-modules/core-java-concurrency-advanced/README.md b/core-java-modules/core-java-concurrency-advanced/README.md index 8e99858693..0da59c88fb 100644 --- a/core-java-modules/core-java-concurrency-advanced/README.md +++ b/core-java-modules/core-java-concurrency-advanced/README.md @@ -1,25 +1,16 @@ -========= - ## Core Java Concurrency Advanced Examples +This module contains articles about advanced topics about multithreading with core Java. + ### Relevant Articles: -- [Introduction to Thread Pools in Java](http://www.baeldung.com/thread-pool-java-and-guava) -- [Guide to CountDownLatch in Java](http://www.baeldung.com/java-countdown-latch) -- [Guide to java.util.concurrent.Locks](http://www.baeldung.com/java-concurrent-locks) -- [An Introduction to ThreadLocal in Java](http://www.baeldung.com/java-threadlocal) -- [LongAdder and LongAccumulator in Java](http://www.baeldung.com/java-longadder-and-longaccumulator) -- [The Dining Philosophers Problem in Java](http://www.baeldung.com/java-dining-philoshophers) -- [Guide to the Java Phaser](http://www.baeldung.com/java-phaser) -- [An Introduction to Atomic Variables in Java](http://www.baeldung.com/java-atomic-variables) -- [CyclicBarrier in Java](http://www.baeldung.com/java-cyclic-barrier) -- [Guide to the Volatile Keyword in Java](http://www.baeldung.com/java-volatile) -- [Semaphores in Java](http://www.baeldung.com/java-semaphore) -- [Daemon Threads in Java](http://www.baeldung.com/java-daemon-thread) -- [Priority-based Job Scheduling in Java](http://www.baeldung.com/java-priority-job-schedule) -- [Brief Introduction to Java Thread.yield()](https://www.baeldung.com/java-thread-yield) -- [Print Even and Odd Numbers Using 2 Threads](https://www.baeldung.com/java-even-odd-numbers-with-2-threads) -- [Java CyclicBarrier vs CountDownLatch](https://www.baeldung.com/java-cyclicbarrier-countdownlatch) -- [Guide to the Fork/Join Framework in Java](http://www.baeldung.com/java-fork-join) -- [Guide to ThreadLocalRandom in Java](http://www.baeldung.com/java-thread-local-random) -- [The Thread.join() Method in Java](http://www.baeldung.com/java-thread-join) -- [Passing Parameters to Java Threads](https://www.baeldung.com/java-thread-parameters) +- [Introduction to Thread Pools in Java](https://www.baeldung.com/thread-pool-java-and-guava) +- [Guide to CountDownLatch in Java](https://www.baeldung.com/java-countdown-latch) +- [Guide to java.util.concurrent.Locks](https://www.baeldung.com/java-concurrent-locks) +- [An Introduction to ThreadLocal in Java](https://www.baeldung.com/java-threadlocal) +- [LongAdder and LongAccumulator in Java](https://www.baeldung.com/java-longadder-and-longaccumulator) +- [The Dining Philosophers Problem in Java](https://www.baeldung.com/java-dining-philoshophers) +- [Guide to the Java Phaser](https://www.baeldung.com/java-phaser) +- [An Introduction to Atomic Variables in Java](https://www.baeldung.com/java-atomic-variables) +- [CyclicBarrier in Java](https://www.baeldung.com/java-cyclic-barrier) +- [Guide to the Volatile Keyword in Java](https://www.baeldung.com/java-volatile) +- More Articles: [[next -->]](/core-java-modules/core-java-concurrency-advanced-2) diff --git a/core-java-modules/core-java-concurrency-advanced/pom.xml b/core-java-modules/core-java-concurrency-advanced/pom.xml index 5d41909ed3..4a9ee30d65 100644 --- a/core-java-modules/core-java-concurrency-advanced/pom.xml +++ b/core-java-modules/core-java-concurrency-advanced/pom.xml @@ -47,16 +47,6 @@ ${avaitility.version} test - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator-annprocess.version} - @@ -78,8 +68,6 @@ 3.6.1 1.7.0 - 1.19 - 1.19 diff --git a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExample.java b/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExample.java index 7c1299da62..00cf314706 100644 --- a/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExample.java +++ b/core-java-modules/core-java-concurrency-advanced/src/main/java/com/baeldung/concurrent/cyclicbarrier/CyclicBarrierCompletionMethodExample.java @@ -4,6 +4,7 @@ import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; public class CyclicBarrierCompletionMethodExample { @@ -35,6 +36,11 @@ public class CyclicBarrierCompletionMethodExample { }); } es.shutdown(); + try { + es.awaitTermination(1, TimeUnit.SECONDS); + } catch (InterruptedException e) { + e.printStackTrace(); + } return updateCount.get(); } diff --git a/core-java-modules/core-java-concurrency-basic-2/README.md b/core-java-modules/core-java-concurrency-basic-2/README.md new file mode 100644 index 0000000000..e72725b7cb --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-2/README.md @@ -0,0 +1,10 @@ +========= + +## Core Java Concurrency Basic 2 Examples + +### Relevant Articles: +- [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) +- [wait and notify() Methods in Java](https://www.baeldung.com/java-wait-notify) +- [Difference Between Wait and Sleep in Java](https://www.baeldung.com/java-wait-and-sleep) +- [Guide to the Synchronized Keyword in Java](https://www.baeldung.com/java-synchronized) +- [Life Cycle of a Thread in Java](https://www.baeldung.com/java-thread-lifecycle) diff --git a/core-java-modules/core-java-concurrency-basic-2/pom.xml b/core-java-modules/core-java-concurrency-basic-2/pom.xml new file mode 100644 index 0000000000..396447ff75 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-2/pom.xml @@ -0,0 +1,29 @@ + + 4.0.0 + core-java-concurrency-basic-2 + 0.1.0-SNAPSHOT + core-java-concurrency-basic-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + + core-java-concurrency-basic-2 + + + src/main/resources + true + + + + + diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/delay/Delay.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/delay/Delay.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/delay/Delay.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/delay/Delay.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/ThreadA.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/ThreadA.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/ThreadA.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/ThreadA.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/ThreadB.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/ThreadB.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/ThreadB.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/ThreadB.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/WaitSleepExample.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/WaitSleepExample.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/sleepwait/WaitSleepExample.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/sleepwait/WaitSleepExample.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedBlocks.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedBlocks.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedBlocks.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedBlocks.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedMethods.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedMethods.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedMethods.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizedMethods.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/BlockedState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/NewState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/NewState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/NewState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/NewState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/RunnableState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/RunnableState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/RunnableState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/RunnableState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/TerminatedState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/TerminatedState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/TerminatedState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/TerminatedState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/TimedWaitingState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/threadlifecycle/WaitingState.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Data.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/NetworkDriver.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/NetworkDriver.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/NetworkDriver.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/NetworkDriver.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Receiver.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Receiver.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Receiver.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Receiver.java diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Sender.java b/core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Sender.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/waitandnotify/Sender.java rename to core-java-modules/core-java-concurrency-basic-2/src/main/java/com/baeldung/concurrent/waitandnotify/Sender.java diff --git a/spring-all/src/main/resources/logback.xml b/core-java-modules/core-java-concurrency-basic-2/src/main/resources/logback.xml similarity index 100% rename from spring-all/src/main/resources/logback.xml rename to core-java-modules/core-java-concurrency-basic-2/src/main/resources/logback.xml diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java rename to core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSychronizedBlockUnitTest.java diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsUnitTest.java b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsUnitTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsUnitTest.java rename to core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/synchronize/BaeldungSynchronizeMethodsUnitTest.java diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java similarity index 100% rename from core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java rename to core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java index e2bc328df3..473fe6ff8e 100644 --- a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java +++ b/core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/waitandnotify/NetworkIntegrationTest.java @@ -1,15 +1,15 @@ package com.baeldung.concurrent.waitandnotify; -import static org.junit.Assert.assertEquals; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class NetworkIntegrationTest { diff --git a/core-java-modules/core-java-concurrency-basic/README.md b/core-java-modules/core-java-concurrency-basic/README.md index c498bed315..846687b8dd 100644 --- a/core-java-modules/core-java-concurrency-basic/README.md +++ b/core-java-modules/core-java-concurrency-basic/README.md @@ -1,20 +1,16 @@ -========= +## Core Java Concurrency Basic -## Core Java Concurrency Basic Examples +This module contains articles about basic Java concurrency ### Relevant Articles: -- [Guide To CompletableFuture](http://www.baeldung.com/java-completablefuture) -- [A Guide to the Java ExecutorService](http://www.baeldung.com/java-executor-service-tutorial) -- [Guide to java.util.concurrent.Future](http://www.baeldung.com/java-future) -- [Difference Between Wait and Sleep in Java](http://www.baeldung.com/java-wait-and-sleep) -- [Guide to the Synchronized Keyword in Java](http://www.baeldung.com/java-synchronized) -- [Overview of the java.util.concurrent](http://www.baeldung.com/java-util-concurrent) -- [Implementing a Runnable vs Extending a Thread](http://www.baeldung.com/java-runnable-vs-extending-thread) -- [How to Kill a Java Thread](http://www.baeldung.com/java-thread-stop) -- [ExecutorService – Waiting for Threads to Finish](http://www.baeldung.com/java-executor-wait-for-threads) -- [wait and notify() Methods in Java](http://www.baeldung.com/java-wait-notify) -- [Life Cycle of a Thread in Java](http://www.baeldung.com/java-thread-lifecycle) -- [Runnable vs. Callable in Java](http://www.baeldung.com/java-runnable-callable) +- [Guide To CompletableFuture](https://www.baeldung.com/java-completablefuture) +- [A Guide to the Java ExecutorService](https://www.baeldung.com/java-executor-service-tutorial) +- [Guide to java.util.concurrent.Future](https://www.baeldung.com/java-future) +- [Overview of the java.util.concurrent](https://www.baeldung.com/java-util-concurrent) +- [Implementing a Runnable vs Extending a Thread](https://www.baeldung.com/java-runnable-vs-extending-thread) +- [How to Kill a Java Thread](https://www.baeldung.com/java-thread-stop) +- [ExecutorService – Waiting for Threads to Finish](https://www.baeldung.com/java-executor-wait-for-threads) +- [Runnable vs. Callable in Java](https://www.baeldung.com/java-runnable-callable) - [What is Thread-Safety and How to Achieve it?](https://www.baeldung.com/java-thread-safety) - [How to Start a Thread in Java](https://www.baeldung.com/java-start-thread) -- [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) +- [[Next -->]](/core-java-modules/core-java-concurrency-basic-2) diff --git a/core-java-modules/core-java-concurrency-basic/pom.xml b/core-java-modules/core-java-concurrency-basic/pom.xml index 96b3ef76f7..93b8523eb4 100644 --- a/core-java-modules/core-java-concurrency-basic/pom.xml +++ b/core-java-modules/core-java-concurrency-basic/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-concurrency-basic 0.1.0-SNAPSHOT core-java-concurrency-basic diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/semaphore/SemaPhoreDemo.java b/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/semaphore/SemaPhoreDemo.java index 3a1d8555d3..43261e5ee4 100644 --- a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/semaphore/SemaPhoreDemo.java +++ b/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/semaphore/SemaPhoreDemo.java @@ -12,9 +12,11 @@ public class SemaPhoreDemo { System.out.println("Number of threads waiting to acquire: " + semaphore.getQueueLength()); if (semaphore.tryAcquire()) { - semaphore.acquire(); + try { // perform some critical operations - semaphore.release(); + } finally { + semaphore.release(); + } } } diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/CounterTest.java b/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/CounterTest.java deleted file mode 100644 index 176151083c..0000000000 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/CounterTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.concurrent.threadsafety.tests; - -import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; -import com.baeldung.concurrent.threadsafety.callables.CounterCallable; -import com.baeldung.concurrent.threadsafety.services.Counter; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -public class CounterTest { - - @Test - public void whenCalledIncrementCounter_thenCorrect() throws Exception { - ExecutorService executorService = Executors.newFixedThreadPool(2); - Counter counter = new Counter(); - Future future1 = (Future) executorService.submit(new CounterCallable(counter)); - Future future2 = (Future) executorService.submit(new CounterCallable(counter)); - - assertThat(future1.get()).isEqualTo(1); - assertThat(future2.get()).isEqualTo(2); - } -} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ExtrinsicLockCounterTest.java b/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ExtrinsicLockCounterTest.java deleted file mode 100644 index e34eb250bf..0000000000 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ExtrinsicLockCounterTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.concurrent.threadsafety.tests; - -import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; -import com.baeldung.concurrent.threadsafety.callables.ExtrinsicLockCounterCallable; -import com.baeldung.concurrent.threadsafety.services.ExtrinsicLockCounter; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -public class ExtrinsicLockCounterTest { - - @Test - public void whenCalledIncrementCounter_thenCorrect() throws Exception { - ExecutorService executorService = Executors.newFixedThreadPool(2); - ExtrinsicLockCounter counter = new ExtrinsicLockCounter(); - Future future1 = (Future) executorService.submit(new ExtrinsicLockCounterCallable(counter)); - Future future2 = (Future) executorService.submit(new ExtrinsicLockCounterCallable(counter)); - - assertThat(future1.get()).isEqualTo(1); - assertThat(future2.get()).isEqualTo(2); - } -} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MathUtilsTest.java b/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MathUtilsTest.java deleted file mode 100644 index 2708152906..0000000000 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MathUtilsTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.concurrent.threadsafety.tests; - -import com.baeldung.concurrent.threadsafety.mathutils.MathUtils; -import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; - -public class MathUtilsTest { - - @Test - public void whenCalledFactorialMethod_thenCorrect() { - assertThat(MathUtils.factorial(2)).isEqualTo(2); - } -} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MessageServiceTest.java b/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MessageServiceTest.java deleted file mode 100644 index e62206c09a..0000000000 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/MessageServiceTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.concurrent.threadsafety.tests; - -import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; -import com.baeldung.concurrent.threadsafety.callables.MessageServiceCallable; -import com.baeldung.concurrent.threadsafety.services.MessageService; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -public class MessageServiceTest { - - @Test - public void whenCalledgetMessage_thenCorrect() throws Exception { - ExecutorService executorService = Executors.newFixedThreadPool(2); - MessageService messageService = new MessageService("Welcome to Baeldung!"); - Future future1 = (Future) executorService.submit(new MessageServiceCallable(messageService)); - Future future2 = (Future) executorService.submit(new MessageServiceCallable(messageService)); - - assertThat(future1.get()).isEqualTo("Welcome to Baeldung!"); - assertThat(future2.get()).isEqualTo("Welcome to Baeldung!"); - } -} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantLockCounterTest.java b/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantLockCounterTest.java deleted file mode 100644 index 20fa2c74da..0000000000 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantLockCounterTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.concurrent.threadsafety.tests; - -import com.baeldung.concurrent.threadsafety.callables.ReentrantLockCounterCallable; -import com.baeldung.concurrent.threadsafety.services.ReentrantLockCounter; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; - -public class ReentrantLockCounterTest { - - @Test - public void whenCalledIncrementCounter_thenCorrect() throws Exception { - ExecutorService executorService = Executors.newFixedThreadPool(2); - ReentrantLockCounter counter = new ReentrantLockCounter(); - Future future1 = (Future) executorService.submit(new ReentrantLockCounterCallable(counter)); - Future future2 = (Future) executorService.submit(new ReentrantLockCounterCallable(counter)); - - assertThat(future1.get()).isEqualTo(1); - assertThat(future2.get()).isEqualTo(2); - } -} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantReadWriteLockCounterTest.java b/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantReadWriteLockCounterTest.java deleted file mode 100644 index 6113473cac..0000000000 --- a/core-java-modules/core-java-concurrency-basic/src/test/com/baeldung/concurrent/threadsafety/tests/ReentrantReadWriteLockCounterTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.concurrent.threadsafety.tests; - -import com.baeldung.concurrent.threadsafety.callables.ReentranReadWriteLockCounterCallable; -import com.baeldung.concurrent.threadsafety.services.ReentrantReadWriteLockCounter; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; - -public class ReentrantReadWriteLockCounterTest { - - @Test - public void whenCalledIncrementCounter_thenCorrect() throws Exception { - ExecutorService executorService = Executors.newFixedThreadPool(2); - ReentrantReadWriteLockCounter counter = new ReentrantReadWriteLockCounter(); - Future future1 = (Future) executorService.submit(new ReentranReadWriteLockCounterCallable(counter)); - Future future2 = (Future) executorService.submit(new ReentranReadWriteLockCounterCallable(counter)); - - assertThat(future1.get()).isEqualTo(1); - assertThat(future2.get()).isEqualTo(2); - } - -} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/CounterUnitTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/CounterUnitTest.java new file mode 100644 index 0000000000..6761b05282 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/CounterUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.concurrent.threadsafety; + +import com.baeldung.concurrent.threadsafety.callables.CounterCallable; +import com.baeldung.concurrent.threadsafety.services.Counter; +import org.junit.Test; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import static org.assertj.core.api.Assertions.assertThat; + +public class CounterUnitTest { + + @Test + public void whenCalledIncrementCounter_thenCorrect() throws Exception { + ExecutorService executorService = Executors.newFixedThreadPool(2); + Counter counter = new Counter(); + Future future1 = (Future) executorService.submit(new CounterCallable(counter)); + Future future2 = (Future) executorService.submit(new CounterCallable(counter)); + + assertThat(future1.get()).isEqualTo(1); + assertThat(future2.get()).isEqualTo(2); + } +} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ExtrinsicLockCounterUnitTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ExtrinsicLockCounterUnitTest.java new file mode 100644 index 0000000000..2dcb846bf4 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ExtrinsicLockCounterUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.concurrent.threadsafety; + +import com.baeldung.concurrent.threadsafety.callables.ExtrinsicLockCounterCallable; +import com.baeldung.concurrent.threadsafety.services.ExtrinsicLockCounter; +import org.junit.Test; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ExtrinsicLockCounterUnitTest { + + @Test + public void whenCalledIncrementCounter_thenCorrect() throws Exception { + ExecutorService executorService = Executors.newFixedThreadPool(2); + ExtrinsicLockCounter counter = new ExtrinsicLockCounter(); + Future future1 = (Future) executorService.submit(new ExtrinsicLockCounterCallable(counter)); + Future future2 = (Future) executorService.submit(new ExtrinsicLockCounterCallable(counter)); + + assertThat(future1.get()).isEqualTo(1); + assertThat(future2.get()).isEqualTo(2); + } +} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MathUtilsUnitTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MathUtilsUnitTest.java new file mode 100644 index 0000000000..018d4164f0 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MathUtilsUnitTest.java @@ -0,0 +1,16 @@ +package com.baeldung.concurrent.threadsafety; + +import com.baeldung.concurrent.threadsafety.mathutils.MathUtils; +import org.junit.Test; + +import java.math.BigInteger; + +import static org.assertj.core.api.Assertions.assertThat; + +public class MathUtilsUnitTest { + + @Test + public void whenCalledFactorialMethod_thenCorrect() { + assertThat(MathUtils.factorial(2)).isEqualTo(new BigInteger("2")); + } +} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MessageServiceUnitTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MessageServiceUnitTest.java new file mode 100644 index 0000000000..4df695a537 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/MessageServiceUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.concurrent.threadsafety; + +import com.baeldung.concurrent.threadsafety.callables.MessageServiceCallable; +import com.baeldung.concurrent.threadsafety.services.MessageService; +import org.junit.Test; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import static org.assertj.core.api.Assertions.assertThat; + +public class MessageServiceUnitTest { + + @Test + public void whenCalledgetMessage_thenCorrect() throws Exception { + ExecutorService executorService = Executors.newFixedThreadPool(2); + MessageService messageService = new MessageService("Welcome to Baeldung!"); + Future future1 = (Future) executorService.submit(new MessageServiceCallable(messageService)); + Future future2 = (Future) executorService.submit(new MessageServiceCallable(messageService)); + + assertThat(future1.get()).isEqualTo("Welcome to Baeldung!"); + assertThat(future2.get()).isEqualTo("Welcome to Baeldung!"); + } +} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantLockCounterUnitTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantLockCounterUnitTest.java new file mode 100644 index 0000000000..330d2d4c86 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantLockCounterUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.concurrent.threadsafety; + +import com.baeldung.concurrent.threadsafety.callables.ReentrantLockCounterCallable; +import com.baeldung.concurrent.threadsafety.services.ReentrantLockCounter; +import org.junit.Test; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ReentrantLockCounterUnitTest { + + @Test + public void whenCalledIncrementCounter_thenCorrect() throws Exception { + ExecutorService executorService = Executors.newFixedThreadPool(2); + ReentrantLockCounter counter = new ReentrantLockCounter(); + Future future1 = (Future) executorService.submit(new ReentrantLockCounterCallable(counter)); + Future future2 = (Future) executorService.submit(new ReentrantLockCounterCallable(counter)); + + assertThat(future1.get()).isEqualTo(1); + assertThat(future2.get()).isEqualTo(2); + } +} diff --git a/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantReadWriteLockCounterUnitTest.java b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantReadWriteLockCounterUnitTest.java new file mode 100644 index 0000000000..71fad2c87f --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/threadsafety/ReentrantReadWriteLockCounterUnitTest.java @@ -0,0 +1,26 @@ +package com.baeldung.concurrent.threadsafety; + +import com.baeldung.concurrent.threadsafety.callables.ReentranReadWriteLockCounterCallable; +import com.baeldung.concurrent.threadsafety.services.ReentrantReadWriteLockCounter; +import org.junit.Test; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ReentrantReadWriteLockCounterUnitTest { + + @Test + public void whenCalledIncrementCounter_thenCorrect() throws Exception { + ExecutorService executorService = Executors.newFixedThreadPool(2); + ReentrantReadWriteLockCounter counter = new ReentrantReadWriteLockCounter(); + Future future1 = (Future) executorService.submit(new ReentranReadWriteLockCounterCallable(counter)); + Future future2 = (Future) executorService.submit(new ReentranReadWriteLockCounterCallable(counter)); + + assertThat(future2.get()).isEqualTo(2); + assertThat(future1.get()).isEqualTo(1); + } + +} diff --git a/core-java-modules/core-java-concurrency-collections/README.md b/core-java-modules/core-java-concurrency-collections/README.md index b982a91861..80a21ee533 100644 --- a/core-java-modules/core-java-concurrency-collections/README.md +++ b/core-java-modules/core-java-concurrency-collections/README.md @@ -1,6 +1,6 @@ -========= +## Core Java Concurrency Collections -## Core Java Concurrency Collections Examples +This module contains articles about concurrent Java collections ### Relevant Articles: - [Guide to java.util.concurrent.BlockingQueue](http://www.baeldung.com/java-blocking-queue) diff --git a/core-java-modules/core-java-concurrency-collections/pom.xml b/core-java-modules/core-java-concurrency-collections/pom.xml index ea3bbe44f3..0d3a6042ac 100644 --- a/core-java-modules/core-java-concurrency-collections/pom.xml +++ b/core-java-modules/core-java-concurrency-collections/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-concurrency-collections 0.1.0-SNAPSHOT core-java-concurrency-collections @@ -15,38 +14,12 @@ - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - - - commons-io - commons-io - ${commons-io.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.apache.commons - commons-math3 - ${commons-math3.version} - org.assertj assertj-core ${assertj.version} test - - com.jayway.awaitility - awaitility - ${avaitility.version} - test - @@ -60,14 +33,8 @@ - - 21.0 - 3.6.1 - 4.1 - 4.01 3.6.1 - 1.7.0 diff --git a/core-java-modules/core-java-date-operations/pom.xml b/core-java-modules/core-java-date-operations/pom.xml new file mode 100644 index 0000000000..dcfe893a46 --- /dev/null +++ b/core-java-modules/core-java-date-operations/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + core-java-date-operations + ${project.parent.version} + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + joda-time + joda-time + ${joda-time.version} + + + com.darwinsys + hirondelle-date4j + ${hirondelle-date4j.version} + + + + 2.10 + 1.5.1 + + \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/date/comparison/DateComparisonUtils.java b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/date/comparison/DateComparisonUtils.java new file mode 100644 index 0000000000..ae8d21c29c --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/date/comparison/DateComparisonUtils.java @@ -0,0 +1,55 @@ +package com.baeldung.date.comparison; + +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; + +import org.apache.commons.lang3.time.DateUtils; + +import hirondelle.date4j.DateTime; + +public class DateComparisonUtils { + + public static boolean isSameDayUsingLocalDate(Date date1, Date date2) { + LocalDate localDate1 = date1.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDate(); + LocalDate localDate2 = date2.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDate(); + return localDate1.isEqual(localDate2); + } + + public static boolean isSameDayUsingSimpleDateFormat(Date date1, Date date2) { + SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + return fmt.format(date1) + .equals(fmt.format(date2)); + } + + public static boolean isSameDayUsingCalendar(Date date1, Date date2) { + Calendar calendar1 = Calendar.getInstance(); + calendar1.setTime(date1); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(date2); + return calendar1.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR) && calendar1.get(Calendar.MONTH) == calendar2.get(Calendar.MONTH) && calendar1.get(Calendar.DAY_OF_MONTH) == calendar2.get(Calendar.DAY_OF_MONTH); + } + + public static boolean isSameDayUsingApacheCommons(Date date1, Date date2) { + return DateUtils.isSameDay(date1, date2); + } + + public static boolean isSameDayUsingJoda(Date date1, Date date2) { + org.joda.time.LocalDate localDate1 = new org.joda.time.LocalDate(date1); + org.joda.time.LocalDate localDate2 = new org.joda.time.LocalDate(date2); + return localDate1.equals(localDate2); + } + + public static boolean isSameDayUsingDate4j(Date date1, Date date2) { + DateTime dateObject1 = DateTime.forInstant(date1.getTime(), TimeZone.getDefault()); + DateTime dateObject2 = DateTime.forInstant(date2.getTime(), TimeZone.getDefault()); + return dateObject1.isSameDayAs(dateObject2); + } +} diff --git a/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtils.java b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtils.java new file mode 100644 index 0000000000..bf32fdb79a --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtils.java @@ -0,0 +1,31 @@ +package com.baeldung.datetime; + +import java.time.DayOfWeek; +import java.time.LocalDate; + +public class AddSubtractDaysSkippingWeekendsUtils { + + public static LocalDate addDaysSkippingWeekends(LocalDate date, int days) { + LocalDate result = date; + int addedDays = 0; + while (addedDays < days) { + result = result.plusDays(1); + if (!(result.getDayOfWeek() == DayOfWeek.SATURDAY || result.getDayOfWeek() == DayOfWeek.SUNDAY)) { + ++addedDays; + } + } + return result; + } + + public static LocalDate subtractDaysSkippingWeekends(LocalDate date, int days) { + LocalDate result = date; + int subtractedDays = 0; + while (subtractedDays < days) { + result = result.minusDays(1); + if (!(result.getDayOfWeek() == DayOfWeek.SATURDAY || result.getDayOfWeek() == DayOfWeek.SUNDAY)) { + ++subtractedDays; + } + } + return result; + } +} diff --git a/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/CalendarUtils.java b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/CalendarUtils.java new file mode 100644 index 0000000000..ab1550fd90 --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/CalendarUtils.java @@ -0,0 +1,15 @@ +package com.baeldung.datetime; + +import java.text.ParseException; +import java.util.Calendar; +import java.util.Date; + +public class CalendarUtils { + + public static Calendar getPlusDays(Date date, int amount) throws ParseException { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_YEAR, amount); + return calendar; + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/DateUtils.java b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/DateUtils.java new file mode 100644 index 0000000000..34f799d3f4 --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/DateUtils.java @@ -0,0 +1,20 @@ +package com.baeldung.datetime; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class DateUtils { + + public static Date getNow() { + return new Date(); + } + + public static Date getDate(long millis) { + return new Date(millis); + } + + public static Date getDate(String dateAsString, String pattern) throws ParseException { + return new SimpleDateFormat(pattern).parse(dateAsString); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/sql/DateUtils.java b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/sql/DateUtils.java new file mode 100644 index 0000000000..1b4e825df8 --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/sql/DateUtils.java @@ -0,0 +1,21 @@ +package com.baeldung.datetime.sql; + +import java.sql.Date; +import java.text.ParseException; +import java.text.SimpleDateFormat; + +public class DateUtils { + + public static Date getNow() { + return new Date(System.currentTimeMillis()); + } + + public static Date getDate(String dateAsString) { + return Date.valueOf(dateAsString); + } + + public static Date getDate(String dateAsString, String pattern) throws ParseException { + java.util.Date customUtilDate = new SimpleDateFormat(pattern).parse(dateAsString); + return new Date(customUtilDate.getTime()); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/sql/TimeUtils.java b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/sql/TimeUtils.java new file mode 100644 index 0000000000..3fa1ffdef8 --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/sql/TimeUtils.java @@ -0,0 +1,21 @@ +package com.baeldung.datetime.sql; + +import java.sql.Time; +import java.text.ParseException; +import java.text.SimpleDateFormat; + +public class TimeUtils { + + public static Time getNow() { + return new Time(System.currentTimeMillis()); + } + + public static Time getTime(String timeAsString) { + return Time.valueOf(timeAsString); + } + + public static Time getTime(String dateAsString, String pattern) throws ParseException { + java.util.Date customUtilDate = new SimpleDateFormat(pattern).parse(dateAsString); + return new Time(customUtilDate.getTime()); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/sql/TimestampUtils.java b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/sql/TimestampUtils.java new file mode 100644 index 0000000000..02a928daa7 --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/sql/TimestampUtils.java @@ -0,0 +1,21 @@ +package com.baeldung.datetime.sql; + +import java.sql.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; + +public class TimestampUtils { + + public static Timestamp getNow() { + return new Timestamp(System.currentTimeMillis()); + } + + public static Timestamp getTimestamp(String timestampAsString) { + return Timestamp.valueOf(timestampAsString); + } + + public static Timestamp getTimestamp(String dateAsString, String pattern) throws ParseException { + java.util.Date customUtilDate = new SimpleDateFormat(pattern).parse(dateAsString); + return new Timestamp(customUtilDate.getTime()); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/date/comparison/DateComparisonUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/date/comparison/DateComparisonUtilsUnitTest.java new file mode 100644 index 0000000000..f02d97d73c --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/date/comparison/DateComparisonUtilsUnitTest.java @@ -0,0 +1,53 @@ +package com.baeldung.date.comparison; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; + +import org.junit.Test; + +public class DateComparisonUtilsUnitTest { + + private Date day1Morning = toDate(LocalDateTime.of(2019, 10, 19, 6, 30, 40)); + private Date day1Evening = toDate(LocalDateTime.of(2019, 10, 19, 18, 30, 50)); + private Date day2Morning = toDate(LocalDateTime.of(2019, 10, 20, 6, 30, 50)); + + private Date toDate(LocalDateTime localDateTime) { + return Date.from(localDateTime.atZone(ZoneId.systemDefault()) + .toInstant()); + } + + @Test + public void givenDatesWithDifferentTime_whenIsSameDay_thenReturnsTrue() { + assertTrue(DateComparisonUtils.isSameDayUsingLocalDate(day1Morning, day1Evening)); + assertTrue(DateComparisonUtils.isSameDayUsingSimpleDateFormat(day1Morning, day1Evening)); + assertTrue(DateComparisonUtils.isSameDayUsingCalendar(day1Morning, day1Evening)); + assertTrue(DateComparisonUtils.isSameDayUsingApacheCommons(day1Morning, day1Evening)); + assertTrue(DateComparisonUtils.isSameDayUsingJoda(day1Morning, day1Evening)); + assertTrue(DateComparisonUtils.isSameDayUsingDate4j(day1Morning, day1Evening)); + } + + @Test + public void givenDates_whenIsDifferentDay_thenReturnsFalse() { + assertFalse(DateComparisonUtils.isSameDayUsingLocalDate(day1Morning, day2Morning)); + assertFalse(DateComparisonUtils.isSameDayUsingLocalDate(day1Evening, day2Morning)); + + assertFalse(DateComparisonUtils.isSameDayUsingSimpleDateFormat(day1Morning, day2Morning)); + assertFalse(DateComparisonUtils.isSameDayUsingSimpleDateFormat(day1Evening, day2Morning)); + + assertFalse(DateComparisonUtils.isSameDayUsingCalendar(day1Morning, day2Morning)); + assertFalse(DateComparisonUtils.isSameDayUsingCalendar(day1Evening, day2Morning)); + + assertFalse(DateComparisonUtils.isSameDayUsingApacheCommons(day1Morning, day2Morning)); + assertFalse(DateComparisonUtils.isSameDayUsingApacheCommons(day1Evening, day2Morning)); + + assertFalse(DateComparisonUtils.isSameDayUsingJoda(day1Morning, day2Morning)); + assertFalse(DateComparisonUtils.isSameDayUsingJoda(day1Evening, day2Morning)); + + assertFalse(DateComparisonUtils.isSameDayUsingDate4j(day1Morning, day2Morning)); + assertFalse(DateComparisonUtils.isSameDayUsingDate4j(day1Evening, day2Morning)); + } +} diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtilsUnitTest.java new file mode 100644 index 0000000000..d60a0f4015 --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtilsUnitTest.java @@ -0,0 +1,27 @@ +package com.baeldung.datetime; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import java.time.LocalDate; + +public class AddSubtractDaysSkippingWeekendsUtilsUnitTest { + + @Test + public void givenLocalDateAndDaysToAdd_thenAddDaysSkippingWeekends() { + LocalDate initialDate = LocalDate.of(2019, 11, 7); + LocalDate expectedDate = LocalDate.of(2019, 11, 13); + LocalDate result = AddSubtractDaysSkippingWeekendsUtils.addDaysSkippingWeekends(initialDate, 4); + assertEquals(expectedDate, result); + } + + @Test + public void givenLocalDateAndDaysToSubtract_thenSubtractDaysSkippingWeekends() { + LocalDate initialDate = LocalDate.of(2019, 11, 7); + LocalDate expectedDate = LocalDate.of(2019, 11, 1); + LocalDate result = AddSubtractDaysSkippingWeekendsUtils.subtractDaysSkippingWeekends(initialDate, 4); + assertEquals(expectedDate, result); + } + +} diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/CalendarUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/CalendarUtilsUnitTest.java new file mode 100644 index 0000000000..0060162ffb --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/CalendarUtilsUnitTest.java @@ -0,0 +1,21 @@ +package com.baeldung.datetime; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import com.baeldung.datetime.CalendarUtils; +import com.baeldung.datetime.DateUtils; + +import java.text.ParseException; +import java.util.Date; + +public class CalendarUtilsUnitTest { + + @Test + public void givenDateAndDaysToAdd_thenCalendarIsCorrectlyReturned() throws ParseException { + Date initialDate = DateUtils.getDate("2020/01/01", "yyyy/MM/dd"); + Date expectedDate= DateUtils.getDate("2020/01/11", "yyyy/MM/dd"); + assertEquals(expectedDate, CalendarUtils.getPlusDays(initialDate, 10).getTime()); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/DateUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/DateUtilsUnitTest.java new file mode 100644 index 0000000000..62a0fc0b4b --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/DateUtilsUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.datetime; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import com.baeldung.datetime.DateUtils; + +import java.text.ParseException; +import java.util.Date; + +public class DateUtilsUnitTest { + + @Test + public void givenTimeMillis_thenDateIsReturned() { + Date now = DateUtils.getNow(); + assertEquals(DateUtils.getDate(now.getTime()), now); + } + + @Test + public void givenDateAndPattern_thenDateIsCorrectlyReturned() throws ParseException { + long milliseconds = new Date(2020 - 1900, 0, 1).getTime(); + assertEquals(DateUtils.getDate(milliseconds), DateUtils.getDate("2020/01/01", "yyyy/MM/dd")); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/sql/DateUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/sql/DateUtilsUnitTest.java new file mode 100644 index 0000000000..a04f64f6dd --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/sql/DateUtilsUnitTest.java @@ -0,0 +1,28 @@ +package com.baeldung.datetime.sql; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import com.baeldung.datetime.sql.DateUtils; + +import java.text.ParseException; +import java.util.Date; + +public class DateUtilsUnitTest { + + @Test + public void givenCurrentDate_thenTodayIsReturned() { + assertEquals(DateUtils.getNow(), new Date()); + } + + @Test(expected = IllegalArgumentException.class) + public void givenDateAsString_whenPatternIsNotRespected_thenExceptionIsThrown() { + DateUtils.getDate("2020 01 01"); + } + + @Test + public void givenDateAndPattern_thenDateIsCorrectlyReturned() throws ParseException { + assertEquals(DateUtils.getDate("2020-01-01"), DateUtils.getDate("2020/01/01", "yyyy/MM/dd")); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/sql/TimeUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/sql/TimeUtilsUnitTest.java new file mode 100644 index 0000000000..e13c53bfbb --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/sql/TimeUtilsUnitTest.java @@ -0,0 +1,22 @@ +package com.baeldung.datetime.sql; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import com.baeldung.datetime.sql.TimeUtils; + +import java.text.ParseException; + +public class TimeUtilsUnitTest { + + @Test(expected = IllegalArgumentException.class) + public void givenTimeAsString_whenPatternIsNotRespected_thenExceptionIsThrown() { + TimeUtils.getTime("10 11 12"); + } + + @Test + public void givenTimeAndPattern_thenTimeIsCorrectlyReturned() throws ParseException { + assertEquals(TimeUtils.getTime("10:11:12"), TimeUtils.getTime("10 11 12", "hh mm ss")); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/sql/TimestampUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/sql/TimestampUtilsUnitTest.java new file mode 100644 index 0000000000..2faf8fab0e --- /dev/null +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/sql/TimestampUtilsUnitTest.java @@ -0,0 +1,29 @@ +package com.baeldung.datetime.sql; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import com.baeldung.datetime.sql.TimestampUtils; + +import java.text.ParseException; +import java.util.Date; + +public class TimestampUtilsUnitTest { + + @Test + public void givenCurrentTimestamp_thenNowIsReturned() { + assertEquals(TimestampUtils.getNow() + .getTime(), new Date().getTime()); + } + + @Test(expected = IllegalArgumentException.class) + public void givenTimestampAsString_whenPatternIsNotRespected_thenExceptionIsThrown() { + TimestampUtils.getTimestamp("2020/01/01 10:11-12"); + } + + @Test + public void givenTimestampAndPattern_thenTimestampIsCorrectlyReturned() throws ParseException { + assertEquals(TimestampUtils.getTimestamp("2020-01-01 10:11:12"), TimestampUtils.getTimestamp("2020/01/01 10:11-12", "yyyy/MM/dd hh:mm-ss")); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-datetime-computations/README.md b/core-java-modules/core-java-datetime-computations/README.md new file mode 100644 index 0000000000..591ddeaa94 --- /dev/null +++ b/core-java-modules/core-java-datetime-computations/README.md @@ -0,0 +1,15 @@ +## Java Date/time computations Cookbooks and Examples + +This module contains articles about date and time computations in Java. + +### Relevant Articles: +- [Difference Between Two Dates in Java](http://www.baeldung.com/java-date-difference) +- [Get Date Without Time in Java](http://www.baeldung.com/java-date-without-time) +- [How to Get All Dates Between Two Dates?](http://www.baeldung.com/java-between-dates) +- [Extracting Year, Month and Day from Date in Java](http://www.baeldung.com/java-year-month-day) +- [Guide to java.util.GregorianCalendar](http://www.baeldung.com/java-gregorian-calendar) +- [Handling Daylight Savings Time in Java](http://www.baeldung.com/java-daylight-savings) +- [Calculate Age in Java](http://www.baeldung.com/java-get-age) +- [Increment Date in Java](http://www.baeldung.com/java-increment-date) +- [Add Hours To a Date In Java](http://www.baeldung.com/java-add-hours-date) +- [Introduction to Joda-Time](http://www.baeldung.com/joda-time) diff --git a/core-java-modules/core-java-datetime-computations/pom.xml b/core-java-modules/core-java-datetime-computations/pom.xml new file mode 100644 index 0000000000..934df8018f --- /dev/null +++ b/core-java-modules/core-java-datetime-computations/pom.xml @@ -0,0 +1,71 @@ + + 4.0.0 + core-java-datetime-computations + ${project.parent.version} + core-java-datetime-computations + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + joda-time + joda-time + ${joda-time.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + com.darwinsys + hirondelle-date4j + RELEASE + test + + + + + core-java-datetime-computations + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + 2.10 + + 3.6.1 + 1.9 + 1.9 + + diff --git a/java-dates/src/main/java/com/baeldung/date/AgeCalculator.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/date/AgeCalculator.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/date/AgeCalculator.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/date/AgeCalculator.java diff --git a/java-dates/src/main/java/com/baeldung/date/DateWithoutTime.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/date/DateWithoutTime.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/date/DateWithoutTime.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/date/DateWithoutTime.java diff --git a/java-dates/src/main/java/com/baeldung/datetime/AddHoursToDate.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/AddHoursToDate.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetime/AddHoursToDate.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/AddHoursToDate.java diff --git a/java-dates/src/main/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValues.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValues.java similarity index 95% rename from java-dates/src/main/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValues.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValues.java index a6cef94377..8b6d9885af 100644 --- a/java-dates/src/main/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValues.java +++ b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValues.java @@ -1,28 +1,28 @@ -package com.baeldung.datetime; - -import java.util.Calendar; -import java.util.Date; - -public class DateExtractYearMonthDayIntegerValues { - - int getYear(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - - return calendar.get(Calendar.YEAR); - } - - int getMonth(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - - return calendar.get(Calendar.MONTH); - } - - int getDay(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - - return calendar.get(Calendar.DAY_OF_MONTH); - } -} +package com.baeldung.datetime; + +import java.util.Calendar; +import java.util.Date; + +public class DateExtractYearMonthDayIntegerValues { + + int getYear(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + + return calendar.get(Calendar.YEAR); + } + + int getMonth(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + + return calendar.get(Calendar.MONTH); + } + + int getDay(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + + return calendar.get(Calendar.DAY_OF_MONTH); + } +} diff --git a/java-dates/src/main/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValues.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValues.java similarity index 95% rename from java-dates/src/main/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValues.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValues.java index b40e10f6ad..6daa86130d 100644 --- a/java-dates/src/main/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValues.java +++ b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValues.java @@ -1,18 +1,18 @@ -package com.baeldung.datetime; - -import java.time.LocalDate; - -public class LocalDateExtractYearMonthDayIntegerValues { - - int getYear(LocalDate localDate) { - return localDate.getYear(); - } - - int getMonth(LocalDate localDate) { - return localDate.getMonthValue(); - } - - int getDay(LocalDate localDate) { - return localDate.getDayOfMonth(); - } -} +package com.baeldung.datetime; + +import java.time.LocalDate; + +public class LocalDateExtractYearMonthDayIntegerValues { + + int getYear(LocalDate localDate) { + return localDate.getYear(); + } + + int getMonth(LocalDate localDate) { + return localDate.getMonthValue(); + } + + int getDay(LocalDate localDate) { + return localDate.getDayOfMonth(); + } +} diff --git a/java-dates/src/main/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValues.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValues.java similarity index 95% rename from java-dates/src/main/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValues.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValues.java index 404a62d2f4..bb4415fbc7 100644 --- a/java-dates/src/main/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValues.java +++ b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValues.java @@ -1,18 +1,18 @@ -package com.baeldung.datetime; - -import java.time.LocalDateTime; - -public class LocalDateTimeExtractYearMonthDayIntegerValues { - - int getYear(LocalDateTime localDateTime) { - return localDateTime.getYear(); - } - - int getMonth(LocalDateTime localDateTime) { - return localDateTime.getMonthValue(); - } - - int getDay(LocalDateTime localDateTime) { - return localDateTime.getDayOfMonth(); - } -} +package com.baeldung.datetime; + +import java.time.LocalDateTime; + +public class LocalDateTimeExtractYearMonthDayIntegerValues { + + int getYear(LocalDateTime localDateTime) { + return localDateTime.getYear(); + } + + int getMonth(LocalDateTime localDateTime) { + return localDateTime.getMonthValue(); + } + + int getDay(LocalDateTime localDateTime) { + return localDateTime.getDayOfMonth(); + } +} diff --git a/java-dates/src/main/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValues.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValues.java similarity index 96% rename from java-dates/src/main/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValues.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValues.java index e686b05493..398c03102c 100644 --- a/java-dates/src/main/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValues.java +++ b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValues.java @@ -1,18 +1,18 @@ -package com.baeldung.datetime; - -import java.time.OffsetDateTime; - -public class OffsetDateTimeExtractYearMonthDayIntegerValues { - - int getYear(OffsetDateTime offsetDateTime) { - return offsetDateTime.getYear(); - } - - int getMonth(OffsetDateTime offsetDateTime) { - return offsetDateTime.getMonthValue(); - } - - int getDay(OffsetDateTime offsetDateTime) { - return offsetDateTime.getDayOfMonth(); - } -} +package com.baeldung.datetime; + +import java.time.OffsetDateTime; + +public class OffsetDateTimeExtractYearMonthDayIntegerValues { + + int getYear(OffsetDateTime offsetDateTime) { + return offsetDateTime.getYear(); + } + + int getMonth(OffsetDateTime offsetDateTime) { + return offsetDateTime.getMonthValue(); + } + + int getDay(OffsetDateTime offsetDateTime) { + return offsetDateTime.getDayOfMonth(); + } +} diff --git a/java-dates/src/main/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValues.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValues.java similarity index 95% rename from java-dates/src/main/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValues.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValues.java index 3e790b2b3f..86bce90f75 100644 --- a/java-dates/src/main/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValues.java +++ b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValues.java @@ -1,18 +1,18 @@ -package com.baeldung.datetime; - -import java.time.ZonedDateTime; - -public class ZonedDateTimeExtractYearMonthDayIntegerValues { - - int getYear(ZonedDateTime zonedDateTime) { - return zonedDateTime.getYear(); - } - - int getMonth(ZonedDateTime zonedDateTime) { - return zonedDateTime.getMonthValue(); - } - - int getDay(ZonedDateTime zonedDateTime) { - return zonedDateTime.getDayOfMonth(); - } -} +package com.baeldung.datetime; + +import java.time.ZonedDateTime; + +public class ZonedDateTimeExtractYearMonthDayIntegerValues { + + int getYear(ZonedDateTime zonedDateTime) { + return zonedDateTime.getYear(); + } + + int getMonth(ZonedDateTime zonedDateTime) { + return zonedDateTime.getMonthValue(); + } + + int getDay(ZonedDateTime zonedDateTime) { + return zonedDateTime.getDayOfMonth(); + } +} diff --git a/java-dates/src/main/java/com/baeldung/datetime/modify/DateIncrementer.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/modify/DateIncrementer.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetime/modify/DateIncrementer.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/datetime/modify/DateIncrementer.java diff --git a/java-dates/src/main/java/com/baeldung/gregorian/calendar/GregorianCalendarExample.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/gregorian/calendar/GregorianCalendarExample.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/gregorian/calendar/GregorianCalendarExample.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/gregorian/calendar/GregorianCalendarExample.java diff --git a/java-dates/src/main/java/com/baeldung/java9/time/TimeApi.java b/core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/java9/time/TimeApi.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/java9/time/TimeApi.java rename to core-java-modules/core-java-datetime-computations/src/main/java/com/baeldung/java9/time/TimeApi.java diff --git a/java-dates/src/test/java/com/baeldung/date/AgeCalculatorUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/date/AgeCalculatorUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/date/AgeCalculatorUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/date/AgeCalculatorUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/date/DateDiffUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/date/DateDiffUnitTest.java similarity index 97% rename from java-dates/src/test/java/com/baeldung/date/DateDiffUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/date/DateDiffUnitTest.java index a35699e469..226556d4bb 100644 --- a/java-dates/src/test/java/com/baeldung/date/DateDiffUnitTest.java +++ b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/date/DateDiffUnitTest.java @@ -1,6 +1,6 @@ package com.baeldung.date; -import org.junit.Test; +import static org.junit.Assert.assertEquals; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -16,7 +16,7 @@ import java.util.Locale; import java.util.TimeZone; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertEquals; +import org.junit.Test; public class DateDiffUnitTest { @@ -31,14 +31,14 @@ public class DateDiffUnitTest { assertEquals(diff, 6); } - + @Test public void givenTwoDatesInJava8_whenDifferentiating_thenWeGetSix() { LocalDate now = LocalDate.now(); LocalDate sixDaysBehind = now.minusDays(6); Period period = Period.between(now, sixDaysBehind); - int diff = period.getDays(); + int diff = Math.abs(period.getDays()); assertEquals(diff, 6); } @@ -68,7 +68,8 @@ public class DateDiffUnitTest { public void givenTwoZonedDateTimesInJava8_whenDifferentiating_thenWeGetSix() { LocalDateTime ldt = LocalDateTime.now(); ZonedDateTime now = ldt.atZone(ZoneId.of("America/Montreal")); - ZonedDateTime sixDaysBehind = now.withZoneSameInstant(ZoneId.of("Asia/Singapore")).minusDays(6); + ZonedDateTime sixDaysBehind = now.withZoneSameInstant(ZoneId.of("Asia/Singapore")) + .minusDays(6); long diff = ChronoUnit.DAYS.between(sixDaysBehind, now); assertEquals(diff, 6); } diff --git a/java-dates/src/test/java/com/baeldung/date/DateWithoutTimeUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/date/DateWithoutTimeUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/date/DateWithoutTimeUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/date/DateWithoutTimeUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/AddHoursToDateUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/AddHoursToDateUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/AddHoursToDateUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/AddHoursToDateUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValuesUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValuesUnitTest.java similarity index 96% rename from java-dates/src/test/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValuesUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValuesUnitTest.java index 3b1fcfa6c5..5914b5a727 100644 --- a/java-dates/src/test/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValuesUnitTest.java +++ b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/DateExtractYearMonthDayIntegerValuesUnitTest.java @@ -1,45 +1,45 @@ -package com.baeldung.datetime; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.junit.Before; -import org.junit.Test; - -public class DateExtractYearMonthDayIntegerValuesUnitTest { - - DateExtractYearMonthDayIntegerValues extractYearMonthDateIntegerValues = new DateExtractYearMonthDayIntegerValues(); - - Date date; - - @Before - public void setup() throws ParseException - { - date=new SimpleDateFormat("dd-MM-yyyy").parse("01-03-2018"); - } - - @Test - public void whenGetYear_thenCorrectYear() - { - int actualYear=extractYearMonthDateIntegerValues.getYear(date); - assertThat(actualYear,is(2018)); - } - - @Test - public void whenGetMonth_thenCorrectMonth() - { - int actualMonth=extractYearMonthDateIntegerValues.getMonth(date); - assertThat(actualMonth,is(02)); - } - - @Test - public void whenGetDay_thenCorrectDay() - { - int actualDayOfMonth=extractYearMonthDateIntegerValues.getDay(date); - assertThat(actualDayOfMonth,is(01)); - } -} +package com.baeldung.datetime; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.junit.Before; +import org.junit.Test; + +public class DateExtractYearMonthDayIntegerValuesUnitTest { + + DateExtractYearMonthDayIntegerValues extractYearMonthDateIntegerValues = new DateExtractYearMonthDayIntegerValues(); + + Date date; + + @Before + public void setup() throws ParseException + { + date=new SimpleDateFormat("dd-MM-yyyy").parse("01-03-2018"); + } + + @Test + public void whenGetYear_thenCorrectYear() + { + int actualYear=extractYearMonthDateIntegerValues.getYear(date); + assertThat(actualYear,is(2018)); + } + + @Test + public void whenGetMonth_thenCorrectMonth() + { + int actualMonth=extractYearMonthDateIntegerValues.getMonth(date); + assertThat(actualMonth,is(02)); + } + + @Test + public void whenGetDay_thenCorrectDay() + { + int actualDayOfMonth=extractYearMonthDateIntegerValues.getDay(date); + assertThat(actualDayOfMonth,is(01)); + } +} diff --git a/java-dates/src/test/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValuesUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValuesUnitTest.java similarity index 96% rename from java-dates/src/test/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValuesUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValuesUnitTest.java index 05de6ed0b9..641d45a536 100644 --- a/java-dates/src/test/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValuesUnitTest.java +++ b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/LocalDateExtractYearMonthDayIntegerValuesUnitTest.java @@ -1,36 +1,36 @@ -package com.baeldung.datetime; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import java.time.LocalDate; - -import org.junit.Test; - -public class LocalDateExtractYearMonthDayIntegerValuesUnitTest { - - LocalDateExtractYearMonthDayIntegerValues localDateExtractYearMonthDayIntegerValues=new LocalDateExtractYearMonthDayIntegerValues(); - - LocalDate localDate=LocalDate.parse("2007-12-03"); - - @Test - public void whenGetYear_thenCorrectYear() - { - int actualYear=localDateExtractYearMonthDayIntegerValues.getYear(localDate); - assertThat(actualYear,is(2007)); - } - - @Test - public void whenGetMonth_thenCorrectMonth() - { - int actualMonth=localDateExtractYearMonthDayIntegerValues.getMonth(localDate); - assertThat(actualMonth,is(12)); - } - - @Test - public void whenGetDay_thenCorrectDay() - { - int actualDayOfMonth=localDateExtractYearMonthDayIntegerValues.getDay(localDate); - assertThat(actualDayOfMonth,is(03)); - } -} +package com.baeldung.datetime; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +import java.time.LocalDate; + +import org.junit.Test; + +public class LocalDateExtractYearMonthDayIntegerValuesUnitTest { + + LocalDateExtractYearMonthDayIntegerValues localDateExtractYearMonthDayIntegerValues=new LocalDateExtractYearMonthDayIntegerValues(); + + LocalDate localDate=LocalDate.parse("2007-12-03"); + + @Test + public void whenGetYear_thenCorrectYear() + { + int actualYear=localDateExtractYearMonthDayIntegerValues.getYear(localDate); + assertThat(actualYear,is(2007)); + } + + @Test + public void whenGetMonth_thenCorrectMonth() + { + int actualMonth=localDateExtractYearMonthDayIntegerValues.getMonth(localDate); + assertThat(actualMonth,is(12)); + } + + @Test + public void whenGetDay_thenCorrectDay() + { + int actualDayOfMonth=localDateExtractYearMonthDayIntegerValues.getDay(localDate); + assertThat(actualDayOfMonth,is(03)); + } +} diff --git a/java-dates/src/test/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValuesUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValuesUnitTest.java similarity index 96% rename from java-dates/src/test/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValuesUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValuesUnitTest.java index 70544ea970..295a4018c2 100644 --- a/java-dates/src/test/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValuesUnitTest.java +++ b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/LocalDateTimeExtractYearMonthDayIntegerValuesUnitTest.java @@ -1,36 +1,36 @@ -package com.baeldung.datetime; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import java.time.LocalDateTime; - -import org.junit.Test; - -public class LocalDateTimeExtractYearMonthDayIntegerValuesUnitTest { - - LocalDateTimeExtractYearMonthDayIntegerValues localDateTimeExtractYearMonthDayIntegerValues = new LocalDateTimeExtractYearMonthDayIntegerValues(); - - LocalDateTime localDateTime=LocalDateTime.parse("2007-12-03T10:15:30"); - - @Test - public void whenGetYear_thenCorrectYear() - { - int actualYear=localDateTimeExtractYearMonthDayIntegerValues.getYear(localDateTime); - assertThat(actualYear,is(2007)); - } - - @Test - public void whenGetMonth_thenCorrectMonth() - { - int actualMonth=localDateTimeExtractYearMonthDayIntegerValues.getMonth(localDateTime); - assertThat(actualMonth,is(12)); - } - - @Test - public void whenGetDay_thenCorrectDay() - { - int actualDayOfMonth=localDateTimeExtractYearMonthDayIntegerValues.getDay(localDateTime); - assertThat(actualDayOfMonth,is(03)); - } -} +package com.baeldung.datetime; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +import java.time.LocalDateTime; + +import org.junit.Test; + +public class LocalDateTimeExtractYearMonthDayIntegerValuesUnitTest { + + LocalDateTimeExtractYearMonthDayIntegerValues localDateTimeExtractYearMonthDayIntegerValues = new LocalDateTimeExtractYearMonthDayIntegerValues(); + + LocalDateTime localDateTime=LocalDateTime.parse("2007-12-03T10:15:30"); + + @Test + public void whenGetYear_thenCorrectYear() + { + int actualYear=localDateTimeExtractYearMonthDayIntegerValues.getYear(localDateTime); + assertThat(actualYear,is(2007)); + } + + @Test + public void whenGetMonth_thenCorrectMonth() + { + int actualMonth=localDateTimeExtractYearMonthDayIntegerValues.getMonth(localDateTime); + assertThat(actualMonth,is(12)); + } + + @Test + public void whenGetDay_thenCorrectDay() + { + int actualDayOfMonth=localDateTimeExtractYearMonthDayIntegerValues.getDay(localDateTime); + assertThat(actualDayOfMonth,is(03)); + } +} diff --git a/java-dates/src/test/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValuesUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValuesUnitTest.java similarity index 96% rename from java-dates/src/test/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValuesUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValuesUnitTest.java index efb01c49a5..3e1044e4be 100644 --- a/java-dates/src/test/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValuesUnitTest.java +++ b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/OffsetDateTimeExtractYearMonthDayIntegerValuesUnitTest.java @@ -1,36 +1,36 @@ -package com.baeldung.datetime; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import java.time.OffsetDateTime; - -import org.junit.Test; - -public class OffsetDateTimeExtractYearMonthDayIntegerValuesUnitTest { - - OffsetDateTimeExtractYearMonthDayIntegerValues offsetDateTimeExtractYearMonthDayIntegerValues = new OffsetDateTimeExtractYearMonthDayIntegerValues(); - - OffsetDateTime offsetDateTime=OffsetDateTime.parse("2007-12-03T10:15:30+01:00"); - - @Test - public void whenGetYear_thenCorrectYear() - { - int actualYear=offsetDateTimeExtractYearMonthDayIntegerValues.getYear(offsetDateTime); - assertThat(actualYear,is(2007)); - } - - @Test - public void whenGetMonth_thenCorrectMonth() - { - int actualMonth=offsetDateTimeExtractYearMonthDayIntegerValues.getMonth(offsetDateTime); - assertThat(actualMonth,is(12)); - } - - @Test - public void whenGetDay_thenCorrectDay() - { - int actualDayOfMonth=offsetDateTimeExtractYearMonthDayIntegerValues.getDay(offsetDateTime); - assertThat(actualDayOfMonth,is(03)); - } -} +package com.baeldung.datetime; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +import java.time.OffsetDateTime; + +import org.junit.Test; + +public class OffsetDateTimeExtractYearMonthDayIntegerValuesUnitTest { + + OffsetDateTimeExtractYearMonthDayIntegerValues offsetDateTimeExtractYearMonthDayIntegerValues = new OffsetDateTimeExtractYearMonthDayIntegerValues(); + + OffsetDateTime offsetDateTime=OffsetDateTime.parse("2007-12-03T10:15:30+01:00"); + + @Test + public void whenGetYear_thenCorrectYear() + { + int actualYear=offsetDateTimeExtractYearMonthDayIntegerValues.getYear(offsetDateTime); + assertThat(actualYear,is(2007)); + } + + @Test + public void whenGetMonth_thenCorrectMonth() + { + int actualMonth=offsetDateTimeExtractYearMonthDayIntegerValues.getMonth(offsetDateTime); + assertThat(actualMonth,is(12)); + } + + @Test + public void whenGetDay_thenCorrectDay() + { + int actualDayOfMonth=offsetDateTimeExtractYearMonthDayIntegerValues.getDay(offsetDateTime); + assertThat(actualDayOfMonth,is(03)); + } +} diff --git a/java-dates/src/test/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValuesUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValuesUnitTest.java similarity index 96% rename from java-dates/src/test/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValuesUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValuesUnitTest.java index a9ed3d2b74..2f2c0a99be 100644 --- a/java-dates/src/test/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValuesUnitTest.java +++ b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/ZonedDateTimeExtractYearMonthDayIntegerValuesUnitTest.java @@ -1,36 +1,36 @@ -package com.baeldung.datetime; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import java.time.ZonedDateTime; - -import org.junit.Test; - -public class ZonedDateTimeExtractYearMonthDayIntegerValuesUnitTest { - - ZonedDateTimeExtractYearMonthDayIntegerValues zonedDateTimeExtractYearMonthDayIntegerValues = new ZonedDateTimeExtractYearMonthDayIntegerValues(); - - ZonedDateTime zonedDateTime=ZonedDateTime.parse("2007-12-03T10:15:30+01:00"); - - @Test - public void whenGetYear_thenCorrectYear() - { - int actualYear=zonedDateTimeExtractYearMonthDayIntegerValues.getYear(zonedDateTime); - assertThat(actualYear,is(2007)); - } - - @Test - public void whenGetMonth_thenCorrectMonth() - { - int actualMonth=zonedDateTimeExtractYearMonthDayIntegerValues.getMonth(zonedDateTime); - assertThat(actualMonth,is(12)); - } - - @Test - public void whenGetDay_thenCorrectDay() - { - int actualDayOfMonth=zonedDateTimeExtractYearMonthDayIntegerValues.getDay(zonedDateTime); - assertThat(actualDayOfMonth,is(03)); - } -} +package com.baeldung.datetime; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +import java.time.ZonedDateTime; + +import org.junit.Test; + +public class ZonedDateTimeExtractYearMonthDayIntegerValuesUnitTest { + + ZonedDateTimeExtractYearMonthDayIntegerValues zonedDateTimeExtractYearMonthDayIntegerValues = new ZonedDateTimeExtractYearMonthDayIntegerValues(); + + ZonedDateTime zonedDateTime=ZonedDateTime.parse("2007-12-03T10:15:30+01:00"); + + @Test + public void whenGetYear_thenCorrectYear() + { + int actualYear=zonedDateTimeExtractYearMonthDayIntegerValues.getYear(zonedDateTime); + assertThat(actualYear,is(2007)); + } + + @Test + public void whenGetMonth_thenCorrectMonth() + { + int actualMonth=zonedDateTimeExtractYearMonthDayIntegerValues.getMonth(zonedDateTime); + assertThat(actualMonth,is(12)); + } + + @Test + public void whenGetDay_thenCorrectDay() + { + int actualDayOfMonth=zonedDateTimeExtractYearMonthDayIntegerValues.getDay(zonedDateTime); + assertThat(actualDayOfMonth,is(03)); + } +} diff --git a/java-dates/src/test/java/com/baeldung/datetime/modify/DateIncrementerUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/modify/DateIncrementerUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/modify/DateIncrementerUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/datetime/modify/DateIncrementerUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/dst/DaylightSavingTimeExamplesUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/dst/DaylightSavingTimeExamplesUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/dst/DaylightSavingTimeExamplesUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/dst/DaylightSavingTimeExamplesUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/dst/DaylightSavingTimeJavaTimeExamplesUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/dst/DaylightSavingTimeJavaTimeExamplesUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/dst/DaylightSavingTimeJavaTimeExamplesUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/dst/DaylightSavingTimeJavaTimeExamplesUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/gregorian/calendar/GregorianCalendarTester.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/gregorian/calendar/GregorianCalendarTester.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/gregorian/calendar/GregorianCalendarTester.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/gregorian/calendar/GregorianCalendarTester.java diff --git a/java-dates/src/test/java/com/baeldung/java9/time/TimeApiUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/java9/time/TimeApiUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/java9/time/TimeApiUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/java9/time/TimeApiUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/jodatime/JodaTimeUnitTest.java b/core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/jodatime/JodaTimeUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/jodatime/JodaTimeUnitTest.java rename to core-java-modules/core-java-datetime-computations/src/test/java/com/baeldung/jodatime/JodaTimeUnitTest.java diff --git a/core-java-modules/core-java-datetime-conversion/README.md b/core-java-modules/core-java-datetime-conversion/README.md new file mode 100644 index 0000000000..2503459f50 --- /dev/null +++ b/core-java-modules/core-java-datetime-conversion/README.md @@ -0,0 +1,9 @@ +## Java Date/time conversion Cookbooks and Examples + +This module contains articles about converting between Java date and time objects. + +### Relevant Articles: +- [Converting Between LocalDate and XMLGregorianCalendar](https://www.baeldung.com/java-localdate-to-xmlgregoriancalendar) +- [Convert Time to Milliseconds in Java](https://www.baeldung.com/java-time-milliseconds) +- [Convert Date to LocalDate or LocalDateTime and Back](http://www.baeldung.com/java-date-to-localdate-and-localdatetime) +- [Convert Between java.time.Instant and java.sql.Timestamp](https://www.baeldung.com/java-time-instant-to-java-sql-timestamp) diff --git a/core-java-modules/core-java-datetime-conversion/pom.xml b/core-java-modules/core-java-datetime-conversion/pom.xml new file mode 100644 index 0000000000..a93eca00af --- /dev/null +++ b/core-java-modules/core-java-datetime-conversion/pom.xml @@ -0,0 +1,70 @@ + + 4.0.0 + core-java-datetime-conversion + ${project.parent.version} + core-java-datetime-conversion + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + joda-time + joda-time + ${joda-time.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + log4j + log4j + ${log4j.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-datetime-conversion + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + 2.10 + + 3.6.1 + 1.9 + 1.9 + + diff --git a/java-dates/src/main/java/com/baeldung/datetolocaldate/DateToLocalDateConverter.java b/core-java-modules/core-java-datetime-conversion/src/main/java/com/baeldung/datetolocaldate/DateToLocalDateConverter.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetolocaldate/DateToLocalDateConverter.java rename to core-java-modules/core-java-datetime-conversion/src/main/java/com/baeldung/datetolocaldate/DateToLocalDateConverter.java diff --git a/java-dates/src/main/java/com/baeldung/datetolocaldate/DateToLocalDateTimeConverter.java b/core-java-modules/core-java-datetime-conversion/src/main/java/com/baeldung/datetolocaldate/DateToLocalDateTimeConverter.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetolocaldate/DateToLocalDateTimeConverter.java rename to core-java-modules/core-java-datetime-conversion/src/main/java/com/baeldung/datetolocaldate/DateToLocalDateTimeConverter.java diff --git a/java-dates/src/main/java/com/baeldung/datetolocaldate/LocalDateTimeToDateConverter.java b/core-java-modules/core-java-datetime-conversion/src/main/java/com/baeldung/datetolocaldate/LocalDateTimeToDateConverter.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetolocaldate/LocalDateTimeToDateConverter.java rename to core-java-modules/core-java-datetime-conversion/src/main/java/com/baeldung/datetolocaldate/LocalDateTimeToDateConverter.java diff --git a/java-dates/src/main/java/com/baeldung/datetolocaldate/LocalDateToDateConverter.java b/core-java-modules/core-java-datetime-conversion/src/main/java/com/baeldung/datetolocaldate/LocalDateToDateConverter.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetolocaldate/LocalDateToDateConverter.java rename to core-java-modules/core-java-datetime-conversion/src/main/java/com/baeldung/datetolocaldate/LocalDateToDateConverter.java diff --git a/java-dates-2/src/test/java/com/baeldung/convert/ConvertDateTimeUnitTest.java b/core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/convert/ConvertDateTimeUnitTest.java similarity index 100% rename from java-dates-2/src/test/java/com/baeldung/convert/ConvertDateTimeUnitTest.java rename to core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/convert/ConvertDateTimeUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java b/core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java similarity index 97% rename from java-dates/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java rename to core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java index 3ba01a591a..e5fd80285c 100644 --- a/java-dates/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java +++ b/core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetime/ConvertInstantToTimestampUnitTest.java @@ -1,15 +1,14 @@ package com.baeldung.datetime; -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; import java.sql.Timestamp; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.Instant; -import java.time.ZoneId; import java.util.TimeZone; -import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; public class ConvertInstantToTimestampUnitTest { diff --git a/java-dates/src/test/java/com/baeldung/datetolocaldate/DateToLocalDateConverterUnitTest.java b/core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetolocaldate/DateToLocalDateConverterUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetolocaldate/DateToLocalDateConverterUnitTest.java rename to core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetolocaldate/DateToLocalDateConverterUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetolocaldate/DateToLocalDateTimeConverterUnitTest.java b/core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetolocaldate/DateToLocalDateTimeConverterUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetolocaldate/DateToLocalDateTimeConverterUnitTest.java rename to core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetolocaldate/DateToLocalDateTimeConverterUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetolocaldate/LocalDateTimeToDateConverterUnitTest.java b/core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetolocaldate/LocalDateTimeToDateConverterUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetolocaldate/LocalDateTimeToDateConverterUnitTest.java rename to core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetolocaldate/LocalDateTimeToDateConverterUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetolocaldate/LocalDateToDateConverterUnitTest.java b/core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetolocaldate/LocalDateToDateConverterUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetolocaldate/LocalDateToDateConverterUnitTest.java rename to core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/datetolocaldate/LocalDateToDateConverterUnitTest.java diff --git a/java-dates-2/src/test/java/com/baeldung/xmlgregoriancalendar/XmlGregorianCalendarConverterUnitTest.java b/core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/xmlgregoriancalendar/XmlGregorianCalendarConverterUnitTest.java similarity index 100% rename from java-dates-2/src/test/java/com/baeldung/xmlgregoriancalendar/XmlGregorianCalendarConverterUnitTest.java rename to core-java-modules/core-java-datetime-conversion/src/test/java/com/baeldung/xmlgregoriancalendar/XmlGregorianCalendarConverterUnitTest.java diff --git a/core-java-modules/core-java-datetime-java8/README.md b/core-java-modules/core-java-datetime-java8/README.md new file mode 100644 index 0000000000..044f6f3fe3 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/README.md @@ -0,0 +1,15 @@ +## Java 8+ Date and Time API + +This module contains articles about the Date and Time API introduced with Java 8. + +### Relevant Articles: +- [Introduction to the Java 8 Date/Time API](http://www.baeldung.com/java-8-date-time-intro) +- [Migrating to the New Java 8 Date Time API](http://www.baeldung.com/migrating-to-java-8-date-time-api) +- [Get the Current Date, Time and Timestamp in Java 8](http://www.baeldung.com/current-date-time-and-timestamp-in-java-8) +- [TemporalAdjuster in Java](http://www.baeldung.com/java-temporal-adjuster) +- [ZoneOffset in Java](https://www.baeldung.com/java-zone-offset) +- [Differences Between ZonedDateTime and OffsetDateTime](https://www.baeldung.com/java-zoneddatetime-offsetdatetime) +- [Period and Duration in Java](http://www.baeldung.com/java-period-duration) +- [How to Get the Start and the End of a Day using Java](http://www.baeldung.com/java-day-start-end) +- [Set the Time Zone of a Date in Java](https://www.baeldung.com/java-set-date-time-zone) +- [Comparing Dates in Java](https://www.baeldung.com/java-comparing-dates) diff --git a/core-java-modules/core-java-datetime-java8/pom.xml b/core-java-modules/core-java-datetime-java8/pom.xml new file mode 100644 index 0000000000..72d51b5f10 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/pom.xml @@ -0,0 +1,70 @@ + + 4.0.0 + core-java-datetime-java8 + ${project.parent.version} + core-java-datetime-java8 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + joda-time + joda-time + ${joda-time.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + log4j + log4j + ${log4j.version} + test + + + + + core-java-datetime-java8 + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + 1.9 + 1.9 + 2.10 + + 3.6.1 + + diff --git a/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/date/comparison/DateTimeComparisonUtils.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/date/comparison/DateTimeComparisonUtils.java new file mode 100644 index 0000000000..4d732df795 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/date/comparison/DateTimeComparisonUtils.java @@ -0,0 +1,35 @@ +package com.baeldung.date.comparison; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; + +import static java.time.temporal.ChronoUnit.*; + +public class DateTimeComparisonUtils { + + public static boolean isSameDay(LocalDateTime timestamp, LocalDate localDateToCompare) { + return timestamp.toLocalDate().isEqual(localDateToCompare); + } + + public static boolean isSameDay(LocalDateTime timestamp, LocalDateTime timestampToCompare) { + return timestamp.truncatedTo(DAYS).isEqual(timestampToCompare.truncatedTo(DAYS)); + } + + public static boolean isSameHour(LocalDateTime timestamp, LocalDateTime timestampToCompare) { + return timestamp.truncatedTo(HOURS).isEqual(timestampToCompare.truncatedTo(HOURS)); + } + + public static boolean isSameMinute(LocalDateTime timestamp, LocalDateTime timestampToCompare) { + return timestamp.truncatedTo(MINUTES).isEqual(timestampToCompare.truncatedTo(MINUTES)); + } + + public static boolean isSameHour(ZonedDateTime zonedTimestamp, ZonedDateTime zonedTimestampToCompare) { + return zonedTimestamp.truncatedTo(HOURS).isEqual(zonedTimestampToCompare.truncatedTo(HOURS)); + } + + public static boolean isSameHour(ZonedDateTime zonedDateTime, LocalDateTime localDateTime, ZoneId zoneId) { + return isSameHour(zonedDateTime, localDateTime.atZone(zoneId)); + } +} diff --git a/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/date/comparison/LegacyDateComparisonUtils.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/date/comparison/LegacyDateComparisonUtils.java new file mode 100644 index 0000000000..9519bc316a --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/date/comparison/LegacyDateComparisonUtils.java @@ -0,0 +1,17 @@ +package com.baeldung.date.comparison; + +import org.apache.commons.lang3.time.DateUtils; + +import java.util.Calendar; +import java.util.Date; + +public class LegacyDateComparisonUtils { + + public static boolean isSameDay(Date date, Date dateToCompare) { + return DateUtils.isSameDay(date, dateToCompare); + } + + public static boolean isSameHour(Date date, Date dateToCompare) { + return DateUtils.truncatedEquals(date, dateToCompare, Calendar.HOUR); + } +} diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseDuration.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseDuration.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetime/UseDuration.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseDuration.java diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseLocalDate.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseLocalDate.java similarity index 91% rename from java-dates/src/main/java/com/baeldung/datetime/UseLocalDate.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseLocalDate.java index b380c04fc2..ec8dfa2fc4 100644 --- a/java-dates/src/main/java/com/baeldung/datetime/UseLocalDate.java +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseLocalDate.java @@ -36,10 +36,15 @@ class UseLocalDate { } LocalDate getFirstDayOfMonth() { - LocalDate firstDayOfMonth = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()); + LocalDate firstDayOfMonth = LocalDate.now() + .with(TemporalAdjusters.firstDayOfMonth()); return firstDayOfMonth; } + boolean isLeapYear(LocalDate localDate) { + return localDate.isLeapYear(); + } + LocalDateTime getStartOfDay(LocalDate localDate) { LocalDateTime startofDay = localDate.atStartOfDay(); return startofDay; diff --git a/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseLocalDateTime.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseLocalDateTime.java new file mode 100644 index 0000000000..267a9412eb --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseLocalDateTime.java @@ -0,0 +1,28 @@ +package com.baeldung.datetime; + +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneOffset; +import java.time.temporal.ChronoField; + +public class UseLocalDateTime { + + public LocalDateTime getLocalDateTimeUsingParseMethod(String representation) { + return LocalDateTime.parse(representation); + } + + LocalDateTime getEndOfDayFromLocalDateTimeDirectly(LocalDateTime localDateTime) { + LocalDateTime endOfDate = localDateTime.with(ChronoField.NANO_OF_DAY, LocalTime.MAX.toNanoOfDay()); + return endOfDate; + } + + LocalDateTime getEndOfDayFromLocalDateTime(LocalDateTime localDateTime) { + LocalDateTime endOfDate = localDateTime.toLocalDate() + .atTime(LocalTime.MAX); + return endOfDate; + } + + LocalDateTime ofEpochSecond(int epochSecond, ZoneOffset zoneOffset) { + return LocalDateTime.ofEpochSecond(epochSecond, 0, zoneOffset); + } +} diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseLocalTime.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseLocalTime.java similarity index 87% rename from java-dates/src/main/java/com/baeldung/datetime/UseLocalTime.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseLocalTime.java index 8d166c413f..876516e365 100644 --- a/java-dates/src/main/java/com/baeldung/datetime/UseLocalTime.java +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseLocalTime.java @@ -9,6 +9,10 @@ public class UseLocalTime { return LocalTime.of(hour, min, seconds); } + LocalTime getLocalTimeUsingFactoryOfMethod(int hour, int min) { + return LocalTime.of(hour, min); + } + LocalTime getLocalTimeUsingParseMethod(String timeRepresentation) { return LocalTime.parse(timeRepresentation); } diff --git a/java-dates/src/main/java/com/baeldung/datetime/UsePeriod.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UsePeriod.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetime/UsePeriod.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UsePeriod.java diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseToInstant.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseToInstant.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetime/UseToInstant.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseToInstant.java diff --git a/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseZonedDateTime.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseZonedDateTime.java new file mode 100644 index 0000000000..a8948e5ce1 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseZonedDateTime.java @@ -0,0 +1,46 @@ +package com.baeldung.datetime; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.temporal.ChronoField; + +class UseZonedDateTime { + + ZonedDateTime getZonedDateTime(LocalDateTime localDateTime, ZoneId zoneId) { + return ZonedDateTime.of(localDateTime, zoneId); + } + + ZonedDateTime getZonedDateTimeUsingParseMethod(String parsableString) { + return ZonedDateTime.parse(parsableString); + } + + ZonedDateTime getStartOfDay(LocalDate localDate, ZoneId zone) { + ZonedDateTime startOfDay = localDate.atStartOfDay() + .atZone(zone); + return startOfDay; + } + + ZonedDateTime getStartOfDayShorthand(LocalDate localDate, ZoneId zone) { + ZonedDateTime startOfDay = localDate.atStartOfDay(zone); + return startOfDay; + } + + ZonedDateTime getStartOfDayFromZonedDateTime(ZonedDateTime zonedDateTime) { + ZonedDateTime startOfDay = zonedDateTime.toLocalDateTime() + .toLocalDate() + .atStartOfDay(zonedDateTime.getZone()); + return startOfDay; + } + + ZonedDateTime getStartOfDayAtMinTime(ZonedDateTime zonedDateTime) { + ZonedDateTime startOfDay = zonedDateTime.with(ChronoField.HOUR_OF_DAY, 0); + return startOfDay; + } + + ZonedDateTime getStartOfDayAtMidnightTime(ZonedDateTime zonedDateTime) { + ZonedDateTime startOfDay = zonedDateTime.with(ChronoField.NANO_OF_DAY, 0); + return startOfDay; + } +} diff --git a/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/LegacyRandomDateTimes.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/LegacyRandomDateTimes.java new file mode 100644 index 0000000000..3f965dbac7 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/LegacyRandomDateTimes.java @@ -0,0 +1,19 @@ +package com.baeldung.random; + +import java.util.Date; +import java.util.concurrent.ThreadLocalRandom; + +public class LegacyRandomDateTimes { + + public static Date between(Date startInclusive, Date endExclusive) { + long startMillis = startInclusive.getTime(); + long endMillis = endExclusive.getTime(); + long randomMillisSinceEpoch = ThreadLocalRandom.current().nextLong(startMillis, endMillis); + + return new Date(randomMillisSinceEpoch); + } + + public static Date timestamp() { + return new Date(ThreadLocalRandom.current().nextInt() * 1000L); + } +} diff --git a/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/RandomDateTimes.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/RandomDateTimes.java new file mode 100644 index 0000000000..a40299e515 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/RandomDateTimes.java @@ -0,0 +1,27 @@ +package com.baeldung.random; + +import java.time.Instant; +import java.util.concurrent.ThreadLocalRandom; + +public class RandomDateTimes { + + public static Instant timestamp() { + return Instant.ofEpochSecond(ThreadLocalRandom.current().nextInt()); + } + + public static Instant between(Instant startInclusive, Instant endExclusive) { + long startSeconds = startInclusive.getEpochSecond(); + long endSeconds = endExclusive.getEpochSecond(); + long random = ThreadLocalRandom.current().nextLong(startSeconds, endSeconds); + + return Instant.ofEpochSecond(random); + } + + public static Instant after(Instant startInclusive) { + return between(startInclusive, Instant.MAX); + } + + public static Instant before(Instant upperExclusive) { + return between(Instant.MIN, upperExclusive); + } +} diff --git a/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/RandomDates.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/RandomDates.java new file mode 100644 index 0000000000..f0b76873f9 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/RandomDates.java @@ -0,0 +1,20 @@ +package com.baeldung.random; + +import java.time.LocalDate; +import java.util.concurrent.ThreadLocalRandom; + +public class RandomDates { + + public static LocalDate between(LocalDate startInclusive, LocalDate endExclusive) { + long startEpochDay = startInclusive.toEpochDay(); + long endEpochDay = endExclusive.toEpochDay(); + long randomDay = ThreadLocalRandom.current().nextLong(startEpochDay, endEpochDay); + + return LocalDate.ofEpochDay(randomDay); + } + + public static LocalDate date() { + int hundredYears = 100 * 365; + return LocalDate.ofEpochDay(ThreadLocalRandom.current().nextInt(-hundredYears, hundredYears)); + } +} diff --git a/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/RandomTimes.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/RandomTimes.java new file mode 100644 index 0000000000..92818b2390 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/random/RandomTimes.java @@ -0,0 +1,19 @@ +package com.baeldung.random; + +import java.time.LocalTime; +import java.util.concurrent.ThreadLocalRandom; + +public class RandomTimes { + + public static LocalTime between(LocalTime startTime, LocalTime endTime) { + int startSeconds = startTime.toSecondOfDay(); + int endSeconds = endTime.toSecondOfDay(); + int randomTime = ThreadLocalRandom.current().nextInt(startSeconds, endSeconds); + + return LocalTime.ofSecondOfDay(randomTime); + } + + public static LocalTime time() { + return between(LocalTime.MIN, LocalTime.MAX); + } +} diff --git a/java-dates/src/main/java/com/baeldung/temporaladjuster/CustomTemporalAdjuster.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/temporaladjuster/CustomTemporalAdjuster.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/temporaladjuster/CustomTemporalAdjuster.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/temporaladjuster/CustomTemporalAdjuster.java diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/date/comparison/DateTimeComparisonUtilsUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/date/comparison/DateTimeComparisonUtilsUnitTest.java new file mode 100644 index 0000000000..0db0d1e8d7 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/date/comparison/DateTimeComparisonUtilsUnitTest.java @@ -0,0 +1,75 @@ +package com.baeldung.date.comparison; + +import org.junit.jupiter.api.Test; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; + +class DateTimeComparisonUtilsUnitTest { + + @Test + void givenLocalDateTimes_whenIsSameDay_thenCompareTrue() { + LocalDateTime firstTimestamp = LocalDateTime.of(2019, 8, 10, 11, 00, 0); + LocalDateTime secondTimestamp = firstTimestamp.plusHours(5); + LocalDateTime thirdTimestamp = firstTimestamp.plusDays(1); + + assertThat(DateTimeComparisonUtils.isSameDay(firstTimestamp, secondTimestamp), is(true)); + + assertThat(DateTimeComparisonUtils.isSameDay(secondTimestamp, thirdTimestamp), is(false)); + } + + @Test + void givenLocalDateAndLocalDateTime_whenIsSameDay_thenCompareTrue() { + LocalDate localDate = LocalDate.of(2019, 8, 10); + LocalDateTime localDateTime = LocalDateTime.of(2019, 8, 10, 11, 30, 0); + + assertThat(DateTimeComparisonUtils.isSameDay(localDateTime, localDate), is(true)); + } + + @Test + void givenLocalDateTimes_whenIsSameHour_thenCompareTrue() { + LocalDateTime firstTimestamp = LocalDateTime.of(2019, 8, 10, 8, 00, 0); + LocalDateTime secondTimestamp = firstTimestamp.plusMinutes(15); + LocalDateTime thirdTimestamp = firstTimestamp.plusHours(2); + + assertThat(DateTimeComparisonUtils.isSameHour(firstTimestamp, secondTimestamp), is(true)); + + assertThat(DateTimeComparisonUtils.isSameHour(secondTimestamp, thirdTimestamp), is(false)); + } + + @Test + void givenLocalDateTimes_whenIsSameMinute_thenCompareTrue() { + LocalDateTime firstTimestamp = LocalDateTime.of(2019, 8, 10, 8, 15, 0); + LocalDateTime secondTimestamp = firstTimestamp.plusSeconds(30); + LocalDateTime thirdTimestamp = firstTimestamp.plusMinutes(5); + + assertThat(DateTimeComparisonUtils.isSameMinute(firstTimestamp, secondTimestamp), is(true)); + + assertThat(DateTimeComparisonUtils.isSameMinute(secondTimestamp, thirdTimestamp), is(false)); + } + + @Test + void givenZonedDateTimes_whenIsSameHour_thenCompareTrue() { + ZonedDateTime zonedTimestamp = ZonedDateTime.of(2019, 8, 10, 8, 0, 0, 30, + ZoneId.of("America/New_York")); + ZonedDateTime zonedTimestampToCompare = ZonedDateTime.of(2019, 8, 10, 14, 0, 0, 0, + ZoneId.of("Europe/Berlin")); + + assertThat(DateTimeComparisonUtils.isSameHour(zonedTimestamp, zonedTimestampToCompare), is(true)); + } + + @Test + void givenZonedDateTimeAndLocalDateTime_whenIsSameHour_thenCompareTrue() { + ZonedDateTime zonedTimestamp = ZonedDateTime.of(2019, 8, 10, 8, 15, 0, 0, + ZoneId.of("America/New_York")); + LocalDateTime localTimestamp = LocalDateTime.of(2019, 8, 10, 14, 20, 0); + ZoneId zoneId = ZoneId.of("Europe/Berlin"); + + assertThat(DateTimeComparisonUtils.isSameHour(zonedTimestamp, localTimestamp, zoneId), is(true)); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/date/comparison/Java8DateTimeApiGeneralComparisonsUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/date/comparison/Java8DateTimeApiGeneralComparisonsUnitTest.java new file mode 100644 index 0000000000..af72f9e58a --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/date/comparison/Java8DateTimeApiGeneralComparisonsUnitTest.java @@ -0,0 +1,95 @@ +package com.baeldung.date.comparison; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; + +import org.junit.Test; + +public class Java8DateTimeApiGeneralComparisonsUnitTest { + + @Test + public void givenLocalDates_whenComparing_thenAssertsPass() { + LocalDate firstDate = LocalDate.of(2019, 8, 10); + LocalDate secondDate = LocalDate.of(2019, 7, 1); + LocalDate thirdDate = LocalDate.of(2019, 7, 1); // same date as secondDate + + assertThat(firstDate.isAfter(secondDate), is(true)); + assertThat(firstDate.isBefore(secondDate), is(false)); + + assertThat(firstDate.isEqual(secondDate), is(false)); + assertThat(firstDate.equals(secondDate), is(false)); + + assertThat(firstDate.compareTo(secondDate), is(1)); + assertThat(secondDate.compareTo(firstDate), is(-1)); + + assertThat(secondDate.isAfter(thirdDate), is(false)); + assertThat(secondDate.isBefore(thirdDate), is(false)); + assertThat(secondDate.isEqual(thirdDate), is(true)); + assertThat(secondDate.equals(thirdDate), is(true)); + assertThat(secondDate.compareTo(thirdDate), is(0)); + } + + @Test + public void givenLocalDateTimes_whenComparing_thenAssertsPass() { + LocalDateTime firstTimestamp = LocalDateTime.of(2019, 8, 10, 11, 30, 0); + LocalDateTime secondTimestamp = LocalDateTime.of(2019, 8, 10, 11, 15, 0); + LocalDateTime thirdTimestamp = LocalDateTime.of(2019, 8, 10, 11, 15, 0); // same as secondTimestamp + + assertThat(firstTimestamp.isAfter(secondTimestamp), is(true)); + assertThat(firstTimestamp.isBefore(secondTimestamp), is(false)); + + assertThat(firstTimestamp.isEqual(secondTimestamp), is(false)); + assertThat(firstTimestamp.equals(secondTimestamp), is(false)); + + assertThat(firstTimestamp.compareTo(secondTimestamp), is(1)); + assertThat(secondTimestamp.compareTo(firstTimestamp), is(-1)); + + assertThat(secondTimestamp.isAfter(thirdTimestamp), is(false)); + assertThat(secondTimestamp.isBefore(thirdTimestamp), is(false)); + assertThat(secondTimestamp.isEqual(thirdTimestamp), is(true)); + assertThat(secondTimestamp.compareTo(thirdTimestamp), is(0)); + } + + @Test + public void givenZonedDateTimes_whenComparing_thenAssertsPass() { + ZonedDateTime timeInNewYork = ZonedDateTime.of(2019, 8, 10, 8, 0, 0, 0, ZoneId.of("America/New_York")); + ZonedDateTime timeInBerlin = ZonedDateTime.of(2019, 8, 10, 14, 0, 0, 0, ZoneId.of("Europe/Berlin")); + + assertThat(timeInNewYork.isAfter(timeInBerlin), is(false)); + assertThat(timeInNewYork.isBefore(timeInBerlin), is(false)); + + assertThat(timeInNewYork.isEqual(timeInBerlin), is(true)); + assertThat(timeInNewYork.equals(timeInBerlin), is(false)); + + assertThat(timeInNewYork.compareTo(timeInBerlin), is(-1)); + } + + @Test + public void givenLocalTimes_whenComparing_thenAssertsPass() { + LocalTime firstTime = LocalTime.of(8, 30); + LocalTime secondTime = LocalTime.of(9, 45); + + assertThat(firstTime.isAfter(secondTime), is(false)); + assertThat(firstTime.isBefore(secondTime), is(true)); + + assertThat(firstTime.equals(secondTime), is(false)); + + assertThat(firstTime.compareTo(secondTime), is(-1)); + } + + @Test + public void givenMinMaxLocalTimes_whenComparing_thenAssertsPass() { + LocalTime minTime = LocalTime.MIN; + LocalTime time = LocalTime.of(8, 30); + LocalTime maxTime = LocalTime.MAX; + + assertThat(minTime.isBefore(time), is(true)); + assertThat(time.isBefore(maxTime), is(true)); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/date/comparison/LegacyDateComparisonUtilsUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/date/comparison/LegacyDateComparisonUtilsUnitTest.java new file mode 100644 index 0000000000..a501cb8888 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/date/comparison/LegacyDateComparisonUtilsUnitTest.java @@ -0,0 +1,54 @@ +package com.baeldung.date.comparison; + +import org.junit.jupiter.api.Test; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; + +class LegacyDateComparisonUtilsUnitTest { + + private Date toDate(LocalDateTime localDateTime) { + return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); + } + + @Test + void givenDatesWithDifferentHours_whenIsSameDay_thenReturnsTrue() { + Date firstDate = toDate(LocalDateTime.of(2019, 8, 10, 11, 00, 00)); + Date secondDate = toDate(LocalDateTime.of(2019, 8, 10, 12, 00, 00)); + Date thirdDate = toDate(LocalDateTime.of(2019, 8, 15, 12, 00, 00)); + + assertThat(LegacyDateComparisonUtils.isSameDay(firstDate, secondDate), is(true)); + assertThat(LegacyDateComparisonUtils.isSameDay(secondDate, thirdDate), is(false)); + } + + @Test + void givenDatesWithingSameHour_whenIsSameHour_thenReturnsTrue() { + Date firstDate = toDate(LocalDateTime.of(2019, 8, 10, 11, 00, 00)); + Date secondDate = toDate(LocalDateTime.of(2019, 8, 10, 11, 15, 00)); + Date thirdDate = toDate(LocalDateTime.of(2019, 8, 10, 12, 00, 00)); + + assertThat(LegacyDateComparisonUtils.isSameHour(firstDate, secondDate), is(true)); + assertThat(LegacyDateComparisonUtils.isSameHour(secondDate, thirdDate), is(false)); + } + + @Test + void givenDates__whenComparing_thenAssertsPass() { + Date firstDate = toDate(LocalDateTime.of(2019, 8, 10, 0, 00, 00)); + Date secondDate = toDate(LocalDateTime.of(2019, 8, 15, 0, 00, 00)); + Date thirdDate = toDate(LocalDateTime.of(2019, 8, 15, 0, 00, 00)); // same date as secondDate + + assertThat(firstDate.after(secondDate), is(false)); + assertThat(firstDate.before(secondDate), is(true)); + assertThat(firstDate.compareTo(secondDate), is(-1)); + assertThat(firstDate.equals(secondDate), is(false)); + + assertThat(thirdDate.after(secondDate), is(false)); + assertThat(thirdDate.before(secondDate), is(false)); + assertThat(thirdDate.compareTo(secondDate), is(0)); + assertThat(thirdDate.equals(secondDate), is(true)); + } +} \ No newline at end of file diff --git a/java-dates/src/test/java/com/baeldung/dateapi/ConversionExample.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/ConversionExample.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/dateapi/ConversionExample.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/ConversionExample.java diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/JavaDurationUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/JavaDurationUnitTest.java new file mode 100644 index 0000000000..be43fb609a --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/JavaDurationUnitTest.java @@ -0,0 +1,69 @@ +package com.baeldung.dateapi; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import java.time.Duration; +import java.time.Instant; +import java.time.LocalTime; +import java.time.temporal.ChronoUnit; + +import org.junit.Test; + +public class JavaDurationUnitTest { + + @Test + public void givenATimePlus30Seconds_whenRequestingDuration_thenExpect30() { + LocalTime initialTime = LocalTime.of(6, 30, 0); + LocalTime finalTime = initialTime.plus(Duration.ofSeconds(30)); + + long seconds = Duration.between(initialTime, finalTime) + .getSeconds(); + + assertThat(seconds).isEqualTo(30); + } + + @Test + public void givenATimePlus30Seconds_whenRequestingSecondsBetween_thenExpect30() { + LocalTime initialTime = LocalTime.of(6, 30, 0); + LocalTime finalTime = initialTime.plus(Duration.ofSeconds(30)); + + long seconds = ChronoUnit.SECONDS.between(initialTime, finalTime); + + assertThat(seconds).isEqualTo(30); + } + + @Test + public void test2() { + Instant start = Instant.parse("2017-10-03T10:15:30.00Z"); + Instant end = Instant.parse("2017-10-03T10:16:30.00Z"); + + Duration duration = Duration.between(start, end); + + assertFalse(duration.isNegative()); + + assertEquals(60, duration.getSeconds()); + assertEquals(1, duration.toMinutes()); + + Duration fromDays = Duration.ofDays(1); + assertEquals(86400, fromDays.getSeconds()); + + Duration fromMinutes = Duration.ofMinutes(60); + assertEquals(1, fromMinutes.toHours()); + + assertEquals(120, duration.plusSeconds(60) + .getSeconds()); + assertEquals(30, duration.minusSeconds(30) + .getSeconds()); + + assertEquals(120, duration.plus(60, ChronoUnit.SECONDS) + .getSeconds()); + assertEquals(30, duration.minus(30, ChronoUnit.SECONDS) + .getSeconds()); + + Duration fromChar1 = Duration.parse("P1DT1H10M10.5S"); + Duration fromChar2 = Duration.parse("PT10M"); + } + +} diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/JavaPeriodUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/JavaPeriodUnitTest.java new file mode 100644 index 0000000000..6dfbbe8c24 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/JavaPeriodUnitTest.java @@ -0,0 +1,69 @@ +package com.baeldung.dateapi; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import java.time.LocalDate; +import java.time.Period; +import java.time.temporal.ChronoUnit; + +import org.apache.log4j.Logger; +import org.junit.Test; + +public class JavaPeriodUnitTest { + + private static final Logger LOG = Logger.getLogger(JavaPeriodUnitTest.class); + + @Test + public void givenADatePlus5Days_whenRequestingPeriod_thenExpectFive() { + LocalDate initialDate = LocalDate.parse("2007-05-10"); + LocalDate finalDate = initialDate.plus(Period.ofDays(5)); + + int days = Period.between(initialDate, finalDate) + .getDays(); + + assertThat(days).isEqualTo(5); + } + + @Test + public void givenADatePlus5Days_whenRequestingDaysBetween_thenExpectFive() { + LocalDate initialDate = LocalDate.parse("2007-05-10"); + LocalDate finalDate = initialDate.plus(Period.ofDays(5)); + + long days = ChronoUnit.DAYS.between(initialDate, finalDate); + + assertThat(days).isEqualTo(5); + } + + @Test + public void whenTestPeriod_thenOk() { + + LocalDate startDate = LocalDate.of(2015, 2, 15); + LocalDate endDate = LocalDate.of(2017, 1, 21); + + Period period = Period.between(startDate, endDate); + + LOG.info(String.format("Years:%d months:%d days:%d", period.getYears(), period.getMonths(), period.getDays())); + + assertFalse(period.isNegative()); + assertEquals(56, period.plusDays(50) + .getDays()); + assertEquals(9, period.minusMonths(2) + .getMonths()); + + Period fromUnits = Period.of(3, 10, 10); + Period fromDays = Period.ofDays(50); + Period fromMonths = Period.ofMonths(5); + Period fromYears = Period.ofYears(10); + Period fromWeeks = Period.ofWeeks(40); + + assertEquals(280, fromWeeks.getDays()); + + Period fromCharYears = Period.parse("P2Y"); + assertEquals(2, fromCharYears.getYears()); + Period fromCharUnits = Period.parse("P2Y3M5D"); + assertEquals(5, fromCharUnits.getDays()); + } + +} diff --git a/java-dates/src/test/java/com/baeldung/dateapi/JavaUtilTimeUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/JavaUtilTimeUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/dateapi/JavaUtilTimeUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/dateapi/JavaUtilTimeUnitTest.java diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java new file mode 100644 index 0000000000..2bbee16e25 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java @@ -0,0 +1,61 @@ +package com.baeldung.datetime; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.Month; +import java.time.ZoneOffset; + +import org.junit.Test; + +public class UseLocalDateTimeUnitTest { + + private UseLocalDateTime useLocalDateTime = new UseLocalDateTime(); + + @Test + public void givenString_whenUsingParse_thenLocalDateTime() { + assertEquals(LocalDate.of(2016, Month.MAY, 10), useLocalDateTime.getLocalDateTimeUsingParseMethod("2016-05-10T06:30") + .toLocalDate()); + assertEquals(LocalTime.of(6, 30), useLocalDateTime.getLocalDateTimeUsingParseMethod("2016-05-10T06:30") + .toLocalTime()); + } + + @Test + public void givenLocalDateTime_whenSettingEndOfDay_thenReturnLastMomentOfDay() { + LocalDateTime givenTimed = LocalDateTime.parse("2018-06-23T05:55:55"); + + LocalDateTime endOfDayFromGivenDirectly = useLocalDateTime.getEndOfDayFromLocalDateTimeDirectly(givenTimed); + LocalDateTime endOfDayFromGiven = useLocalDateTime.getEndOfDayFromLocalDateTime(givenTimed); + + assertThat(endOfDayFromGivenDirectly).isEqualTo(endOfDayFromGiven); + assertThat(endOfDayFromGivenDirectly.toLocalTime()).isEqualTo(LocalTime.MAX); + assertThat(endOfDayFromGivenDirectly.toString()).isEqualTo("2018-06-23T23:59:59.999999999"); + } + + @Test + public void givenLocalDateTimeInFebruary_whenRequestingMonth_thenMonthIsFebruary() { + LocalDateTime givenLocalDateTime = LocalDateTime.of(2015, Month.FEBRUARY, 20, 6, 30); + + assertThat(givenLocalDateTime.getMonth()).isEqualTo(Month.FEBRUARY); + } + + @Test + public void givenLocalDateTime_whenManipulating_thenResultIsAsExpected() { + LocalDateTime givenLocalDateTime = LocalDateTime.parse("2015-02-20T06:30:00"); + + LocalDateTime manipulatedLocalDateTime = givenLocalDateTime.plusDays(1); + manipulatedLocalDateTime = manipulatedLocalDateTime.minusHours(2); + + assertThat(manipulatedLocalDateTime).isEqualTo(LocalDateTime.of(2015, Month.FEBRUARY, 21, 4, 30)); + } + + @Test + public void whenRequestTimeFromEpoch_thenResultIsAsExpected() { + LocalDateTime result = useLocalDateTime.ofEpochSecond(1465817690, ZoneOffset.UTC); + + assertThat(result.toString()).isEqualTo("2016-06-13T11:34:50"); + } +} diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java similarity index 79% rename from java-dates/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java index bb9b60956d..fd22be9260 100644 --- a/java-dates/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseLocalDateUnitTest.java @@ -12,7 +12,7 @@ import org.junit.Test; public class UseLocalDateUnitTest { - UseLocalDate useLocalDate = new UseLocalDate(); + private UseLocalDate useLocalDate = new UseLocalDate(); @Test public void givenValues_whenUsingFactoryOf_thenLocalDate() { @@ -88,4 +88,31 @@ public class UseLocalDateUnitTest { assertThat(endOfDayWithMax.toString()).isEqualTo("2018-06-23T23:59:59.999999999"); } + @Test + public void givenTheYear2000_whenCheckingForLeapYear_thenReturnTrue() { + LocalDate given = LocalDate.parse("2000-06-23"); + + boolean leapYear = useLocalDate.isLeapYear(given); + + assertThat(leapYear).isEqualTo(true); + } + + @Test + public void givenTheYear2004_whenCheckingForLeapYear_thenReturnTrue() { + LocalDate given = LocalDate.parse("2004-06-23"); + + boolean leapYear = useLocalDate.isLeapYear(given); + + assertThat(leapYear).isEqualTo(true); + } + + @Test + public void givenTheYear2019_whenCheckingForLeapYear_thenReturnFalse() { + LocalDate given = LocalDate.parse("2019-06-23"); + + boolean leapYear = useLocalDate.isLeapYear(given); + + assertThat(leapYear).isEqualTo(false); + } + } diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseLocalTimeUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseLocalTimeUnitTest.java new file mode 100644 index 0000000000..afee9126f9 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseLocalTimeUnitTest.java @@ -0,0 +1,45 @@ +package com.baeldung.datetime; + +import java.time.LocalTime; + +import org.junit.Assert; +import org.junit.Test; + +public class UseLocalTimeUnitTest { + + private UseLocalTime useLocalTime = new UseLocalTime(); + + @Test + public void givenValues_whenUsingFactoryOf_thenLocalTime() { + Assert.assertEquals("07:07:07", useLocalTime.getLocalTimeUsingFactoryOfMethod(7, 7, 7) + .toString()); + } + + @Test + public void givenValues_whenUsingFactoryOfWithoutSeconds_thenLocalTime() { + Assert.assertEquals("07:07", useLocalTime.getLocalTimeUsingFactoryOfMethod(7, 7) + .toString()); + } + + @Test + public void givenString_whenUsingParse_thenLocalTime() { + Assert.assertEquals("06:30", useLocalTime.getLocalTimeUsingParseMethod("06:30") + .toString()); + } + + @Test + public void givenTime_whenAddHour_thenLocalTime() { + Assert.assertEquals("07:30", useLocalTime.addAnHour(LocalTime.of(6, 30)) + .toString()); + } + + @Test + public void getHourFromLocalTime() { + Assert.assertEquals(1, useLocalTime.getHourFromLocalTime(LocalTime.of(1, 1))); + } + + @Test + public void getLocalTimeWithMinuteSetToValue() { + Assert.assertEquals(LocalTime.of(10, 20), useLocalTime.getLocalTimeWithMinuteSetToValue(LocalTime.of(10, 10), 20)); + } +} diff --git a/java-dates/src/test/java/com/baeldung/datetime/UsePeriodUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UsePeriodUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/UsePeriodUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UsePeriodUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseTimeZoneUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseTimeZoneUnitTest.java similarity index 97% rename from java-dates/src/test/java/com/baeldung/datetime/UseTimeZoneUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseTimeZoneUnitTest.java index 4423ac6ce0..7e403ddcab 100644 --- a/java-dates/src/test/java/com/baeldung/datetime/UseTimeZoneUnitTest.java +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseTimeZoneUnitTest.java @@ -1,72 +1,72 @@ -package com.baeldung.datetime; - -import java.text.SimpleDateFormat; -import java.time.Instant; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; - -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.junit.Assert; -import org.junit.Test; - -public class UseTimeZoneUnitTest { - - /* https://en.wikipedia.org/wiki/List_of_tz_database_time_zones */ - - String timeZone = "Asia/Singapore"; - - private static final String PATTERN = "E yyyy-MM-dd HH:mm:ss a"; - - @Test - public void givenDateWithoutTimeZone_WhenSetTimeZoneUsingJava7_ThenTimeZoneIsSetSuccessfully() { - Date nowUtc = new Date(); - TimeZone asiaSingapore = TimeZone.getTimeZone(timeZone); - - Calendar nowAsiaSingapore = Calendar.getInstance(asiaSingapore); - nowAsiaSingapore.setTime(nowUtc); - - SimpleDateFormat simpleDateFormat = new SimpleDateFormat(PATTERN); - simpleDateFormat.setTimeZone(TimeZone.getTimeZone(timeZone)); - - System.out.println(String.format("Java7: Time now in '%s' is '%s'", nowAsiaSingapore.getTimeZone() - .getID(), simpleDateFormat.format(nowAsiaSingapore.getTime()))); - - Assert.assertEquals(nowUtc.toInstant().getEpochSecond(), nowAsiaSingapore.toInstant().getEpochSecond()); - Assert.assertEquals(asiaSingapore, nowAsiaSingapore.getTimeZone()); - - } - - @Test - public void givenDateWithoutTimeZone_WhenSetTimeZoneUsingJava8_ThenTimeZoneIsSetSuccessfully() { - Instant nowUtc = Instant.now(); - ZoneId asiaSingapore = ZoneId.of(timeZone); - - ZonedDateTime nowAsiaSingapore = ZonedDateTime.ofInstant(nowUtc, asiaSingapore); - - System.out.println(String.format("Java8: Time now in '%s' is '%s'", nowAsiaSingapore.getZone(), - nowAsiaSingapore.format(DateTimeFormatter.ofPattern(PATTERN)))); - - Assert.assertEquals(nowUtc.getEpochSecond(), nowAsiaSingapore.toEpochSecond()); - Assert.assertEquals(asiaSingapore, nowAsiaSingapore.getZone()); - } - - @Test - public void givenDateWithoutTimeZone_WhenSetTimeZoneUsingJodaTime_ThenTimeZoneIsSetSuccessfully() { - org.joda.time.Instant nowUtc = org.joda.time.Instant.now(); - DateTimeZone asiaSingapore = DateTimeZone.forID(timeZone); - - DateTime nowAsiaSingapore = nowUtc.toDateTime(asiaSingapore); - - System.out.println(String.format("Joda-time: Time now in '%s' is '%s'", nowAsiaSingapore.getZone(), - nowAsiaSingapore.toString(PATTERN))); - - Assert.assertEquals(nowUtc.toInstant().getMillis(), nowAsiaSingapore.toInstant().getMillis()); - Assert.assertEquals(asiaSingapore, nowAsiaSingapore.getZone()); - } - -} +package com.baeldung.datetime; + +import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.junit.Assert; +import org.junit.Test; + +public class UseTimeZoneUnitTest { + + /* https://en.wikipedia.org/wiki/List_of_tz_database_time_zones */ + + String timeZone = "Asia/Singapore"; + + private static final String PATTERN = "E yyyy-MM-dd HH:mm:ss a"; + + @Test + public void givenDateWithoutTimeZone_WhenSetTimeZoneUsingJava7_ThenTimeZoneIsSetSuccessfully() { + Date nowUtc = new Date(); + TimeZone asiaSingapore = TimeZone.getTimeZone(timeZone); + + Calendar nowAsiaSingapore = Calendar.getInstance(asiaSingapore); + nowAsiaSingapore.setTime(nowUtc); + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(PATTERN); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone(timeZone)); + + System.out.println(String.format("Java7: Time now in '%s' is '%s'", nowAsiaSingapore.getTimeZone() + .getID(), simpleDateFormat.format(nowAsiaSingapore.getTime()))); + + Assert.assertEquals(nowUtc.toInstant().getEpochSecond(), nowAsiaSingapore.toInstant().getEpochSecond()); + Assert.assertEquals(asiaSingapore, nowAsiaSingapore.getTimeZone()); + + } + + @Test + public void givenDateWithoutTimeZone_WhenSetTimeZoneUsingJava8_ThenTimeZoneIsSetSuccessfully() { + Instant nowUtc = Instant.now(); + ZoneId asiaSingapore = ZoneId.of(timeZone); + + ZonedDateTime nowAsiaSingapore = ZonedDateTime.ofInstant(nowUtc, asiaSingapore); + + System.out.println(String.format("Java8: Time now in '%s' is '%s'", nowAsiaSingapore.getZone(), + nowAsiaSingapore.format(DateTimeFormatter.ofPattern(PATTERN)))); + + Assert.assertEquals(nowUtc.getEpochSecond(), nowAsiaSingapore.toEpochSecond()); + Assert.assertEquals(asiaSingapore, nowAsiaSingapore.getZone()); + } + + @Test + public void givenDateWithoutTimeZone_WhenSetTimeZoneUsingJodaTime_ThenTimeZoneIsSetSuccessfully() { + org.joda.time.Instant nowUtc = org.joda.time.Instant.now(); + DateTimeZone asiaSingapore = DateTimeZone.forID(timeZone); + + DateTime nowAsiaSingapore = nowUtc.toDateTime(asiaSingapore); + + System.out.println(String.format("Joda-time: Time now in '%s' is '%s'", nowAsiaSingapore.getZone(), + nowAsiaSingapore.toString(PATTERN))); + + Assert.assertEquals(nowUtc.toInstant().getMillis(), nowAsiaSingapore.toInstant().getMillis()); + Assert.assertEquals(asiaSingapore, nowAsiaSingapore.getZone()); + } + +} diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseZonedDateTimeUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseZonedDateTimeUnitTest.java new file mode 100644 index 0000000000..4a39f6056e --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseZonedDateTimeUnitTest.java @@ -0,0 +1,64 @@ +package com.baeldung.datetime; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Set; + +import org.junit.Assert; +import org.junit.Test; + +public class UseZonedDateTimeUnitTest { + + private UseZonedDateTime zonedDateTime = new UseZonedDateTime(); + + @Test + public void givenZoneId_thenZonedDateTime() { + ZoneId zoneId = ZoneId.of("Europe/Paris"); + ZonedDateTime zonedDatetime = zonedDateTime.getZonedDateTime(LocalDateTime.parse("2016-05-20T06:30"), zoneId); + Assert.assertEquals(zoneId, ZoneId.from(zonedDatetime)); + } + + @Test + public void whenRequestingZones_thenAtLeastOneIsReturned() { + Set allZoneIds = ZoneId.getAvailableZoneIds(); + + assertThat(allZoneIds.size()).isGreaterThan(1); + } + + @Test + public void givenLocalDateOrZoned_whenSettingStartOfDay_thenReturnMidnightInAllCases() { + LocalDate given = LocalDate.parse("2018-06-23"); + ZoneId zone = ZoneId.of("Europe/Paris"); + ZonedDateTime zonedGiven = ZonedDateTime.of(given, LocalTime.NOON, zone); + + ZonedDateTime startOfOfDayWithMethod = zonedDateTime.getStartOfDay(given, zone); + ZonedDateTime startOfOfDayWithShorthandMethod = zonedDateTime.getStartOfDayShorthand(given, zone); + ZonedDateTime startOfOfDayFromZonedDateTime = zonedDateTime.getStartOfDayFromZonedDateTime(zonedGiven); + ZonedDateTime startOfOfDayAtMinTime = zonedDateTime.getStartOfDayAtMinTime(zonedGiven); + ZonedDateTime startOfOfDayAtMidnightTime = zonedDateTime.getStartOfDayAtMidnightTime(zonedGiven); + + assertThat(startOfOfDayWithMethod).isEqualTo(startOfOfDayWithShorthandMethod) + .isEqualTo(startOfOfDayFromZonedDateTime) + .isEqualTo(startOfOfDayAtMinTime) + .isEqualTo(startOfOfDayAtMidnightTime); + assertThat(startOfOfDayWithMethod.toLocalTime()).isEqualTo(LocalTime.MIDNIGHT); + assertThat(startOfOfDayWithMethod.toLocalTime() + .toString()).isEqualTo("00:00"); + } + + @Test + public void givenAStringWithTimeZone_whenParsing_thenEqualsExpected() { + ZonedDateTime resultFromString = zonedDateTime.getZonedDateTimeUsingParseMethod("2015-05-03T10:15:30+01:00[Europe/Paris]"); + ZonedDateTime resultFromLocalDateTime = ZonedDateTime.of(2015, 5, 3, 11, 15, 30, 0, ZoneId.of("Europe/Paris")); + + assertThat(resultFromString.getZone()).isEqualTo(ZoneId.of("Europe/Paris")); + assertThat(resultFromLocalDateTime.getZone()).isEqualTo(ZoneId.of("Europe/Paris")); + + assertThat(resultFromString).isEqualTo(resultFromLocalDateTime); + } +} diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/LegacyRandomDateTimesUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/LegacyRandomDateTimesUnitTest.java new file mode 100644 index 0000000000..26fcaa942f --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/LegacyRandomDateTimesUnitTest.java @@ -0,0 +1,36 @@ +package com.baeldung.random; + +import org.junit.jupiter.api.RepeatedTest; + +import java.util.Date; +import java.util.concurrent.TimeUnit; + +import static org.assertj.core.api.Assertions.assertThat; + +class LegacyRandomDateTimesUnitTest { + + private static final Date MIN_DATE = new Date(Long.MIN_VALUE); + private static final Date MAX_DATE = new Date(Long.MAX_VALUE); + + @RepeatedTest(100) + void givenARange_WhenGenTimestamp_ShouldBeInRange() { + long aDay = TimeUnit.DAYS.toMillis(1); + long now = new Date().getTime(); + + Date hundredYearsAgo = new Date(now - aDay * 365 * 100); + Date tenDaysAgo = new Date(now - aDay * 10); + + Date random = LegacyRandomDateTimes.between(hundredYearsAgo, tenDaysAgo); + assertThat(random).isBetween(hundredYearsAgo, tenDaysAgo); + } + + @RepeatedTest(100) + void givenNoRange_WhenGenTimestamp_ShouldGenerateRandomTimestamps() { + Date random = LegacyRandomDateTimes.timestamp(); + + assertThat(random) + .isNotNull() + .isBetween(MIN_DATE, MAX_DATE); + } + +} \ No newline at end of file diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/RandomDateTimesUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/RandomDateTimesUnitTest.java new file mode 100644 index 0000000000..c801afa4e2 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/RandomDateTimesUnitTest.java @@ -0,0 +1,27 @@ +package com.baeldung.random; + +import org.junit.jupiter.api.RepeatedTest; + +import java.time.Duration; +import java.time.Instant; + +import static org.assertj.core.api.Assertions.assertThat; + +class RandomDateTimesUnitTest { + + @RepeatedTest(100) + void givenNoRange_WhenGenTimestamp_ShouldGenerateRandomTimestamps() { + Instant random = RandomDateTimes.timestamp(); + + assertThat(random).isBetween(Instant.MIN, Instant.MAX); + } + + @RepeatedTest(100) + void givenARange_WhenGenTimestamp_ShouldBeInRange() { + Instant hundredYearsAgo = Instant.now().minus(Duration.ofDays(100 * 365)); + Instant tenDaysAgo = Instant.now().minus(Duration.ofDays(10)); + + Instant random = RandomDateTimes.between(hundredYearsAgo, tenDaysAgo); + assertThat(random).isBetween(hundredYearsAgo, tenDaysAgo); + } +} diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/RandomDatesUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/RandomDatesUnitTest.java new file mode 100644 index 0000000000..6005cf93c2 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/RandomDatesUnitTest.java @@ -0,0 +1,27 @@ +package com.baeldung.random; + +import org.junit.jupiter.api.RepeatedTest; + +import java.time.LocalDate; +import java.time.Month; + +import static org.assertj.core.api.Assertions.assertThat; + +class RandomDatesUnitTest { + + @RepeatedTest(100) + void givenNoRange_WhenGenDate_ShouldGenerateRandomDates() { + LocalDate randomDay = RandomDates.date(); + + assertThat(randomDay).isAfter(LocalDate.MIN).isBefore(LocalDate.MAX); + } + + @RepeatedTest(100) + void givenARange_WhenGenDate_ShouldBeInRange() { + LocalDate start = LocalDate.of(1989, Month.OCTOBER, 14); + LocalDate end = LocalDate.now(); + + LocalDate random = RandomDates.between(start, end); + assertThat(random).isAfter(start).isBefore(end); + } +} diff --git a/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/RandomTimesUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/RandomTimesUnitTest.java new file mode 100644 index 0000000000..a346d0df20 --- /dev/null +++ b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/random/RandomTimesUnitTest.java @@ -0,0 +1,20 @@ +package com.baeldung.random; + +import org.junit.jupiter.api.RepeatedTest; + +import java.time.LocalTime; + +import static org.assertj.core.api.Assertions.assertThat; + +class RandomTimesUnitTest { + + @RepeatedTest(100) + void givenARange_WhenGenTime_ShouldBeInRange() { + LocalTime morning = LocalTime.of(8, 30); + LocalTime randomTime = RandomTimes.between(LocalTime.MIDNIGHT, morning); + + assertThat(randomTime) + .isAfter(LocalTime.MIDNIGHT).isBefore(morning) + .isAfter(LocalTime.MIN).isBefore(LocalTime.MAX); + } +} diff --git a/java-dates/src/test/java/com/baeldung/temporaladjusters/CustomTemporalAdjusterUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/temporaladjusters/CustomTemporalAdjusterUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/temporaladjusters/CustomTemporalAdjusterUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/temporaladjusters/CustomTemporalAdjusterUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/temporaladjusters/TemporalAdjustersUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/temporaladjusters/TemporalAdjustersUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/temporaladjusters/TemporalAdjustersUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/temporaladjusters/TemporalAdjustersUnitTest.java diff --git a/core-java-modules/core-java-datetime-string/README.md b/core-java-modules/core-java-datetime-string/README.md new file mode 100644 index 0000000000..cf00bdeb1f --- /dev/null +++ b/core-java-modules/core-java-datetime-string/README.md @@ -0,0 +1,13 @@ +## Java Dates Parsing and Formatting Cookbooks and Examples + +This module contains articles about parsing and formatting Java date and time objects. + +### Relevant Articles: +- [Check If a String Is a Valid Date in Java](https://www.baeldung.com/java-string-valid-date) +- [RegEx for matching Date Pattern in Java](http://www.baeldung.com/java-date-regular-expressions) +- [Guide to DateTimeFormatter](https://www.baeldung.com/java-datetimeformatter) +- [Format ZonedDateTime to String](https://www.baeldung.com/java-format-zoned-datetime-string) +- [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) +- [Display All Time Zones With GMT And UTC in Java](http://www.baeldung.com/java-time-zones) +- [Convert between String and Timestamp](https://www.baeldung.com/java-string-to-timestamp) +- [Convert String to Date in Java](http://www.baeldung.com/java-string-to-date) diff --git a/core-java-modules/core-java-datetime-string/pom.xml b/core-java-modules/core-java-datetime-string/pom.xml new file mode 100644 index 0000000000..b4e7aff524 --- /dev/null +++ b/core-java-modules/core-java-datetime-string/pom.xml @@ -0,0 +1,83 @@ + + 4.0.0 + core-java-datetime-string + ${project.parent.version} + core-java-datetime-string + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + commons-validator + commons-validator + ${commons-validator.version} + + + log4j + log4j + ${log4j.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + joda-time + joda-time + ${joda-time.version} + + + com.darwinsys + hirondelle-date4j + RELEASE + test + + + + + core-java-datetime-string + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + 1.6 + 2.10 + + 3.6.1 + 1.9 + 1.9 + + diff --git a/java-dates-2/src/main/java/com/baeldung/date/validation/DateValidator.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidator.java similarity index 100% rename from java-dates-2/src/main/java/com/baeldung/date/validation/DateValidator.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidator.java diff --git a/java-dates-2/src/main/java/com/baeldung/date/validation/DateValidatorUsingApacheValidator.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidatorUsingApacheValidator.java similarity index 100% rename from java-dates-2/src/main/java/com/baeldung/date/validation/DateValidatorUsingApacheValidator.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidatorUsingApacheValidator.java diff --git a/java-dates-2/src/main/java/com/baeldung/date/validation/DateValidatorUsingDateFormat.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidatorUsingDateFormat.java similarity index 100% rename from java-dates-2/src/main/java/com/baeldung/date/validation/DateValidatorUsingDateFormat.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidatorUsingDateFormat.java diff --git a/java-dates-2/src/main/java/com/baeldung/date/validation/DateValidatorUsingDateTimeFormatter.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidatorUsingDateTimeFormatter.java similarity index 100% rename from java-dates-2/src/main/java/com/baeldung/date/validation/DateValidatorUsingDateTimeFormatter.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidatorUsingDateTimeFormatter.java diff --git a/java-dates-2/src/main/java/com/baeldung/date/validation/DateValidatorUsingLocalDate.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidatorUsingLocalDate.java similarity index 100% rename from java-dates-2/src/main/java/com/baeldung/date/validation/DateValidatorUsingLocalDate.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/date/validation/DateValidatorUsingLocalDate.java diff --git a/java-dates/src/main/java/com/baeldung/regexp/datepattern/DateMatcher.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/DateMatcher.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/regexp/datepattern/DateMatcher.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/DateMatcher.java diff --git a/java-dates/src/main/java/com/baeldung/regexp/datepattern/FormattedDateMatcher.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/FormattedDateMatcher.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/regexp/datepattern/FormattedDateMatcher.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/FormattedDateMatcher.java diff --git a/java-dates/src/main/java/com/baeldung/regexp/datepattern/RangedDateMatcher.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/RangedDateMatcher.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/regexp/datepattern/RangedDateMatcher.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/RangedDateMatcher.java diff --git a/java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/February29thMatcher.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/February29thMatcher.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/February29thMatcher.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/February29thMatcher.java diff --git a/java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/FebruaryGeneralMatcher.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/FebruaryGeneralMatcher.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/FebruaryGeneralMatcher.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/FebruaryGeneralMatcher.java diff --git a/java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/GregorianDateMatcher.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/GregorianDateMatcher.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/GregorianDateMatcher.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/GregorianDateMatcher.java diff --git a/java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf30DaysMatcher.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf30DaysMatcher.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf30DaysMatcher.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf30DaysMatcher.java diff --git a/java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf31DaysMatcher.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf31DaysMatcher.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf31DaysMatcher.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf31DaysMatcher.java diff --git a/java-dates/src/main/java/com/baeldung/regexp/datepattern/optmization/OptimizedMatcher.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/optmization/OptimizedMatcher.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/regexp/datepattern/optmization/OptimizedMatcher.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/regexp/datepattern/optmization/OptimizedMatcher.java diff --git a/java-dates/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplay.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplay.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplay.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplay.java diff --git a/java-dates/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayApp.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayApp.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayApp.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayApp.java diff --git a/java-dates/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayJava7.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayJava7.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayJava7.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayJava7.java diff --git a/java-dates/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayJava7App.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayJava7App.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayJava7App.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/timezonedisplay/TimezoneDisplayJava7App.java diff --git a/java-dates/src/main/java/com/baeldung/zoneddatetime/OffsetDateTimeExample.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/zonedatetime/OffsetDateTimeExample.java similarity index 89% rename from java-dates/src/main/java/com/baeldung/zoneddatetime/OffsetDateTimeExample.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/zonedatetime/OffsetDateTimeExample.java index fb92eb8d0d..90077795f0 100644 --- a/java-dates/src/main/java/com/baeldung/zoneddatetime/OffsetDateTimeExample.java +++ b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/zonedatetime/OffsetDateTimeExample.java @@ -1,4 +1,4 @@ -package com.baeldung.zoneddatetime; +package com.baeldung.zonedatetime; import java.time.OffsetDateTime; import java.time.ZoneOffset; diff --git a/java-dates/src/main/java/com/baeldung/zoneddatetime/OffsetTimeExample.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/zonedatetime/OffsetTimeExample.java similarity index 89% rename from java-dates/src/main/java/com/baeldung/zoneddatetime/OffsetTimeExample.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/zonedatetime/OffsetTimeExample.java index 58e2d4d5ad..e280d365c2 100644 --- a/java-dates/src/main/java/com/baeldung/zoneddatetime/OffsetTimeExample.java +++ b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/zonedatetime/OffsetTimeExample.java @@ -1,4 +1,4 @@ -package com.baeldung.zoneddatetime; +package com.baeldung.zonedatetime; import java.time.OffsetTime; import java.time.ZoneOffset; diff --git a/java-dates/src/main/java/com/baeldung/zoneddatetime/ZoneDateTimeExample.java b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/zonedatetime/ZoneDateTimeExample.java similarity index 93% rename from java-dates/src/main/java/com/baeldung/zoneddatetime/ZoneDateTimeExample.java rename to core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/zonedatetime/ZoneDateTimeExample.java index b54b8c5225..a0dd304876 100644 --- a/java-dates/src/main/java/com/baeldung/zoneddatetime/ZoneDateTimeExample.java +++ b/core-java-modules/core-java-datetime-string/src/main/java/com/baeldung/zonedatetime/ZoneDateTimeExample.java @@ -1,4 +1,4 @@ -package com.baeldung.zoneddatetime; +package com.baeldung.zonedatetime; import java.time.ZoneId; import java.time.ZonedDateTime; diff --git a/java-dates/src/test/java/com/baeldung/date/StringToDateUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/StringToDateUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/date/StringToDateUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/StringToDateUnitTest.java diff --git a/java-dates-2/src/test/java/com/baeldung/date/validation/DateValidatorUsingApacheValidatorUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/validation/DateValidatorUsingApacheValidatorUnitTest.java similarity index 100% rename from java-dates-2/src/test/java/com/baeldung/date/validation/DateValidatorUsingApacheValidatorUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/validation/DateValidatorUsingApacheValidatorUnitTest.java diff --git a/java-dates-2/src/test/java/com/baeldung/date/validation/DateValidatorUsingDateFormatUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/validation/DateValidatorUsingDateFormatUnitTest.java similarity index 100% rename from java-dates-2/src/test/java/com/baeldung/date/validation/DateValidatorUsingDateFormatUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/validation/DateValidatorUsingDateFormatUnitTest.java diff --git a/java-dates-2/src/test/java/com/baeldung/date/validation/DateValidatorUsingDateTimeFormatterUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/validation/DateValidatorUsingDateTimeFormatterUnitTest.java similarity index 100% rename from java-dates-2/src/test/java/com/baeldung/date/validation/DateValidatorUsingDateTimeFormatterUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/validation/DateValidatorUsingDateTimeFormatterUnitTest.java diff --git a/java-dates-2/src/test/java/com/baeldung/date/validation/DateValidatorUsingLocalDateUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/validation/DateValidatorUsingLocalDateUnitTest.java similarity index 100% rename from java-dates-2/src/test/java/com/baeldung/date/validation/DateValidatorUsingLocalDateUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/date/validation/DateValidatorUsingLocalDateUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/DateTimeFormatterUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/datetime/DateTimeFormatterUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/DateTimeFormatterUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/datetime/DateTimeFormatterUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/regexp/datepattern/FormattedDateMatcherUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/FormattedDateMatcherUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/regexp/datepattern/FormattedDateMatcherUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/FormattedDateMatcherUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/regexp/datepattern/RangedDateMatcherUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/RangedDateMatcherUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/regexp/datepattern/RangedDateMatcherUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/RangedDateMatcherUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/February29thMatcherUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/February29thMatcherUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/February29thMatcherUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/February29thMatcherUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/FebruaryGeneralMatcherUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/FebruaryGeneralMatcherUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/FebruaryGeneralMatcherUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/FebruaryGeneralMatcherUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/GregorianDateMatcherUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/GregorianDateMatcherUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/GregorianDateMatcherUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/GregorianDateMatcherUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf30DaysMatcherUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf30DaysMatcherUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf30DaysMatcherUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf30DaysMatcherUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf31DaysMatcherUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf31DaysMatcherUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf31DaysMatcherUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/MonthsOf31DaysMatcherUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/testhelper/GregorianDateTestHelper.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/testhelper/GregorianDateTestHelper.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/regexp/datepattern/gregorian/testhelper/GregorianDateTestHelper.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/regexp/datepattern/gregorian/testhelper/GregorianDateTestHelper.java diff --git a/java-dates/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/simpledateformat/SimpleDateFormatUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/timestamp/StringToTimestampConverterUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/timestamp/StringToTimestampConverterUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/timestamp/StringToTimestampConverterUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/timestamp/StringToTimestampConverterUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/timestamp/TimestampToStringConverterTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/timestamp/TimestampToStringConverterTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/timestamp/TimestampToStringConverterTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/timestamp/TimestampToStringConverterTest.java diff --git a/java-dates/src/test/java/com/baeldung/zoneddatetime/OffsetDateTimeExampleUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/OffsetDateTimeExampleUnitTest.java similarity index 93% rename from java-dates/src/test/java/com/baeldung/zoneddatetime/OffsetDateTimeExampleUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/OffsetDateTimeExampleUnitTest.java index a08d3737cd..7634ff1572 100644 --- a/java-dates/src/test/java/com/baeldung/zoneddatetime/OffsetDateTimeExampleUnitTest.java +++ b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/OffsetDateTimeExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.zoneddatetime; +package com.baeldung.zonedatetime; import static org.junit.Assert.assertTrue; diff --git a/java-dates/src/test/java/com/baeldung/zoneddatetime/OffsetTimeExampleUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/OffsetTimeExampleUnitTest.java similarity index 93% rename from java-dates/src/test/java/com/baeldung/zoneddatetime/OffsetTimeExampleUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/OffsetTimeExampleUnitTest.java index 488f934179..6134e48f70 100644 --- a/java-dates/src/test/java/com/baeldung/zoneddatetime/OffsetTimeExampleUnitTest.java +++ b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/OffsetTimeExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.zoneddatetime; +package com.baeldung.zonedatetime; import static org.junit.Assert.assertTrue; diff --git a/java-dates/src/test/java/com/baeldung/zoneddatetime/ZoneDateTimeExampleUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/ZoneDateTimeExampleUnitTest.java similarity index 96% rename from java-dates/src/test/java/com/baeldung/zoneddatetime/ZoneDateTimeExampleUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/ZoneDateTimeExampleUnitTest.java index e78ff3e3fd..cc19055beb 100644 --- a/java-dates/src/test/java/com/baeldung/zoneddatetime/ZoneDateTimeExampleUnitTest.java +++ b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/ZoneDateTimeExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.zoneddatetime; +package com.baeldung.zonedatetime; import static org.junit.Assert.assertTrue; diff --git a/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/ZonedDateTimeUnitTest.java similarity index 98% rename from java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java rename to core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/ZonedDateTimeUnitTest.java index 65f63bc787..150983c61b 100644 --- a/java-dates/src/test/java/com/baeldung/zoneddatetime/ZonedDateTimeUnitTest.java +++ b/core-java-modules/core-java-datetime-string/src/test/java/com/baeldung/zonedatetime/ZonedDateTimeUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.zoneddatetime; +package com.baeldung.zonedatetime; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/core-java-modules/core-java-exceptions/README.md b/core-java-modules/core-java-exceptions/README.md index 78599c6b7b..f7b0c37e73 100644 --- a/core-java-modules/core-java-exceptions/README.md +++ b/core-java-modules/core-java-exceptions/README.md @@ -1,8 +1,19 @@ -## Relevant Articles: +## Core Java Exceptions -- [Will an Error Be Caught by Catch Block in Java?](https://www.baeldung.com/java-error-catch) -- [Java Global Exception Handler](http://www.baeldung.com/java-global-exception-handler) -- [Common Java Exceptions](http://www.baeldung.com/java-common-exceptions) +This module contains articles about core java exceptions + +### Relevant articles: +- [Chained Exceptions in Java](https://www.baeldung.com/java-chained-exceptions) +- [ClassNotFoundException vs NoClassDefFoundError](https://www.baeldung.com/java-classnotfoundexception-and-noclassdeffounderror) +- [Create a Custom Exception in Java](https://www.baeldung.com/java-new-custom-exception) +- [Exception Handling in Java](https://www.baeldung.com/java-exceptions) +- [Differences Between Final, Finally and Finalize in Java](https://www.baeldung.com/java-final-finally-finalize) +- [Difference Between Throw and Throws in Java](https://www.baeldung.com/java-throw-throws) +- [“Sneaky Throws” in Java](https://www.baeldung.com/java-sneaky-throws) +- [The StackOverflowError in Java](https://www.baeldung.com/java-stack-overflow-error) +- [Checked and Unchecked Exceptions in Java](https://www.baeldung.com/java-checked-unchecked-exceptions) +- [Java – Try with Resources](https://www.baeldung.com/java-try-with-resources) +- [Java Global Exception Handler](https://www.baeldung.com/java-global-exception-handler) +- [Common Java Exceptions](https://www.baeldung.com/java-common-exceptions) - [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception) - [How to Find an Exception’s Root Cause in Java](https://www.baeldung.com/java-exception-root-cause) -- [Java – Try with Resources](https://www.baeldung.com/java-try-with-resources) diff --git a/core-java-modules/core-java-exceptions/pom.xml b/core-java-modules/core-java-exceptions/pom.xml index 43c4e31033..da5ec76622 100644 --- a/core-java-modules/core-java-exceptions/pom.xml +++ b/core-java-modules/core-java-exceptions/pom.xml @@ -1,55 +1,46 @@ + - 4.0.0 - com.baeldung.exception.numberformat - core-java-exceptions - 0.0.1-SNAPSHOT - core-java-exceptions + 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"> + com.baeldung.exceptions + 4.0.0 + core-java-exceptions + 0.1.0-SNAPSHOT + core-java-exceptions + jar - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../../parent-java - + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + - - - junit - junit - ${junit.version} - test - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator-annprocess.version} - - - - org.assertj - assertj-core - ${assertj-core.version} - test - - + + + javax.mail + mail + ${javax.mail.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + - - 3.9 - 1.19 - 3.10.0 - 1.19 - + + 1.5.0-b01 + + 3.10.0 + - + \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/Arithmetic.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/Arithmetic.java deleted file mode 100644 index 138916ec60..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/Arithmetic.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.baeldung.exceptions; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Arithmetic { - - private static Logger LOGGER = LoggerFactory.getLogger(Arithmetic.class); - - public static void main(String[] args) { - - try { - int result = 30 / 0; // Trying to divide by zero - } catch (ArithmeticException e) { - LOGGER.error("ArithmeticException caught!"); - } - - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/ArrayIndexOutOfBounds.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/ArrayIndexOutOfBounds.java deleted file mode 100644 index 93b53f284c..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/ArrayIndexOutOfBounds.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.exceptions; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ArrayIndexOutOfBounds { - - private static Logger LOGGER = LoggerFactory.getLogger(ArrayIndexOutOfBounds.class); - - public static void main(String[] args) { - - int[] nums = new int[] { 1, 2, 3 }; - - try { - int numFromNegativeIndex = nums[-1]; // Trying to access at negative index - int numFromGreaterIndex = nums[4]; // Trying to access at greater index - int numFromLengthIndex = nums[3]; // Trying to access at index equal to size of the array - } catch (ArrayIndexOutOfBoundsException e) { - LOGGER.error("ArrayIndexOutOfBoundsException caught"); - } - - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/CheckedUncheckedExceptions.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/CheckedUncheckedExceptions.java deleted file mode 100644 index 780189b654..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/CheckedUncheckedExceptions.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.baeldung.exceptions; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; - -public class CheckedUncheckedExceptions { - public static void checkedExceptionWithThrows() throws FileNotFoundException { - File file = new File("not_existing_file.txt"); - FileInputStream stream = new FileInputStream(file); - } - - public static void checkedExceptionWithTryCatch() { - File file = new File("not_existing_file.txt"); - try { - FileInputStream stream = new FileInputStream(file); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - } - - public static int divideByZero() { - int numerator = 1; - int denominator = 0; - return numerator / denominator; - } - - public static void checkFile(String fileName) throws IncorrectFileNameException { - if (fileName == null || fileName.isEmpty()) { - throw new NullOrEmptyException("The filename is null."); - } - if (!isCorrectFileName(fileName)) { - throw new IncorrectFileNameException("Incorrect filename : " + fileName); - } - } - - private static boolean isCorrectFileName(String fileName) { - if (fileName.equals("wrongFileName.txt")) - return false; - else - return true; - } -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/ClassCast.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/ClassCast.java deleted file mode 100644 index 183f8f54a3..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/ClassCast.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.baeldung.exceptions; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class Animal { - -} - -class Dog extends Animal { - -} - -class Lion extends Animal { - -} - -public class ClassCast { - - private static Logger LOGGER = LoggerFactory.getLogger(ClassCast.class); - - public static void main(String[] args) { - - try { - Animal animalOne = new Dog(); // At runtime the instance is dog - Dog bruno = (Dog) animalOne; // Downcasting - - Animal animalTwo = new Lion(); // At runtime the instance is animal - Dog tommy = (Dog) animalTwo; // Downcasting - } catch (ClassCastException e) { - LOGGER.error("ClassCastException caught!"); - } - - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/FileNotFound.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/FileNotFound.java deleted file mode 100644 index bb9e0bf4ac..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/FileNotFound.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.exceptions; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class FileNotFound { - - private static Logger LOGGER = LoggerFactory.getLogger(FileNotFound.class); - - public static void main(String[] args) { - - BufferedReader reader = null; - try { - reader = new BufferedReader(new FileReader(new File("/invalid/file/location"))); - } catch (FileNotFoundException e) { - LOGGER.error("FileNotFoundException caught!"); - } - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/GlobalExceptionHandler.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/GlobalExceptionHandler.java deleted file mode 100644 index ab46c83da4..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/GlobalExceptionHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.baeldung.exceptions; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class GlobalExceptionHandler { - - public static void main(String[] args) { - - Handler globalExceptionHandler = new Handler(); - Thread.setDefaultUncaughtExceptionHandler(globalExceptionHandler); - new GlobalExceptionHandler().performArithmeticOperation(10, 0); - } - - public int performArithmeticOperation(int num1, int num2) { - return num1/num2; - } - -} - -class Handler implements Thread.UncaughtExceptionHandler { - - private static Logger LOGGER = LoggerFactory.getLogger(Handler.class); - - public void uncaughtException(Thread t, Throwable e) { - LOGGER.info("Unhandled exception caught!"); - } -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/IllegalArgument.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/IllegalArgument.java deleted file mode 100644 index 801536cb2d..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/IllegalArgument.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.exceptions; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class IllegalArgument { - - private static Logger LOGGER = LoggerFactory.getLogger(IllegalArgument.class); - - public static void main(String[] args) { - try { - Thread.sleep(-1000); - } catch (InterruptedException e) { - LOGGER.error("IllegalArgumentException caught!"); - } - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/IllegalState.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/IllegalState.java deleted file mode 100644 index e8ddcea3c2..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/IllegalState.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.baeldung.exceptions; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class IllegalState { - - private static Logger LOGGER = LoggerFactory.getLogger(IllegalState.class); - - public static void main(String[] args) { - - List intList = new ArrayList<>(); - - for (int i = 0; i < 10; i++) { - intList.add(i); - } - - Iterator intListIterator = intList.iterator(); // Initialized with index at -1 - - try { - intListIterator.remove(); // IllegalStateException - } catch (IllegalStateException e) { - LOGGER.error("IllegalStateException caught!"); - } - - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/IncorrectFileNameException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/IncorrectFileNameException.java deleted file mode 100644 index 9877fe25ca..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/IncorrectFileNameException.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.exceptions; - -public class IncorrectFileNameException extends Exception { - private static final long serialVersionUID = 1L; - - public IncorrectFileNameException(String errorMessage) { - super(errorMessage); - } - - public IncorrectFileNameException(String errorMessage, Throwable thr) { - super(errorMessage, thr); - } -} \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/InterruptedExceptionExample.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/InterruptedExceptionExample.java deleted file mode 100644 index 319fd33591..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/InterruptedExceptionExample.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.baeldung.exceptions; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class ChildThread extends Thread { - - private static Logger LOGGER = LoggerFactory.getLogger(ChildThread.class); - - public void run() { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - LOGGER.error("InterruptedException caught!"); - } - } - -} - -public class InterruptedExceptionExample { - - public static void main(String[] args) throws InterruptedException { - ChildThread childThread = new ChildThread(); - childThread.start(); - childThread.interrupt(); - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/MalformedURL.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/MalformedURL.java deleted file mode 100644 index 57fcddf76b..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/MalformedURL.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.exceptions; - -import java.net.MalformedURLException; -import java.net.URL; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class MalformedURL { - - private static Logger LOGGER = LoggerFactory.getLogger(MalformedURL.class); - - public static void main(String[] args) { - - URL baeldungURL = null; - - try { - baeldungURL = new URL("malformedurl"); - } catch (MalformedURLException e) { - LOGGER.error("MalformedURLException caught!"); - } - - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/NullOrEmptyException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/NullOrEmptyException.java deleted file mode 100644 index d4ee9c0d6f..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/NullOrEmptyException.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.exceptions; - -public class NullOrEmptyException extends RuntimeException { - - private static final long serialVersionUID = 1L; - - public NullOrEmptyException(String errorMessage) { - super(errorMessage); - } - - public NullOrEmptyException(String errorMessage, Throwable thr) { - super(errorMessage, thr); - } -} \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/NullPointer.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/NullPointer.java deleted file mode 100644 index 2402a786a9..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/NullPointer.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.baeldung.exceptions; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class NullPointer { - - private static Logger LOGGER = LoggerFactory.getLogger(NullPointer.class); - - public static void main(String[] args) { - - Person personObj = null; - - try { - String name = personObj.personName; // Accessing the field of a null object - personObj.personName = "Jon Doe"; // Modifying the field of a null object - } catch (NullPointerException e) { - LOGGER.error("NullPointerException caught!"); - } - - } -} - -class Person { - - public String personName; - - public String getPersonName() { - return personName; - } - - public void setPersonName(String personName) { - this.personName = personName; - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/NumberFormat.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/NumberFormat.java deleted file mode 100644 index 7050e70aee..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/NumberFormat.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.exceptions; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class NumberFormat { - - private static Logger LOGGER = LoggerFactory.getLogger(NumberFormat.class); - - public static void main(String[] args) { - - String str1 = "100ABCD"; - - try { - int x = Integer.parseInt(str1); // Converting string with inappropriate format - int y = Integer.valueOf(str1); - } catch (NumberFormatException e) { - LOGGER.error("NumberFormatException caught!"); - } - - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/ParseExceptionExample.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/ParseExceptionExample.java deleted file mode 100644 index f7fb4c91e4..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/ParseExceptionExample.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.exceptions; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ParseExceptionExample { - - private static Logger LOGGER = LoggerFactory.getLogger(ParseExceptionExample.class); - - public static void main(String[] args) { - - DateFormat format = new SimpleDateFormat("MM, dd, yyyy"); - - try { - format.parse("01, , 2010"); - } catch (ParseException e) { - LOGGER.error("ParseException caught!"); - } - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/RootCauseFinder.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/RootCauseFinder.java deleted file mode 100644 index cf449110e6..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/RootCauseFinder.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.baeldung.exceptions; - -import java.time.LocalDate; -import java.time.Period; -import java.time.format.DateTimeParseException; -import java.util.Objects; - -/** - * Utility class to find root cause exceptions. - */ -public class RootCauseFinder { - - private RootCauseFinder() { - } - - public static Throwable findCauseUsingPlainJava(Throwable throwable) { - Objects.requireNonNull(throwable); - Throwable rootCause = throwable; - while (rootCause.getCause() != null && rootCause.getCause() != rootCause) { - rootCause = rootCause.getCause(); - } - return rootCause; - } - - /** - * Calculates the age of a person from a given date. - */ - static class AgeCalculator { - - private AgeCalculator() { - } - - public static int calculateAge(String birthDate) { - if (birthDate == null || birthDate.isEmpty()) { - throw new IllegalArgumentException(); - } - - try { - return Period - .between(parseDate(birthDate), LocalDate.now()) - .getYears(); - } catch (DateParseException ex) { - throw new CalculationException(ex); - } - } - - private static LocalDate parseDate(String birthDateAsString) { - - LocalDate birthDate; - try { - birthDate = LocalDate.parse(birthDateAsString); - } catch (DateTimeParseException ex) { - throw new InvalidFormatException(birthDateAsString, ex); - } - - if (birthDate.isAfter(LocalDate.now())) { - throw new DateOutOfRangeException(birthDateAsString); - } - - return birthDate; - } - - } - - static class CalculationException extends RuntimeException { - - CalculationException(DateParseException ex) { - super(ex); - } - } - - static class DateParseException extends RuntimeException { - - DateParseException(String input) { - super(input); - } - - DateParseException(String input, Throwable thr) { - super(input, thr); - } - } - - static class InvalidFormatException extends DateParseException { - - InvalidFormatException(String input, Throwable thr) { - super("Invalid date format: " + input, thr); - } - } - - static class DateOutOfRangeException extends DateParseException { - - DateOutOfRangeException(String date) { - super("Date out of range: " + date); - } - - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/StackTraceToString.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/StackTraceToString.java deleted file mode 100644 index c6bf915996..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/StackTraceToString.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.baeldung.exceptions; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import java.io.PrintWriter; -import java.io.StringWriter; - -public class StackTraceToString { - - public static void main(String[] args) { - // Convert a StackTrace to String using core java - try { - throw new NullPointerException(); - } catch (Exception e) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - e.printStackTrace(pw); - - System.out.println(sw.toString()); - } - - // Convert a StackTrace to String using Apache Commons - try { - throw new IndexOutOfBoundsException(); - } catch (Exception e) { - System.out.println(ExceptionUtils.getStackTrace(e)); - } - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/StringIndexOutOfBounds.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/StringIndexOutOfBounds.java deleted file mode 100644 index bc297be498..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/StringIndexOutOfBounds.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.exceptions; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class StringIndexOutOfBounds { - - private static Logger LOGGER = LoggerFactory.getLogger(StringIndexOutOfBounds.class); - - public static void main(String[] args) { - - String str = "Hello World"; - - try { - char charAtNegativeIndex = str.charAt(-1); // Trying to access at negative index - char charAtLengthIndex = str.charAt(11); // Trying to access at index equal to size of the string - } catch (StringIndexOutOfBoundsException e) { - LOGGER.error("StringIndexOutOfBoundsException caught"); - } - - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/LogWithChain.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/LogWithChain.java new file mode 100644 index 0000000000..a2eae50108 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/LogWithChain.java @@ -0,0 +1,41 @@ +package com.baeldung.exceptions.chainedexception; + +import com.baeldung.exceptions.chainedexception.exceptions.GirlFriendOfManagerUpsetException; +import com.baeldung.exceptions.chainedexception.exceptions.ManagerUpsetException; +import com.baeldung.exceptions.chainedexception.exceptions.NoLeaveGrantedException; +import com.baeldung.exceptions.chainedexception.exceptions.TeamLeadUpsetException; + +public class LogWithChain { + + public static void main(String[] args) throws Exception { + getLeave(); + } + + private static void getLeave() throws NoLeaveGrantedException { + try { + howIsTeamLead(); + } catch (TeamLeadUpsetException e) { + throw new NoLeaveGrantedException("Leave not sanctioned.", e); + } + } + + private static void howIsTeamLead() throws TeamLeadUpsetException { + try { + howIsManager(); + } catch (ManagerUpsetException e) { + throw new TeamLeadUpsetException("Team lead is not in good mood", e); + } + } + + private static void howIsManager() throws ManagerUpsetException { + try { + howIsGirlFriendOfManager(); + } catch (GirlFriendOfManagerUpsetException e) { + throw new ManagerUpsetException("Manager is in bad mood", e); + } + } + + private static void howIsGirlFriendOfManager() throws GirlFriendOfManagerUpsetException { + throw new GirlFriendOfManagerUpsetException("Girl friend of manager is in bad mood"); + } +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithoutChain.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/LogWithoutChain.java similarity index 75% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithoutChain.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/LogWithoutChain.java index 7556e30663..8c37db0307 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithoutChain.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/LogWithoutChain.java @@ -1,9 +1,9 @@ -package com.baeldung.chainedexception; +package com.baeldung.exceptions.chainedexception; -import com.baeldung.chainedexception.exceptions.GirlFriendOfManagerUpsetException; -import com.baeldung.chainedexception.exceptions.ManagerUpsetException; -import com.baeldung.chainedexception.exceptions.NoLeaveGrantedException; -import com.baeldung.chainedexception.exceptions.TeamLeadUpsetException; +import com.baeldung.exceptions.chainedexception.exceptions.GirlFriendOfManagerUpsetException; +import com.baeldung.exceptions.chainedexception.exceptions.ManagerUpsetException; +import com.baeldung.exceptions.chainedexception.exceptions.NoLeaveGrantedException; +import com.baeldung.exceptions.chainedexception.exceptions.TeamLeadUpsetException; public class LogWithoutChain { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java similarity index 82% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java index e20c58ea5b..91537b58d4 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/GirlFriendOfManagerUpsetException.java @@ -1,4 +1,4 @@ -package com.baeldung.chainedexception.exceptions; +package com.baeldung.exceptions.chainedexception.exceptions; public class GirlFriendOfManagerUpsetException extends Exception { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/ManagerUpsetException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/ManagerUpsetException.java similarity index 80% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/ManagerUpsetException.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/ManagerUpsetException.java index e95a3921a4..351521a522 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/ManagerUpsetException.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/ManagerUpsetException.java @@ -1,4 +1,4 @@ -package com.baeldung.chainedexception.exceptions; +package com.baeldung.exceptions.chainedexception.exceptions; public class ManagerUpsetException extends Exception { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/NoLeaveGrantedException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/NoLeaveGrantedException.java similarity index 80% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/NoLeaveGrantedException.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/NoLeaveGrantedException.java index b9521858b3..dd84baae74 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/NoLeaveGrantedException.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/NoLeaveGrantedException.java @@ -1,4 +1,4 @@ -package com.baeldung.chainedexception.exceptions; +package com.baeldung.exceptions.chainedexception.exceptions; public class NoLeaveGrantedException extends Exception { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/TeamLeadUpsetException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/TeamLeadUpsetException.java similarity index 80% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/TeamLeadUpsetException.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/TeamLeadUpsetException.java index f874620f00..4ea8c3db7a 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/exceptions/TeamLeadUpsetException.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/chainedexception/exceptions/TeamLeadUpsetException.java @@ -1,4 +1,4 @@ -package com.baeldung.chainedexception.exceptions; +package com.baeldung.exceptions.chainedexception.exceptions; public class TeamLeadUpsetException extends Exception { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/customexception/FileManager.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/customexception/FileManager.java similarity index 96% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/customexception/FileManager.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/customexception/FileManager.java index b6f4d960aa..adc1b1613c 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/customexception/FileManager.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/customexception/FileManager.java @@ -1,4 +1,4 @@ -package com.baeldung.customexception; +package com.baeldung.exceptions.customexception; import java.io.File; import java.io.FileNotFoundException; diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileExtensionException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/customexception/IncorrectFileExtensionException.java similarity index 83% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileExtensionException.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/customexception/IncorrectFileExtensionException.java index c6dc6d6964..4e8fece145 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileExtensionException.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/customexception/IncorrectFileExtensionException.java @@ -1,4 +1,4 @@ -package com.baeldung.customexception; +package com.baeldung.exceptions.customexception; public class IncorrectFileExtensionException extends RuntimeException{ private static final long serialVersionUID = 1L; diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/customexception/IncorrectFileNameException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/customexception/IncorrectFileNameException.java new file mode 100644 index 0000000000..f7f6a9dd8c --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/customexception/IncorrectFileNameException.java @@ -0,0 +1,9 @@ +package com.baeldung.exceptions.customexception; + +public class IncorrectFileNameException extends Exception { + private static final long serialVersionUID = 1L; + + public IncorrectFileNameException(String errorMessage, Throwable err) { + super(errorMessage, err); + } +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/Exceptions.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/Exceptions.java similarity index 99% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/Exceptions.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/Exceptions.java index 32d88cfd12..14483b3489 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/Exceptions.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/Exceptions.java @@ -1,4 +1,4 @@ -package com.baeldung.exceptionhandling; +package com.baeldung.exceptions.exceptionhandling; import java.io.File; import java.io.FileNotFoundException; diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/MyException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/MyException.java new file mode 100644 index 0000000000..bc2c6baffb --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/MyException.java @@ -0,0 +1,5 @@ +package com.baeldung.exceptions.exceptionhandling; + +public class MyException extends Throwable { + +} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/Player.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/Player.java new file mode 100644 index 0000000000..1251cd58e6 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/Player.java @@ -0,0 +1,12 @@ +package com.baeldung.exceptions.exceptionhandling; + +public class Player { + + public int id; + public String name; + + public Player(String name) { + this.name = name; + } + +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerLoadException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/PlayerLoadException.java similarity index 75% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerLoadException.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/PlayerLoadException.java index d92edeebbd..432232c23e 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerLoadException.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/PlayerLoadException.java @@ -1,4 +1,4 @@ -package com.baeldung.exceptionhandling; +package com.baeldung.exceptions.exceptionhandling; import java.io.IOException; diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/PlayerScoreException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/PlayerScoreException.java new file mode 100644 index 0000000000..ba2a6d74e4 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/PlayerScoreException.java @@ -0,0 +1,8 @@ +package com.baeldung.exceptions.exceptionhandling; + +public class PlayerScoreException extends Exception { + + public PlayerScoreException(Exception e) { + super(e); + } +} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/TimeoutException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/TimeoutException.java new file mode 100644 index 0000000000..0f926ccf58 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/exceptionhandling/TimeoutException.java @@ -0,0 +1,8 @@ +package com.baeldung.exceptions.exceptionhandling; + +public class TimeoutException extends Exception { + + public TimeoutException(String message) { + super(message); + } +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalize/FinalizeObject.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalize/FinalizeObject.java similarity index 88% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalize/FinalizeObject.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalize/FinalizeObject.java index af0449c0da..9e5e7461ea 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalize/FinalizeObject.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalize/FinalizeObject.java @@ -1,4 +1,4 @@ -package com.baeldung.keywords.finalize; +package com.baeldung.exceptions.keywords.finalize; public class FinalizeObject { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Child.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalkeyword/Child.java similarity index 78% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Child.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalkeyword/Child.java index 8615c78652..b006850199 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Child.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalkeyword/Child.java @@ -1,4 +1,4 @@ -package com.baeldung.keywords.finalkeyword; +package com.baeldung.exceptions.keywords.finalkeyword; public final class Child extends Parent { diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalkeyword/GrandChild.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalkeyword/GrandChild.java new file mode 100644 index 0000000000..f8adf27914 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalkeyword/GrandChild.java @@ -0,0 +1,5 @@ +package com.baeldung.exceptions.keywords.finalkeyword; + +/*public class GrandChild extends Child { + // Compilation error +}*/ diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Parent.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalkeyword/Parent.java similarity index 87% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Parent.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalkeyword/Parent.java index 5cd2996e7a..2a5d19a32f 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/Parent.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finalkeyword/Parent.java @@ -1,4 +1,4 @@ -package com.baeldung.keywords.finalkeyword; +package com.baeldung.exceptions.keywords.finalkeyword; public class Parent { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finallykeyword/FinallyExample.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finallykeyword/FinallyExample.java similarity index 92% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finallykeyword/FinallyExample.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finallykeyword/FinallyExample.java index 3c0aee3196..8f9d9a29d2 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finallykeyword/FinallyExample.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/keywords/finallykeyword/FinallyExample.java @@ -1,4 +1,4 @@ -package com.baeldung.keywords.finallykeyword; +package com.baeldung.exceptions.keywords.finallykeyword; public class FinallyExample { diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/noclassdeffounderror/ClassWithInitErrors.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/noclassdeffounderror/ClassWithInitErrors.java new file mode 100644 index 0000000000..a82f430959 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/noclassdeffounderror/ClassWithInitErrors.java @@ -0,0 +1,5 @@ +package com.baeldung.exceptions.noclassdeffounderror; + +public class ClassWithInitErrors { + static int data = 1 / 0; +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/noclassdeffounderror/NoClassDefFoundErrorExample.java similarity index 86% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/noclassdeffounderror/NoClassDefFoundErrorExample.java index 7bcefbdbd3..0dc74a9d01 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorExample.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/noclassdeffounderror/NoClassDefFoundErrorExample.java @@ -1,4 +1,4 @@ -package com.baeldung.noclassdeffounderror; +package com.baeldung.exceptions.noclassdeffounderror; public class NoClassDefFoundErrorExample { public ClassWithInitErrors getClassWithInitErrors() { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyRunnable.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/sneakythrows/SneakyRunnable.java similarity index 90% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyRunnable.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/sneakythrows/SneakyRunnable.java index 88a8696053..06b587d0e0 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyRunnable.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/sneakythrows/SneakyRunnable.java @@ -1,4 +1,4 @@ -package com.baeldung.sneakythrows; +package com.baeldung.exceptions.sneakythrows; import lombok.SneakyThrows; diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyThrows.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/sneakythrows/SneakyThrows.java similarity index 90% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyThrows.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/sneakythrows/SneakyThrows.java index 847aaa7249..e86ef53733 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/sneakythrows/SneakyThrows.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/sneakythrows/SneakyThrows.java @@ -1,4 +1,4 @@ -package com.baeldung.sneakythrows; +package com.baeldung.exceptions.sneakythrows; import java.io.IOException; diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/AccountHolder.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/AccountHolder.java new file mode 100644 index 0000000000..5beac1cd04 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/AccountHolder.java @@ -0,0 +1,8 @@ +package com.baeldung.exceptions.stackoverflowerror; + +public class AccountHolder { + private String firstName; + private String lastName; + + AccountHolder jointAccountHolder = new AccountHolder(); +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassOne.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/ClassOne.java similarity index 86% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassOne.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/ClassOne.java index 3b95fd1368..e290a1fe38 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassOne.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/ClassOne.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; public class ClassOne { private int oneValue; diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassTwo.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/ClassTwo.java similarity index 86% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassTwo.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/ClassTwo.java index 0adf075b43..fc6a89e1fb 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/ClassTwo.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/ClassTwo.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; public class ClassTwo { private int twoValue; diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java similarity index 78% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java index c67eeb30d1..858871cb9d 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/InfiniteRecursionWithTerminationCondition.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; public class InfiniteRecursionWithTerminationCondition { public int calculateFactorial(final int number) { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationCondition.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/RecursionWithCorrectTerminationCondition.java similarity index 78% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationCondition.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/RecursionWithCorrectTerminationCondition.java index 8d10c65dcc..69b1c0b5ab 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationCondition.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/RecursionWithCorrectTerminationCondition.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; public class RecursionWithCorrectTerminationCondition { public int calculateFactorial(final int number) { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursion.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/UnintendedInfiniteRecursion.java similarity index 75% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursion.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/UnintendedInfiniteRecursion.java index 0b7fb3cf94..c07fdcb01b 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursion.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/stackoverflowerror/UnintendedInfiniteRecursion.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; public class UnintendedInfiniteRecursion { public int calculateFactorial(int number) { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/DataAccessException.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/DataAccessException.java similarity index 78% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/DataAccessException.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/DataAccessException.java index 0b371dcedb..448c8e2213 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/DataAccessException.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/DataAccessException.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.exceptions.throwvsthrows; public class DataAccessException extends RuntimeException { diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/Main.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/Main.java new file mode 100644 index 0000000000..dfe8fcbd5a --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/Main.java @@ -0,0 +1,41 @@ +package com.baeldung.exceptions.throwvsthrows; + +import com.sun.mail.iap.ConnectionException; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.net.SocketException; + +public class Main { + + public static void main(String[] args) throws FileNotFoundException { + TryCatch tryCatch = new TryCatch(); + + try { + tryCatch.execute(); + } catch (ConnectionException | SocketException ex) { + System.out.println("IOException"); + } catch (Exception ex) { + System.out.println("General exception"); + } + + checkedException(); + checkedExceptionWithThrows(); + } + + private static void checkedExceptionWithThrows() throws FileNotFoundException { + File file = new File("not_existing_file.txt"); + FileInputStream stream = new FileInputStream(file); + } + + private static void checkedException() { + File file = new File("not_existing_file.txt"); + try { + FileInputStream stream = new FileInputStream(file); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + } + +} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/PersonRepository.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/PersonRepository.java new file mode 100644 index 0000000000..73453f4fc0 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/PersonRepository.java @@ -0,0 +1,12 @@ +package com.baeldung.exceptions.throwvsthrows; + +import java.sql.SQLException; +import java.util.List; + +public class PersonRepository { + + public List findAll() throws SQLException { + throw new SQLException(); + } + +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/SimpleService.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/SimpleService.java similarity index 90% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/SimpleService.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/SimpleService.java index 6bb8b90bf1..605d900633 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/SimpleService.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/SimpleService.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.exceptions.throwvsthrows; import java.sql.SQLException; diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/TryCatch.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/TryCatch.java similarity index 85% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/TryCatch.java rename to core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/TryCatch.java index 2fd87f124d..f8a603f013 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/TryCatch.java +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/exceptions/throwvsthrows/TryCatch.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.exceptions.throwvsthrows; import com.sun.mail.iap.ConnectionException; diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/optional/PersonRepository.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/optional/PersonRepository.java deleted file mode 100644 index 46018faf80..0000000000 --- a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/optional/PersonRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.baeldung.optional; - -public class PersonRepository { - - public String findNameById(String id) { - return id == null ? null : "Name"; - } - -} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/AutoCloseableMain.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/AutoCloseableMain.java new file mode 100644 index 0000000000..fee52fe2bc --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/AutoCloseableMain.java @@ -0,0 +1,16 @@ +package com.baeldung.trywithresource; + +public class AutoCloseableMain { + + public static void main(String[] args) throws Exception { + orderOfClosingResources(); + } + + private static void orderOfClosingResources() throws Exception { + try (AutoCloseableResourcesFirst af = new AutoCloseableResourcesFirst(); + AutoCloseableResourcesSecond as = new AutoCloseableResourcesSecond()) { + af.doSomething(); + as.doSomething(); + } + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/AutoCloseableResourcesFirst.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/AutoCloseableResourcesFirst.java new file mode 100644 index 0000000000..b001244d93 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/AutoCloseableResourcesFirst.java @@ -0,0 +1,17 @@ +package com.baeldung.trywithresource; + +public class AutoCloseableResourcesFirst implements AutoCloseable { + + public AutoCloseableResourcesFirst() { + System.out.println("Constructor -> AutoCloseableResources_First"); + } + + public void doSomething() { + System.out.println("Something -> AutoCloseableResources_First"); + } + + @Override + public void close() throws Exception { + System.out.println("Closed AutoCloseableResources_First"); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/AutoCloseableResourcesSecond.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/AutoCloseableResourcesSecond.java new file mode 100644 index 0000000000..ef8bcd7166 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/AutoCloseableResourcesSecond.java @@ -0,0 +1,17 @@ +package com.baeldung.trywithresource; + +public class AutoCloseableResourcesSecond implements AutoCloseable { + + public AutoCloseableResourcesSecond() { + System.out.println("Constructor -> AutoCloseableResources_Second"); + } + + public void doSomething() { + System.out.println("Something -> AutoCloseableResources_Second"); + } + + @Override + public void close() throws Exception { + System.out.println("Closed AutoCloseableResources_Second"); + } +} diff --git a/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/MyResource.java b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/MyResource.java new file mode 100644 index 0000000000..3ddf0f52e0 --- /dev/null +++ b/core-java-modules/core-java-exceptions/src/main/java/com/baeldung/trywithresource/MyResource.java @@ -0,0 +1,8 @@ +package com.baeldung.trywithresource; + +public class MyResource implements AutoCloseable { + @Override + public void close() throws Exception { + System.out.println("Closed MyResource"); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exception/error/ErrorGeneratorUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exception/error/ErrorGeneratorUnitTest.java deleted file mode 100644 index 6dcd0d72e0..0000000000 --- a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exception/error/ErrorGeneratorUnitTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.exception.error; - -import org.junit.Assert; -import org.junit.Test; - -public class ErrorGeneratorUnitTest { - - @Test(expected = AssertionError.class) - public void whenError_thenIsNotCaughtByCatchException() { - try { - throw new AssertionError(); - } catch (Exception e) { - Assert.fail(); // errors are not caught by catch exception - } - } - - @Test - public void whenError_thenIsCaughtByCatchError() { - try { - throw new AssertionError(); - } catch (Error e) { - // caught! -> test pass - } - } -} \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exception/numberformat/NumberFormatExceptionUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exception/numberformat/NumberFormatExceptionUnitTest.java deleted file mode 100644 index cb26bf451a..0000000000 --- a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exception/numberformat/NumberFormatExceptionUnitTest.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.baeldung.exception.numberformat; - -import static org.junit.Assert.assertEquals; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.text.NumberFormat; -import java.text.ParseException; -import java.util.Locale; -import java.util.logging.Logger; - -import org.junit.Test; - -/** - * A set of examples tested to show cases where NumberFormatException is thrown and not thrown. - */ -public class NumberFormatExceptionUnitTest { - - Logger LOG = Logger.getLogger(NumberFormatExceptionUnitTest.class.getName()); - - /* ---INTEGER FAIL CASES--- */ - @Test(expected = NumberFormatException.class) - public void givenByteConstructor_whenAlphabetAsInput_thenFail() { - Byte byteInt = new Byte("one"); - } - - @Test(expected = NumberFormatException.class) - public void givenShortConstructor_whenSpaceInInput_thenFail() { - Short shortInt = new Short("2 "); - } - - @Test(expected = NumberFormatException.class) - public void givenParseIntMethod_whenSpaceInInput_thenFail() { - Integer aIntPrim = Integer.parseInt("6000 "); - } - - @Test(expected = NumberFormatException.class) - public void givenParseIntMethod_whenUnderscoreInInput_thenFail() { - int bIntPrim = Integer.parseInt("_6000"); - } - - @Test(expected = NumberFormatException.class) - public void givenIntegerValueOfMethod_whenCommaInInput_thenFail() { - Integer cIntPrim = Integer.valueOf("6,000"); - } - - @Test(expected = NumberFormatException.class) - public void givenBigIntegerConstructor_whenDecimalInInput_thenFail() { - BigInteger bigInteger = new BigInteger("4.0"); - } - - @Test(expected = NumberFormatException.class) - public void givenDecodeMethod_whenAlphabetInInput_thenFail() { - Long decodedLong = Long.decode("64403L"); - } - - /* ---INTEGER PASS CASES--- */ - @Test - public void givenInvalidNumberInputs_whenOptimized_thenPass() { - Byte byteInt = new Byte("1"); - assertEquals(1, byteInt.intValue()); - - Short shortInt = new Short("2 ".trim()); - assertEquals(2, shortInt.intValue()); - - Integer aIntObj = Integer.valueOf("6"); - assertEquals(6, aIntObj.intValue()); - - BigInteger bigInteger = new BigInteger("4"); - assertEquals(4, bigInteger.intValue()); - - int aIntPrim = Integer.parseInt("6000 ".trim()); - assertEquals(6000, aIntPrim); - - int bIntPrim = Integer.parseInt("_6000".replaceAll("_", "")); - assertEquals(6000, bIntPrim); - - int cIntPrim = Integer.parseInt("-6000"); - assertEquals(-6000, cIntPrim); - - Long decodeInteger = Long.decode("644032334"); - assertEquals(644032334L, decodeInteger.longValue()); - } - - /* ---DOUBLE FAIL CASES--- */ - @Test(expected = NumberFormatException.class) - public void givenFloatConstructor_whenAlphabetInInput_thenFail() { - Float floatDecimalObj = new Float("one.1"); - } - - @Test(expected = NumberFormatException.class) - public void givenDoubleConstructor_whenAlphabetInInput_thenFail() { - Double doubleDecimalObj = new Double("two.2"); - } - - @Test(expected = NumberFormatException.class) - public void givenBigDecimalConstructor_whenSpecialCharsInInput_thenFail() { - BigDecimal bigDecimalObj = new BigDecimal("3_0.3"); - } - - @Test(expected = NumberFormatException.class) - public void givenParseDoubleMethod_whenCommaInInput_thenFail() { - double aDoublePrim = Double.parseDouble("4000,1"); - } - - /* ---DOUBLE PASS CASES--- */ - @Test - public void givenDoubleConstructor_whenDecimalInInput_thenPass() { - Double doubleDecimalObj = new Double("2.2"); - assertEquals(2.2, doubleDecimalObj.doubleValue(), 0); - } - - @Test - public void givenDoubleValueOfMethod_whenMinusInInput_thenPass() { - Double aDoubleObj = Double.valueOf("-6000"); - assertEquals(-6000, aDoubleObj.doubleValue(), 0); - } - - @Test - public void givenUsDecimalNumber_whenParsedWithNumberFormat_thenPass() throws ParseException { - Number parsedNumber = parseNumberWithLocale("4000.1", Locale.US); - assertEquals(4000.1, parsedNumber); - assertEquals(4000.1, parsedNumber.doubleValue(), 0); - assertEquals(4000, parsedNumber.intValue()); - } - - /** - * In most European countries (for example, France), comma is used as decimal in place of period. - * @throws ParseException if the input string contains special characters other than comma or decimal. - * In this test case, anything after decimal (period) is dropped when a European locale is set. - */ - @Test - public void givenEuDecimalNumberHasComma_whenParsedWithNumberFormat_thenPass() throws ParseException { - Number parsedNumber = parseNumberWithLocale("4000,1", Locale.FRANCE); - LOG.info("Number parsed is: " + parsedNumber); - assertEquals(4000.1, parsedNumber); - assertEquals(4000.1, parsedNumber.doubleValue(), 0); - assertEquals(4000, parsedNumber.intValue()); - } - - /** - * Converts a string into a number retaining all decimals, and symbols valid in a locale. - * @param number the input string for a number. - * @param locale the locale to consider while parsing a number. - * @return the generic number object which can represent multiple number types. - * @throws ParseException when input contains invalid characters. - */ - private Number parseNumberWithLocale(String number, Locale locale) throws ParseException { - locale = locale == null ? Locale.getDefault() : locale; - NumberFormat numberFormat = NumberFormat.getInstance(locale); - return numberFormat.parse(number); - } - -} diff --git a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/CheckedUncheckedExceptionsUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/CheckedUncheckedExceptionsUnitTest.java deleted file mode 100644 index d82b1349d8..0000000000 --- a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/CheckedUncheckedExceptionsUnitTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.baeldung.exceptions; - -import static org.junit.jupiter.api.Assertions.assertThrows; - -import java.io.FileNotFoundException; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -/** - * Tests the {@link CheckedUncheckedExceptions}. - */ -public class CheckedUncheckedExceptionsUnitTest { - - @Test - public void whenFileNotExist_thenThrowException() { - assertThrows(FileNotFoundException.class, () -> { - CheckedUncheckedExceptions.checkedExceptionWithThrows(); - }); - } - - @Test - public void whenTryCatchExcetpion_thenSuccess() { - try { - CheckedUncheckedExceptions.checkedExceptionWithTryCatch(); - } catch (Exception e) { - Assertions.fail(e.getMessage()); - } - } - - @Test - public void whenDivideByZero_thenThrowException() { - assertThrows(ArithmeticException.class, () -> { - CheckedUncheckedExceptions.divideByZero(); - }); - } - - @Test - public void whenInvalidFile_thenThrowException() { - - assertThrows(IncorrectFileNameException.class, () -> { - CheckedUncheckedExceptions.checkFile("wrongFileName.txt"); - }); - } - - @Test - public void whenNullOrEmptyFile_thenThrowException() { - assertThrows(NullOrEmptyException.class, () -> { - CheckedUncheckedExceptions.checkFile(null); - }); - assertThrows(NullOrEmptyException.class, () -> { - CheckedUncheckedExceptions.checkFile(""); - }); - } -} diff --git a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/GlobalExceptionHandlerUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/GlobalExceptionHandlerUnitTest.java deleted file mode 100644 index 394de9c576..0000000000 --- a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/GlobalExceptionHandlerUnitTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.baeldung.exceptions; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; -import org.slf4j.LoggerFactory; -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.Logger; -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.classic.spi.LoggingEvent; -import ch.qos.logback.core.Appender; -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.verify; - -@RunWith(MockitoJUnitRunner.class) -public class GlobalExceptionHandlerUnitTest { - - @Mock - private Appender mockAppender; - - @Captor - private ArgumentCaptor captorLoggingEvent; - - @Before - public void setup() { - final Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); - logger.addAppender(mockAppender); - - Handler globalExceptionHandler = new Handler(); - Thread.setDefaultUncaughtExceptionHandler(globalExceptionHandler); - } - - @After - public void teardown() { - final Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); - logger.detachAppender(mockAppender); - } - - @Test - public void whenArithmeticException_thenUseUncaughtExceptionHandler() throws InterruptedException { - - Thread globalExceptionHandlerThread = new Thread() { - public void run() { - GlobalExceptionHandler globalExceptionHandlerObj = new GlobalExceptionHandler(); - globalExceptionHandlerObj.performArithmeticOperation(99, 0); - } - }; - - globalExceptionHandlerThread.start(); - globalExceptionHandlerThread.join(); - - verify(mockAppender).doAppend(captorLoggingEvent.capture()); - LoggingEvent loggingEvent = captorLoggingEvent.getValue(); - - assertThat(loggingEvent.getLevel()).isEqualTo(Level.INFO); - assertThat(loggingEvent.getFormattedMessage()).isEqualTo("Unhandled exception caught!"); - } - -} diff --git a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/RootCauseFinderUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/RootCauseFinderUnitTest.java deleted file mode 100644 index 5d0f3b9c3e..0000000000 --- a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/RootCauseFinderUnitTest.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.baeldung.exceptions; - -import com.google.common.base.Throwables; -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.time.LocalDate; -import java.time.format.DateTimeParseException; -import java.time.temporal.ChronoUnit; - -import static com.baeldung.exceptions.RootCauseFinder.*; -import static org.junit.jupiter.api.Assertions.assertTrue; - -/** - * Tests the {@link RootCauseFinder}. - */ -public class RootCauseFinderUnitTest { - - @Test - public void givenBirthDate_whenCalculatingAge_thenAgeReturned() { - try { - int age = AgeCalculator.calculateAge("1990-01-01"); - Assertions.assertEquals(1990, LocalDate - .now() - .minus(age, ChronoUnit.YEARS) - .getYear()); - } catch (CalculationException e) { - Assertions.fail(e.getMessage()); - } - } - - @Test - public void givenWrongFormatDate_whenFindingRootCauseUsingJava_thenRootCauseFound() { - try { - AgeCalculator.calculateAge("010102"); - } catch (CalculationException ex) { - assertTrue(findCauseUsingPlainJava(ex) instanceof DateTimeParseException); - } - } - - @Test - public void givenOutOfRangeDate_whenFindingRootCauseUsingJava_thenRootCauseFound() { - try { - AgeCalculator.calculateAge("2020-04-04"); - } catch (CalculationException ex) { - assertTrue(findCauseUsingPlainJava(ex) instanceof DateOutOfRangeException); - } - } - - @Test - public void givenNullDate_whenFindingRootCauseUsingJava_thenRootCauseFound() { - try { - AgeCalculator.calculateAge(null); - } catch (Exception ex) { - assertTrue(findCauseUsingPlainJava(ex) instanceof IllegalArgumentException); - } - } - - @Test - public void givenWrongFormatDate_whenFindingRootCauseUsingApacheCommons_thenRootCauseFound() { - try { - AgeCalculator.calculateAge("010102"); - } catch (CalculationException ex) { - assertTrue(ExceptionUtils.getRootCause(ex) instanceof DateTimeParseException); - } - } - - @Test - public void givenOutOfRangeDate_whenFindingRootCauseUsingApacheCommons_thenRootCauseFound() { - try { - AgeCalculator.calculateAge("2020-04-04"); - } catch (CalculationException ex) { - assertTrue(ExceptionUtils.getRootCause(ex) instanceof DateOutOfRangeException); - } - } - - @Test - public void givenNullDate_whenFindingRootCauseUsingApacheCommons_thenRootCauseNotFound() { - try { - AgeCalculator.calculateAge(null); - } catch (Exception ex) { - assertTrue(ExceptionUtils.getRootCause(ex) instanceof IllegalArgumentException); - } - } - - @Test - public void givenWrongFormatDate_whenFindingRootCauseUsingGuava_thenRootCauseFound() { - try { - AgeCalculator.calculateAge("010102"); - } catch (CalculationException ex) { - assertTrue(Throwables.getRootCause(ex) instanceof DateTimeParseException); - } - } - - @Test - public void givenOutOfRangeDate_whenFindingRootCauseUsingGuava_thenRootCauseFound() { - try { - AgeCalculator.calculateAge("2020-04-04"); - } catch (CalculationException ex) { - assertTrue(Throwables.getRootCause(ex) instanceof DateOutOfRangeException); - } - } - - @Test - public void givenNullDate_whenFindingRootCauseUsingGuava_thenRootCauseFound() { - try { - AgeCalculator.calculateAge(null); - } catch (Exception ex) { - assertTrue(Throwables.getRootCause(ex) instanceof IllegalArgumentException); - } - } - -} diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/classnotfoundexception/ClassNotFoundExceptionUnitTest.java similarity index 84% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionUnitTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/classnotfoundexception/ClassNotFoundExceptionUnitTest.java index 59605fb1c9..9311a9d886 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/classnotfoundexception/ClassNotFoundExceptionUnitTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/classnotfoundexception/ClassNotFoundExceptionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.classnotfoundexception; +package com.baeldung.exceptions.classnotfoundexception; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileExtensionExceptionUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/customexception/IncorrectFileExtensionExceptionUnitTest.java similarity index 95% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileExtensionExceptionUnitTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/customexception/IncorrectFileExtensionExceptionUnitTest.java index 230698f719..80787daaaa 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileExtensionExceptionUnitTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/customexception/IncorrectFileExtensionExceptionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.customexception; +package com.baeldung.exceptions.customexception; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileNameExceptionUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/customexception/IncorrectFileNameExceptionUnitTest.java similarity index 92% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileNameExceptionUnitTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/customexception/IncorrectFileNameExceptionUnitTest.java index acb05eb763..8e135c1cec 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/customexception/IncorrectFileNameExceptionUnitTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/customexception/IncorrectFileNameExceptionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.customexception; +package com.baeldung.exceptions.customexception; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/exceptionhandling/ExceptionsUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/exceptionhandling/ExceptionsUnitTest.java similarity index 97% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/exceptionhandling/ExceptionsUnitTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/exceptionhandling/ExceptionsUnitTest.java index 29c690133d..3551de3631 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/exceptionhandling/ExceptionsUnitTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/exceptionhandling/ExceptionsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.exceptionhandling; +package com.baeldung.exceptions.exceptionhandling; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java similarity index 85% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java index 521c50098a..135a51f9dd 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/noclassdeffounderror/NoClassDefFoundErrorUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.noclassdeffounderror; +package com.baeldung.exceptions.noclassdeffounderror; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyRunnableUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/sneakythrows/SneakyRunnableUnitTest.java similarity index 89% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyRunnableUnitTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/sneakythrows/SneakyRunnableUnitTest.java index 8d8e4f14fe..086c4eaef0 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyRunnableUnitTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/sneakythrows/SneakyRunnableUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.sneakythrows; +package com.baeldung.exceptions.sneakythrows; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyThrowsUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/sneakythrows/SneakyThrowsUnitTest.java similarity index 89% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyThrowsUnitTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/sneakythrows/SneakyThrowsUnitTest.java index da1b2e617b..3b70128a9b 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/sneakythrows/SneakyThrowsUnitTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/sneakythrows/SneakyThrowsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.sneakythrows; +package com.baeldung.exceptions.sneakythrows; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/AccountHolderManualTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/AccountHolderManualTest.java similarity index 82% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/AccountHolderManualTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/AccountHolderManualTest.java index 180b7723ac..dac8698bf8 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/AccountHolderManualTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/AccountHolderManualTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/CyclicDependancyManualTest.java similarity index 81% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/CyclicDependancyManualTest.java index 95164ac935..db6b1d45f8 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/CyclicDependancyManualTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/CyclicDependancyManualTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java similarity index 95% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java index ccf8c25271..2c7289cd5c 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/InfiniteRecursionWithTerminationConditionManualTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java similarity index 89% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java index 40c2c4799e..e7fb0874ea 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/RecursionWithCorrectTerminationConditionManualTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java similarity index 94% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java index f4e2e5221a..0f1d71034d 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/stackoverflowerror/UnintendedInfiniteRecursionManualTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stackoverflowerror; +package com.baeldung.exceptions.stackoverflowerror; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/throwsexception/SimpleServiceUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/throwvsthrows/SimpleServiceUnitTest.java similarity index 92% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/throwsexception/SimpleServiceUnitTest.java rename to core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/throwvsthrows/SimpleServiceUnitTest.java index b9a658a960..87f6224217 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/throwsexception/SimpleServiceUnitTest.java +++ b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exceptions/throwvsthrows/SimpleServiceUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.throwsexception; +package com.baeldung.exceptions.throwvsthrows; import org.junit.jupiter.api.Test; diff --git a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/java8/JavaTryWithResourcesLongRunningUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/java8/JavaTryWithResourcesLongRunningUnitTest.java deleted file mode 100644 index 32879aed0c..0000000000 --- a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/java8/JavaTryWithResourcesLongRunningUnitTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.baeldung.java8; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.Date; -import java.util.Scanner; - -import org.junit.Assert; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class JavaTryWithResourcesLongRunningUnitTest { - - private static final Logger LOG = LoggerFactory.getLogger(JavaTryWithResourcesLongRunningUnitTest.class); - - private static final String TEST_STRING_HELLO_WORLD = "Hello World"; - private Date resource1Date, resource2Date; - - // tests - - /* Example for using Try_with_resources */ - @Test - public void whenWritingToStringWriter_thenCorrectlyWritten() { - final StringWriter sw = new StringWriter(); - try (PrintWriter pw = new PrintWriter(sw, true)) { - pw.print(TEST_STRING_HELLO_WORLD); - } - - Assert.assertEquals(sw.getBuffer() - .toString(), TEST_STRING_HELLO_WORLD); - } - - /* Example for using multiple resources */ - @Test - public void givenStringToScanner_whenWritingToStringWriter_thenCorrectlyWritten() { - - final StringWriter sw = new StringWriter(); - try (Scanner sc = new Scanner(TEST_STRING_HELLO_WORLD); PrintWriter pw = new PrintWriter(sw, true)) { - while (sc.hasNext()) { - pw.print(sc.nextLine()); - } - } - - Assert.assertEquals(sw.getBuffer() - .toString(), TEST_STRING_HELLO_WORLD); - } - - /* Example to show order in which the resources are closed */ - @Test - public void whenFirstAutoClosableResourceIsinitializedFirst_thenFirstAutoClosableResourceIsReleasedFirst() throws Exception { - try (AutoCloseableResourcesFirst af = new AutoCloseableResourcesFirst(); AutoCloseableResourcesSecond as = new AutoCloseableResourcesSecond()) { - af.doSomething(); - as.doSomething(); - } - Assert.assertTrue(resource1Date.after(resource2Date)); - } - - class AutoCloseableResourcesFirst implements AutoCloseable { - public AutoCloseableResourcesFirst() { - LOG.debug("Constructor -> AutoCloseableResources_First"); - } - - public void doSomething() { - LOG.debug("Something -> AutoCloseableResources_First"); - } - - @Override - public void close() throws Exception { - LOG.debug("Closed AutoCloseableResources_First"); - resource1Date = new Date(); - } - } - - class AutoCloseableResourcesSecond implements AutoCloseable { - public AutoCloseableResourcesSecond() { - LOG.debug("Constructor -> AutoCloseableResources_Second"); - } - - public void doSomething() { - LOG.debug("Something -> AutoCloseableResources_Second"); - } - - @Override - public void close() throws Exception { - LOG.debug("Closed AutoCloseableResources_Second"); - resource2Date = new Date(); - Thread.sleep(10000); - } - } - -} \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/optional/PersonRepositoryUnitTest.java b/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/optional/PersonRepositoryUnitTest.java deleted file mode 100644 index 4efa625ccd..0000000000 --- a/core-java-modules/core-java-exceptions/src/test/java/com/baeldung/optional/PersonRepositoryUnitTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.baeldung.optional; - -import org.junit.Test; - -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertAll; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - -public class PersonRepositoryUnitTest { - - PersonRepository personRepository = new PersonRepository(); - - @Test - public void whenIdIsNull_thenExceptionIsThrown() { - assertThrows(IllegalArgumentException.class, - () -> - Optional - .ofNullable(personRepository.findNameById(null)) - .orElseThrow(IllegalArgumentException::new)); - } - - @Test - public void whenIdIsNonNull_thenNoExceptionIsThrown() { - assertAll( - () -> - Optional - .ofNullable(personRepository.findNameById("id")) - .orElseThrow(RuntimeException::new)); - } - - @Test - public void whenIdNonNull_thenReturnsNameUpperCase() { - String name = Optional - .ofNullable(personRepository.findNameById("id")) - .map(String::toUpperCase) - .orElseThrow(RuntimeException::new); - - assertEquals("NAME", name); - } - -} \ No newline at end of file diff --git a/core-java-modules/core-java-lang/src/test/resources/correctFileNameWithoutProperExtension b/core-java-modules/core-java-exceptions/src/test/resources/correctFileNameWithoutProperExtension similarity index 100% rename from core-java-modules/core-java-lang/src/test/resources/correctFileNameWithoutProperExtension rename to core-java-modules/core-java-exceptions/src/test/resources/correctFileNameWithoutProperExtension diff --git a/core-java-modules/core-java-function/README.md b/core-java-modules/core-java-function/README.md new file mode 100644 index 0000000000..677f148bdb --- /dev/null +++ b/core-java-modules/core-java-function/README.md @@ -0,0 +1,6 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [Java 8 Predicate Chain](https://www.baeldung.com/java-predicate-chain) \ No newline at end of file diff --git a/core-java-modules/core-java-function/pom.xml b/core-java-modules/core-java-function/pom.xml new file mode 100644 index 0000000000..22b2fd9bda --- /dev/null +++ b/core-java-modules/core-java-function/pom.xml @@ -0,0 +1,40 @@ + + 4.0.0 + core-java-function + 0.1.0-SNAPSHOT + core-java-function + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-function + + + src/main/resources + true + + + + + + + 3.6.1 + + diff --git a/java-strings-ops/src/main/resources/logback.xml b/core-java-modules/core-java-function/src/main/resources/logback.xml similarity index 100% rename from java-strings-ops/src/main/resources/logback.xml rename to core-java-modules/core-java-function/src/main/resources/logback.xml diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/Java8PredicateChainUnitTest.java b/core-java-modules/core-java-function/src/test/java/com/baeldung/java8/Java8PredicateChainUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/Java8PredicateChainUnitTest.java rename to core-java-modules/core-java-function/src/test/java/com/baeldung/java8/Java8PredicateChainUnitTest.java diff --git a/core-java-modules/core-java-io-2/.gitignore b/core-java-modules/core-java-io-2/.gitignore index de044ef20f..c61d35324d 100644 --- a/core-java-modules/core-java-io-2/.gitignore +++ b/core-java-modules/core-java-io-2/.gitignore @@ -1,3 +1,5 @@ -# Intellij -.idea/ -*.iml +0.* + +# Files generated by integration tests +# *.txt +/temp \ No newline at end of file diff --git a/core-java-modules/core-java-io-2/README.md b/core-java-modules/core-java-io-2/README.md new file mode 100644 index 0000000000..3251d2153e --- /dev/null +++ b/core-java-modules/core-java-io-2/README.md @@ -0,0 +1,15 @@ +## Core Java IO + +This module contains articles about core Java input and output (IO) + +### Relevant Articles: +- [Create a File in a Specific Directory in Java](https://www.baeldung.com/java-create-file-in-directory) +- [How to Read a Large File Efficiently with Java](https://www.baeldung.com/java-read-lines-large-file) +- [Java – Write to File](https://www.baeldung.com/java-write-to-file) +- [FileNotFoundException in Java](https://www.baeldung.com/java-filenotfound-exception) +- [Delete the Contents of a File in Java](https://www.baeldung.com/java-delete-file-contents) +- [List Files in a Directory in Java](https://www.baeldung.com/java-list-directory-files) +- [Java – Append Data to a File](https://www.baeldung.com/java-append-to-file) +- [How to Copy a File with Java](https://www.baeldung.com/java-copy-file) +- [Create a Directory in Java](https://www.baeldung.com/java-create-directory) +- [[<-- Prev]](/core-java-modules/core-java-io) diff --git a/core-java-modules/core-java-io-2/pom.xml b/core-java-modules/core-java-io-2/pom.xml index 64d9434beb..dd0f8931c3 100644 --- a/core-java-modules/core-java-io-2/pom.xml +++ b/core-java-modules/core-java-io-2/pom.xml @@ -16,57 +16,16 @@ - net.sourceforge.collections - collections-generic - ${collections-generic.version} - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} + com.google.guava + guava + ${guava.version} + commons-io commons-io ${commons-io.version} - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.apache.commons - commons-math3 - ${commons-math3.version} - - - org.decimal4j - decimal4j - ${decimal4j.version} - - - org.bouncycastle - bcprov-jdk15on - ${bouncycastle.version} - - - org.unix4j - unix4j-command - ${unix4j.version} - - - com.googlecode.grep4j - grep4j - ${grep4j.version} - - - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - log4j @@ -78,12 +37,6 @@ log4j-over-slf4j ${org.slf4j.version} - - org.projectlombok - lombok - ${lombok.version} - provided - org.assertj @@ -91,86 +44,6 @@ ${assertj.version} test - - com.jayway.awaitility - awaitility - ${avaitility.version} - test - - - commons-codec - commons-codec - ${commons-codec.version} - - - org.javamoney - moneta - ${moneta.version} - - - org.owasp.esapi - esapi - ${esapi.version} - - - com.sun.messaging.mq - fscontext - ${fscontext.version} - - - com.codepoetics - protonpack - ${protonpack.version} - - - one.util - streamex - ${streamex.version} - - - io.vavr - vavr - ${vavr.version} - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator-annprocess.version} - - - org.hsqldb - hsqldb - ${hsqldb.version} - runtime - - - - org.asynchttpclient - async-http-client - ${async-http-client.version} - - - com.opencsv - opencsv - ${opencsv.version} - test - - - - org.apache.tika - tika-core - ${tika.version} - - - net.sf.jmimemagic - jmimemagic - ${jmime-magic.version} - @@ -182,22 +55,6 @@ - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - java - com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed - - -Xmx300m - -XX:+UseParallelGC - -classpath - - com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed - - - org.apache.maven.plugins maven-javadoc-plugin @@ -210,70 +67,9 @@ - - - integration - - - - org.codehaus.mojo - exec-maven-plugin - - - - run-benchmarks - - none - - exec - - - test - java - - -classpath - - org.openjdk.jmh.Main - .* - - - - - - - - - - - - - 1.55 - 1.10 - 3.6.1 - 1.0.3 - 4.1 - 4.01 - 0.4 - 1.8.7 - 4.6-b01 - 1.13 - 0.6.5 - 0.9.0 - 4.1 - 3.6.1 - 1.7.0 - - 3.0.0-M1 - 2.4.0 - 2.1.0.1 - 1.19 - 2.4.5 - - 1.18 - 0.1.5 \ No newline at end of file diff --git a/core-java-modules/core-java-io-2/src/main/java/com/baeldung/filereader/FileReaderExample.java b/core-java-modules/core-java-io-2/src/main/java/com/baeldung/filereader/FileReaderExample.java deleted file mode 100644 index 34a8f61615..0000000000 --- a/core-java-modules/core-java-io-2/src/main/java/com/baeldung/filereader/FileReaderExample.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.baeldung.filereader; - -import java.io.*; - -public class FileReaderExample { - - public static String readAllCharactersOneByOne(Reader reader) throws IOException { - StringBuilder content = new StringBuilder(); - int nextChar; - while ((nextChar = reader.read()) != -1) { - content.append((char) nextChar); - } - return String.valueOf(content); - } - - public static String readMultipleCharacters(Reader reader, int length) throws IOException { - char[] buffer = new char[length]; - int charactersRead = reader.read(buffer, 0, length); - - - if (charactersRead != -1) { - return new String(buffer, 0, charactersRead); - } else { - return ""; - } - } - - public static String readFile(String path) { - FileReader fileReader = null; - try { - fileReader = new FileReader(path); - return readAllCharactersOneByOne(fileReader); - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (fileReader != null) { - try { - fileReader.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return null; - } - - public static String readFileUsingTryWithResources(String path) { - try (FileReader fileReader = new FileReader(path)) { - return readAllCharactersOneByOne(fileReader); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - -} \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/files/ListFiles.java b/core-java-modules/core-java-io-2/src/main/java/com/baeldung/listfiles/ListFiles.java similarity index 98% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/files/ListFiles.java rename to core-java-modules/core-java-io-2/src/main/java/com/baeldung/listfiles/ListFiles.java index c5de36270c..2275128dfe 100644 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/files/ListFiles.java +++ b/core-java-modules/core-java-io-2/src/main/java/com/baeldung/listfiles/ListFiles.java @@ -1,4 +1,4 @@ -package com.baeldung.files; +package com.baeldung.listfiles; import java.io.File; import java.io.IOException; diff --git a/core-java-modules/core-java-io-2/src/test/java/com/baeldung/appendtofile/AppendToFileManualTest.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/appendtofile/AppendToFileManualTest.java new file mode 100644 index 0000000000..5d0382c64c --- /dev/null +++ b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/appendtofile/AppendToFileManualTest.java @@ -0,0 +1,80 @@ +package com.baeldung.appendtofile; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; + +import com.google.common.base.Charsets; +import com.google.common.io.CharSink; +import com.google.common.io.FileWriteMode; +import org.apache.commons.io.FileUtils; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class AppendToFileManualTest { + + public static final String fileName = "src/main/resources/countries.properties"; + + @Before + @After + public void setup() throws Exception { + PrintWriter writer = new PrintWriter(fileName); + writer.print("UK\r\n" + "US\r\n" + "Germany\r\n"); + writer.close(); + } + + @Test + public void whenAppendToFileUsingGuava_thenCorrect() throws IOException { + File file = new File(fileName); + CharSink chs = com.google.common.io.Files.asCharSink(file, Charsets.UTF_8, FileWriteMode.APPEND); + chs.write("Spain\r\n"); + + assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); + } + + @Test + public void whenAppendToFileUsingFiles_thenCorrect() throws IOException { + Files.write(Paths.get(fileName), "Spain\r\n".getBytes(), StandardOpenOption.APPEND); + + assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); + } + + @Test + public void whenAppendToFileUsingFileUtils_thenCorrect() throws IOException { + File file = new File(fileName); + FileUtils.writeStringToFile(file, "Spain\r\n", StandardCharsets.UTF_8, true); + + assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); + } + + @Test + public void whenAppendToFileUsingFileOutputStream_thenCorrect() throws Exception { + FileOutputStream fos = new FileOutputStream(fileName, true); + fos.write("Spain\r\n".getBytes()); + fos.close(); + + assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); + } + + @Test + public void whenAppendToFileUsingFileWriter_thenCorrect() throws IOException { + FileWriter fw = new FileWriter(fileName, true); + BufferedWriter bw = new BufferedWriter(fw); + bw.write("Spain"); + bw.newLine(); + bw.close(); + + assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-io-2/src/test/java/com/baeldung/appendtofile/StreamUtils.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/appendtofile/StreamUtils.java new file mode 100644 index 0000000000..846735fae2 --- /dev/null +++ b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/appendtofile/StreamUtils.java @@ -0,0 +1,16 @@ +package com.baeldung.appendtofile; + +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; + +public class StreamUtils { + + public static String getStringFromInputStream(InputStream input) throws IOException { + StringWriter writer = new StringWriter(); + IOUtils.copy(input, writer, "UTF-8"); + return writer.toString(); + } +} diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/copyfiles/FileCopierIntegrationTest.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/copyfiles/FileCopierIntegrationTest.java similarity index 100% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/copyfiles/FileCopierIntegrationTest.java rename to core-java-modules/core-java-io-2/src/test/java/com/baeldung/copyfiles/FileCopierIntegrationTest.java diff --git a/core-java-modules/core-java-io-2/src/test/java/com/baeldung/createfiles/CreateFilesUnitTest.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/createfiles/CreateFilesUnitTest.java new file mode 100644 index 0000000000..995d2b56ce --- /dev/null +++ b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/createfiles/CreateFilesUnitTest.java @@ -0,0 +1,60 @@ +package com.baeldung.createfiles; + +import com.google.common.io.Files; +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import org.junit.BeforeClass; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class CreateFilesUnitTest { + + @BeforeClass + public static void clean() { + File tempDirectory = new File(System.getProperty("java.io.tmpdir")); + File file1 = new File(tempDirectory.getAbsolutePath() + "/testFile.txt"); + File file2 = new File(tempDirectory, "newFile.txt"); + File file3 = new File(tempDirectory.getAbsolutePath() + File.separator + "newFile2.txt"); + file1.delete(); + file2.delete(); + file3.delete(); + } + + @Test + public void givenAnExistingDirectory_whenCreatingAFileWithAbsolutePath_thenFileIsCreated() throws IOException { + File tempDirectory = new File(System.getProperty("java.io.tmpdir")); + File fileWithAbsolutePath = new File(tempDirectory.getAbsolutePath() + "/testFile.txt"); + + assertFalse(fileWithAbsolutePath.exists()); + + Files.touch(fileWithAbsolutePath); + + assertTrue(fileWithAbsolutePath.exists()); + } + + @Test + public void givenAnExistingDirectory_whenCreatingANewDirectoryAndFileWithRelativePath_thenFileIsCreated() throws IOException { + File tempDirectory = new File(System.getProperty("java.io.tmpdir")); + File fileWithRelativePath = new File(tempDirectory, "newFile.txt"); + + assertFalse(fileWithRelativePath.exists()); + + Files.touch(fileWithRelativePath); + + assertTrue(fileWithRelativePath.exists()); + } + + @Test + public void whenCreatingAFileWithFileSeparator_thenFileIsCreated() throws IOException { + File tempDirectory = new File(System.getProperty("java.io.tmpdir")); + File newFile = new File(tempDirectory.getAbsolutePath() + File.separator + "newFile2.txt"); + + assertFalse(newFile.exists()); + + Files.touch(newFile); + + assertTrue(newFile.exists()); + } +} diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/file/FilesClearDataUnitTest.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/deletecontents/FilesClearDataUnitTest.java similarity index 98% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/file/FilesClearDataUnitTest.java rename to core-java-modules/core-java-io-2/src/test/java/com/baeldung/deletecontents/FilesClearDataUnitTest.java index 8302124f32..470e260f57 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/file/FilesClearDataUnitTest.java +++ b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/deletecontents/FilesClearDataUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.file; +package com.baeldung.deletecontents; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -20,8 +20,6 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import com.baeldung.util.StreamUtils; - public class FilesClearDataUnitTest { public static final String FILE_PATH = "src/test/resources/fileexample.txt"; diff --git a/core-java-modules/core-java-io-2/src/test/java/com/baeldung/deletecontents/StreamUtils.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/deletecontents/StreamUtils.java new file mode 100644 index 0000000000..3584b3f2d9 --- /dev/null +++ b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/deletecontents/StreamUtils.java @@ -0,0 +1,16 @@ +package com.baeldung.deletecontents; + +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; + +public class StreamUtils { + + public static String getStringFromInputStream(InputStream input) throws IOException { + StringWriter writer = new StringWriter(); + IOUtils.copy(input, writer, "UTF-8"); + return writer.toString(); + } +} diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/directories/NewDirectoryUnitTest.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/directories/NewDirectoryUnitTest.java similarity index 100% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/directories/NewDirectoryUnitTest.java rename to core-java-modules/core-java-io-2/src/test/java/com/baeldung/directories/NewDirectoryUnitTest.java diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/core/exceptions/FileNotFoundExceptionUnitTest.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/filenotfoundexception/FileNotFoundExceptionUnitTest.java similarity index 97% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/core/exceptions/FileNotFoundExceptionUnitTest.java rename to core-java-modules/core-java-io-2/src/test/java/com/baeldung/filenotfoundexception/FileNotFoundExceptionUnitTest.java index 3f48049fe3..266cffb21a 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/core/exceptions/FileNotFoundExceptionUnitTest.java +++ b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/filenotfoundexception/FileNotFoundExceptionUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.core.exceptions; +package com.baeldung.filenotfoundexception; import org.junit.Test; import org.slf4j.Logger; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/file/ListFilesUnitTest.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/listfiles/ListFilesUnitTest.java similarity index 94% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/file/ListFilesUnitTest.java rename to core-java-modules/core-java-io-2/src/test/java/com/baeldung/listfiles/ListFilesUnitTest.java index 65710121cc..a87097f085 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/file/ListFilesUnitTest.java +++ b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/listfiles/ListFilesUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.file; +package com.baeldung.listfiles; import static org.junit.Assert.assertEquals; @@ -8,7 +8,7 @@ import java.util.Set; import org.junit.Test; -import com.baeldung.files.ListFiles; +import com.baeldung.listfiles.ListFiles; public class ListFilesUnitTest { diff --git a/core-java-modules/core-java-io-2/src/test/java/com/baeldung/readlargefile/ReadLargeFileUnitTest.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/readlargefile/ReadLargeFileUnitTest.java new file mode 100644 index 0000000000..b2923d9c01 --- /dev/null +++ b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/readlargefile/ReadLargeFileUnitTest.java @@ -0,0 +1,107 @@ +package com.baeldung.readlargefile; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Scanner; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.LineIterator; +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Charsets; +import com.google.common.io.Files; + +@Ignore("need large file for testing") +public class ReadLargeFileUnitTest { + protected final Logger logger = LoggerFactory.getLogger(getClass()); + + // tests - iterate lines in a file + + @Test + public final void givenUsingGuava_whenIteratingAFile_thenCorrect() throws IOException { + final String path = "G:\\full\\train\\input\\" + "trainDataNegative.csv"; + // final String path = "G:\\full\\train\\input\\" + "trainDataPositive.csv"; + + logMemory(); + Files.readLines(new File(path), Charsets.UTF_8); + logMemory(); + } + + @Test + public final void givenUsingCommonsIo_whenIteratingAFileInMemory_thenCorrect() throws IOException { + // final String path = "G:\\full\\train\\input\\" + "trainDataNegative.csv"; + final String path = "G:\\full\\train\\input\\" + "trainDataPositive.csv"; + + logMemory(); + FileUtils.readLines(new File(path)); + logMemory(); + } + + @Test + public final void whenStreamingThroughAFile_thenCorrect() throws IOException { + final String path = "G:\\full\\train\\input\\" + "trainDataNegative.csv"; + // final String path = "G:\\full\\train\\input\\" + "trainDataPositive.csv"; + + logMemory(); + + FileInputStream inputStream = null; + Scanner sc = null; + try { + inputStream = new FileInputStream(path); + sc = new Scanner(inputStream, "UTF-8"); + while (sc.hasNextLine()) { + final String line = sc.nextLine(); + // System.out.println(line); + } + // note that Scanner suppresses exceptions + if (sc.ioException() != null) { + throw sc.ioException(); + } + } finally { + if (inputStream != null) { + inputStream.close(); + } + if (sc != null) { + sc.close(); + } + } + + logMemory(); + } + + @Test + public final void givenUsingApacheIo_whenStreamingThroughAFile_thenCorrect() throws IOException { + final String path = "G:\\full\\train\\input\\" + "trainDataNegative.csv"; + // final String path = "G:\\full\\train\\input\\" + "trainDataPositive.csv"; + + logMemory(); + + final LineIterator it = FileUtils.lineIterator(new File(path), "UTF-8"); + try { + while (it.hasNext()) { + final String line = it.nextLine(); + // do something with line + } + } finally { + LineIterator.closeQuietly(it); + } + + logMemory(); + } + + // utils + + private final void logMemory() { + logger.info("Max Memory: {} Mb", Runtime.getRuntime() + .maxMemory() / 1048576); + logger.info("Total Memory: {} Mb", Runtime.getRuntime() + .totalMemory() / 1048576); + logger.info("Free Memory: {} Mb", Runtime.getRuntime() + .freeMemory() / 1048576); + } + +} diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/writetofile/JavaWriteToFileUnitTest.java b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/writetofile/JavaWriteToFileUnitTest.java similarity index 99% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/writetofile/JavaWriteToFileUnitTest.java rename to core-java-modules/core-java-io-2/src/test/java/com/baeldung/writetofile/JavaWriteToFileUnitTest.java index bdc6b34b5c..f53f26e349 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/writetofile/JavaWriteToFileUnitTest.java +++ b/core-java-modules/core-java-io-2/src/test/java/com/baeldung/writetofile/JavaWriteToFileUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.writetofile; +package com.baeldung.writetofile; import static org.junit.Assert.assertEquals; diff --git a/core-java-modules/core-java-io/src/test/resources/copiedWithApacheCommons.txt b/core-java-modules/core-java-io-2/src/test/resources/copiedWithApacheCommons.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/copiedWithApacheCommons.txt rename to core-java-modules/core-java-io-2/src/test/resources/copiedWithApacheCommons.txt diff --git a/core-java-modules/core-java-io/src/test/resources/copiedWithIo.txt b/core-java-modules/core-java-io-2/src/test/resources/copiedWithIo.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/copiedWithIo.txt rename to core-java-modules/core-java-io-2/src/test/resources/copiedWithIo.txt diff --git a/core-java-modules/core-java-io/src/test/resources/copiedWithNio.txt b/core-java-modules/core-java-io-2/src/test/resources/copiedWithNio.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/copiedWithNio.txt rename to core-java-modules/core-java-io-2/src/test/resources/copiedWithNio.txt diff --git a/core-java-modules/core-java-io/src/main/resources/countries.properties b/core-java-modules/core-java-io-2/src/test/resources/countries.properties similarity index 100% rename from core-java-modules/core-java-io/src/main/resources/countries.properties rename to core-java-modules/core-java-io-2/src/test/resources/countries.properties diff --git a/core-java-modules/core-java-io/src/test/resources/fileexample.txt b/core-java-modules/core-java-io-2/src/test/resources/fileexample.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/fileexample.txt rename to core-java-modules/core-java-io-2/src/test/resources/fileexample.txt diff --git a/core-java-modules/core-java-io/src/test/resources/listFilesUnitTestFolder/country.txt b/core-java-modules/core-java-io-2/src/test/resources/listFilesUnitTestFolder/country.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/listFilesUnitTestFolder/country.txt rename to core-java-modules/core-java-io-2/src/test/resources/listFilesUnitTestFolder/country.txt diff --git a/core-java-modules/core-java-io/src/test/resources/listFilesUnitTestFolder/employee.json b/core-java-modules/core-java-io-2/src/test/resources/listFilesUnitTestFolder/employee.json similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/listFilesUnitTestFolder/employee.json rename to core-java-modules/core-java-io-2/src/test/resources/listFilesUnitTestFolder/employee.json diff --git a/core-java-modules/core-java-io/src/test/resources/fileNameFilterManualTestFolder/students.json b/core-java-modules/core-java-io-2/src/test/resources/listFilesUnitTestFolder/students.json similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/fileNameFilterManualTestFolder/students.json rename to core-java-modules/core-java-io-2/src/test/resources/listFilesUnitTestFolder/students.json diff --git a/core-java-modules/core-java-io/src/test/resources/listFilesUnitTestFolder/test.xml b/core-java-modules/core-java-io-2/src/test/resources/listFilesUnitTestFolder/test.xml similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/listFilesUnitTestFolder/test.xml rename to core-java-modules/core-java-io-2/src/test/resources/listFilesUnitTestFolder/test.xml diff --git a/core-java-modules/core-java-io/src/test/resources/original.txt b/core-java-modules/core-java-io-2/src/test/resources/original.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/original.txt rename to core-java-modules/core-java-io-2/src/test/resources/original.txt diff --git a/core-java-modules/core-java-io/src/test/resources/test_write.txt b/core-java-modules/core-java-io-2/src/test/resources/test_write.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/test_write.txt rename to core-java-modules/core-java-io-2/src/test/resources/test_write.txt diff --git a/core-java-modules/core-java-io/src/test/resources/test_write_1.txt b/core-java-modules/core-java-io-2/src/test/resources/test_write_1.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/test_write_1.txt rename to core-java-modules/core-java-io-2/src/test/resources/test_write_1.txt diff --git a/core-java-modules/core-java-io/src/test/resources/test_write_2.txt b/core-java-modules/core-java-io-2/src/test/resources/test_write_2.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/test_write_2.txt rename to core-java-modules/core-java-io-2/src/test/resources/test_write_2.txt diff --git a/core-java-modules/core-java-io/src/test/resources/test_write_3.txt b/core-java-modules/core-java-io-2/src/test/resources/test_write_3.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/test_write_3.txt rename to core-java-modules/core-java-io-2/src/test/resources/test_write_3.txt diff --git a/core-java-modules/core-java-io/src/test/resources/test_write_4.txt b/core-java-modules/core-java-io-2/src/test/resources/test_write_4.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/test_write_4.txt rename to core-java-modules/core-java-io-2/src/test/resources/test_write_4.txt diff --git a/core-java-modules/core-java-io/src/test/resources/test_write_5.txt b/core-java-modules/core-java-io-2/src/test/resources/test_write_5.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/test_write_5.txt rename to core-java-modules/core-java-io-2/src/test/resources/test_write_5.txt diff --git a/core-java-modules/core-java-io-apis/README.md b/core-java-modules/core-java-io-apis/README.md new file mode 100644 index 0000000000..4d2bb0afb1 --- /dev/null +++ b/core-java-modules/core-java-io-apis/README.md @@ -0,0 +1,16 @@ +## Core Java IO APIs + +This module contains articles about core Java input/output(IO) APIs. + +### Relevant Articles: +- [Guide to Java OutputStream](https://www.baeldung.com/java-outputstream) +- [A Guide to the Java FileReader Class](https://www.baeldung.com/java-filereader) +- [The Java File Class](https://www.baeldung.com/java-io-file) +- [Java FileWriter](https://www.baeldung.com/java-filewriter) +- [Differences Between the Java WatchService API and the Apache Commons IO Monitor Library](https://www.baeldung.com/java-watchservice-vs-apache-commons-io-monitor-library) +- [Comparing getPath(), getAbsolutePath(), and getCanonicalPath() in Java](https://www.baeldung.com/java-path) +- [Quick Use of FilenameFilter](https://www.baeldung.com/java-filename-filter) +- [Guide to BufferedReader](https://www.baeldung.com/java-buffered-reader) +- [Java Scanner](https://www.baeldung.com/java-scanner) +- [Scanner nextLine() Method](https://www.baeldung.com/java-scanner-nextline) +- [Java Scanner hasNext() vs. hasNextLine()](https://www.baeldung.com/java-scanner-hasnext-vs-hasnextline) \ No newline at end of file diff --git a/core-java-modules/core-java-io-apis/pom.xml b/core-java-modules/core-java-io-apis/pom.xml new file mode 100644 index 0000000000..0eab844681 --- /dev/null +++ b/core-java-modules/core-java-io-apis/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + core-java-io-apis + 0.1.0-SNAPSHOT + core-java-io-apis + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + log4j + log4j + ${log4j.version} + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-io-apis + + + src/main/resources + true + + + + + + 3.6.1 + + + \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/bufferedreader/BufferedReaderExample.java b/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/bufferedreader/BufferedReaderExample.java similarity index 100% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/bufferedreader/BufferedReaderExample.java rename to core-java-modules/core-java-io-apis/src/main/java/com/baeldung/bufferedreader/BufferedReaderExample.java diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/dirmonitoring/DirectoryMonitoringExample.java b/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/dirmonitoring/DirectoryMonitoringExample.java similarity index 100% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/dirmonitoring/DirectoryMonitoringExample.java rename to core-java-modules/core-java-io-apis/src/main/java/com/baeldung/dirmonitoring/DirectoryMonitoringExample.java diff --git a/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/filereader/FileReaderExample.java b/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/filereader/FileReaderExample.java new file mode 100644 index 0000000000..0606d3e346 --- /dev/null +++ b/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/filereader/FileReaderExample.java @@ -0,0 +1,59 @@ +package com.baeldung.filereader; + +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; + +public class FileReaderExample { + + public static String readAllCharactersOneByOne(Reader reader) throws IOException { + StringBuilder content = new StringBuilder(); + int nextChar; + while ((nextChar = reader.read()) != -1) { + content.append((char) nextChar); + } + return String.valueOf(content); + } + + public static String readMultipleCharacters(Reader reader, int length) throws IOException { + char[] buffer = new char[length]; + int charactersRead = reader.read(buffer, 0, length); + + + if (charactersRead != -1) { + return new String(buffer, 0, charactersRead); + } else { + return ""; + } + } + + public static String readFile(String path) { + FileReader fileReader = null; + try { + fileReader = new FileReader(path); + return readAllCharactersOneByOne(fileReader); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (fileReader != null) { + try { + fileReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return null; + } + + public static String readFileUsingTryWithResources(String path) { + try (FileReader fileReader = new FileReader(path)) { + return readAllCharactersOneByOne(fileReader); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + +} \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/stream/OutputStreamExamples.java b/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/outputstream/OutputStreamExamples.java similarity index 86% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/stream/OutputStreamExamples.java rename to core-java-modules/core-java-io-apis/src/main/java/com/baeldung/outputstream/OutputStreamExamples.java index c7168c5b26..b6e7a97fff 100644 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/stream/OutputStreamExamples.java +++ b/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/outputstream/OutputStreamExamples.java @@ -1,11 +1,6 @@ -package com.baeldung.stream; +package com.baeldung.outputstream; -import java.io.BufferedOutputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; +import java.io.*; public class OutputStreamExamples { diff --git a/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/scanner/HasNextVsHasNextLineDemo.java b/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/scanner/HasNextVsHasNextLineDemo.java new file mode 100644 index 0000000000..8653b1e137 --- /dev/null +++ b/core-java-modules/core-java-io-apis/src/main/java/com/baeldung/scanner/HasNextVsHasNextLineDemo.java @@ -0,0 +1,96 @@ +package com.baeldung.scanner; + +import lombok.extern.log4j.Log4j; +import org.apache.log4j.LogManager; +import org.apache.log4j.PropertyConfigurator; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; +import java.util.Scanner; + +@Log4j +public class HasNextVsHasNextLineDemo { + private static final String LINE = "----------------------------"; + private static final String END_LINE = "--------OUTPUT--END---------\n"; + + + private static final String INPUT = new StringBuilder() + .append("magic\tproject\n") + .append(" database: oracle\n") + .append("dependencies:\n") + .append("spring:foo:bar\n") + .append("\n").toString(); + + private static void hasNextBasic() { + printHeader("hasNext() Basic"); + Scanner scanner = new Scanner(INPUT); + while (scanner.hasNext()) { + log.info(scanner.next()); + } + log.info(END_LINE); + scanner.close(); + } + + private static void hasNextWithDelimiter() { + printHeader("hasNext() with delimiter"); + Scanner scanner = new Scanner(INPUT); + while (scanner.hasNext()) { + String token = scanner.next(); + if ("dependencies:".equals(token)) { + scanner.useDelimiter(":"); + } + log.info(token); + } + log.info(END_LINE); + scanner.close(); + } + + private static void hasNextWithDelimiterFixed() { + printHeader("hasNext() with delimiter FIX"); + Scanner scanner = new Scanner(INPUT); + while (scanner.hasNext()) { + String token = scanner.next(); + if ("dependencies:".equals(token)) { + scanner.useDelimiter(":|\\s+"); + } + log.info(token); + } + log.info(END_LINE); + scanner.close(); + } + + private static void addLineNumber() { + printHeader("add line number by hasNextLine() "); + Scanner scanner = new Scanner(INPUT); + int i = 0; + while (scanner.hasNextLine()) { + log.info(String.format("%d|%s", ++i, scanner.nextLine())); + } + log.info(END_LINE); + scanner.close(); + } + + private static void printHeader(String title) { + log.info(LINE); + log.info(title); + log.info(LINE); + } + + public static void main(String[] args) throws IOException { + setLogger(); + hasNextBasic(); + hasNextWithDelimiter(); + hasNextWithDelimiterFixed(); + addLineNumber(); + } + + //overwrite the logger config + private static void setLogger() throws IOException { + InputStream is = HasNextVsHasNextLineDemo.class.getResourceAsStream("/scanner/log4j.properties"); + Properties props = new Properties(); + props.load(is); + LogManager.resetConfiguration(); + PropertyConfigurator.configure(props); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-io-apis/src/main/resources/input.txt b/core-java-modules/core-java-io-apis/src/main/resources/input.txt new file mode 100644 index 0000000000..650da894e8 --- /dev/null +++ b/core-java-modules/core-java-io-apis/src/main/resources/input.txt @@ -0,0 +1,45 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In lacus enim, scelerisque id sapien ut, semper euismod quam. Nunc ullamcorper semper blandit. Praesent quis quam mollis, iaculis lectus a, fringilla leo. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis vitae auctor mauris. Pellentesque eu pellentesque lorem, vel ultricies libero. Pellentesque vestibulum sagittis eros. In vestibulum lacus elit. Interdum et malesuada fames ac ante ipsum primis in faucibus. + +Vivamus pharetra lacus fringilla nisl molestie eleifend. Donec et dolor non quam mattis mattis. Proin malesuada maximus elit id semper. Donec facilisis dolor ut feugiat auctor. Proin accumsan semper consectetur. Vivamus facilisis odio vel bibendum imperdiet. Sed rutrum nisi nec nisi interdum fringilla. Aliquam laoreet velit ullamcorper egestas ultrices. Aliquam ultricies sem sed orci interdum, eu porta purus malesuada. Sed accumsan, nunc ut maximus rhoncus, arcu ante pretium ex, non ultrices magna nisi et velit. Pellentesque tempor mi quis lacus consectetur, quis imperdiet enim efficitur. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. + +Nunc sed maximus erat. Aenean imperdiet finibus massa ac aliquam. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis dignissim cursus purus, eu tempus urna. Nunc sed mauris scelerisque, luctus eros ut, viverra nisi. Maecenas congue sed ligula in eleifend. Praesent nec dignissim enim, dictum efficitur massa. Nullam eros dui, rutrum quis aliquam accumsan, sollicitudin cursus eros. Phasellus euismod, lorem vitae vehicula ullamcorper, leo lorem vestibulum magna, vitae malesuada libero ipsum id lorem. Aenean finibus turpis facilisis tortor bibendum, vitae dignissim dolor dictum. Ut quis ornare nisi, non rutrum sapien. + +Etiam placerat, est eget placerat imperdiet, neque urna tristique est, a dictum nisl dolor vitae leo. Vivamus porttitor mi vitae volutpat ultrices. Quisque at ante porta mauris ultricies iaculis. Phasellus iaculis sollicitudin urna nec facilisis. Suspendisse dapibus vulputate scelerisque. Fusce felis diam, eleifend in tristique in, malesuada a purus. Suspendisse euismod ipsum sed urna imperdiet, quis venenatis lacus dapibus. Maecenas vitae est vel sem fringilla ornare at ut mi. Quisque porta, nulla at rutrum fringilla, mi ligula egestas libero, ac convallis elit diam et sapien. Vestibulum purus tortor, ornare ut enim sed, mattis lobortis erat. Maecenas ac ante tincidunt, euismod mauris a, fermentum diam. Nullam arcu est, consequat sed enim in, bibendum aliquet velit. Donec bibendum magna ac augue sagittis vehicula. Curabitur nec mauris eu augue bibendum volutpat. Fusce fringilla varius fringilla. + +Aliquam faucibus massa non orci accumsan, porta consectetur diam vulputate. Nullam nec erat mollis, imperdiet libero nec, tincidunt neque. Aenean varius purus nec est auctor, sed vulputate libero varius. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vel neque elit. Donec vulputate fermentum nulla, ut aliquam neque tempor in. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec vel venenatis est. Suspendisse luctus elit quis dui dapibus, id sodales dolor cursus. Curabitur ut vehicula dui. Fusce aliquet est et ante feugiat, et tempus ex congue. Nunc eget dapibus leo. Nunc eu accumsan diam. Suspendisse risus eros, rutrum et volutpat in, consequat in nulla. Suspendisse id felis a orci accumsan iaculis. + +Duis tincidunt diam eget tortor aliquet sodales. Etiam sodales purus ac urna mollis, et cursus enim porttitor. Nulla viverra ligula nunc, ornare condimentum felis posuere sed. Fusce aliquet pretium sagittis. Sed ac mi elementum massa dictum ornare. Integer quis dapibus lectus. Curabitur in rhoncus justo, et vulputate justo. Integer eget efficitur felis. + +Sed finibus vel tortor ac egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vestibulum nulla mi, blandit efficitur sapien fermentum eu. Integer sed turpis eros. Phasellus sed aliquam ligula. Etiam dictum quam in dapibus mattis. Donec et tristique quam. Pellentesque gravida luctus dolor, eu ornare sapien. Donec justo ante, lacinia non sem et, ultricies dignissim nibh. Vivamus eu nisl et magna pulvinar efficitur. Sed at vehicula lectus, sit amet luctus sem. Morbi vehicula sapien nisi, nec sagittis orci vestibulum et. + +Praesent non finibus diam. Quisque sit amet nisl vitae augue lobortis commodo. Morbi ullamcorper, tortor id ornare maximus, erat ipsum ullamcorper ipsum, in imperdiet diam sem vel erat. Sed pellentesque quis ex sed volutpat. Vestibulum volutpat diam ac dignissim sollicitudin. Praesent at luctus ex, at volutpat dui. Nunc nulla dui, lobortis et pharetra quis, efficitur in turpis. Donec sodales auctor purus id mollis. Sed auctor eu erat eget bibendum. Mauris tincidunt ornare neque id consequat. Suspendisse non massa ante. Quisque velit enim, rhoncus at erat eget, scelerisque placerat elit. Donec finibus luctus dolor. In sed eleifend lorem. Sed tempor ullamcorper lorem nec tristique. Fusce nec volutpat neque, id elementum est. + +Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum mattis elementum tellus, vitae maximus nulla eleifend ut. Vestibulum eu nibh vulputate, posuere felis eget, aliquet ex. Nullam leo ex, lacinia a ante ac, accumsan efficitur ligula. Vestibulum ornare gravida tempus. Proin rhoncus felis sit amet dolor commodo facilisis. Integer aliquet, diam sed pharetra feugiat, sem massa mollis orci, eget pretium libero nunc at quam. Ut rhoncus quam vitae massa hendrerit, ornare condimentum odio varius. Donec odio sapien, tristique eget libero ac, interdum facilisis odio. Phasellus nec mauris vel dolor semper mattis et quis ligula. Donec nec porttitor nunc. Integer maximus quam vitae sem gravida, ut commodo ex porttitor. + +Sed cursus nisi turpis, vel laoreet massa blandit ut. Cras posuere velit nulla, nec pellentesque ipsum dignissim eget. Donec pharetra, ex et commodo viverra, leo dolor dapibus tellus, vel dignissim est sem ac lectus. Quisque a arcu dapibus, aliquet magna sed, rhoncus neque. Integer suscipit, nulla ac varius lacinia, orci metus scelerisque neque, a laoreet nibh risus vitae dolor. Pellentesque felis metus, pulvinar vel cursus id, ultrices non purus. Donec mi lectus, faucibus sit amet nunc at, sagittis pretium lectus. Fusce nec purus arcu. Mauris neque neque, blandit eget mi at, auctor tempus orci. Mauris sapien lorem, luctus nec tellus non, porttitor aliquam dui. + +Mauris non ex risus. Aliquam imperdiet in eros eget placerat. Sed congue sed sapien porta sollicitudin. Phasellus tempor hendrerit metus vitae tincidunt. Suspendisse congue nisi sed augue dapibus, at pretium ante mollis. Cras non posuere nulla. Proin malesuada finibus magna vel iaculis. Cras in dapibus lorem. Pellentesque volutpat dolor sit amet magna tincidunt mollis. Nunc et lectus sodales, accumsan est vitae, ornare augue. Maecenas malesuada arcu leo, eget blandit lectus porttitor et. Nam aliquam sapien sit amet purus consequat lobortis. Aenean varius, augue porta dignissim efficitur, felis velit dapibus leo, tincidunt ultricies magna felis id ligula. Duis hendrerit, lectus eu elementum euismod, elit lectus consequat mi, sit amet egestas justo massa ut urna. Proin eleifend interdum ultrices. + +Donec lacinia orci pharetra ornare tincidunt. Nulla facilisi. Maecenas malesuada dui ac elit sagittis tincidunt id dictum dolor. Quisque lobortis purus ac metus volutpat viverra. Proin finibus sapien ut odio semper consectetur. Sed gravida luctus egestas. Mauris pretium volutpat elit, at commodo arcu sagittis nec. Ut condimentum fringilla urna ac dignissim. Cras aliquam metus pulvinar, pulvinar nibh at, placerat arcu. Nulla ornare tortor sed lectus mollis, vitae fringilla tellus egestas. Vivamus efficitur tincidunt sapien, sed finibus mi congue eu. Nullam magna velit, lacinia vitae ligula eget, molestie consectetur felis. Suspendisse varius turpis orci, ac laoreet arcu accumsan sed. Fusce quis fermentum lacus, nec varius libero. Pellentesque ac odio ut justo lobortis elementum sit amet vehicula lorem. Nulla interdum nulla eget mi tristique, vitae egestas nunc egestas. + +Curabitur commodo libero eu elit tincidunt, quis placerat risus vehicula. Vestibulum vehicula id nunc iaculis fermentum. Aenean semper, tellus ac semper rutrum, justo lorem feugiat leo, quis vulputate neque dui non ligula. Etiam egestas, enim eget tempor porta, nunc est tristique ante, vel suscipit massa lorem vel diam. Donec faucibus ante id turpis rhoncus congue. Nullam laoreet, diam efficitur scelerisque consequat, ligula leo ultrices est, non fermentum elit mauris ut dolor. Morbi non porttitor lorem. Sed volutpat sapien et lorem porttitor, ultricies ultricies tellus congue. Mauris sodales, tortor nec sagittis finibus, dui odio aliquet nibh, in luctus sapien massa eu risus. Nulla in est sed ante molestie vehicula vel nec lectus. Fusce maximus a quam eget aliquam. Vivamus pulvinar quis nisi a maximus. Proin cursus lacus sapien, et hendrerit elit pretium a. Donec tellus lectus, consectetur id dolor a, luctus rutrum libero. Suspendisse auctor scelerisque dui, nec pellentesque felis viverra nec. Cras elit ex, varius sed pulvinar sed, suscipit ultrices lacus. + +Vivamus eu luctus lectus. Maecenas congue magna orci, quis semper nulla blandit vel. Phasellus dignissim risus placerat lacinia sagittis. Praesent at gravida nisi, at pulvinar diam. Nulla egestas lectus sed felis facilisis egestas. Curabitur posuere gravida urna eu vestibulum. Pellentesque at dolor gravida, placerat quam sit amet, fermentum ligula. Morbi fringilla, mi eget mollis dictum, neque dolor ullamcorper leo, a rutrum libero ipsum eget orci. Curabitur consectetur iaculis vestibulum. Suspendisse ultricies ligula et neque lacinia luctus. Sed dignissim neque id eros sollicitudin pellentesque. + +Donec et magna quis lectus pharetra finibus a fringilla sapien. Phasellus accumsan, erat eu sodales cursus, tortor elit dapibus risus, ut ornare neque arcu in tellus. Nam ac vehicula diam, at aliquam nisl. Cras in sem eget nisi ultrices rutrum sit amet eu velit. Sed molestie tellus eget ante scelerisque, sit amet pulvinar neque fringilla. Nunc volutpat facilisis egestas. Cras sodales dui ac massa egestas, in mattis leo rhoncus. Pellentesque vitae urna vehicula ipsum sodales suscipit. Sed commodo tempus fringilla. + +Etiam egestas elit vitae mi maximus fringilla quis eget libero. Fusce finibus ultrices tellus at molestie. Pellentesque posuere blandit elementum. Etiam eu erat eu urna hendrerit euismod. Nulla quis lectus rhoncus, ultricies urna eget, pretium neque. Cras sit amet ipsum sit amet purus rutrum ultricies nec vitae tortor. Sed tempor dapibus augue in pulvinar. Ut pretium sapien in malesuada accumsan. Donec eget ultrices erat, ut efficitur ligula. Sed posuere mauris est, nec convallis ipsum tempus non. + +Duis a ullamcorper ante. Quisque eu ultricies metus, at aliquet odio. Nullam tempus molestie augue ut varius. Fusce purus eros, dictum nec finibus sed, sodales et diam. Suspendisse sed mi purus. Donec eleifend ipsum diam, nec fringilla enim laoreet non. Phasellus condimentum, magna sit amet porttitor suscipit, arcu risus lobortis dolor, ac fringilla nibh nisl vel purus. Phasellus facilisis posuere orci sit amet tempus. Nam nec enim maximus, rhoncus felis a, rutrum diam. + +Suspendisse potenti. Donec vel tempor neque. In aliquet nulla in eleifend bibendum. Sed sapien sem, finibus in sodales vitae, euismod in sem. Phasellus nec elit a erat pulvinar semper. Aliquam luctus nisl in libero molestie aliquam. Nunc ac ornare felis. Ut non mauris ut ipsum rhoncus pretium. Curabitur tristique lacus a sagittis aliquam. Morbi vel volutpat tellus. Maecenas volutpat, lacus sed tempus imperdiet, eros tellus volutpat nisi, a egestas augue nulla quis arcu. In sollicitudin imperdiet efficitur. Suspendisse viverra aliquet nisi, congue ultrices arcu hendrerit in. + +Maecenas vitae vestibulum nunc. Nullam semper faucibus tincidunt. Etiam sed hendrerit risus. Proin gravida, urna nec tincidunt tempus, nulla sapien porttitor nibh, porttitor lobortis nunc quam et tortor. Praesent ut varius lacus, ut hendrerit enim. Ut nec turpis ac felis imperdiet bibendum. Phasellus porttitor enim odio, et vehicula mi convallis vel. Quisque porta scelerisque sagittis. Praesent dignissim sagittis vulputate. Aenean non justo ac est volutpat bibendum. Aliquam mattis, sapien dapibus pellentesque semper, velit urna malesuada diam, nec varius nibh eros at erat. Proin leo ante, ultricies id velit ut, faucibus porta nibh. Sed nec fermentum urna, sed mollis leo. Aliquam erat volutpat. + +Donec condimentum, urna sed hendrerit vestibulum, ante nibh lacinia dui, in tincidunt odio sem eget orci. In hac habitasse platea dictumst. Mauris id ex id ante tempus finibus eu sagittis erat. Quisque interdum urna risus, vel varius nibh euismod non. Nulla eget pellentesque quam. Aliquam vestibulum ac tortor non lobortis. Sed vitae erat sed libero dignissim dictum nec in turpis. Vivamus id ornare elit, ut facilisis lectus. Morbi dictum purus eget ipsum dignissim porttitor. Sed at vehicula purus, nec rhoncus quam. Nunc a nisl quis arcu blandit fermentum vel quis odio. Vivamus rhoncus, sapien sed lacinia hendrerit, velit urna fermentum dolor, id feugiat magna ligula sed urna. Proin euismod efficitur libero, eget porttitor lacus tempus quis. Duis tincidunt quis est a laoreet. Nam sit amet tristique nisl, sit amet mattis mi. + +Aenean id dictum nulla, sed laoreet magna. Morbi consectetur in turpis at aliquam. Maecenas rutrum feugiat metus, at ullamcorper augue fermentum ut. Vivamus in magna pretium nibh dictum rhoncus luctus at orci. In hac habitasse platea dictumst. Fusce convallis, nulla nec hendrerit suscipit, ipsum diam lobortis sem, vitae elementum lectus erat sit amet magna. Quisque sollicitudin fringilla purus, ac molestie justo congue vitae. Nulla sapien leo, ullamcorper ac tellus in, cursus rhoncus enim. Suspendisse rutrum magna non ex elementum elementum id vitae enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse ornare libero eu molestie pulvinar. Phasellus faucibus, magna eget rutrum porta, lorem turpis blandit lectus, eu viverra massa risus et ex. + +Ut consectetur eros lacus, ac ullamcorper lacus mattis a. Cras congue justo ut erat interdum, et scelerisque nisi malesuada. Quisque sed sapien sollicitudin purus tincidunt finibus vestibulum vel dolor. Cras iaculis bibendum erat, a dictum urna viverra et. Integer non neque vulputate, tincidunt purus nec, rutrum arcu. Aliquam nec magna non sem semper laoreet quis at quam. Mauris dui lectus, convallis eu efficitur at, facilisis nec lorem. Cras felis sem, egestas ac rutrum vel, mollis et ex. Aenean semper egestas libero, nec commodo mi blandit efficitur. Duis nec quam in massa dignissim sagittis vel vitae leo. Nam molestie hendrerit auctor. + +Sed suscipit egestas tellus sed cursus. Donec vel massa sit amet dui condimentum accumsan. Phasellus libero eros, lobortis a nisi id, porttitor maximus lectus. Praesent consectetur diam urna, id viverra turpis elementum in. Vivamus vitae pretium justo, nec tempor felis. Vivamus volutpat ultricies magna. Suspendisse vulputate lectus ac orci volutpat ullamcorper. Nulla eu leo pretium, commodo arcu accumsan, tempor nisl. Fusce sit amet tellus a ipsum vehicula laoreet sed vitae mauris. Duis porttitor massa mattis nibh placerat consequat. Fusce rutrum commodo tortor eget pellentesque. Suspendisse tempor enim libero, consequat dictum nibh dictum varius. Pellentesque feugiat sit amet urna sed facilisis. Curabitur a sagittis augue. \ No newline at end of file diff --git a/core-java-modules/core-java-io-apis/src/main/resources/scanner/log4j.properties b/core-java-modules/core-java-io-apis/src/main/resources/scanner/log4j.properties new file mode 100644 index 0000000000..59cb116bff --- /dev/null +++ b/core-java-modules/core-java-io-apis/src/main/resources/scanner/log4j.properties @@ -0,0 +1,4 @@ +log4j.rootLogger=INFO, A1 +log4j.appender.A1=org.apache.log4j.ConsoleAppender +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=[DEMO]%m%n diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderExampleUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/bufferedreader/BufferedReaderExampleUnitTest.java similarity index 100% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderExampleUnitTest.java rename to core-java-modules/core-java-io-apis/src/test/java/com/baeldung/bufferedreader/BufferedReaderExampleUnitTest.java diff --git a/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java new file mode 100644 index 0000000000..9fb2662594 --- /dev/null +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java @@ -0,0 +1,56 @@ +package com.baeldung.bufferedreader; + +import org.junit.Test; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.nio.file.Files; +import java.nio.file.Paths; + +import static org.junit.Assert.*; + +public class BufferedReaderUnitTest { + + private static final String FILE_PATH = "src/main/resources/input.txt"; + + @Test + public void givenBufferedReader_whenSkipUnderscores_thenOk() throws IOException { + StringBuilder result = new StringBuilder(); + + try (BufferedReader reader = new BufferedReader(new StringReader("1__2__3__4__5"))) { + int value; + while((value = reader.read()) != -1) { + result.append((char) value); + reader.skip(2L); + } + } + + assertEquals("12345", result.toString()); + } + + @Test + public void givenBufferedReader_whenSkipsWhitespacesAtBeginning_thenOk() throws IOException { + String result; + + try (BufferedReader reader = new BufferedReader(new StringReader(" Lorem ipsum dolor sit amet."))) { + do { + reader.mark(1); + } while(Character.isWhitespace(reader.read())); + + reader.reset(); + result = reader.readLine(); + } + + assertEquals("Lorem ipsum dolor sit amet.", result); + } + + @Test + public void whenCreatesNewBufferedReader_thenOk() throws IOException { + try(BufferedReader reader = Files.newBufferedReader(Paths.get(FILE_PATH))) { + assertNotNull(reader); + assertTrue(reader.ready()); + } + } + +} diff --git a/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java new file mode 100644 index 0000000000..57e12560bb --- /dev/null +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java @@ -0,0 +1,202 @@ +package com.baeldung.file; + +import org.junit.Test; + +import java.io.*; +import java.util.Arrays; +import java.util.List; + +import static org.junit.Assert.*; + +public class FileClassUnitTest { + + @Test + public void givenDir_whenMkdir_thenDirIsDeleted() { + File directory = new File("dir"); + assertTrue(directory.mkdir()); + assertTrue(directory.delete()); + } + + @Test + public void givenFile_whenCreateNewFile_thenFileIsDeleted() { + File file = new File("file.txt"); + try { + assertTrue(file.createNewFile()); + } catch (IOException e) { + fail("Could not create " + "file.txt"); + } + assertTrue(file.delete()); + } + + @Test + public void givenFile_whenCreateNewFile_thenMetadataIsCorrect() { + + String sep = File.separator; + + File parentDir = makeDir("filesDir"); + + File child = new File(parentDir, "file.txt"); + try { + child.createNewFile(); + } catch (IOException e) { + fail("Could not create " + "file.txt"); + } + + assertEquals("file.txt", child.getName()); + assertEquals(parentDir.getName(), child.getParentFile().getName()); + assertEquals(parentDir.getPath() + sep + "file.txt", child.getPath()); + + removeDir(parentDir); + } + + + @Test + public void givenReadOnlyFile_whenCreateNewFile_thenCantModFile() { + File parentDir = makeDir("readDir"); + + File child = new File(parentDir, "file.txt"); + try { + child.createNewFile(); + } catch (IOException e) { + fail("Could not create " + "file.txt"); + } + child.setWritable(false); + boolean writable = true; + try (FileOutputStream fos = new FileOutputStream(child)) { + fos.write("Hello World".getBytes()); // write operation + fos.flush(); + } catch (IOException e) { + writable = false; + } finally { + removeDir(parentDir); + } + assertFalse(writable); + } + + @Test + public void givenWriteOnlyFile_whenCreateNewFile_thenCantReadFile() { + File parentDir = makeDir("writeDir"); + + File child = new File(parentDir, "file.txt"); + try { + child.createNewFile(); + } catch (IOException e) { + fail("Could not create " + "file.txt"); + } + child.setReadable(false); + boolean readable = true; + try (FileInputStream fis = new FileInputStream(child)) { + fis.read(); // read operation + } catch (IOException e) { + readable = false; + } finally { + removeDir(parentDir); + } + assertFalse(readable); + } + + @Test + public void givenFilesInDir_whenCreateNewFile_thenCanListFiles() { + File parentDir = makeDir("filtersDir"); + + String[] files = {"file1.csv", "file2.txt"}; + for (String file : files) { + try { + new File(parentDir, file).createNewFile(); + } catch (IOException e) { + fail("Could not create " + file); + } + } + + //normal listing + assertEquals(2, parentDir.list().length); + + //filtered listing + FilenameFilter csvFilter = (dir, ext) -> ext.endsWith(".csv"); + assertEquals(1, parentDir.list(csvFilter).length); + + removeDir(parentDir); + } + + @Test + public void givenDir_whenMkdir_thenCanRenameDir() { + + File source = makeDir("source"); + File destination = makeDir("destination"); + boolean renamed = source.renameTo(destination); + + if (renamed) { + assertFalse(source.isDirectory()); + assertTrue(destination.isDirectory()); + + removeDir(destination); + } + } + + @Test + public void givenDataWritten_whenWrite_thenFreeSpaceReduces() { + + String home = System.getProperty("user.home"); + String sep = File.separator; + File testDir = makeDir(home + sep + "test"); + File sample = new File(testDir, "sample.txt"); + + long freeSpaceBefore = testDir.getFreeSpace(); + try { + writeSampleDataToFile(sample); + } catch (IOException e) { + fail("Could not write to " + "sample.txt"); + } + + long freeSpaceAfter = testDir.getFreeSpace(); + assertTrue(freeSpaceAfter < freeSpaceBefore); + + removeDir(testDir); + } + + private static File makeDir(String name) { + File directory = new File(name); + directory.mkdir(); + if (directory.isDirectory()) { + return directory; + } + throw new RuntimeException("'" + name + "' not made!"); + } + + private static void removeDir(File directory) { + // make sure you don't delete your home directory here + String home = System.getProperty("user.home"); + if (directory.getPath().equals(home)) { + return; + } + + // remove directory and its files from system + if (directory.exists()) { + // delete all files inside the directory + File[] dirFiles = directory.listFiles(); + if (dirFiles != null) { + List files = Arrays.asList(dirFiles); + files.forEach(f -> deleteFile(f)); + } + + // finally delete the directory itself + deleteFile(directory); + } + } + + private static void deleteFile(File fileToDelete) { + if (fileToDelete != null && fileToDelete.exists()) { + fileToDelete.delete(); + } + } + + private static void writeSampleDataToFile(File sample) throws IOException { + //write sample text to file + try (FileOutputStream out = new FileOutputStream(sample)) { + for (int i = 1; i <= 100000; i++) { + String text = "Sample line number " + i + "\n"; + out.write(text.getBytes()); + } + } + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/file/FilenameFilterManualTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filenamefilter/FilenameFilterManualTest.java similarity index 97% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/file/FilenameFilterManualTest.java rename to core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filenamefilter/FilenameFilterManualTest.java index f9a2ce972d..94e7a1addc 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/file/FilenameFilterManualTest.java +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filenamefilter/FilenameFilterManualTest.java @@ -1,4 +1,8 @@ -package com.baeldung.file; +package com.baeldung.filenamefilter; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; import java.io.File; import java.io.FilenameFilter; @@ -7,10 +11,6 @@ import java.util.List; import java.util.function.Predicate; import java.util.stream.Collectors; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - public class FilenameFilterManualTest { private static File directory; diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaFilePathUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filepath/JavaFilePathUnitTest.java similarity index 97% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaFilePathUnitTest.java rename to core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filepath/JavaFilePathUnitTest.java index e4d78568d0..668dd253cc 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaFilePathUnitTest.java +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filepath/JavaFilePathUnitTest.java @@ -1,6 +1,4 @@ -package org.baeldung.java.io; - -import static org.junit.Assert.*; +package com.baeldung.filepath; import org.junit.AfterClass; import org.junit.Assume; @@ -10,6 +8,8 @@ import org.junit.Test; import java.io.File; import java.io.IOException; +import static org.junit.Assert.assertEquals; + public class JavaFilePathUnitTest { private static String userDir; diff --git a/core-java-modules/core-java-io-2/src/test/java/com/baeldung/filereader/FileReaderExampleUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filereader/FileReaderExampleUnitTest.java similarity index 100% rename from core-java-modules/core-java-io-2/src/test/java/com/baeldung/filereader/FileReaderExampleUnitTest.java rename to core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filereader/FileReaderExampleUnitTest.java diff --git a/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filewriter/FileWriterExampleUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filewriter/FileWriterExampleUnitTest.java new file mode 100644 index 0000000000..d8bc22b554 --- /dev/null +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/filewriter/FileWriterExampleUnitTest.java @@ -0,0 +1,47 @@ +package com.baeldung.filewriter; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Test; + +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class FileWriterExampleUnitTest { + + @After + public void tearDown() throws IOException { + Files.delete(Paths.get("src/test/resources/FileWriterTest.txt")); + } + + @Test + public void testWriteString() throws IOException { + try (FileWriter fileWriter = new FileWriter("src/test/resources/FileWriterTest.txt")) { + fileWriter.write("Hello Folks!"); + } + Assert.assertEquals("Hello Folks!", new String(Files.readAllBytes(Paths.get("src/test/resources/FileWriterTest.txt")))); + } + + @Test + public void testAppendString() throws IOException { + try (FileWriter fileWriter = new FileWriter("src/test/resources/FileWriterTest.txt")) { + fileWriter.write("Hello Folks!"); + } + // using another try with resources to reopen the file in append mode + try (FileWriter fileWriter = new FileWriter("src/test/resources/FileWriterTest.txt", true)) { + fileWriter.write("Hello Folks Again!"); + } + + Assert.assertEquals("Hello Folks!" + "Hello Folks Again!", new String(Files.readAllBytes(Paths.get("src/test/resources/FileWriterTest.txt")))); + } + + @Test + public void testWriteCharArray() throws IOException { + try (FileWriter fileWriter = new FileWriter("src/test/resources/FileWriterTest.txt")) { + fileWriter.write("Hello Folks!".toCharArray()); + } + Assert.assertEquals("Hello Folks!", new String(Files.readAllBytes(Paths.get("src/test/resources/FileWriterTest.txt")))); + } +} diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/outputstream/OutputStreamExamplesUnitTest.java similarity index 98% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesUnitTest.java rename to core-java-modules/core-java-io-apis/src/test/java/com/baeldung/outputstream/OutputStreamExamplesUnitTest.java index aa949259a0..921b78cf5b 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/stream/OutputStreamExamplesUnitTest.java +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/outputstream/OutputStreamExamplesUnitTest.java @@ -1,12 +1,12 @@ -package com.baeldung.stream; +package com.baeldung.outputstream; -import static org.junit.Assert.assertTrue; +import org.junit.Before; +import org.junit.Test; import java.io.File; import java.io.IOException; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertTrue; public class OutputStreamExamplesUnitTest { diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaScannerUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/scanner/JavaScannerUnitTest.java similarity index 93% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaScannerUnitTest.java rename to core-java-modules/core-java-io-apis/src/test/java/com/baeldung/scanner/JavaScannerUnitTest.java index 1c16a5d435..fbd9695634 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaScannerUnitTest.java +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/scanner/JavaScannerUnitTest.java @@ -1,20 +1,12 @@ -package org.baeldung.java.io; +package com.baeldung.scanner; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import org.junit.Test; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; import java.util.Locale; import java.util.Scanner; -import org.junit.Test; +import static org.junit.Assert.*; public class JavaScannerUnitTest { diff --git a/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/scannernextline/ScannerNextLineUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/scannernextline/ScannerNextLineUnitTest.java new file mode 100644 index 0000000000..f3e76229da --- /dev/null +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/scannernextline/ScannerNextLineUnitTest.java @@ -0,0 +1,44 @@ +package com.baeldung.scannernextline; + +import org.junit.Test; + +import java.util.NoSuchElementException; +import java.util.Scanner; + +import static org.junit.Assert.assertEquals; + +public class ScannerNextLineUnitTest { + + @Test + public void whenReadingLines_thenCorrect() { + String input = "Scanner\nTest\n"; + try (Scanner scanner = new Scanner(input)) { + assertEquals("Scanner", scanner.nextLine()); + assertEquals("Test", scanner.nextLine()); + } + } + + @Test + public void whenReadingPartialLines_thenCorrect() { + String input = "Scanner\n"; + try (Scanner scanner = new Scanner(input)) { + scanner.useDelimiter(""); + scanner.next(); + assertEquals("canner", scanner.nextLine()); + } + } + + @Test(expected = NoSuchElementException.class) + public void givenNoNewLine_whenReadingNextLine_thenThrowNoSuchElementException() { + try (Scanner scanner = new Scanner("")) { + String result = scanner.nextLine(); + } + } + + @Test(expected = IllegalStateException.class) + public void givenScannerIsClosed_whenReadingNextLine_thenThrowIllegalStateException() { + Scanner scanner = new Scanner(""); + scanner.close(); + String result = scanner.nextLine(); + } +} diff --git a/core-java-modules/core-java-io-2/src/test/resources/HelloWorld.txt b/core-java-modules/core-java-io-apis/src/test/resources/HelloWorld.txt similarity index 100% rename from core-java-modules/core-java-io-2/src/test/resources/HelloWorld.txt rename to core-java-modules/core-java-io-apis/src/test/resources/HelloWorld.txt diff --git a/core-java-modules/core-java-io/src/test/resources/fileNameFilterManualTestFolder/people.json b/core-java-modules/core-java-io-apis/src/test/resources/fileNameFilterManualTestFolder/people.json similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/fileNameFilterManualTestFolder/people.json rename to core-java-modules/core-java-io-apis/src/test/resources/fileNameFilterManualTestFolder/people.json diff --git a/core-java-modules/core-java-io/src/test/resources/listFilesUnitTestFolder/students.json b/core-java-modules/core-java-io-apis/src/test/resources/fileNameFilterManualTestFolder/students.json similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/listFilesUnitTestFolder/students.json rename to core-java-modules/core-java-io-apis/src/test/resources/fileNameFilterManualTestFolder/students.json diff --git a/core-java-modules/core-java-io/src/test/resources/fileNameFilterManualTestFolder/teachers.xml b/core-java-modules/core-java-io-apis/src/test/resources/fileNameFilterManualTestFolder/teachers.xml similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/fileNameFilterManualTestFolder/teachers.xml rename to core-java-modules/core-java-io-apis/src/test/resources/fileNameFilterManualTestFolder/teachers.xml diff --git a/core-java-modules/core-java-io/src/test/resources/fileNameFilterManualTestFolder/workers.xml b/core-java-modules/core-java-io-apis/src/test/resources/fileNameFilterManualTestFolder/workers.xml similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/fileNameFilterManualTestFolder/workers.xml rename to core-java-modules/core-java-io-apis/src/test/resources/fileNameFilterManualTestFolder/workers.xml diff --git a/core-java-modules/core-java-io/src/test/resources/testFolder/sample_file_1.in b/core-java-modules/core-java-io-apis/src/test/resources/test_read.in similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/testFolder/sample_file_1.in rename to core-java-modules/core-java-io-apis/src/test/resources/test_read.in diff --git a/core-java-modules/core-java-io/src/test/resources/test_read_d.in b/core-java-modules/core-java-io-apis/src/test/resources/test_read_d.in similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/test_read_d.in rename to core-java-modules/core-java-io-apis/src/test/resources/test_read_d.in diff --git a/core-java-modules/core-java-io/src/test/resources/test_read_multiple.in b/core-java-modules/core-java-io-apis/src/test/resources/test_read_multiple.in similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/test_read_multiple.in rename to core-java-modules/core-java-io-apis/src/test/resources/test_read_multiple.in diff --git a/core-java-modules/core-java-io-conversions/README.md b/core-java-modules/core-java-io-conversions/README.md new file mode 100644 index 0000000000..cdb7df04d0 --- /dev/null +++ b/core-java-modules/core-java-io-conversions/README.md @@ -0,0 +1,17 @@ +## Core Java IO Conversions + +This module contains articles about core Java input/output(IO) conversions. + +### Relevant Articles: +- [Java InputStream to String](https://www.baeldung.com/convert-input-stream-to-string) +- [Java – Convert File to InputStream](https://www.baeldung.com/convert-file-to-input-stream) +- [Java – Byte Array to Writer](https://www.baeldung.com/java-convert-byte-array-to-writer) +- [Java InputStream to Byte Array and ByteBuffer](https://www.baeldung.com/convert-input-stream-to-array-of-bytes) +- [Java – String to Reader](https://www.baeldung.com/java-convert-string-to-reader) +- [Java – Byte Array to Reader](https://www.baeldung.com/java-convert-byte-array-to-reader) +- [Java – File to Reader](https://www.baeldung.com/java-convert-file-to-reader) +- [Java – InputStream to Reader](https://www.baeldung.com/java-convert-inputstream-to-reader) +- [Java – Reader to String](https://www.baeldung.com/java-convert-reader-to-string) +- [Java – Write a Reader to File](https://www.baeldung.com/java-write-reader-to-file) +- [Java – Reader to Byte Array](https://www.baeldung.com/java-convert-reader-to-byte-array) +- [Java – Reader to InputStream](https://www.baeldung.com/java-convert-reader-to-inputstream) diff --git a/core-java-modules/core-java-io-conversions/pom.xml b/core-java-modules/core-java-io-conversions/pom.xml new file mode 100644 index 0000000000..186dde2721 --- /dev/null +++ b/core-java-modules/core-java-io-conversions/pom.xml @@ -0,0 +1,34 @@ + + 4.0.0 + core-java-io-conversions + 0.1.0-SNAPSHOT + core-java-io-conversions + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + + core-java-io-conversions + + + src/main/resources + true + + + + + \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToWriterUnitTest.java b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/bytearraytowriter/JavaXToWriterUnitTest.java similarity index 97% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToWriterUnitTest.java rename to core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/bytearraytowriter/JavaXToWriterUnitTest.java index eb393668bd..05964178c6 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToWriterUnitTest.java +++ b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/bytearraytowriter/JavaXToWriterUnitTest.java @@ -1,17 +1,16 @@ -package org.baeldung.java.io; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; +package com.baeldung.bytearraytowriter; +import com.google.common.io.CharSink; import org.apache.commons.io.output.StringBuilderWriter; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.io.CharSink; +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; + +import static org.junit.Assert.assertEquals; public class JavaXToWriterUnitTest { protected final Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToInputStreamUnitTest.java b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/filetoinputstream/JavaXToInputStreamUnitTest.java similarity index 94% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToInputStreamUnitTest.java rename to core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/filetoinputstream/JavaXToInputStreamUnitTest.java index 6604d75ed1..caedd1747b 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToInputStreamUnitTest.java +++ b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/filetoinputstream/JavaXToInputStreamUnitTest.java @@ -1,13 +1,8 @@ -package org.baeldung.java.io; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.SequenceInputStream; +package com.baeldung.filetoinputstream; +import com.google.common.io.ByteSource; +import com.google.common.io.CharSource; +import com.google.common.io.Files; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.ReaderInputStream; @@ -15,9 +10,7 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.io.ByteSource; -import com.google.common.io.CharSource; -import com.google.common.io.Files; +import java.io.*; public class JavaXToInputStreamUnitTest { protected final Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/InputStreamToByteBufferUnitTest.java b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/inputstreamtobytes/InputStreamToByteBufferUnitTest.java similarity index 97% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/InputStreamToByteBufferUnitTest.java rename to core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/inputstreamtobytes/InputStreamToByteBufferUnitTest.java index 37f52fefea..c10aaae22a 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/InputStreamToByteBufferUnitTest.java +++ b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/inputstreamtobytes/InputStreamToByteBufferUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.io; +package com.baeldung.inputstreamtobytes; import com.google.common.io.ByteSource; import com.google.common.io.ByteStreams; diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaInputStreamToXUnitTest.java b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/inputstreamtostring/JavaInputStreamToXUnitTest.java similarity index 99% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaInputStreamToXUnitTest.java rename to core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/inputstreamtostring/JavaInputStreamToXUnitTest.java index c49681efb8..eb8c39f2d9 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaInputStreamToXUnitTest.java +++ b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/inputstreamtostring/JavaInputStreamToXUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.io; +package com.baeldung.inputstreamtostring; import com.google.common.base.Charsets; import com.google.common.io.ByteSource; diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaReaderToXUnitTest.java b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/readertox/JavaReaderToXUnitTest.java similarity index 99% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaReaderToXUnitTest.java rename to core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/readertox/JavaReaderToXUnitTest.java index 3c574f1e5c..72813df9b1 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaReaderToXUnitTest.java +++ b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/readertox/JavaReaderToXUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.io; +package com.baeldung.readertox; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToReaderUnitTest.java b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/xtoreader/JavaXToReaderUnitTest.java similarity index 99% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToReaderUnitTest.java rename to core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/xtoreader/JavaXToReaderUnitTest.java index eac37441ca..a7b9326996 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToReaderUnitTest.java +++ b/core-java-modules/core-java-io-conversions/src/test/java/com/baeldung/xtoreader/JavaXToReaderUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.io; +package com.baeldung.xtoreader; import java.io.ByteArrayInputStream; import java.io.File; diff --git a/core-java-modules/core-java-io/src/test/resources/anothersample.txt b/core-java-modules/core-java-io-conversions/src/test/resources/anothersample.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/anothersample.txt rename to core-java-modules/core-java-io-conversions/src/test/resources/anothersample.txt diff --git a/core-java-modules/core-java-io/src/test/resources/initialFile.txt b/core-java-modules/core-java-io-conversions/src/test/resources/initialFile.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/initialFile.txt rename to core-java-modules/core-java-io-conversions/src/test/resources/initialFile.txt diff --git a/core-java-modules/core-java-io/src/test/resources/sample.txt b/core-java-modules/core-java-io-conversions/src/test/resources/sample.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/sample.txt rename to core-java-modules/core-java-io-conversions/src/test/resources/sample.txt diff --git a/core-java-modules/core-java-io/src/test/resources/targetFile.tmp b/core-java-modules/core-java-io-conversions/src/test/resources/targetFile.tmp similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/targetFile.tmp rename to core-java-modules/core-java-io-conversions/src/test/resources/targetFile.tmp diff --git a/core-java-modules/core-java-io/src/test/resources/targetFile.txt b/core-java-modules/core-java-io-conversions/src/test/resources/targetFile.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/targetFile.txt rename to core-java-modules/core-java-io-conversions/src/test/resources/targetFile.txt diff --git a/core-java-modules/core-java-io/README.md b/core-java-modules/core-java-io/README.md index 6737ad6eb9..5c4978722f 100644 --- a/core-java-modules/core-java-io/README.md +++ b/core-java-modules/core-java-io/README.md @@ -1,43 +1,16 @@ -========= +## Core Java IO -## Core Java IO Cookbooks and Examples +This module contains articles about core Java input and output (IO) ### Relevant Articles: -- [How to Read a Large File Efficiently with Java](http://www.baeldung.com/java-read-lines-large-file) -- [Java InputStream to String](http://www.baeldung.com/convert-input-stream-to-string) -- [Java – Write to File](http://www.baeldung.com/java-write-to-file) -- [Java – Convert File to InputStream](http://www.baeldung.com/convert-file-to-input-stream) -- [Java Scanner](http://www.baeldung.com/java-scanner) -- [Java – Byte Array to Writer](http://www.baeldung.com/java-convert-byte-array-to-writer) -- [Java – Directory Size](http://www.baeldung.com/java-folder-size) -- [Differences Between the Java WatchService API and the Apache Commons IO Monitor Library](http://www.baeldung.com/java-watchservice-vs-apache-commons-io-monitor-library) -- [File Size in Java](http://www.baeldung.com/java-file-size) -- [Comparing getPath(), getAbsolutePath(), and getCanonicalPath() in Java](http://www.baeldung.com/java-path) -- [Using Java MappedByteBuffer](http://www.baeldung.com/java-mapped-byte-buffer) -- [How to Copy a File with Java](http://www.baeldung.com/java-copy-file) -- [Java – Append Data to a File](http://www.baeldung.com/java-append-to-file) -- [FileNotFoundException in Java](http://www.baeldung.com/java-filenotfound-exception) -- [How to Read a File in Java](http://www.baeldung.com/reading-file-in-java) -- [A Guide To NIO2 Asynchronous File Channel](http://www.baeldung.com/java-nio2-async-file-channel) -- [A Guide To NIO2 FileVisitor](http://www.baeldung.com/java-nio2-file-visitor) -- [A Guide To NIO2 File Attribute APIs](http://www.baeldung.com/java-nio2-file-attribute) -- [Introduction to the Java NIO2 File API](http://www.baeldung.com/java-nio-2-file-api) -- [Zipping and Unzipping in Java](http://www.baeldung.com/java-compress-and-uncompress) -- [Java NIO2 Path API](http://www.baeldung.com/java-nio-2-path) -- [A Guide to WatchService in Java NIO2](http://www.baeldung.com/java-nio2-watchservice) -- [Guide to Java NIO2 Asynchronous Channel APIs](http://www.baeldung.com/java-nio-2-async-channels) -- [A Guide to NIO2 Asynchronous Socket Channel](http://www.baeldung.com/java-nio2-async-socket-channel) -- [Download a File From an URL in Java](http://www.baeldung.com/java-download-file) -- [Create a Symbolic Link with Java](http://www.baeldung.com/java-symlink) -- [Quick Use of FilenameFilter](http://www.baeldung.com/java-filename-filter) +- [How to Read a File in Java](https://www.baeldung.com/reading-file-in-java) - [Read a File into an ArrayList](https://www.baeldung.com/java-file-to-arraylist) -- [Guide to Java OutputStream](https://www.baeldung.com/java-outputstream) +- [Java – Directory Size](https://www.baeldung.com/java-folder-size) +- [File Size in Java](https://www.baeldung.com/java-file-size) +- [Zipping and Unzipping in Java](https://www.baeldung.com/java-compress-and-uncompress) - [Reading a CSV File into an Array](https://www.baeldung.com/java-csv-file-array) -- [Guide to BufferedReader](https://www.baeldung.com/java-buffered-reader) -- [How to Get the File Extension of a File in Java](http://www.baeldung.com/java-file-extension) -- [Getting a File’s Mime Type in Java](http://www.baeldung.com/java-file-mime-type) -- [Create a Directory in Java](https://www.baeldung.com/java-create-directory) +- [How to Get the File Extension of a File in Java](https://www.baeldung.com/java-file-extension) +- [Getting a File’s Mime Type in Java](https://www.baeldung.com/java-file-mime-type) - [How to Write to a CSV File in Java](https://www.baeldung.com/java-csv) -- [List Files in a Directory in Java](https://www.baeldung.com/java-list-directory-files) -- [Java InputStream to Byte Array and ByteBuffer](https://www.baeldung.com/convert-input-stream-to-array-of-bytes) -- [Introduction to the Java NIO Selector](https://www.baeldung.com/java-nio-selector) +- [How to Avoid the Java FileNotFoundException When Loading Resources](https://www.baeldung.com/java-classpath-resource-cannot-be-opened) +- [[More -->]](/core-java-modules/core-java-io-2) diff --git a/core-java-modules/core-java-io/pom.xml b/core-java-modules/core-java-io/pom.xml index 84bf3baeed..0244011f78 100644 --- a/core-java-modules/core-java-io/pom.xml +++ b/core-java-modules/core-java-io/pom.xml @@ -14,76 +14,6 @@ - - - net.sourceforge.collections - collections-generic - ${collections-generic.version} - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - - - commons-io - commons-io - ${commons-io.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.apache.commons - commons-math3 - ${commons-math3.version} - - - org.decimal4j - decimal4j - ${decimal4j.version} - - - org.bouncycastle - bcprov-jdk15on - ${bouncycastle.version} - - - org.unix4j - unix4j-command - ${unix4j.version} - - - com.googlecode.grep4j - grep4j - ${grep4j.version} - - - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - - log4j - log4j - ${log4j.version} - - - org.slf4j - log4j-over-slf4j - ${org.slf4j.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - org.assertj @@ -91,69 +21,12 @@ ${assertj.version} test - - com.jayway.awaitility - awaitility - ${avaitility.version} - test - - - commons-codec - commons-codec - ${commons-codec.version} - - - org.javamoney - moneta - ${moneta.version} - - - org.owasp.esapi - esapi - ${esapi.version} - - - com.sun.messaging.mq - fscontext - ${fscontext.version} - - - com.codepoetics - protonpack - ${protonpack.version} - - - one.util - streamex - ${streamex.version} - - - io.vavr - vavr - ${vavr.version} - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator-annprocess.version} - org.hsqldb hsqldb ${hsqldb.version} runtime - - - org.asynchttpclient - async-http-client - ${async-http-client.version} - com.opencsv opencsv @@ -171,6 +44,12 @@ jmimemagic ${jmime-magic.version} + + + com.sun.messaging.mq + fscontext + ${fscontext.version} + @@ -261,36 +140,18 @@ - - 1.55 - 1.10 - 3.6.1 - 1.0.3 - 4.1 - 4.01 - 0.4 - 1.8.7 - 4.6-b01 - 1.13 - 0.6.5 - 0.9.0 4.1 3.6.1 - 1.7.0 - 3.0.0-M1 2.4.0 - 2.1.0.1 - 1.19 - 2.4.5 1.18 0.1.5 3.1.0 - + 4.4.2 \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio/selector/README.md b/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio/selector/README.md deleted file mode 100644 index b28aae1397..0000000000 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio/selector/README.md +++ /dev/null @@ -1,2 +0,0 @@ -###Relevant Articles: -- [Introduction to the Java NIO Selector](http://www.baeldung.com/java-nio-selector) diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio2/watcher/DirectoryWatcherExample.java b/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio2/watcher/DirectoryWatcherExample.java deleted file mode 100644 index 4c35ffdb22..0000000000 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio2/watcher/DirectoryWatcherExample.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.baeldung.java.nio2.watcher; - -import java.io.IOException; -import java.nio.file.FileSystems; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardWatchEventKinds; -import java.nio.file.WatchEvent; -import java.nio.file.WatchKey; -import java.nio.file.WatchService; - -public class DirectoryWatcherExample { - - public static void main(String[] args) throws IOException, InterruptedException { - WatchService watchService = FileSystems.getDefault().newWatchService(); - Path path = Paths.get(System.getProperty("user.home")); - path.register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY); - WatchKey key; - while ((key = watchService.take()) != null) { - for (WatchEvent event : key.pollEvents()) { - System.out.println("Event kind:" + event.kind() + ". File affected: " + event.context() + "."); - } - key.reset(); - } - - watchService.close(); - } - -} diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/stream/FileCopy.java b/core-java-modules/core-java-io/src/main/java/com/baeldung/stream/FileCopy.java deleted file mode 100644 index ccc2066b36..0000000000 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/stream/FileCopy.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.baeldung.stream; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.channels.FileChannel; -import java.nio.file.Files; - -import org.apache.commons.io.FileUtils; - -public class FileCopy { - - public static void copyFileUsingStream(File source, File dest) throws IOException { - InputStream is = null; - OutputStream os = null; - is = new FileInputStream(source); - os = new FileOutputStream(dest); - byte[] buffer = new byte[1024]; - int length; - while ((length = is.read(buffer)) > 0) { - os.write(buffer, 0, length); - } - is.close(); - os.close(); - } - - public static void copyFileUsingChannel(File source, File dest) throws IOException { - FileChannel sourceChannel = null; - FileChannel destChannel = null; - sourceChannel = new FileInputStream(source).getChannel(); - destChannel = new FileOutputStream(dest).getChannel(); - destChannel.transferFrom(sourceChannel, 0, sourceChannel.size()); - sourceChannel.close(); - destChannel.close(); - } - - public static void copyFileUsingApacheCommonsIO(File source, File dest) throws IOException { - FileUtils.copyFile(source, dest); - } - - public static void copyFileUsingJavaFiles(File source, File dest) throws IOException { - Files.copy(source.toPath(), dest.toPath()); - } - -} diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/util/StreamUtils.java b/core-java-modules/core-java-io/src/main/java/com/baeldung/util/StreamUtils.java deleted file mode 100644 index 42f438732f..0000000000 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/util/StreamUtils.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.util; - -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; - -import org.apache.commons.io.IOUtils; - -public class StreamUtils { - - public static String getStringFromInputStream(InputStream input) throws IOException { - StringWriter writer = new StringWriter(); - IOUtils.copy(input, writer, "UTF-8"); - return writer.toString(); - } -} diff --git a/core-java-modules/core-java-io/src/main/resources/META-INF/persistence.xml b/core-java-modules/core-java-io/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 3966afdcda..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/core-java-modules/core-java-io/src/main/resources/META-INF/services/com.sun.source.util.Plugin b/core-java-modules/core-java-io/src/main/resources/META-INF/services/com.sun.source.util.Plugin deleted file mode 100644 index 91fb6eb3b0..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/META-INF/services/com.sun.source.util.Plugin +++ /dev/null @@ -1 +0,0 @@ -com.baeldung.javac.SampleJavacPlugin \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/main/resources/datasource.properties b/core-java-modules/core-java-io/src/main/resources/datasource.properties deleted file mode 100644 index 61df0d45f7..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/datasource.properties +++ /dev/null @@ -1,6 +0,0 @@ -dataSourceClassName=//TBD -dataSource.user=//TBD -dataSource.password=//TBD -dataSource.databaseName=//TBD -dataSource.portNumber=//TBD -dataSource.serverName=//TBD \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/main/resources/js/bind.js b/core-java-modules/core-java-io/src/main/resources/js/bind.js deleted file mode 100644 index 652e646d0d..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/js/bind.js +++ /dev/null @@ -1,15 +0,0 @@ -var first = { - name: "Whiskey", - age: 5 -}; - -var second = { - volume: 100 -}; - -Object.bindProperties(first, second); - -print(first.volume); - -second.volume = 1000; -print(first.volume); diff --git a/core-java-modules/core-java-io/src/main/resources/js/locations.js b/core-java-modules/core-java-io/src/main/resources/js/locations.js deleted file mode 100644 index abfc944639..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/js/locations.js +++ /dev/null @@ -1 +0,0 @@ -print(__FILE__, __LINE__, __DIR__); diff --git a/core-java-modules/core-java-io/src/main/resources/js/math_module.js b/core-java-modules/core-java-io/src/main/resources/js/math_module.js deleted file mode 100644 index 267a100f36..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/js/math_module.js +++ /dev/null @@ -1,19 +0,0 @@ -var math = { - increment: function (num) { - return ++num; - }, - - failFunc: function () { - try { - throw "BOOM"; - } catch (e if typeof e === 'string') { - print("String thrown: " + e); - } - catch (e) { - print("this shouldn't happen!"); - } - } -}; - - -math; diff --git a/core-java-modules/core-java-io/src/main/resources/js/no_such.js b/core-java-modules/core-java-io/src/main/resources/js/no_such.js deleted file mode 100644 index 43b50c5cad..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/js/no_such.js +++ /dev/null @@ -1,11 +0,0 @@ -var demo = { - __noSuchProperty__: function (propName) { - print("Accessed non-existing property: " + propName); - }, - - __noSuchMethod__: function (methodName) { - print("Invoked non-existing method: " + methodName); - } -}; - -demo; diff --git a/core-java-modules/core-java-io/src/main/resources/js/script.js b/core-java-modules/core-java-io/src/main/resources/js/script.js deleted file mode 100644 index 6f701ed59d..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/js/script.js +++ /dev/null @@ -1 +0,0 @@ -function increment(num) ++num; diff --git a/core-java-modules/core-java-io/src/main/resources/js/trim.js b/core-java-modules/core-java-io/src/main/resources/js/trim.js deleted file mode 100644 index 81be009978..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/js/trim.js +++ /dev/null @@ -1,2 +0,0 @@ -print(" hello world".trimLeft()); -print("hello world ".trimRight()); diff --git a/core-java-modules/core-java-io/src/main/resources/js/typed_arrays.js b/core-java-modules/core-java-io/src/main/resources/js/typed_arrays.js deleted file mode 100644 index 6899b29373..0000000000 --- a/core-java-modules/core-java-io/src/main/resources/js/typed_arrays.js +++ /dev/null @@ -1,9 +0,0 @@ -function arrays(arr) { - - var javaIntArray = Java.to(arr, "int[]"); - print(javaIntArray[0]); - print(javaIntArray[1]); - print(javaIntArray[2]); -} - -arrays([100, "1654", true]); diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java deleted file mode 100644 index 985eb05aec..0000000000 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/bufferedreader/BufferedReaderUnitTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.baeldung.bufferedreader; - -import org.junit.Test; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringReader; -import java.nio.file.Files; -import java.nio.file.Paths; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -public class BufferedReaderUnitTest { - - private static final String FILE_PATH = "src/main/resources/input.txt"; - - @Test - public void givenBufferedReader_whenSkipUnderscores_thenOk() throws IOException { - StringBuilder result = new StringBuilder(); - - try (BufferedReader reader = new BufferedReader(new StringReader("1__2__3__4__5"))) { - int value; - while((value = reader.read()) != -1) { - result.append((char) value); - reader.skip(2L); - } - } - - assertEquals("12345", result.toString()); - } - - @Test - public void givenBufferedReader_whenSkipsWhitespacesAtBeginning_thenOk() throws IOException { - String result; - - try (BufferedReader reader = new BufferedReader(new StringReader(" Lorem ipsum dolor sit amet."))) { - do { - reader.mark(1); - } while(Character.isWhitespace(reader.read())); - - reader.reset(); - result = reader.readLine(); - } - - assertEquals("Lorem ipsum dolor sit amet.", result); - } - - @Test - public void whenCreatesNewBufferedReader_thenOk() throws IOException { - try(BufferedReader reader = Files.newBufferedReader(Paths.get(FILE_PATH))) { - assertNotNull(reader); - assertTrue(reader.ready()); - } - } - -} diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/file/FilesManualTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/file/FilesManualTest.java deleted file mode 100644 index f5c5c3dd3a..0000000000 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/file/FilesManualTest.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.baeldung.file; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.nio.file.StandardOpenOption; - -import com.google.common.base.Charsets; -import com.google.common.io.CharSink; -import com.google.common.io.FileWriteMode; -import org.apache.commons.io.FileUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.baeldung.util.StreamUtils; - -public class FilesManualTest { - - public static final String fileName = "src/main/resources/countries.properties"; - - @Before - @After - public void setup() throws Exception { - PrintWriter writer = new PrintWriter(fileName); - writer.print("UK\r\n" + "US\r\n" + "Germany\r\n"); - writer.close(); - } - - @Test - public void whenAppendToFileUsingGuava_thenCorrect() throws IOException { - File file = new File(fileName); - CharSink chs = com.google.common.io.Files.asCharSink(file, Charsets.UTF_8, FileWriteMode.APPEND); - chs.write("Spain\r\n"); - - assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); - } - - @Test - public void whenAppendToFileUsingFiles_thenCorrect() throws IOException { - Files.write(Paths.get(fileName), "Spain\r\n".getBytes(), StandardOpenOption.APPEND); - - assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); - } - - @Test - public void whenAppendToFileUsingFileUtils_thenCorrect() throws IOException { - File file = new File(fileName); - FileUtils.writeStringToFile(file, "Spain\r\n", StandardCharsets.UTF_8, true); - - assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); - } - - @Test - public void whenAppendToFileUsingFileOutputStream_thenCorrect() throws Exception { - FileOutputStream fos = new FileOutputStream(fileName, true); - fos.write("Spain\r\n".getBytes()); - fos.close(); - - assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); - } - - @Test - public void whenAppendToFileUsingFileWriter_thenCorrect() throws IOException { - FileWriter fw = new FileWriter(fileName, true); - BufferedWriter bw = new BufferedWriter(fw); - bw.write("Spain"); - bw.newLine(); - bw.close(); - - assertThat(StreamUtils.getStringFromInputStream(new FileInputStream(fileName))).isEqualTo("UK\r\n" + "US\r\n" + "Germany\r\n" + "Spain\r\n"); - } -} \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/filechannel/FileChannelUnitTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/filechannel/FileChannelUnitTest.java deleted file mode 100644 index 6964ba80e3..0000000000 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/filechannel/FileChannelUnitTest.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.baeldung.filechannel; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.nio.ByteBuffer; -import java.nio.MappedByteBuffer; -import java.nio.channels.FileChannel; -import java.nio.channels.FileLock; -import java.nio.charset.StandardCharsets; - -import org.junit.Test; - -public class FileChannelUnitTest { - - @Test - public void givenFile_whenReadWithFileChannelUsingRandomAccessFile_thenCorrect() throws IOException { - - try (RandomAccessFile reader = new RandomAccessFile("src/test/resources/test_read.in", "r"); - FileChannel channel = reader.getChannel(); - ByteArrayOutputStream out = new ByteArrayOutputStream();) { - - int bufferSize = 1024; - if (bufferSize > channel.size()) { - bufferSize = (int) channel.size(); - } - ByteBuffer buff = ByteBuffer.allocate(bufferSize); - - while (channel.read(buff) > 0) { - out.write(buff.array(), 0, buff.position()); - buff.clear(); - } - - String fileContent = new String(out.toByteArray(), StandardCharsets.UTF_8); - - assertEquals("Hello world", fileContent); - } - } - - @Test - public void givenFile_whenReadWithFileChannelUsingFileInputStream_thenCorrect() throws IOException { - - try (ByteArrayOutputStream out = new ByteArrayOutputStream(); - FileInputStream fin = new FileInputStream("src/test/resources/test_read.in"); - FileChannel channel = fin.getChannel();) { - - int bufferSize = 1024; - if (bufferSize > channel.size()) { - bufferSize = (int) channel.size(); - } - ByteBuffer buff = ByteBuffer.allocate(bufferSize); - - while (channel.read(buff) > 0) { - out.write(buff.array(), 0, buff.position()); - buff.clear(); - } - String fileContent = new String(out.toByteArray(), StandardCharsets.UTF_8); - - assertEquals("Hello world", fileContent); - } - } - - @Test - public void givenFile_whenReadAFileSectionIntoMemoryWithFileChannel_thenCorrect() throws IOException { - - try (RandomAccessFile reader = new RandomAccessFile("src/test/resources/test_read.in", "r"); - FileChannel channel = reader.getChannel(); - ByteArrayOutputStream out = new ByteArrayOutputStream();) { - - MappedByteBuffer buff = channel.map(FileChannel.MapMode.READ_ONLY, 6, 5); - - if (buff.hasRemaining()) { - byte[] data = new byte[buff.remaining()]; - buff.get(data); - assertEquals("world", new String(data, StandardCharsets.UTF_8)); - } - } - } - - @Test - public void whenWriteWithFileChannelUsingRandomAccessFile_thenCorrect() throws IOException { - String file = "src/test/resources/test_write_using_filechannel.txt"; - try (RandomAccessFile writer = new RandomAccessFile(file, "rw"); - FileChannel channel = writer.getChannel();) { - ByteBuffer buff = ByteBuffer.wrap("Hello world".getBytes(StandardCharsets.UTF_8)); - - channel.write(buff); - - // now we verify whether the file was written correctly - RandomAccessFile reader = new RandomAccessFile(file, "r"); - assertEquals("Hello world", reader.readLine()); - reader.close(); - } - } - - @Test - public void givenFile_whenWriteAFileUsingLockAFileSectionWithFileChannel_thenCorrect() throws IOException { - try (RandomAccessFile reader = new RandomAccessFile("src/test/resources/test_read.in", "rw"); - FileChannel channel = reader.getChannel(); - FileLock fileLock = channel.tryLock(6, 5, Boolean.FALSE);) { - - assertNotNull(fileLock); - } - } - - @Test - public void givenFile_whenReadWithFileChannelGetPosition_thenCorrect() throws IOException { - - try (ByteArrayOutputStream out = new ByteArrayOutputStream(); - RandomAccessFile reader = new RandomAccessFile("src/test/resources/test_read.in", "r"); - FileChannel channel = reader.getChannel();) { - - int bufferSize = 1024; - if (bufferSize > channel.size()) { - bufferSize = (int) channel.size(); - } - ByteBuffer buff = ByteBuffer.allocate(bufferSize); - - while (channel.read(buff) > 0) { - out.write(buff.array(), 0, buff.position()); - buff.clear(); - } - - // the original file is 11 bytes long, so that's where the position pointer should be - assertEquals(11, channel.position()); - - channel.position(4); - assertEquals(4, channel.position()); - } - } - - @Test - public void whenGetFileSize_thenCorrect() throws IOException { - - try (RandomAccessFile reader = new RandomAccessFile("src/test/resources/test_read.in", "r"); - FileChannel channel = reader.getChannel();) { - - // the original file is 11 bytes long, so that's where the position pointer should be - assertEquals(11, channel.size()); - } - } - - @Test - public void whenTruncateFile_thenCorrect() throws IOException { - String input = "this is a test input"; - - FileOutputStream fout = new FileOutputStream("src/test/resources/test_truncate.txt"); - FileChannel channel = fout.getChannel(); - - ByteBuffer buff = ByteBuffer.wrap(input.getBytes()); - channel.write(buff); - buff.flip(); - - channel = channel.truncate(5); - assertEquals(5, channel.size()); - - fout.close(); - channel.close(); - } -} diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/filesystem/jndi/test/LookupFSJNDIIntegrationTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/filesystem/jndi/LookupFSJNDIIntegrationTest.java similarity index 96% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/filesystem/jndi/test/LookupFSJNDIIntegrationTest.java rename to core-java-modules/core-java-io/src/test/java/com/baeldung/filesystem/jndi/LookupFSJNDIIntegrationTest.java index 023a47cb97..fe744c5d50 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/filesystem/jndi/test/LookupFSJNDIIntegrationTest.java +++ b/core-java-modules/core-java-io/src/test/java/com/baeldung/filesystem/jndi/LookupFSJNDIIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.filesystem.jndi.test; +package com.baeldung.filesystem.jndi; import com.baeldung.filesystem.jndi.LookupFSJNDI; import org.junit.Test; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/README.md b/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/README.md deleted file mode 100644 index 569be82d27..0000000000 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/README.md +++ /dev/null @@ -1,11 +0,0 @@ -### Relevant Articles: -- [Introduction to the Java NIO2 File API](http://www.baeldung.com/java-nio-2-file-api) -- [Java NIO2 Path API](http://www.baeldung.com/java-nio-2-path) -- [A Guide To NIO2 Asynchronous File Channel](http://www.baeldung.com/java-nio2-async-file-channel) -- [Guide to Selenium with JUnit / TestNG](http://www.baeldung.com/java-selenium-with-junit-and-testng) -- [A Guide to NIO2 Asynchronous Socket Channel](http://www.baeldung.com/java-nio2-async-socket-channel) -- [A Guide To NIO2 FileVisitor](http://www.baeldung.com/java-nio2-file-visitor) -- [A Guide To NIO2 File Attribute APIs](http://www.baeldung.com/java-nio2-file-attribute) -- [How to use the Spring FactoryBean?](http://www.baeldung.com/spring-factorybean) -- [A Guide to WatchService in Java NIO2](http://www.baeldung.com/java-nio2-watchservice) -- [Guide to Java NIO2 Asynchronous Channel APIs](http://www.baeldung.com/java-nio-2-async-channels) diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncFileIntegrationTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncFileIntegrationTest.java deleted file mode 100644 index cf37b92565..0000000000 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncFileIntegrationTest.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.baeldung.java.nio2.async; - -import org.junit.Test; - -import java.io.IOException; -import java.net.URI; -import java.nio.ByteBuffer; -import java.nio.channels.AsynchronousFileChannel; -import java.nio.channels.CompletionHandler; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardOpenOption; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - -import static org.junit.Assert.assertEquals; - -public class AsyncFileIntegrationTest { - - @Test - public void givenPath_whenReadsContentWithFuture_thenCorrect() throws IOException, ExecutionException, InterruptedException { - final Path path = Paths.get(URI.create(this.getClass().getClassLoader().getResource("file.txt").toString())); - final AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.READ); - - final ByteBuffer buffer = ByteBuffer.allocate(1024); - - final Future operation = fileChannel.read(buffer, 0); - - operation.get(); - - final String fileContent = new String(buffer.array()).trim(); - buffer.clear(); - - assertEquals(fileContent, "baeldung.com"); - } - - @Test - public void givenPath_whenReadsContentWithCompletionHandler_thenCorrect() throws IOException { - final Path path = Paths.get(URI.create(this.getClass().getClassLoader().getResource("file.txt").toString())); - final AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.READ); - - final ByteBuffer buffer = ByteBuffer.allocate(1024); - - fileChannel.read(buffer, 0, buffer, new CompletionHandler() { - @Override - public void completed(Integer result, ByteBuffer attachment) { - // result is number of bytes read - // attachment is the buffer - } - - @Override - public void failed(Throwable exc, ByteBuffer attachment) { - - } - }); - } - - @Test - public void givenPathAndContent_whenWritesToFileWithFuture_thenCorrect() throws IOException, ExecutionException, InterruptedException { - final String fileName = "temp"; - final Path path = Paths.get(fileName); - final AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.WRITE, StandardOpenOption.CREATE); - - final ByteBuffer buffer = ByteBuffer.allocate(1024); - final long position = 0; - - buffer.put("hello world".getBytes()); - buffer.flip(); - - final Future operation = fileChannel.write(buffer, position); - buffer.clear(); - - operation.get(); - - final String content = readContent(path); - assertEquals("hello world", content); - } - - @Test - public void givenPathAndContent_whenWritesToFileWithHandler_thenCorrect() throws IOException { - final String fileName = UUID.randomUUID().toString(); - final Path path = Paths.get(fileName); - final AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.DELETE_ON_CLOSE); - - final ByteBuffer buffer = ByteBuffer.allocate(1024); - buffer.put("hello world".getBytes()); - buffer.flip(); - - fileChannel.write(buffer, 0, buffer, new CompletionHandler() { - @Override - public void completed(Integer result, ByteBuffer attachment) { - // result is number of bytes written - // attachment is the buffer - } - - @Override - public void failed(Throwable exc, ByteBuffer attachment) { - - } - }); - } - - // - - private String readContent(Path file) throws ExecutionException, InterruptedException { - AsynchronousFileChannel fileChannel = null; - try { - fileChannel = AsynchronousFileChannel.open(file, StandardOpenOption.READ); - } catch (IOException e) { - e.printStackTrace(); - } - - final ByteBuffer buffer = ByteBuffer.allocate(1024); - - final Future operation = fileChannel.read(buffer, 0); - - operation.get(); - - final String fileContent = new String(buffer.array()).trim(); - buffer.clear(); - return fileContent; - } - -} \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/mimetype/MimeTypeUnitTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/mimetype/MimeTypeUnitTest.java similarity index 99% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java/mimetype/MimeTypeUnitTest.java rename to core-java-modules/core-java-io/src/test/java/com/baeldung/mimetype/MimeTypeUnitTest.java index c8da2c1339..bf916e39e7 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/mimetype/MimeTypeUnitTest.java +++ b/core-java-modules/core-java-io/src/test/java/com/baeldung/mimetype/MimeTypeUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.mimetype; +package com.baeldung.mimetype; import static org.junit.Assert.assertEquals; diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaReadFromFileUnitTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/readfile/JavaReadFromFileUnitTest.java similarity index 99% rename from core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaReadFromFileUnitTest.java rename to core-java-modules/core-java-io/src/test/java/com/baeldung/readfile/JavaReadFromFileUnitTest.java index a96232d66c..a4ccaad594 100644 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaReadFromFileUnitTest.java +++ b/core-java-modules/core-java-io/src/test/java/com/baeldung/readfile/JavaReadFromFileUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.io; +package com.baeldung.readfile; import org.junit.Test; import org.junit.Ignore; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java8/JavaFileSizeUnitTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFileSizeUnitTest.java similarity index 95% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java8/JavaFileSizeUnitTest.java rename to core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFileSizeUnitTest.java index c640932d6f..6b6197c7ce 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java8/JavaFileSizeUnitTest.java +++ b/core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFileSizeUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java8; +package com.baeldung.size; import static org.junit.Assert.assertEquals; @@ -18,7 +18,7 @@ public class JavaFileSizeUnitTest { @Before public void init() { final String separator = File.separator; - filePath = String.join(separator, new String[] { "src", "test", "resources", "testFolder", "sample_file_1.in" }); + filePath = String.join(separator, new String[] { "src", "test", "resources", "size", "sample_file_1.in" }); } @Test diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java8/JavaFolderSizeUnitTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFolderSizeUnitTest.java similarity index 96% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java8/JavaFolderSizeUnitTest.java rename to core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFolderSizeUnitTest.java index 1f3b380772..467da4f76a 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java8/JavaFolderSizeUnitTest.java +++ b/core-java-modules/core-java-io/src/test/java/com/baeldung/size/JavaFolderSizeUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java8; +package com.baeldung.size; import static org.junit.Assert.assertEquals; @@ -25,7 +25,7 @@ public class JavaFolderSizeUnitTest { @Before public void init() { final String separator = File.separator; - path = String.format("src%stest%sresources%stestFolder", separator, separator, separator); + path = String.format("src%stest%sresources%ssize", separator, separator, separator); } @Test diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/stream/FileCopyUnitTest.java b/core-java-modules/core-java-io/src/test/java/com/baeldung/stream/FileCopyUnitTest.java deleted file mode 100644 index b4641083b9..0000000000 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/stream/FileCopyUnitTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.baeldung.stream; - -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.io.IOException; - -import org.junit.Test; - -public class FileCopyUnitTest { - - @Test - public void whenUsingStream_thenCopyFile() throws IOException { - final File src = new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "copyTest" + File.separator + "src" + File.separator + "test_stream.txt"); - final File dest = new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "copyTest" + File.separator + "dest" + File.separator + "test_stream.txt"); - FileCopy.copyFileUsingStream(src, dest); - - assertTrue(dest.exists()); - dest.delete(); - } - - @Test - public void whenUsingFiles_thenCopyFile() throws IOException { - final File src = new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "copyTest" + File.separator + "src" + File.separator + "test_files.txt"); - final File dest = new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "copyTest" + File.separator + "dest" + File.separator + "test_files.txt"); - FileCopy.copyFileUsingJavaFiles(src, dest); - - assertTrue(dest.exists()); - dest.delete(); - } - - @Test - public void whenUsingChannel_thenCopyFile() throws IOException { - final File src = new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "copyTest" + File.separator + "src" + File.separator + "test_channel.txt"); - final File dest = new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "copyTest" + File.separator + "dest" + File.separator + "test_channel.txt"); - FileCopy.copyFileUsingChannel(src, dest); - - assertTrue(dest.exists()); - dest.delete(); - } - - @Test - public void whenUsingApache_thenCopyFile() throws IOException { - final File src = new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "copyTest" + File.separator + "src" + File.separator + "test_apache.txt"); - final File dest = new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "copyTest" + File.separator + "dest" + File.separator + "test_apache.txt"); - FileCopy.copyFileUsingApacheCommonsIO(src, dest); - - assertTrue(dest.exists()); - dest.delete(); - } - -} diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaFileUnitTest.java b/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaFileUnitTest.java deleted file mode 100644 index 6d972611f1..0000000000 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaFileUnitTest.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.baeldung.java.io; - -import org.apache.commons.io.FileUtils; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.file.FileSystemException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.UUID; - -import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; -import static org.junit.Assert.assertTrue; - -public class JavaFileUnitTest { - - private static final String TEMP_DIR = "src/test/resources/temp" + UUID.randomUUID().toString(); - - @BeforeClass - public static void setup() throws IOException { - Files.createDirectory(Paths.get(TEMP_DIR)); - } - - @AfterClass - public static void cleanup() throws IOException { - FileUtils.deleteDirectory(new File(TEMP_DIR)); - } - - @Test - public final void givenUsingJDK6_whenCreatingFile_thenCorrect() throws IOException { - final File newFile = new File(TEMP_DIR + "/newFile_jdk6.txt"); - final boolean success = newFile.createNewFile(); - - assertTrue(success); - } - - @Test - public final void givenUsingJDK7nio2_whenCreatingFile_thenCorrect() throws IOException { - final Path newFilePath = Paths.get(TEMP_DIR + "/newFile_jdk7.txt"); - Files.createFile(newFilePath); - } - - @Test - public final void givenUsingCommonsIo_whenCreatingFile_thenCorrect() throws IOException { - FileUtils.touch(new File(TEMP_DIR + "/newFile_commonsio.txt")); - } - - @Test - public final void givenUsingGuava_whenCreatingFile_thenCorrect() throws IOException { - com.google.common.io.Files.touch(new File(TEMP_DIR + "/newFile_guava.txt")); - } - - // move a file - - @Test - public final void givenUsingJDK6_whenMovingFile_thenCorrect() throws IOException { - final File fileToMove = new File(TEMP_DIR + "/toMoveFile_jdk6.txt"); - fileToMove.createNewFile();// .exists(); - final File destDir = new File(TEMP_DIR + "/"); - destDir.mkdir(); - - final boolean isMoved = fileToMove.renameTo(new File(TEMP_DIR + "/movedFile_jdk6.txt")); - if (!isMoved) { - throw new FileSystemException(TEMP_DIR + "/movedFile_jdk6.txt"); - } - } - - @Test - public final void givenUsingJDK7Nio2_whenMovingFile_thenCorrect() throws IOException { - final Path fileToMovePath = Files.createFile(Paths.get(TEMP_DIR + "/" + randomAlphabetic(5) + ".txt")); - final Path targetPath = Paths.get(TEMP_DIR + "/"); - - Files.move(fileToMovePath, targetPath.resolve(fileToMovePath.getFileName())); - } - - @Test - public final void givenUsingGuava_whenMovingFile_thenCorrect() throws IOException { - final File fileToMove = new File(TEMP_DIR + "/fileToMove.txt"); - fileToMove.createNewFile(); - final File destDir = new File(TEMP_DIR + "/temp"); - final File targetFile = new File(destDir, fileToMove.getName()); - com.google.common.io.Files.createParentDirs(targetFile); - com.google.common.io.Files.move(fileToMove, targetFile); - } - - @Test - public final void givenUsingApache_whenMovingFile_thenCorrect() throws IOException { - FileUtils.touch(new File(TEMP_DIR + "/fileToMove_apache.txt")); - FileUtils.moveFile(FileUtils.getFile(TEMP_DIR + "/fileToMove_apache.txt"), FileUtils.getFile(TEMP_DIR + "/fileMoved_apache2.txt")); - } - - @Test - public final void givenUsingApache_whenMovingFileApproach2_thenCorrect() throws IOException { - FileUtils.touch(new File(TEMP_DIR + "/fileToMove_apache.txt")); - Files.createDirectory(Paths.get(TEMP_DIR + "/temp")); - FileUtils.moveFileToDirectory(FileUtils.getFile(TEMP_DIR + "/fileToMove_apache.txt"), FileUtils.getFile(TEMP_DIR + "/temp"), true); - } - - // delete a file - - @Test - public final void givenUsingJDK6_whenDeletingAFile_thenCorrect() throws IOException { - new File(TEMP_DIR + "/fileToDelete_jdk6.txt").createNewFile(); - - final File fileToDelete = new File(TEMP_DIR + "/fileToDelete_jdk6.txt"); - final boolean success = fileToDelete.delete(); - - assertTrue(success); - } - - @Test - public final void givenUsingJDK7nio2_whenDeletingAFile_thenCorrect() throws IOException { - Files.createFile(Paths.get(TEMP_DIR + "/fileToDelete_jdk7.txt")); - - final Path fileToDeletePath = Paths.get(TEMP_DIR + "/fileToDelete_jdk7.txt"); - Files.delete(fileToDeletePath); - } - - @Test - public final void givenUsingCommonsIo_whenDeletingAFileV1_thenCorrect() throws IOException { - FileUtils.touch(new File(TEMP_DIR + "/fileToDelete_commonsIo.txt")); - - final File fileToDelete = FileUtils.getFile(TEMP_DIR + "/fileToDelete_commonsIo.txt"); - final boolean success = FileUtils.deleteQuietly(fileToDelete); - - assertTrue(success); - } - - @Test - public void givenUsingCommonsIo_whenDeletingAFileV2_thenCorrect() throws IOException { - FileUtils.touch(new File(TEMP_DIR + "/fileToDelete.txt")); - - FileUtils.forceDelete(FileUtils.getFile(TEMP_DIR + "/fileToDelete.txt")); - } - -} diff --git a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToByteArrayUnitTest.java b/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToByteArrayUnitTest.java deleted file mode 100644 index e45e3e73f4..0000000000 --- a/core-java-modules/core-java-io/src/test/java/org/baeldung/java/io/JavaXToByteArrayUnitTest.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.baeldung.java.io; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class JavaXToByteArrayUnitTest { - protected final Logger logger = LoggerFactory.getLogger(getClass()); - - // tests - X to Byte Array - -} diff --git a/core-java-modules/core-java-io/src/test/resources/copyTest/dest/readme.txt b/core-java-modules/core-java-io/src/test/resources/copyTest/dest/readme.txt deleted file mode 100644 index dfda31ee9f..0000000000 --- a/core-java-modules/core-java-io/src/test/resources/copyTest/dest/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -files will be copied here and then deleted -remove `file.delete()` to see the files here diff --git a/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_apache.txt b/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_apache.txt deleted file mode 100644 index a6b651973d..0000000000 --- a/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_apache.txt +++ /dev/null @@ -1 +0,0 @@ -apache diff --git a/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_channel.txt b/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_channel.txt deleted file mode 100644 index 6dca835871..0000000000 --- a/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_channel.txt +++ /dev/null @@ -1 +0,0 @@ -channel diff --git a/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_files.txt b/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_files.txt deleted file mode 100644 index 027271b9b2..0000000000 --- a/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_files.txt +++ /dev/null @@ -1 +0,0 @@ -files diff --git a/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_stream.txt b/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_stream.txt deleted file mode 100644 index eac9b41cbe..0000000000 --- a/core-java-modules/core-java-io/src/test/resources/copyTest/src/test_stream.txt +++ /dev/null @@ -1 +0,0 @@ -stream diff --git a/core-java-modules/core-java-io/src/test/resources/test_write_using_filechannel.txt b/core-java-modules/core-java-io/src/test/resources/size/sample_file_1.in similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/test_write_using_filechannel.txt rename to core-java-modules/core-java-io/src/test/resources/size/sample_file_1.in diff --git a/core-java-modules/core-java-io/src/test/resources/testFolder/sample_file_2.in b/core-java-modules/core-java-io/src/test/resources/size/sample_file_2.in similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/testFolder/sample_file_2.in rename to core-java-modules/core-java-io/src/test/resources/size/sample_file_2.in diff --git a/core-java-modules/core-java-io/src/test/resources/test_truncate.txt b/core-java-modules/core-java-io/src/test/resources/test_truncate.txt deleted file mode 100644 index 26d3b38cdd..0000000000 --- a/core-java-modules/core-java-io/src/test/resources/test_truncate.txt +++ /dev/null @@ -1 +0,0 @@ -this \ No newline at end of file diff --git a/core-java-modules/core-java-jar/README.md b/core-java-modules/core-java-jar/README.md new file mode 100644 index 0000000000..f6bb7677d4 --- /dev/null +++ b/core-java-modules/core-java-jar/README.md @@ -0,0 +1,9 @@ +## Core Java JAR + +This module contains articles about JAR files + +### Relevant Articles: + +- [How to Create an Executable JAR with Maven](http://www.baeldung.com/executable-jar-with-maven) +- [Importance of Main Manifest Attribute in a Self-Executing JAR](http://www.baeldung.com/java-jar-executable-manifest-main-class) +- [Guide to Creating and Running a Jar File in Java](https://www.baeldung.com/java-create-jar) diff --git a/core-java-modules/core-java-jar/pom.xml b/core-java-modules/core-java-jar/pom.xml new file mode 100644 index 0000000000..cd86479d72 --- /dev/null +++ b/core-java-modules/core-java-jar/pom.xml @@ -0,0 +1,400 @@ + + 4.0.0 + core-java-jar + 0.1.0-SNAPSHOT + core-java-jar + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.unix4j + unix4j-command + ${unix4j.version} + + + com.googlecode.grep4j + grep4j + ${grep4j.version} + + + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + + log4j + log4j + ${log4j.version} + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + + org.javamoney + moneta + ${javamoney.moneta.version} + + + + + core-java + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + prepare-package + + copy-dependencies + + + ${project.build.directory}/libs + + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + + true + libs/ + org.baeldung.executable.ExecutableMavenJar + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + package + + single + + + ${project.basedir} + + + org.baeldung.executable.ExecutableMavenJar + + + + jar-with-dependencies + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven-shade-plugin.version} + + + + shade + + + true + + + org.baeldung.executable.ExecutableMavenJar + + + + + + + + + com.jolira + onejar-maven-plugin + ${onejar-maven-plugin.version} + + + + org.baeldung.executable.ExecutableMavenJar + true + ${project.build.finalName}-onejar.${project.packaging} + + + one-jar + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot-maven-plugin.version} + + + + repackage + + + spring-boot + org.baeldung.executable.ExecutableMavenJar + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + java + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + -Xmx300m + -XX:+UseParallelGC + -classpath + + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + 1.8 + 1.8 + + + + + + + + integration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*ManualTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + + + + + + + json + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + run-benchmarks + + none + + exec + + + test + java + + -classpath + + org.openjdk.jmh.Main + .* + + + + + + + + + + + + buildAgentLoader + + + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + agentLoader + target/classes + + + true + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + com/baeldung/instrumentation/application/AgentLoader.class + com/baeldung/instrumentation/application/Launcher.class + + + + + + + + + + buildApplication + + + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + application + target/classes + + + true + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + com/baeldung/instrumentation/application/MyAtm.class + com/baeldung/instrumentation/application/MyAtmApplication.class + com/baeldung/instrumentation/application/Launcher.class + + + + + + + + + + buildAgent + + + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + agent + target/classes + + + true + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + com/baeldung/instrumentation/agent/AtmTransformer.class + com/baeldung/instrumentation/agent/MyInstrumentationAgent.class + + + + + + + + + + + + + 0.4 + 1.8.7 + + + 3.10.0 + + + 1.1 + + 3.0.0-M1 + 3.0.2 + 1.4.4 + 3.1.1 + 2.0.3.RELEASE + 1.6.0 + + diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/jar/JarExample.java b/core-java-modules/core-java-jar/src/main/java/com/baeldung/jar/JarExample.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/jar/JarExample.java rename to core-java-modules/core-java-jar/src/main/java/com/baeldung/jar/JarExample.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/jar/example_manifest.txt b/core-java-modules/core-java-jar/src/main/java/com/baeldung/jar/example_manifest.txt similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/jar/example_manifest.txt rename to core-java-modules/core-java-jar/src/main/java/com/baeldung/jar/example_manifest.txt diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/manifest/AppExample.java b/core-java-modules/core-java-jar/src/main/java/com/baeldung/manifest/AppExample.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/manifest/AppExample.java rename to core-java-modules/core-java-jar/src/main/java/com/baeldung/manifest/AppExample.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/manifest/ExecuteJarFile.java b/core-java-modules/core-java-jar/src/main/java/com/baeldung/manifest/ExecuteJarFile.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/manifest/ExecuteJarFile.java rename to core-java-modules/core-java-jar/src/main/java/com/baeldung/manifest/ExecuteJarFile.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/manifest/MANIFEST.MF b/core-java-modules/core-java-jar/src/main/java/com/baeldung/manifest/MANIFEST.MF similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/manifest/MANIFEST.MF rename to core-java-modules/core-java-jar/src/main/java/com/baeldung/manifest/MANIFEST.MF diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/manifest/ExecuteJarFileUnitTest.java b/core-java-modules/core-java-jar/src/test/java/com/baeldung/manifest/ExecuteJarFileUnitTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/manifest/ExecuteJarFileUnitTest.java rename to core-java-modules/core-java-jar/src/test/java/com/baeldung/manifest/ExecuteJarFileUnitTest.java diff --git a/core-java-modules/core-java-jndi/README.md b/core-java-modules/core-java-jndi/README.md new file mode 100644 index 0000000000..d9fb324c9a --- /dev/null +++ b/core-java-modules/core-java-jndi/README.md @@ -0,0 +1,4 @@ + +### Relevant Articles: + +- [Java Naming and Directory Interface Overview](https://www.baeldung.com/jndi) diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml index 757d9229df..09ca44d9be 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml @@ -3,7 +3,6 @@ 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"> 4.0.0 - com.baeldung.consumermodule consumermodule 1.0 diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml index 4de3df8c01..861f06f089 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml @@ -3,16 +3,16 @@ 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"> 4.0.0 + com.baeldung.servicemodule + servicemodule + 1.0 + >com.baeldung.decoupling-pattern2 decoupling-pattern2 1.0-SNAPSHOT - com.baeldung.servicemodule - servicemodule - 1.0 - diff --git a/core-java-modules/core-java-jvm/README.md b/core-java-modules/core-java-jvm/README.md index 82067ad952..89600ad924 100644 --- a/core-java-modules/core-java-jvm/README.md +++ b/core-java-modules/core-java-jvm/README.md @@ -1,6 +1,12 @@ -========= - ## Core Java JVM Cookbooks and Examples +This module contains articles about working with the Java Virtual Machine (JVM). + ### Relevant Articles: + - [Method Inlining in the JVM](https://www.baeldung.com/jvm-method-inlining) +- [JVM Log Forging](https://www.baeldung.com/jvm-log-forging) +- [Guide to Java Instrumentation](https://www.baeldung.com/java-instrumentation) +- [Class Loaders in Java](https://www.baeldung.com/java-classloaders) +- [A Guide to System.exit()](https://www.baeldung.com/java-system-exit) +- [Guide to System.gc()](https://www.baeldung.com/java-system-gc) diff --git a/core-java-modules/core-java-jvm/pom.xml b/core-java-modules/core-java-jvm/pom.xml index b1860322a6..74960820d7 100644 --- a/core-java-modules/core-java-jvm/pom.xml +++ b/core-java-modules/core-java-jvm/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-jvm 0.1.0-SNAPSHOT jar @@ -32,9 +31,31 @@ ${assertj.version} test + + org.javassist + javassist + ${javaassist.version} + + + org.owasp.esapi + esapi + ${esapi.version} + + + com.sun + tools + ${sun.tools.version} + system + ${java.home}/../lib/tools.jar + + 3.6.1 + + 3.21.0-GA + 2.1.0.1 + 1.8.0 diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/classloader/CustomClassLoader.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/classloader/CustomClassLoader.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/classloader/CustomClassLoader.java rename to core-java-modules/core-java-jvm/src/main/java/com/baeldung/classloader/CustomClassLoader.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/classloader/PrintClassLoader.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/classloader/PrintClassLoader.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/classloader/PrintClassLoader.java rename to core-java-modules/core-java-jvm/src/main/java/com/baeldung/classloader/PrintClassLoader.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/agent/AtmTransformer.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/agent/AtmTransformer.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/agent/AtmTransformer.java rename to core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/agent/AtmTransformer.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/agent/MyInstrumentationAgent.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/agent/MyInstrumentationAgent.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/agent/MyInstrumentationAgent.java rename to core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/agent/MyInstrumentationAgent.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/application/AgentLoader.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/application/AgentLoader.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/application/AgentLoader.java rename to core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/application/AgentLoader.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/application/Launcher.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/application/Launcher.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/application/Launcher.java rename to core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/application/Launcher.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/application/MyAtm.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/application/MyAtm.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/application/MyAtm.java rename to core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/application/MyAtm.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/application/MyAtmApplication.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/application/MyAtmApplication.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/instrumentation/application/MyAtmApplication.java rename to core-java-modules/core-java-jvm/src/main/java/com/baeldung/instrumentation/application/MyAtmApplication.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/logforging/LogForgingDemo.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/logforging/LogForgingDemo.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/logforging/LogForgingDemo.java rename to core-java-modules/core-java-jvm/src/main/java/com/baeldung/logforging/LogForgingDemo.java diff --git a/core-java-modules/core-java-io/src/main/resources/ESAPI.properties b/core-java-modules/core-java-jvm/src/main/resources/ESAPI.properties similarity index 100% rename from core-java-modules/core-java-io/src/main/resources/ESAPI.properties rename to core-java-modules/core-java-jvm/src/main/resources/ESAPI.properties diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/classloader/CustomClassLoaderUnitTest.java b/core-java-modules/core-java-jvm/src/test/java/com/baeldung/classloader/CustomClassLoaderUnitTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/classloader/CustomClassLoaderUnitTest.java rename to core-java-modules/core-java-jvm/src/test/java/com/baeldung/classloader/CustomClassLoaderUnitTest.java diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/classloader/PrintClassLoaderUnitTest.java b/core-java-modules/core-java-jvm/src/test/java/com/baeldung/classloader/PrintClassLoaderUnitTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/classloader/PrintClassLoaderUnitTest.java rename to core-java-modules/core-java-jvm/src/test/java/com/baeldung/classloader/PrintClassLoaderUnitTest.java diff --git a/core-java-modules/core-java-lambdas/README.md b/core-java-modules/core-java-lambdas/README.md index 98fff64d68..832d4783f2 100644 --- a/core-java-modules/core-java-lambdas/README.md +++ b/core-java-modules/core-java-lambdas/README.md @@ -6,3 +6,4 @@ - [Lambda Expressions and Functional Interfaces: Tips and Best Practices](http://www.baeldung.com/java-8-lambda-expressions-tips) - [Exceptions in Java 8 Lambda Expressions](http://www.baeldung.com/java-lambda-exceptions) - [Method References in Java](https://www.baeldung.com/java-method-references) +- [The Double Colon Operator in Java 8](https://www.baeldung.com/java-8-double-colon-operator) \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/Computer.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/Computer.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/Computer.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/Computer.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/ComputerUtils.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/ComputerUtils.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/ComputerUtils.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/ComputerUtils.java index 317808d893..ea274072ea 100644 --- a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/ComputerUtils.java +++ b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/ComputerUtils.java @@ -1,10 +1,10 @@ package com.baeldung.doublecolon; -import com.baeldung.doublecolon.function.ComputerPredicate; - import java.util.ArrayList; import java.util.List; +import com.baeldung.doublecolon.function.ComputerPredicate; + public class ComputerUtils { static final ComputerPredicate after2010Predicate = (c) -> (c.getAge() > 2010); diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/MacbookPro.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/MacbookPro.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/MacbookPro.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/MacbookPro.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/function/ComputerPredicate.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/function/ComputerPredicate.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/function/ComputerPredicate.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/function/ComputerPredicate.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/function/TriFunction.java b/core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/function/TriFunction.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/doublecolon/function/TriFunction.java rename to core-java-modules/core-java-lambdas/src/main/java/com/baeldung/doublecolon/function/TriFunction.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java b/core-java-modules/core-java-lambdas/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java rename to core-java-modules/core-java-lambdas/src/test/java/com/baeldung/doublecolon/ComputerUtilsUnitTest.java diff --git a/core-java-modules/core-java-lambdas/src/test/java/com/baeldung/java8/lambda/methodreference/MethodReferenceUnitTest.java b/core-java-modules/core-java-lambdas/src/test/java/com/baeldung/java8/lambda/methodreference/MethodReferenceUnitTest.java index 835815aecd..957294153b 100644 --- a/core-java-modules/core-java-lambdas/src/test/java/com/baeldung/java8/lambda/methodreference/MethodReferenceUnitTest.java +++ b/core-java-modules/core-java-lambdas/src/test/java/com/baeldung/java8/lambda/methodreference/MethodReferenceUnitTest.java @@ -35,9 +35,9 @@ public class MethodReferenceUnitTest { public void referenceToInstanceMethodOfArbitratyObjectOfParticularType() { List numbers = Arrays.asList(5, 3, 50, 24, 40, 2, 9, 18); numbers.stream() - .sorted((a, b) -> Integer.compare(a, b)); + .sorted((a, b) -> a.compareTo(b)); numbers.stream() - .sorted(Integer::compare); + .sorted(Integer::compareTo); } @Test diff --git a/core-java-modules/core-java-lang-2/README.md b/core-java-modules/core-java-lang-2/README.md index 88a48661a0..ee57ec6198 100644 --- a/core-java-modules/core-java-lang-2/README.md +++ b/core-java-modules/core-java-lang-2/README.md @@ -1,5 +1,8 @@ -========= +## Core Java Lang (Part 2) -## Core Java Lang Cookbooks and Examples +This module contains articles about core features in the Java language ### Relevant Articles: +- [Java Primitives versus Objects](https://www.baeldung.com/java-primitives-vs-objects) +- [Command-Line Arguments in Java](https://www.baeldung.com/java-command-line-arguments) +- [[<-- Prev]](/core-java-modules/core-java-lang) diff --git a/core-java-modules/core-java-lang-2/pom.xml b/core-java-modules/core-java-lang-2/pom.xml index 4b02e06be4..3230498f41 100644 --- a/core-java-modules/core-java-lang-2/pom.xml +++ b/core-java-modules/core-java-lang-2/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-lang-2 0.1.0-SNAPSHOT core-java-lang-2 @@ -15,6 +14,26 @@ + + commons-beanutils + commons-beanutils + 1.9.4 + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + @@ -28,6 +47,8 @@ + 1.19 + 1.19 diff --git a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/pojo/EmployeeBean.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/pojo/EmployeeBean.java new file mode 100644 index 0000000000..faf1c1f261 --- /dev/null +++ b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/pojo/EmployeeBean.java @@ -0,0 +1,53 @@ +package com.baeldung.pojo; + +import java.io.Serializable; +import java.time.LocalDate; + +public class EmployeeBean implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -3760445487636086034L; + + private String firstName; + + private String lastName; + + private LocalDate startDate; + + public EmployeeBean() { + + } + + public EmployeeBean(String firstName, String lastName, LocalDate startDate) { + this.firstName = firstName; + this.lastName = lastName; + this.startDate = startDate; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(LocalDate startDate) { + this.startDate = startDate; + } + +} diff --git a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/pojo/EmployeePojo.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/pojo/EmployeePojo.java new file mode 100644 index 0000000000..a48fa94381 --- /dev/null +++ b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/pojo/EmployeePojo.java @@ -0,0 +1,27 @@ +package com.baeldung.pojo; + +import java.time.LocalDate; + +public class EmployeePojo { + + public String firstName; + + public String lastName; + + private LocalDate startDate; + + public EmployeePojo(String firstName, String lastName, LocalDate startDate) { + this.firstName = firstName; + this.lastName = lastName; + this.startDate = startDate; + } + + public String name() { + return this.firstName + " " + this.lastName; + } + + public LocalDate getStart() { + return this.startDate; + } + +} diff --git a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/pojo/ReflectionExample.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/pojo/ReflectionExample.java new file mode 100644 index 0000000000..ebb4c10d92 --- /dev/null +++ b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/pojo/ReflectionExample.java @@ -0,0 +1,24 @@ +package com.baeldung.pojo; + +import java.beans.PropertyDescriptor; + +import org.apache.commons.beanutils.PropertyUtils; + + +public class ReflectionExample { + + public static void main(String[] args) { + + System.out.println("Fields for EmployeePojo are:"); + for (PropertyDescriptor pd : PropertyUtils.getPropertyDescriptors(EmployeePojo.class)) { + System.out.println(pd.getDisplayName()); + } + + System.out.println("Fields for EmployeeBean are:"); + for (PropertyDescriptor pd : PropertyUtils.getPropertyDescriptors(EmployeeBean.class)) { + System.out.println(pd.getDisplayName()); + } + + } + +} diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BenchmarkRunner.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BenchmarkRunner.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BenchmarkRunner.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BenchmarkRunner.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BooleanPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BooleanPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BooleanPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BooleanPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BooleanWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BooleanWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BooleanWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BooleanWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BytePrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BytePrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/BytePrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/BytePrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ByteWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ByteWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ByteWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ByteWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/CharPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/CharPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/CharPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/CharPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/CharacterWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/CharacterWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/CharacterWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/CharacterWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/DoublePrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/DoublePrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/DoublePrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/DoublePrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/DoubleWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/DoubleWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/DoubleWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/DoubleWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/FloatPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/FloatPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/FloatPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/FloatPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/FloatWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/FloatWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/FloatWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/FloatWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/IntPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/IntPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/IntPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/IntPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/IntegerWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/IntegerWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/IntegerWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/IntegerWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/LongPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/LongPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/LongPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/LongPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/LongWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/LongWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/LongWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/LongWrapperLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/Lookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/Lookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/Lookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/Lookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ShortPrimitiveLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ShortPrimitiveLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ShortPrimitiveLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ShortPrimitiveLookup.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ShortWrapperLookup.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ShortWrapperLookup.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/primitive/ShortWrapperLookup.java rename to core-java-modules/core-java-lang-2/src/main/java/com/baeldung/primitive/ShortWrapperLookup.java diff --git a/core-java-modules/core-java-lang-math/README.md b/core-java-modules/core-java-lang-math/README.md new file mode 100644 index 0000000000..b316ed1cfb --- /dev/null +++ b/core-java-modules/core-java-lang-math/README.md @@ -0,0 +1,8 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [Java 8 Math New Methods](https://www.baeldung.com/java-8-math) +- [Java 8 Unsigned Arithmetic Support](https://www.baeldung.com/java-unsigned-arithmetic) +- [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts) diff --git a/core-java-modules/core-java-lang-math/pom.xml b/core-java-modules/core-java-lang-math/pom.xml new file mode 100644 index 0000000000..f884aca3a9 --- /dev/null +++ b/core-java-modules/core-java-lang-math/pom.xml @@ -0,0 +1,40 @@ + + 4.0.0 + core-java-lang-math + 0.1.0-SNAPSHOT + core-java-lang-math + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-lang-math + + + src/main/resources + true + + + + + + + 3.6.1 + + diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/doubles/SplitFloatingPointNumbers.java b/core-java-modules/core-java-lang-math/src/main/java/com/baeldung/doubles/SplitFloatingPointNumbers.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/doubles/SplitFloatingPointNumbers.java rename to core-java-modules/core-java-lang-math/src/main/java/com/baeldung/doubles/SplitFloatingPointNumbers.java diff --git a/core-java-modules/core-java-lang-math/src/main/java/com/baeldung/strictfpUsage/Circle.java b/core-java-modules/core-java-lang-math/src/main/java/com/baeldung/strictfpUsage/Circle.java new file mode 100644 index 0000000000..a1f08d1bff --- /dev/null +++ b/core-java-modules/core-java-lang-math/src/main/java/com/baeldung/strictfpUsage/Circle.java @@ -0,0 +1,5 @@ +package com.baeldung.strictfpUsage; + +public strictfp interface Circle { + double computeArea(double radius); +} diff --git a/core-java-modules/core-java-lang-math/src/main/java/com/baeldung/strictfpUsage/ScientificCalculator.java b/core-java-modules/core-java-lang-math/src/main/java/com/baeldung/strictfpUsage/ScientificCalculator.java new file mode 100644 index 0000000000..b898c3da3e --- /dev/null +++ b/core-java-modules/core-java-lang-math/src/main/java/com/baeldung/strictfpUsage/ScientificCalculator.java @@ -0,0 +1,12 @@ +package com.baeldung.strictfpUsage; + +public strictfp class ScientificCalculator { + + public double sum(double value1, double value2) { + return value1 + value2; + } + + public double diff(double value1, double value2) { + return value1 - value2; + } +} diff --git a/java-strings/src/main/resources/logback.xml b/core-java-modules/core-java-lang-math/src/main/resources/logback.xml similarity index 100% rename from java-strings/src/main/resources/logback.xml rename to core-java-modules/core-java-lang-math/src/main/resources/logback.xml diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/UnsignedArithmeticUnitTest.java b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/java8/UnsignedArithmeticUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/UnsignedArithmeticUnitTest.java rename to core-java-modules/core-java-lang-math/src/test/java/com/baeldung/java8/UnsignedArithmeticUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/math/MathNewMethodsUnitTest.java b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/math/MathNewMethodsUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/math/MathNewMethodsUnitTest.java rename to core-java-modules/core-java-lang-math/src/test/java/com/baeldung/math/MathNewMethodsUnitTest.java diff --git a/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/strictfpUsage/ScientificCalculatorUnitTest.java b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/strictfpUsage/ScientificCalculatorUnitTest.java new file mode 100644 index 0000000000..775c75ca9d --- /dev/null +++ b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/strictfpUsage/ScientificCalculatorUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.strictfpUsage; + +import org.junit.Test; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; + +public class ScientificCalculatorUnitTest { + + @Test + public void whenMethodOfstrictfpClassInvoked_thenIdenticalResultOnAllPlatforms() { + ScientificCalculator calculator = new ScientificCalculator(); + double result = calculator.sum(23e10, 98e17); + assertThat(result, is(9.800000230000001E18)); + result = calculator.diff(Double.MAX_VALUE, 1.56); + assertThat(result, is(1.7976931348623157E308)); + } +} diff --git a/core-java-modules/core-java-lang-oop-2/README.md b/core-java-modules/core-java-lang-oop-2/README.md index 7fee77d4bb..035d464c50 100644 --- a/core-java-modules/core-java-lang-oop-2/README.md +++ b/core-java-modules/core-java-lang-oop-2/README.md @@ -1,15 +1,19 @@ -========= +## Core Java Lang OOP (Part 2) -## Core Java Lang OOP 2 Cookbooks and Examples +This module contains articles about Object-oriented programming (OOP) in Java ### Relevant Articles: - [Generic Constructors in Java](https://www.baeldung.com/java-generic-constructors) - [Cannot Reference “X” Before Supertype Constructor Has Been Called](https://www.baeldung.com/java-cannot-reference-x-before-supertype-constructor-error) - [Anonymous Classes in Java](https://www.baeldung.com/java-anonymous-classes) - [Raw Types in Java](https://www.baeldung.com/raw-types-java) -- [Java ‘private’ Access Modifier](https://www.baeldung.com/java-private-keyword) - [Marker Interfaces in Java](https://www.baeldung.com/java-marker-interfaces) - [Java equals() and hashCode() Contracts](https://www.baeldung.com/java-equals-hashcode-contracts) -- [Immutable Objects in Java](http://www.baeldung.com/java-immutable-object) -- [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) +- [Immutable Objects in Java](https://www.baeldung.com/java-immutable-object) +- [Inheritance and Composition (Is-a vs Has-a relationship) in Java](https://www.baeldung.com/java-inheritance-composition) - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) +- [Composition, Aggregation, and Association in Java](https://www.baeldung.com/java-composition-aggregation-association) +- [Static and Default Methods in Interfaces in Java](https://www.baeldung.com/java-static-default-methods) +- [Java Copy Constructor](https://www.baeldung.com/java-copy-constructor) +- [Abstract Classes in Java](https://www.baeldung.com/java-abstract-class) +- [[<-- Prev]](/core-java-modules/core-java-lang-oop)[[More -->]](/core-java-modules/core-java-lang-oop-3) diff --git a/core-java-modules/core-java-lang-oop-2/pom.xml b/core-java-modules/core-java-lang-oop-2/pom.xml index d27df147b7..5bca2f0dbf 100644 --- a/core-java-modules/core-java-lang-oop-2/pom.xml +++ b/core-java-modules/core-java-lang-oop-2/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-lang-oop-2 0.1.0-SNAPSHOT core-java-lang-oop-2 @@ -29,13 +28,6 @@ test - - - 1.4.199 - - 3.10.0 - 3.0.3 - core-java-lang-oop-2 @@ -47,4 +39,10 @@ + + + 3.10.0 + 3.0.3 + + diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/abstractclasses/application/Application.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/abstractclasses/application/Application.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/abstractclasses/application/Application.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/abstractclasses/filereaders/BaseFileReader.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/abstractclasses/filereaders/LowercaseFileReader.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/abstractclasses/filereaders/UppercaseFileReader.java diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/Employee.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/Employee.java deleted file mode 100644 index 6ec68d6ebb..0000000000 --- a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/Employee.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.baeldung.core.modifiers; - -public class Employee { - - private String privateId; - private String name; - private boolean manager; - - public Employee(String id, String name) { - setPrivateId(id); - setName(name); - } - - private Employee(String id, String name, boolean managerAttribute) { - this.privateId = id; - this.name = name; - this.privateId = id + "_ID-MANAGER"; - } - - public void setPrivateId(String customId) { - if (customId.endsWith("_ID")) { - this.privateId = customId; - } else { - this.privateId = customId + "_ID"; - } - } - - public String getPrivateId() { - return privateId; - } - - public boolean isManager() { - return manager; - } - - public void elevateToManager() { - if ("Carl".equals(this.name)) { - setManager(true); - } - } - - private void setManager(boolean manager) { - this.manager = manager; - } - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static Employee buildManager(String id, String name) { - return new Employee(id, name, true); - } - -} diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/application/Application.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/application/Application.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/application/Application.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/application/Application.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Alarm.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Alarm.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Alarm.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Alarm.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Car.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Car.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Car.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Car.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Motorbike.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Motorbike.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Motorbike.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Motorbike.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/MultiAlarmCar.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/MultiAlarmCar.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/MultiAlarmCar.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/MultiAlarmCar.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Vehicle.java b/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Vehicle.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Vehicle.java rename to core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/defaultstaticinterfacemethods/model/Vehicle.java diff --git a/core-java-modules/core-java/src/main/resources/files/test.txt b/core-java-modules/core-java-lang-oop-2/src/main/resources/files/test.txt similarity index 100% rename from core-java-modules/core-java/src/main/resources/files/test.txt rename to core-java-modules/core-java-lang-oop-2/src/main/resources/files/test.txt diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/abstractclasses/test/LowercaseFileReaderUnitTest.java b/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/abstractclasses/test/LowercaseFileReaderUnitTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/abstractclasses/test/LowercaseFileReaderUnitTest.java rename to core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/abstractclasses/test/LowercaseFileReaderUnitTest.java diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/abstractclasses/test/UppercaseFileReaderUnitTest.java b/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/abstractclasses/test/UppercaseFileReaderUnitTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/abstractclasses/test/UppercaseFileReaderUnitTest.java rename to core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/abstractclasses/test/UppercaseFileReaderUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/defaultistaticinterfacemethods/test/StaticDefaulInterfaceMethodUnitTest.java b/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/defaultistaticinterfacemethods/test/StaticDefaulInterfaceMethodUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/defaultistaticinterfacemethods/test/StaticDefaulInterfaceMethodUnitTest.java rename to core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/defaultistaticinterfacemethods/test/StaticDefaulInterfaceMethodUnitTest.java diff --git a/core-java-modules/core-java-lang-oop-3/.gitignore b/core-java-modules/core-java-lang-oop-3/.gitignore deleted file mode 100644 index 3de4cc647e..0000000000 --- a/core-java-modules/core-java-lang-oop-3/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -*.class - -0.* - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* -.resourceCache - -# Packaged files # -*.jar -*.war -*.ear - -# Files generated by integration tests -*.txt -backup-pom.xml -/bin/ -/temp - -#IntelliJ specific -.idea/ -*.iml \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-3/README.md b/core-java-modules/core-java-lang-oop-3/README.md index 57df2c1769..b1ca877ae0 100644 --- a/core-java-modules/core-java-lang-oop-3/README.md +++ b/core-java-modules/core-java-lang-oop-3/README.md @@ -1,11 +1,16 @@ -========= +## Core Java Lang OOP (Part 3) -## Core Java Lang OOP 3 Cookbooks and Examples +This module contains articles about Object-oriented programming (OOP) in Java ### Relevant Articles: -- [Pass-By-Value as a Parameter Passing Mechanism in Java](http://www.baeldung.com/java-pass-by-value-or-pass-by-reference) -- [Access Modifiers in Java](http://www.baeldung.com/java-access-modifiers) -- [Guide to the super Java Keyword](http://www.baeldung.com/java-super) -- [Guide to the this Java Keyword](http://www.baeldung.com/java-this) -- [Java Public Access Modifier](https://www.baeldung.com/java-public-keyword) -- [Composition, Aggregation and Association in Java](https://www.baeldung.com/java-composition-aggregation-association) \ No newline at end of file +- [Pass-By-Value as a Parameter Passing Mechanism in Java](https://www.baeldung.com/java-pass-by-value-or-pass-by-reference) +- [Access Modifiers in Java](https://www.baeldung.com/java-access-modifiers) +- [Guide to the super Java Keyword](https://www.baeldung.com/java-super) +- [Guide to the this Java Keyword](https://www.baeldung.com/java-this) +- [Java ‘public’ Access Modifier](https://www.baeldung.com/java-public-keyword) +- [Composition, Aggregation and Association in Java](https://www.baeldung.com/java-composition-aggregation-association) +- [Nested Classes in Java](https://www.baeldung.com/java-nested-classes) +- [A Guide to Inner Interfaces in Java](https://www.baeldung.com/java-inner-interfaces) +- [Java Classes and Objects](https://www.baeldung.com/java-classes-objects) +- [Java Interfaces](https://www.baeldung.com/java-interfaces) +- [[<-- Prev]](/core-java-modules/core-java-lang-oop-2)[[More -->]](/core-java-modules/core-java-lang-oop-4) \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-3/pom.xml b/core-java-modules/core-java-lang-oop-3/pom.xml index 29807b5bef..1caf17bef3 100644 --- a/core-java-modules/core-java-lang-oop-3/pom.xml +++ b/core-java-modules/core-java-lang-oop-3/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-lang-oop-3 0.1.0-SNAPSHOT core-java-lang-oop-3 @@ -15,6 +14,24 @@ + + + log4j + log4j + ${log4j.version} + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + + + + org.assertj + assertj-core + ${assertj-core.version} + test + com.h2database h2 @@ -23,4 +40,18 @@ + + core-java-lang-oop-3 + + + src/main/resources + true + + + + + + 3.10.0 + + diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/CommaSeparatedCustomers.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/innerinterfaces/CommaSeparatedCustomers.java similarity index 92% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/CommaSeparatedCustomers.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/innerinterfaces/CommaSeparatedCustomers.java index 29ed2d3d26..a815720d62 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/CommaSeparatedCustomers.java +++ b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/innerinterfaces/CommaSeparatedCustomers.java @@ -1,4 +1,4 @@ -package com.baeldung.interfaces; +package com.baeldung.innerinterfaces; import java.util.ArrayList; import java.util.List; diff --git a/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/innerinterfaces/Customer.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/innerinterfaces/Customer.java new file mode 100644 index 0000000000..ce27460cbb --- /dev/null +++ b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/innerinterfaces/Customer.java @@ -0,0 +1,19 @@ +package com.baeldung.innerinterfaces; + +public class Customer { + public interface List { + void Add(Customer customer); + + String getCustomerNames(); + } + + private String name; + + public Customer(String name) { + this.name = name; + } + + String getName() { + return name; + } +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/Box.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/Box.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/Box.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/Box.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/Employee.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/Employee.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/Employee.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/Employee.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/EmployeeSalaryComparator.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/EmployeeSalaryComparator.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/EmployeeSalaryComparator.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/EmployeeSalaryComparator.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/HasColor.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/HasColor.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/HasColor.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/HasColor.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/multiinheritance/Car.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/multiinheritance/Car.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/multiinheritance/Car.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/multiinheritance/Car.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/multiinheritance/Fly.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/multiinheritance/Fly.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/multiinheritance/Fly.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/multiinheritance/Fly.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/multiinheritance/Transform.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/multiinheritance/Transform.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/multiinheritance/Transform.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/multiinheritance/Transform.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/multiinheritance/Vehicle.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/multiinheritance/Vehicle.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/multiinheritance/Vehicle.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/multiinheritance/Vehicle.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/polymorphysim/Circle.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/polymorphysim/Circle.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/polymorphysim/Circle.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/polymorphysim/Circle.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/polymorphysim/MainTestClass.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/polymorphysim/MainTestClass.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/polymorphysim/MainTestClass.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/polymorphysim/MainTestClass.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/polymorphysim/Shape.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/polymorphysim/Shape.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/polymorphysim/Shape.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/polymorphysim/Shape.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/polymorphysim/Square.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/polymorphysim/Square.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/polymorphysim/Square.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/interfaces/polymorphysim/Square.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/objects/Car.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/objects/Car.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/objects/Car.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/objects/Car.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java similarity index 99% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java index 0e1746fc38..2c6ff3d683 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java +++ b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java @@ -17,7 +17,7 @@ public class NonPrimitives { b1.num++; } } - + class FooClass { public int num; diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/parameterpassing/Primitives.java b/core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/parameterpassing/Primitives.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/parameterpassing/Primitives.java rename to core-java-modules/core-java-lang-oop-3/src/main/java/com/baeldung/parameterpassing/Primitives.java diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/interfaces/InnerInterfaceUnitTest.java b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/innerinterfaces/InnerInterfaceUnitTest.java similarity index 78% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/interfaces/InnerInterfaceUnitTest.java rename to core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/innerinterfaces/InnerInterfaceUnitTest.java index 65d7c860a8..65e51ed93d 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/interfaces/InnerInterfaceUnitTest.java +++ b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/innerinterfaces/InnerInterfaceUnitTest.java @@ -1,11 +1,13 @@ -package com.baeldung.interfaces; - -import static org.junit.Assert.assertEquals; +package com.baeldung.innerinterfaces; +import com.baeldung.innerinterfaces.CommaSeparatedCustomers; +import com.baeldung.innerinterfaces.Customer; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import static org.junit.Assert.assertEquals; + @RunWith(JUnit4.class) public class InnerInterfaceUnitTest { @Test diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/AnonymousInner.java b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/AnonymousInner.java similarity index 100% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/AnonymousInner.java rename to core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/AnonymousInner.java diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/Enclosing.java b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/Enclosing.java similarity index 81% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/Enclosing.java rename to core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/Enclosing.java index 3db33cde9b..a7c0e1b29f 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/Enclosing.java +++ b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/Enclosing.java @@ -15,7 +15,7 @@ public class Enclosing { @Test public void test() { - Enclosing.StaticNested nested = new Enclosing.StaticNested(); + StaticNested nested = new StaticNested(); nested.run(); } } diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/NewEnclosing.java b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/NewEnclosing.java similarity index 100% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/NewEnclosing.java rename to core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/NewEnclosing.java diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/NewOuter.java b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/NewOuter.java similarity index 91% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/NewOuter.java rename to core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/NewOuter.java index 260f69fd1b..37c8be7817 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/NewOuter.java +++ b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/NewOuter.java @@ -23,7 +23,7 @@ public class NewOuter { @Test public void test() { NewOuter outer = new NewOuter(); - NewOuter.InnerClass inner = outer.new InnerClass(); + InnerClass inner = outer.new InnerClass(); inner.run(); } diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/Outer.java b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/Outer.java similarity index 86% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/Outer.java rename to core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/Outer.java index d5e46670c9..196cd6cd38 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nestedclass/Outer.java +++ b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/nestedclass/Outer.java @@ -14,7 +14,7 @@ public class Outer { @Test public void test() { Outer outer = new Outer(); - Outer.Inner inner = outer.new Inner(); + Inner inner = outer.new Inner(); inner.run(); } } diff --git a/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/objects/ObjectsUnitTest.java b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/objects/ObjectsUnitTest.java new file mode 100644 index 0000000000..e0f8766be4 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-3/src/test/java/com/baeldung/objects/ObjectsUnitTest.java @@ -0,0 +1,38 @@ +package com.baeldung.objects; + +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.*; + +public class ObjectsUnitTest { + + private Car car; + + @Before + public void setUp() throws Exception { + car = new Car("Ford", "Focus", "red"); + } + + @Test + public final void when_speedIncreased_then_verifySpeed() { + car.increaseSpeed(30); + assertEquals(30, car.getSpeed()); + + car.increaseSpeed(20); + assertEquals(50, car.getSpeed()); + } + + @Test + public final void when_speedDecreased_then_verifySpeed() { + car.increaseSpeed(50); + assertEquals(50, car.getSpeed()); + + car.decreaseSpeed(30); + assertEquals(20, car.getSpeed()); + + car.decreaseSpeed(20); + assertEquals(0, car.getSpeed()); + } + +} diff --git a/core-java-modules/core-java-lang-oop-4/README.md b/core-java-modules/core-java-lang-oop-4/README.md new file mode 100644 index 0000000000..51650dc1f6 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-4/README.md @@ -0,0 +1,9 @@ +## Core Java Lang OOP (Part 4) + +This module contains articles about Object-oriented programming (OOP) in Java + +### Relevant Articles: +- [Static and Dynamic Binding in Java](https://www.baeldung.com/java-static-dynamic-binding) +- [Methods in Java](https://www.baeldung.com/java-methods) +- [Java ‘private’ Access Modifier](https://www.baeldung.com/java-private-keyword) +- [[<-- Prev]](/core-java-modules/core-java-lang-oop-3) \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-4/pom.xml b/core-java-modules/core-java-lang-oop-4/pom.xml new file mode 100644 index 0000000000..72662a8ea4 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-4/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + core-java-lang-oop-4 + 0.1.0-SNAPSHOT + core-java-lang-oop-4 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + log4j + log4j + ${log4j.version} + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + + com.h2database + h2 + ${h2.version} + test + + + + + core-java-lang-oop-4 + + + src/main/resources + true + + + + + + 3.10.0 + + + diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/basicmethods/PersonName.java b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/basicmethods/PersonName.java similarity index 100% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/basicmethods/PersonName.java rename to core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/basicmethods/PersonName.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/binding/Animal.java b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/binding/Animal.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/binding/Animal.java rename to core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/binding/Animal.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/binding/AnimalActivity.java b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/binding/AnimalActivity.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/binding/AnimalActivity.java rename to core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/binding/AnimalActivity.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/binding/Cat.java b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/binding/Cat.java similarity index 100% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/binding/Cat.java rename to core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/binding/Cat.java diff --git a/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/core/privatemodifier/Employee.java b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/core/privatemodifier/Employee.java new file mode 100644 index 0000000000..4598400e93 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/core/privatemodifier/Employee.java @@ -0,0 +1,59 @@ +package com.baeldung.core.privatemodifier; + +public class Employee { + + private String privateId; + private String name; + private boolean manager; + + public Employee(String id, String name) { + setPrivateId(id); + setName(name); + } + + private Employee(String id, String name, boolean managerAttribute) { + this.privateId = id; + this.name = name; + this.privateId = id + "_ID-MANAGER"; + } + + public void setPrivateId(String customId) { + if (customId.endsWith("_ID")) { + this.privateId = customId; + } else { + this.privateId = customId + "_ID"; + } + } + + public String getPrivateId() { + return privateId; + } + + public boolean isManager() { + return manager; + } + + public void elevateToManager() { + if ("Carl".equals(this.name)) { + setManager(true); + } + } + + private void setManager(boolean manager) { + this.manager = manager; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public static Employee buildManager(String id, String name) { + return new Employee(id, name, true); + } + +} diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/ExampleClass.java b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/core/privatemodifier/ExampleClass.java similarity index 84% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/ExampleClass.java rename to core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/core/privatemodifier/ExampleClass.java index 41f0b7a690..8659b4ad9c 100644 --- a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/ExampleClass.java +++ b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/core/privatemodifier/ExampleClass.java @@ -1,4 +1,4 @@ -package com.baeldung.core.modifiers; +package com.baeldung.core.privatemodifier; public class ExampleClass { diff --git a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/PublicOuterClass.java b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/core/privatemodifier/PublicOuterClass.java similarity index 90% rename from core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/PublicOuterClass.java rename to core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/core/privatemodifier/PublicOuterClass.java index 329ebf3bb6..8a9e8a8eb3 100644 --- a/core-java-modules/core-java-lang-oop-2/src/main/java/com/baeldung/core/modifiers/PublicOuterClass.java +++ b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/core/privatemodifier/PublicOuterClass.java @@ -1,4 +1,4 @@ -package com.baeldung.core.modifiers; +package com.baeldung.core.privatemodifier; public class PublicOuterClass { diff --git a/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/strictfpUsage/Circle.java b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/strictfpUsage/Circle.java new file mode 100644 index 0000000000..a1f08d1bff --- /dev/null +++ b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/strictfpUsage/Circle.java @@ -0,0 +1,5 @@ +package com.baeldung.strictfpUsage; + +public strictfp interface Circle { + double computeArea(double radius); +} diff --git a/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/strictfpUsage/ScientificCalculator.java b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/strictfpUsage/ScientificCalculator.java new file mode 100644 index 0000000000..b898c3da3e --- /dev/null +++ b/core-java-modules/core-java-lang-oop-4/src/main/java/com/baeldung/strictfpUsage/ScientificCalculator.java @@ -0,0 +1,12 @@ +package com.baeldung.strictfpUsage; + +public strictfp class ScientificCalculator { + + public double sum(double value1, double value2) { + return value1 + value2; + } + + public double diff(double value1, double value2) { + return value1 - value2; + } +} diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/binding/AnimalActivityUnitTest.java b/core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/binding/AnimalActivityUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/binding/AnimalActivityUnitTest.java rename to core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/binding/AnimalActivityUnitTest.java diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/binding/AnimalUnitTest.java b/core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/binding/AnimalUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/binding/AnimalUnitTest.java rename to core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/binding/AnimalUnitTest.java index a34640b58a..11201965d9 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/binding/AnimalUnitTest.java +++ b/core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/binding/AnimalUnitTest.java @@ -14,13 +14,13 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.slf4j.LoggerFactory; +import java.util.List; + import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import java.util.List; - /** * Created by madhumita.g on 01-08-2018. */ diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/binding/CatUnitTest.java b/core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/binding/CatUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/binding/CatUnitTest.java rename to core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/binding/CatUnitTest.java diff --git a/core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/strictfpUsage/ScientificCalculatorUnitTest.java b/core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/strictfpUsage/ScientificCalculatorUnitTest.java new file mode 100644 index 0000000000..775c75ca9d --- /dev/null +++ b/core-java-modules/core-java-lang-oop-4/src/test/java/com/baeldung/strictfpUsage/ScientificCalculatorUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.strictfpUsage; + +import org.junit.Test; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; + +public class ScientificCalculatorUnitTest { + + @Test + public void whenMethodOfstrictfpClassInvoked_thenIdenticalResultOnAllPlatforms() { + ScientificCalculator calculator = new ScientificCalculator(); + double result = calculator.sum(23e10, 98e17); + assertThat(result, is(9.800000230000001E18)); + result = calculator.diff(Double.MAX_VALUE, 1.56); + assertThat(result, is(1.7976931348623157E308)); + } +} diff --git a/core-java-modules/core-java-lang-oop/README.md b/core-java-modules/core-java-lang-oop/README.md index 1751da8b3e..0fb044138d 100644 --- a/core-java-modules/core-java-lang-oop/README.md +++ b/core-java-modules/core-java-lang-oop/README.md @@ -1,15 +1,16 @@ -========= +## Core Java Lang OOP -## Core Java Lang OOP Cookbooks and Examples +This module contains articles about Object-oriented programming (OOP) in Java ### Relevant Articles: -- [Guide to hashCode() in Java](http://www.baeldung.com/java-hashcode) -- [A Guide to the Static Keyword in Java](http://www.baeldung.com/java-static) -- [Polymorphism in Java](http://www.baeldung.com/java-polymorphism) -- [Method Overloading and Overriding in Java](http://www.baeldung.com/java-method-overload-override) -- [How to Make a Deep Copy of an Object in Java](http://www.baeldung.com/java-deep-copy) -- [Guide to Inheritance in Java](http://www.baeldung.com/java-inheritance) -- [Object Type Casting in Java](http://www.baeldung.com/java-type-casting) -- [The “final” Keyword in Java](http://www.baeldung.com/java-final) -- [Type Erasure in Java Explained](http://www.baeldung.com/java-type-erasure) -- [Variable and Method Hiding in Java](http://www.baeldung.com/java-variable-method-hiding) +- [Guide to hashCode() in Java](https://www.baeldung.com/java-hashcode) +- [A Guide to the Static Keyword in Java](https://www.baeldung.com/java-static) +- [Polymorphism in Java](https://www.baeldung.com/java-polymorphism) +- [Method Overloading and Overriding in Java](https://www.baeldung.com/java-method-overload-override) +- [How to Make a Deep Copy of an Object in Java](https://www.baeldung.com/java-deep-copy) +- [Guide to Inheritance in Java](https://www.baeldung.com/java-inheritance) +- [Object Type Casting in Java](https://www.baeldung.com/java-type-casting) +- [The “final” Keyword in Java](https://www.baeldung.com/java-final) +- [Type Erasure in Java Explained](https://www.baeldung.com/java-type-erasure) +- [Variable and Method Hiding in Java](https://www.baeldung.com/java-variable-method-hiding) +- [[More -->]](/core-java-modules/core-java-lang-oop-2) diff --git a/core-java-modules/core-java-lang-oop/pom.xml b/core-java-modules/core-java-lang-oop/pom.xml index d86347b51f..bdd9857dfa 100644 --- a/core-java-modules/core-java-lang-oop/pom.xml +++ b/core-java-modules/core-java-lang-oop/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-lang-oop 0.1.0-SNAPSHOT core-java-lang-oop @@ -32,23 +31,6 @@ gson ${gson.version} - - - log4j - log4j - ${log4j.version} - - - org.slf4j - log4j-over-slf4j - ${org.slf4j.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - org.assertj diff --git a/core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java b/core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java index d6b1cd90b9..d60ab155dc 100644 --- a/core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java +++ b/core-java-modules/core-java-lang-oop/src/test/java/com/baeldung/deepcopy/DeepCopyUnitTest.java @@ -25,7 +25,7 @@ public class DeepCopyUnitTest { } @Test - public void whenModifyingOriginalObject_thenConstructorCopyShouldNotChange() { + public void whenModifyingOriginalObject_thenCopyShouldNotChange() { Address address = new Address("Downing St 10", "London", "England"); User pm = new User("Prime", "Minister", address); User deepCopy = new User(pm); @@ -125,4 +125,13 @@ public class DeepCopyUnitTest { end = System.currentTimeMillis(); System.out.println("Cloning with Jackson took " + (end - start) + " milliseconds."); } + + @Test + public void whenModifyingOriginalObject_ThenCopyShouldChange() { + Address address = new Address("Downing St 10", "London", "England"); + User pm = new User("Prime", "Minister", address); + User shallowCopy = new User(pm.getFirstName(), pm.getLastName(), pm.getAddress()); + address.setCountry("Great Britain"); + assertThat(shallowCopy.getAddress().getCountry()).isEqualTo(pm.getAddress().getCountry()); + } } diff --git a/core-java-modules/core-java-lang-operators/README.md b/core-java-modules/core-java-lang-operators/README.md new file mode 100644 index 0000000000..1fe524948c --- /dev/null +++ b/core-java-modules/core-java-lang-operators/README.md @@ -0,0 +1,14 @@ +## Core Java Operators + +This module contains articles about Java operators + +## Relevant Articles: +- [Guide to the Diamond Operator in Java](https://www.baeldung.com/java-diamond-operator) +- [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) +- [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) +- [Java instanceof Operator](https://www.baeldung.com/java-instanceof) +- [A Guide to Increment and Decrement Unary Operators in Java](https://www.baeldung.com/java-unary-operators) +- [Java Compound Operators](https://www.baeldung.com/java-compound-operators) +- [The XOR Operator in Java](https://www.baeldung.com/java-xor-operator) +- [Java Bitwise Operators](https://www.baeldung.com/java-bitwise-operators) + diff --git a/core-java-modules/core-java-lang-operators/pom.xml b/core-java-modules/core-java-lang-operators/pom.xml index 58cab9d507..81865552dd 100644 --- a/core-java-modules/core-java-lang-operators/pom.xml +++ b/core-java-modules/core-java-lang-operators/pom.xml @@ -2,7 +2,6 @@ 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"> 4.0.0 - com.baeldung core-java-lang-operators 0.1.0-SNAPSHOT core-java-lang-operators diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/bitwiseoperator/test/BitwiseOperatorUnitTest.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/bitwiseoperator/test/BitwiseOperatorUnitTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/bitwiseoperator/test/BitwiseOperatorUnitTest.java rename to core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/bitwiseoperator/test/BitwiseOperatorUnitTest.java diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java rename to core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Car.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Car.java new file mode 100644 index 0000000000..7fa52a5eb1 --- /dev/null +++ b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Car.java @@ -0,0 +1,5 @@ +package com.baeldung.diamondoperator; + +public class Car implements Vehicle { + +} diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/DiamondOperatorUnitTest.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/DiamondOperatorUnitTest.java similarity index 87% rename from core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/DiamondOperatorUnitTest.java rename to core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/DiamondOperatorUnitTest.java index ee5f639926..b50119b3c6 100644 --- a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/DiamondOperatorUnitTest.java +++ b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/DiamondOperatorUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.diamond; +package com.baeldung.diamondoperator; import static org.junit.Assert.assertNotNull; diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Diesel.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Diesel.java similarity index 76% rename from core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Diesel.java rename to core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Diesel.java index 90eb7d9340..0b92d11318 100644 --- a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Diesel.java +++ b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Diesel.java @@ -1,4 +1,4 @@ -package com.baeldung.java.diamond; +package com.baeldung.diamondoperator; public class Diesel implements Engine { diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Engine.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Engine.java new file mode 100644 index 0000000000..0afd48114a --- /dev/null +++ b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Engine.java @@ -0,0 +1,6 @@ +package com.baeldung.diamondoperator; + +public interface Engine { + + void start(); +} diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Vehicle.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Vehicle.java new file mode 100644 index 0000000000..89a5dfefef --- /dev/null +++ b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/diamondoperator/Vehicle.java @@ -0,0 +1,5 @@ +package com.baeldung.diamondoperator; + +public interface Vehicle { + +} diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Car.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Car.java deleted file mode 100644 index a680c4e670..0000000000 --- a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Car.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.baeldung.java.diamond; - -public class Car implements Vehicle { - -} diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Engine.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Engine.java deleted file mode 100644 index 746baf3254..0000000000 --- a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Engine.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.baeldung.java.diamond; - -public interface Engine { - - void start(); -} diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Vehicle.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Vehicle.java deleted file mode 100644 index 8395cdd970..0000000000 --- a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/diamond/Vehicle.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.baeldung.java.diamond; - -public interface Vehicle { - -} diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/keyword/test/InstanceOfUnitTest.java b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/keyword/InstanceOfUnitTest.java similarity index 97% rename from core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/keyword/test/InstanceOfUnitTest.java rename to core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/keyword/InstanceOfUnitTest.java index 6966fa3944..0e082b69d3 100644 --- a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/keyword/test/InstanceOfUnitTest.java +++ b/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/keyword/InstanceOfUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.keyword.test; +package com.baeldung.keyword; import org.junit.Assert; import org.junit.jupiter.api.Test; diff --git a/core-java-modules/core-java-lang-syntax-2/README.md b/core-java-modules/core-java-lang-syntax-2/README.md new file mode 100644 index 0000000000..1518d1ab35 --- /dev/null +++ b/core-java-modules/core-java-lang-syntax-2/README.md @@ -0,0 +1,15 @@ +## Core Java Lang Syntax + +This module contains articles about Java syntax + +### Relevant Articles: + +- [Guide to Java Packages](https://www.baeldung.com/java-packages) +- [If-Else Statement in Java](https://www.baeldung.com/java-if-else) +- [Control Structures in Java](https://www.baeldung.com/java-control-structures) +- [Java Double Brace Initialization](https://www.baeldung.com/java-double-brace-initialization) +- [The Java Native Keyword and Methods](https://www.baeldung.com/java-native) +- [Variable Scope in Java](https://www.baeldung.com/java-variable-scope) +- [Introduction to Basic Syntax in Java](https://www.baeldung.com/java-syntax) +- [Java ‘protected’ Access Modifier](https://www.baeldung.com/java-protected-access-modifier) +- [[<-- Prev]](/core-java-modules/core-java-lang-syntax) diff --git a/core-java-modules/core-java-lang-syntax-2/pom.xml b/core-java-modules/core-java-lang-syntax-2/pom.xml new file mode 100644 index 0000000000..98eea99fc0 --- /dev/null +++ b/core-java-modules/core-java-lang-syntax-2/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + core-java-lang-syntax-2 + 0.1.0-SNAPSHOT + core-java-lang-syntax-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + core-java-lang-syntax-2 + + + src/main/resources + true + + + + diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/basicsyntax/SimpleAddition.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/basicsyntax/SimpleAddition.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/basicsyntax/SimpleAddition.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/basicsyntax/SimpleAddition.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/controlstructures/ConditionalBranches.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/controlstructures/ConditionalBranches.java similarity index 97% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/controlstructures/ConditionalBranches.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/controlstructures/ConditionalBranches.java index bace609699..e15386f048 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/controlstructures/ConditionalBranches.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/controlstructures/ConditionalBranches.java @@ -1,4 +1,4 @@ -package com.baeldung.controlstructures; +package com.baeldung.core.controlstructures; public class ConditionalBranches { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/controlstructures/Loops.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/controlstructures/Loops.java similarity index 99% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/controlstructures/Loops.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/controlstructures/Loops.java index bc4515bfc7..9d73127cae 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/controlstructures/Loops.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/controlstructures/Loops.java @@ -1,4 +1,4 @@ -package com.baeldung.controlstructures; +package com.baeldung.core.controlstructures; public class Loops { diff --git a/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/FirstClass.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/FirstClass.java new file mode 100644 index 0000000000..a80387d61a --- /dev/null +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/FirstClass.java @@ -0,0 +1,18 @@ +package com.baeldung.core.modifiers; + +public class FirstClass { + + protected String name; + + protected FirstClass(String name) { + this.name = name; + } + + protected String getName() { + return name; + } + + protected static class InnerClass { + public InnerClass() {} + } +} diff --git a/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/GenericClass.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/GenericClass.java new file mode 100644 index 0000000000..83381931d0 --- /dev/null +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/GenericClass.java @@ -0,0 +1,15 @@ +package com.baeldung.core.modifiers; + +public class GenericClass { + + public static void main(String[] args) { + // accessing protected constructor + FirstClass first = new FirstClass("random name"); + // using protected method + System.out.println("FirstClass name is " + first.getName()); + // accessing a protected field + first.name = "new name"; + // instantiating protected inner class + FirstClass.InnerClass innerClass = new FirstClass.InnerClass(); + } +} diff --git a/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/otherpackage/SecondClass.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/otherpackage/SecondClass.java new file mode 100644 index 0000000000..528f97539a --- /dev/null +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/otherpackage/SecondClass.java @@ -0,0 +1,18 @@ +package com.baeldung.core.modifiers.otherpackage; + +import com.baeldung.core.modifiers.FirstClass; + +public class SecondClass extends FirstClass { + + public SecondClass(String name) { + // accessing protected constructor + super(name); + // using protected method + System.out.println("SecondClass name is " + this.getName()); + // accessing a protected field + this.name = "new name"; + // instantiating protected inner class -> add public constructor to InnerClass + FirstClass.InnerClass innerClass = new FirstClass.InnerClass(); + } + +} diff --git a/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/otherpackage/SecondGenericClass.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/otherpackage/SecondGenericClass.java new file mode 100644 index 0000000000..d29533edef --- /dev/null +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/modifiers/otherpackage/SecondGenericClass.java @@ -0,0 +1,20 @@ +package com.baeldung.core.modifiers.otherpackage; + +import com.baeldung.core.modifiers.FirstClass; +//import com.baeldung.core.modifiers.FirstClass.InnerClass; + +public class SecondGenericClass { + + // uncomment the following lines to see the errors + public static void main(String[] args) { + // accessing protected constructor + // FirstClass first = new FirstClass("random name"); + // using protected method + // System.out.println("FirstClass name is " + first.getName()); + // accessing a protected field + // first.name = "new name"; + // instantiating protected inner class + // FirstClass.InnerClass innerClass = new FirstClass.InnerClass(); + } + +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/nativekeyword/DateTimeUtils.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/nativekeyword/DateTimeUtils.java similarity index 78% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/nativekeyword/DateTimeUtils.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/nativekeyword/DateTimeUtils.java index 0762b0eb8a..1d101719ca 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/nativekeyword/DateTimeUtils.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/nativekeyword/DateTimeUtils.java @@ -1,4 +1,4 @@ -package com.baeldung.nativekeyword; +package com.baeldung.core.nativekeyword; public class DateTimeUtils { diff --git a/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/nativekeyword/NativeMainApp.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/nativekeyword/NativeMainApp.java new file mode 100644 index 0000000000..4bf6b88840 --- /dev/null +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/nativekeyword/NativeMainApp.java @@ -0,0 +1,9 @@ +package com.baeldung.core.nativekeyword; + +public class NativeMainApp { + public static void main(String[] args) { + DateTimeUtils dateTimeUtils = new DateTimeUtils(); + String input = dateTimeUtils.getSystemTime(); + System.out.println("System time is : " + input); + } +} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/packages/TodoApp.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/packages/TodoApp.java similarity index 86% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/packages/TodoApp.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/packages/TodoApp.java index 0f4a56f708..d8283f6b0d 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/packages/TodoApp.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/packages/TodoApp.java @@ -1,9 +1,9 @@ -package com.baeldung.packages; +package com.baeldung.core.packages; + +import com.baeldung.core.packages.domain.TodoItem; import java.time.LocalDate; -import com.baeldung.packages.domain.TodoItem; - public class TodoApp { public static void main(String[] args) { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/packages/TodoList.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/packages/TodoList.java similarity index 84% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/packages/TodoList.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/packages/TodoList.java index 6ed6cd4ec1..f9f6ac3aca 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/packages/TodoList.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/packages/TodoList.java @@ -1,10 +1,10 @@ -package com.baeldung.packages; +package com.baeldung.core.packages; + +import com.baeldung.core.packages.domain.TodoItem; import java.util.ArrayList; import java.util.List; -import com.baeldung.packages.domain.TodoItem; - public class TodoList { private List todoItems; diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/packages/domain/TodoItem.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/packages/domain/TodoItem.java similarity index 94% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/packages/domain/TodoItem.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/packages/domain/TodoItem.java index 972e574a7f..195f763974 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/packages/domain/TodoItem.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/packages/domain/TodoItem.java @@ -1,4 +1,4 @@ -package com.baeldung.packages.domain; +package com.baeldung.core.packages.domain; import java.time.LocalDate; diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/BracketScopeExample.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/BracketScopeExample.java similarity index 89% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/BracketScopeExample.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/BracketScopeExample.java index 8deec35c16..99feeb060d 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/BracketScopeExample.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/BracketScopeExample.java @@ -1,4 +1,4 @@ -package com.baeldung.scope; +package com.baeldung.core.scope; public class BracketScopeExample { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/ClassScopeExample.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/ClassScopeExample.java similarity index 86% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/ClassScopeExample.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/ClassScopeExample.java index c81fcc9550..8bcfee44f2 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/ClassScopeExample.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/ClassScopeExample.java @@ -1,4 +1,4 @@ -package com.baeldung.scope; +package com.baeldung.core.scope; public class ClassScopeExample { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/LoopScopeExample.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/LoopScopeExample.java similarity index 92% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/LoopScopeExample.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/LoopScopeExample.java index be41252623..8067085404 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/LoopScopeExample.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/LoopScopeExample.java @@ -1,4 +1,4 @@ -package com.baeldung.scope; +package com.baeldung.core.scope; import java.util.Arrays; import java.util.List; diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/MethodScopeExample.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/MethodScopeExample.java similarity index 86% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/MethodScopeExample.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/MethodScopeExample.java index 63a6a25271..86b2021c6d 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/MethodScopeExample.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/MethodScopeExample.java @@ -1,4 +1,4 @@ -package com.baeldung.scope; +package com.baeldung.core.scope; public class MethodScopeExample { diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/NestedScopesExample.java b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/NestedScopesExample.java similarity index 86% rename from core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/NestedScopesExample.java rename to core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/NestedScopesExample.java index c3c5bec221..51351d237c 100644 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/scope/NestedScopesExample.java +++ b/core-java-modules/core-java-lang-syntax-2/src/main/java/com/baeldung/core/scope/NestedScopesExample.java @@ -1,4 +1,4 @@ -package com.baeldung.scope; +package com.baeldung.core.scope; public class NestedScopesExample { diff --git a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/doublebrace/DoubleBraceUnitTest.java b/core-java-modules/core-java-lang-syntax-2/src/test/java/com/baeldung/core/doublebrace/DoubleBraceUnitTest.java similarity index 96% rename from core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/doublebrace/DoubleBraceUnitTest.java rename to core-java-modules/core-java-lang-syntax-2/src/test/java/com/baeldung/core/doublebrace/DoubleBraceUnitTest.java index b03b01d074..fe47dd4c26 100644 --- a/core-java-modules/core-java-lang-operators/src/test/java/com/baeldung/java/doublebrace/DoubleBraceUnitTest.java +++ b/core-java-modules/core-java-lang-syntax-2/src/test/java/com/baeldung/core/doublebrace/DoubleBraceUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.doublebrace; +package com.baeldung.core.doublebrace; import org.junit.Test; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nativekeyword/DateTimeUtilsManualTest.java b/core-java-modules/core-java-lang-syntax-2/src/test/java/com/baeldung/core/nativekeyword/DateTimeUtilsManualTest.java similarity index 95% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/nativekeyword/DateTimeUtilsManualTest.java rename to core-java-modules/core-java-lang-syntax-2/src/test/java/com/baeldung/core/nativekeyword/DateTimeUtilsManualTest.java index ac27c11c68..1c70acc483 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/nativekeyword/DateTimeUtilsManualTest.java +++ b/core-java-modules/core-java-lang-syntax-2/src/test/java/com/baeldung/core/nativekeyword/DateTimeUtilsManualTest.java @@ -1,11 +1,11 @@ -package com.baeldung.nativekeyword; - -import static org.junit.Assert.assertNotNull; +package com.baeldung.core.nativekeyword; import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; +import static org.junit.Assert.assertNotNull; + public class DateTimeUtilsManualTest { private static final Logger LOG = org.slf4j.LoggerFactory.getLogger(DateTimeUtilsManualTest.class); diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/packages/PackagesUnitTest.java b/core-java-modules/core-java-lang-syntax-2/src/test/java/com/baeldung/core/packages/PackagesUnitTest.java similarity index 85% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/packages/PackagesUnitTest.java rename to core-java-modules/core-java-lang-syntax-2/src/test/java/com/baeldung/core/packages/PackagesUnitTest.java index 212fb7b3c7..b1237e9948 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/packages/PackagesUnitTest.java +++ b/core-java-modules/core-java-lang-syntax-2/src/test/java/com/baeldung/core/packages/PackagesUnitTest.java @@ -1,12 +1,11 @@ -package com.baeldung.packages; +package com.baeldung.core.packages; -import static org.junit.Assert.assertEquals; +import com.baeldung.core.packages.domain.TodoItem; +import org.junit.Test; import java.time.LocalDate; -import org.junit.Test; - -import com.baeldung.packages.domain.TodoItem; +import static org.junit.Assert.assertEquals; public class PackagesUnitTest { diff --git a/core-java-modules/core-java-lang-syntax/README.md b/core-java-modules/core-java-lang-syntax/README.md index 3293e9b23d..25f5c63dbc 100644 --- a/core-java-modules/core-java-lang-syntax/README.md +++ b/core-java-modules/core-java-lang-syntax/README.md @@ -1,21 +1,16 @@ -========= +## Core Java Lang Syntax -## Core Java Lang Syntax Cookbooks and Examples +This module contains articles about Java syntax ### Relevant Articles: -- [The Basics of Java Generics](http://www.baeldung.com/java-generics) -- [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) -- [Java Double Brace Initialization](http://www.baeldung.com/java-double-brace-initialization) -- [Guide to the Diamond Operator in Java](http://www.baeldung.com/java-diamond-operator) -- [The Java continue and break Keywords](http://www.baeldung.com/java-continue-and-break) -- [A Guide to Creating Objects in Java](http://www.baeldung.com/java-initialization) -- [A Guide to Java Loops](http://www.baeldung.com/java-loops) -- [Varargs in Java](http://www.baeldung.com/java-varargs) -- [A Guide to Java Enums](http://www.baeldung.com/a-guide-to-java-enums) -- [Infinite Loops in Java](http://www.baeldung.com/infinite-loops-java) -- [Quick Guide to java.lang.System](http://www.baeldung.com/java-lang-system) +- [The Basics of Java Generics](https://www.baeldung.com/java-generics) +- [Java Primitive Conversions](https://www.baeldung.com/java-primitive-conversions) +- [The Java continue and break Keywords](https://www.baeldung.com/java-continue-and-break) +- [A Guide to Creating Objects in Java](https://www.baeldung.com/java-initialization) +- [A Guide to Java Loops](https://www.baeldung.com/java-loops) +- [Varargs in Java](https://www.baeldung.com/java-varargs) +- [A Guide to Java Enums](https://www.baeldung.com/a-guide-to-java-enums) +- [Infinite Loops in Java](https://www.baeldung.com/infinite-loops-java) - [Java Switch Statement](https://www.baeldung.com/java-switch) -- [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) -- [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) -- [Java instanceof Operator](https://www.baeldung.com/java-instanceof) - [Breaking Out of Nested Loops](https://www.baeldung.com/java-breaking-out-nested-loop) +- [[More -->]](/core-java-modules/core-java-lang-syntax-2) diff --git a/core-java-modules/core-java-lang-syntax/pom.xml b/core-java-modules/core-java-lang-syntax/pom.xml index 46fa8d1206..f4549b689d 100644 --- a/core-java-modules/core-java-lang-syntax/pom.xml +++ b/core-java-modules/core-java-lang-syntax/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-lang-syntax 0.1.0-SNAPSHOT core-java-lang-syntax diff --git a/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/generics/Generics.java b/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/generics/Generics.java index 1c4082c58b..b8d4aa3263 100644 --- a/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/generics/Generics.java +++ b/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/generics/Generics.java @@ -35,4 +35,11 @@ public class Generics { return list; } + public List genericMethod(List list) { + return list.stream().collect(Collectors.toList()); + } + + public List withErasure(List list) { + return list.stream().collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/loops/LoopsUnitTest.java b/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/loops/LoopsUnitTest.java new file mode 100644 index 0000000000..5a8b116a2c --- /dev/null +++ b/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/loops/LoopsUnitTest.java @@ -0,0 +1,107 @@ +package com.baeldung.loops; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class LoopsUnitTest { + + private LoopsInJava loops = new LoopsInJava(); + private static List list = new ArrayList<>(); + private static Set set = new HashSet<>(); + private static Map map = new HashMap<>(); + + @BeforeClass + public static void setUp() { + list.add("One"); + list.add("Two"); + list.add("Three"); + + set.add("Four"); + set.add("Five"); + set.add("Six"); + + map.put("One", 1); + map.put("Two", 2); + map.put("Three", 3); + } + + @Test + public void shouldRunForLoop() { + int[] expected = { 0, 1, 2, 3, 4 }; + int[] actual = loops.simple_for_loop(); + Assert.assertArrayEquals(expected, actual); + } + + @Test + public void shouldRunEnhancedForeachLoop() { + int[] expected = { 0, 1, 2, 3, 4 }; + int[] actual = loops.enhanced_for_each_loop(); + Assert.assertArrayEquals(expected, actual); + } + + @Test + public void shouldRunWhileLoop() { + int[] expected = { 0, 1, 2, 3, 4 }; + int[] actual = loops.while_loop(); + Assert.assertArrayEquals(expected, actual); + } + + @Test + public void shouldRunDoWhileLoop() { + int[] expected = { 0, 1, 2, 3, 4 }; + int[] actual = loops.do_while_loop(); + Assert.assertArrayEquals(expected, actual); + } + + @Test + public void whenUsingSimpleFor_shouldIterateList() { + for (int i = 0; i < list.size(); i++) { + System.out.println(list.get(i)); + } + } + + @Test + public void whenUsingEnhancedFor_shouldIterateList() { + for (String item : list) { + System.out.println(item); + } + } + + @Test + public void whenUsingEnhancedFor_shouldIterateSet() { + for (String item : set) { + System.out.println(item); + } + } + + @Test + public void whenUsingEnhancedFor_shouldIterateMap() { + for (Entry entry : map.entrySet()) { + System.out.println("Key: " + entry.getKey() + " - " + "Value: " + entry.getValue()); + } + } + + @Test + public void whenUsingSimpleFor_shouldRunLabelledLoop() { + aa: for (int i = 1; i <= 3; i++) { + if (i == 1) + continue; + bb: for (int j = 1; j <= 3; j++) { + if (i == 2 && j == 2) { + break aa; + } + System.out.println(i + " " + j); + } + } + } + +} diff --git a/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/loops/WhenUsingLoops.java b/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/loops/WhenUsingLoops.java deleted file mode 100644 index f82f9ddaa7..0000000000 --- a/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/loops/WhenUsingLoops.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.baeldung.loops; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -public class WhenUsingLoops { - - private LoopsInJava loops = new LoopsInJava(); - private static List list = new ArrayList<>(); - private static Set set = new HashSet<>(); - private static Map map = new HashMap<>(); - - @BeforeClass - public static void setUp() { - list.add("One"); - list.add("Two"); - list.add("Three"); - - set.add("Four"); - set.add("Five"); - set.add("Six"); - - map.put("One", 1); - map.put("Two", 2); - map.put("Three", 3); - } - - @Test - public void shouldRunForLoop() { - int[] expected = { 0, 1, 2, 3, 4 }; - int[] actual = loops.simple_for_loop(); - Assert.assertArrayEquals(expected, actual); - } - - @Test - public void shouldRunEnhancedForeachLoop() { - int[] expected = { 0, 1, 2, 3, 4 }; - int[] actual = loops.enhanced_for_each_loop(); - Assert.assertArrayEquals(expected, actual); - } - - @Test - public void shouldRunWhileLoop() { - int[] expected = { 0, 1, 2, 3, 4 }; - int[] actual = loops.while_loop(); - Assert.assertArrayEquals(expected, actual); - } - - @Test - public void shouldRunDoWhileLoop() { - int[] expected = { 0, 1, 2, 3, 4 }; - int[] actual = loops.do_while_loop(); - Assert.assertArrayEquals(expected, actual); - } - - @Test - public void whenUsingSimpleFor_shouldIterateList() { - for (int i = 0; i < list.size(); i++) { - System.out.println(list.get(i)); - } - } - - @Test - public void whenUsingEnhancedFor_shouldIterateList() { - for (String item : list) { - System.out.println(item); - } - } - - @Test - public void whenUsingEnhancedFor_shouldIterateSet() { - for (String item : set) { - System.out.println(item); - } - } - - @Test - public void whenUsingEnhancedFor_shouldIterateMap() { - for (Entry entry : map.entrySet()) { - System.out.println("Key: " + entry.getKey() + " - " + "Value: " + entry.getValue()); - } - } - - @Test - public void whenUsingSimpleFor_shouldRunLabelledLoop() { - aa: for (int i = 1; i <= 3; i++) { - if (i == 1) - continue; - bb: for (int j = 1; j <= 3; j++) { - if (i == 2 && j == 2) { - break aa; - } - System.out.println(i + " " + j); - } - } - } - -} diff --git a/core-java-modules/core-java-lang/README.md b/core-java-modules/core-java-lang/README.md index f3b6d3d8e5..9e98bb849b 100644 --- a/core-java-modules/core-java-lang/README.md +++ b/core-java-modules/core-java-lang/README.md @@ -1,40 +1,19 @@ -========= +## Core Java Lang -## Core Java Lang Cookbooks and Examples +This module contains articles about core features in the Java language ### Relevant Articles: - -- [Generate equals() and hashCode() with Eclipse](http://www.baeldung.com/java-eclipse-equals-and-hashcode) -- [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions) -- [Iterating Over Enum Values in Java](http://www.baeldung.com/java-enum-iteration) -- [Java Double Brace Initialization](http://www.baeldung.com/java-double-brace-initialization) -- [Guide to the Diamond Operator in Java](http://www.baeldung.com/java-diamond-operator) -- [Comparator and Comparable in Java](http://www.baeldung.com/java-comparator-comparable) -- [The Java continue and break Keywords](http://www.baeldung.com/java-continue-and-break) -- [Nested Classes in Java](http://www.baeldung.com/java-nested-classes) -- [A Guide to Inner Interfaces in Java](http://www.baeldung.com/java-inner-interfaces) -- [Recursion In Java](http://www.baeldung.com/java-recursion) -- [A Guide to the finalize Method in Java](http://www.baeldung.com/java-finalize) -- [Infinite Loops in Java](http://www.baeldung.com/infinite-loops-java) -- [Quick Guide to java.lang.System](http://www.baeldung.com/java-lang-system) -- [Using Java Assertions](http://www.baeldung.com/java-assert) -- [ClassNotFoundException vs NoClassDefFoundError](http://www.baeldung.com/java-classnotfoundexception-and-noclassdeffounderror) -- [The StackOverflowError in Java](http://www.baeldung.com/java-stack-overflow-error) -- [Create a Custom Exception in Java](http://www.baeldung.com/java-new-custom-exception) -- [Exception Handling in Java](http://www.baeldung.com/java-exceptions) -- [Differences Between Final, Finally and Finalize in Java](https://www.baeldung.com/java-final-finally-finalize) -- [Static and Dynamic Binding in Java](https://www.baeldung.com/java-static-dynamic-binding) -- [Difference Between Throw and Throws in Java](https://www.baeldung.com/java-throw-throws) +- [Generate equals() and hashCode() with Eclipse](https://www.baeldung.com/java-eclipse-equals-and-hashcode) +- [Iterating Over Enum Values in Java](https://www.baeldung.com/java-enum-iteration) +- [Comparator and Comparable in Java](https://www.baeldung.com/java-comparator-comparable) +- [Recursion In Java](https://www.baeldung.com/java-recursion) +- [A Guide to the finalize Method in Java](https://www.baeldung.com/java-finalize) +- [Quick Guide to java.lang.System](https://www.baeldung.com/java-lang-system) +- [Using Java Assertions](https://www.baeldung.com/java-assert) - [Synthetic Constructs in Java](https://www.baeldung.com/java-synthetic) -- [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts) -- [“Sneaky Throws” in Java](http://www.baeldung.com/java-sneaky-throws) - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) -- [Java Compound Operators](https://www.baeldung.com/java-compound-operators) -- [Guide to Java Packages](https://www.baeldung.com/java-packages) -- [The Java Native Keyword and Methods](https://www.baeldung.com/java-native) -- [If-Else Statement in Java](https://www.baeldung.com/java-if-else) -- [Control Structures in Java](https://www.baeldung.com/java-control-structures) -- [Java Interfaces](https://www.baeldung.com/java-interfaces) - [Attaching Values to Java Enum](https://www.baeldung.com/java-enum-values) -- [Variable Scope in Java](https://www.baeldung.com/java-variable-scope) -- [Java Classes and Objects](https://www.baeldung.com/java-classes-objects) +- [The Java continue and break Keywords](https://www.baeldung.com/java-continue-and-break) +- [A Guide to Java Enums](https://www.baeldung.com/a-guide-to-java-enums) +- [Infinite Loops in Java](https://www.baeldung.com/infinite-loops-java) +- [[More --> ]](/core-java-modules/core-java-lang-2) diff --git a/core-java-modules/core-java-lang/pom.xml b/core-java-modules/core-java-lang/pom.xml index 8311636873..10b0526177 100644 --- a/core-java-modules/core-java-lang/pom.xml +++ b/core-java-modules/core-java-lang/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-lang 0.1.0-SNAPSHOT core-java-lang @@ -14,55 +13,6 @@ ../../parent-java - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - com.google.code.gson - gson - ${gson.version} - - - - log4j - log4j - ${log4j.version} - - - org.slf4j - log4j-over-slf4j - ${org.slf4j.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - - - - org.assertj - assertj-core - ${assertj-core.version} - test - - - javax.mail - mail - ${javax.mail.version} - - - core-java-lang @@ -73,13 +23,4 @@ - - 2.8.2 - - 1.5.0-b01 - - - 3.10.0 - - diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithChain.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithChain.java deleted file mode 100644 index 3d66c2b535..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/chainedexception/LogWithChain.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.baeldung.chainedexception; - -import com.baeldung.chainedexception.exceptions.GirlFriendOfManagerUpsetException; -import com.baeldung.chainedexception.exceptions.ManagerUpsetException; -import com.baeldung.chainedexception.exceptions.NoLeaveGrantedException; -import com.baeldung.chainedexception.exceptions.TeamLeadUpsetException; - -public class LogWithChain { - - public static void main(String[] args) throws Exception { - getLeave(); - } - - private static void getLeave() throws NoLeaveGrantedException { - try { - howIsTeamLead(); - } catch (TeamLeadUpsetException e) { - throw new NoLeaveGrantedException("Leave not sanctioned.", e); - } - } - - private static void howIsTeamLead() throws TeamLeadUpsetException { - try { - howIsManager(); - } catch (ManagerUpsetException e) { - throw new TeamLeadUpsetException("Team lead is not in good mood", e); - } - } - - private static void howIsManager() throws ManagerUpsetException { - try { - howIsGirlFriendOfManager(); - } catch (GirlFriendOfManagerUpsetException e) { - throw new ManagerUpsetException("Manager is in bad mood", e); - } - } - - private static void howIsGirlFriendOfManager() throws GirlFriendOfManagerUpsetException { - throw new GirlFriendOfManagerUpsetException("Girl friend of manager is in bad mood"); - } -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileNameException.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileNameException.java deleted file mode 100644 index a804cadb84..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/customexception/IncorrectFileNameException.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.baeldung.customexception; - -public class IncorrectFileNameException extends Exception { - private static final long serialVersionUID = 1L; - - public IncorrectFileNameException(String errorMessage, Throwable err) { - super(errorMessage, err); - } -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/MyException.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/MyException.java deleted file mode 100644 index c2908b7278..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/MyException.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.baeldung.exceptionhandling; - -public class MyException extends Throwable { - -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/Player.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/Player.java deleted file mode 100644 index e866802fe3..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/Player.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.baeldung.exceptionhandling; - -public class Player { - - public int id; - public String name; - - public Player(String name) { - this.name = name; - } - -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerScoreException.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerScoreException.java deleted file mode 100644 index 299370ee86..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/PlayerScoreException.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.exceptionhandling; - -public class PlayerScoreException extends Exception { - - public PlayerScoreException(Exception e) { - super(e); - } -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/TimeoutException.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/TimeoutException.java deleted file mode 100644 index 0211284e5d..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/exceptionhandling/TimeoutException.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.exceptionhandling; - -public class TimeoutException extends Exception { - - public TimeoutException(String message) { - super(message); - } -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/Customer.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/Customer.java deleted file mode 100644 index d2f2b48074..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/interfaces/Customer.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.interfaces; - -public class Customer { - public interface List { - void Add(Customer customer); - - String getCustomerNames(); - } - - private String name; - - public Customer(String name) { - this.name = name; - } - - String getName() { - return name; - } -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/GrandChild.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/GrandChild.java deleted file mode 100644 index 1530c5037f..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/keywords/finalkeyword/GrandChild.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.baeldung.keywords.finalkeyword; - -/*public class GrandChild extends Child { - // Compilation error -}*/ diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/nativekeyword/NativeMainApp.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/nativekeyword/NativeMainApp.java deleted file mode 100644 index 76fe548ed3..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/nativekeyword/NativeMainApp.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.baeldung.nativekeyword; - -import com.baeldung.nativekeyword.DateTimeUtils; - -public class NativeMainApp { - public static void main(String[] args) { - DateTimeUtils dateTimeUtils = new DateTimeUtils(); - String input = dateTimeUtils.getSystemTime(); - System.out.println("System time is : " + input); - } -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/ClassWithInitErrors.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/ClassWithInitErrors.java deleted file mode 100644 index b5b357a322..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/noclassdeffounderror/ClassWithInitErrors.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.baeldung.noclassdeffounderror; - -public class ClassWithInitErrors { - static int data = 1 / 0; -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/AccountHolder.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/AccountHolder.java deleted file mode 100644 index 91b8a3bbb0..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/stackoverflowerror/AccountHolder.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.baeldung.stackoverflowerror; - -public class AccountHolder { - private String firstName; - private String lastName; - - AccountHolder jointAccountHolder = new AccountHolder(); -} diff --git a/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/ChatWindow.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/system/ChatWindow.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/ChatWindow.java rename to core-java-modules/core-java-lang/src/main/java/com/baeldung/system/ChatWindow.java diff --git a/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/DateTimeService.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/system/DateTimeService.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/DateTimeService.java rename to core-java-modules/core-java-lang/src/main/java/com/baeldung/system/DateTimeService.java diff --git a/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/EnvironmentVariables.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/system/EnvironmentVariables.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/EnvironmentVariables.java rename to core-java-modules/core-java-lang/src/main/java/com/baeldung/system/EnvironmentVariables.java diff --git a/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/SystemErrDemo.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/system/SystemErrDemo.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/SystemErrDemo.java rename to core-java-modules/core-java-lang/src/main/java/com/baeldung/system/SystemErrDemo.java diff --git a/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/SystemExitDemo.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/system/SystemExitDemo.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/SystemExitDemo.java rename to core-java-modules/core-java-lang/src/main/java/com/baeldung/system/SystemExitDemo.java diff --git a/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/SystemOutDemo.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/system/SystemOutDemo.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/SystemOutDemo.java rename to core-java-modules/core-java-lang/src/main/java/com/baeldung/system/SystemOutDemo.java diff --git a/core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/UserCredentials.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/system/UserCredentials.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/main/java/com/baeldung/system/UserCredentials.java rename to core-java-modules/core-java-lang/src/main/java/com/baeldung/system/UserCredentials.java diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/Main.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/Main.java deleted file mode 100644 index 17fbf5a582..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/Main.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.baeldung.throwsexception; - -import com.sun.mail.iap.ConnectionException; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.net.SocketException; - -public class Main { - - public static void main(String[] args) throws FileNotFoundException { - TryCatch tryCatch = new TryCatch(); - - try { - tryCatch.execute(); - } catch (ConnectionException | SocketException ex) { - System.out.println("IOException"); - } catch (Exception ex) { - System.out.println("General exception"); - } - - checkedException(); - checkedExceptionWithThrows(); - } - - private static void checkedExceptionWithThrows() throws FileNotFoundException { - File file = new File("not_existing_file.txt"); - FileInputStream stream = new FileInputStream(file); - } - - private static void checkedException() { - File file = new File("not_existing_file.txt"); - try { - FileInputStream stream = new FileInputStream(file); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - } - -} diff --git a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/PersonRepository.java b/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/PersonRepository.java deleted file mode 100644 index 7d8345c3c1..0000000000 --- a/core-java-modules/core-java-lang/src/main/java/com/baeldung/throwsexception/PersonRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.baeldung.throwsexception; - -import java.sql.SQLException; -import java.util.List; - -public class PersonRepository { - - public List findAll() throws SQLException { - throw new SQLException(); - } - -} diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/java/enumiteration/DaysOfWeekEnum.java b/core-java-modules/core-java-lang/src/test/java/com/baeldung/enums/iteration/DaysOfWeekEnum.java similarity index 92% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/java/enumiteration/DaysOfWeekEnum.java rename to core-java-modules/core-java-lang/src/test/java/com/baeldung/enums/iteration/DaysOfWeekEnum.java index 89e718adf3..f25ddfa6dd 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/java/enumiteration/DaysOfWeekEnum.java +++ b/core-java-modules/core-java-lang/src/test/java/com/baeldung/enums/iteration/DaysOfWeekEnum.java @@ -1,4 +1,4 @@ -package com.baeldung.java.enumiteration; +package com.baeldung.enums.iteration; import java.util.stream.Stream; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/java/enumiteration/EnumIterationExamples.java b/core-java-modules/core-java-lang/src/test/java/com/baeldung/enums/iteration/EnumIterationExamples.java similarity index 97% rename from core-java-modules/core-java-lang/src/test/java/com/baeldung/java/enumiteration/EnumIterationExamples.java rename to core-java-modules/core-java-lang/src/test/java/com/baeldung/enums/iteration/EnumIterationExamples.java index 110943e39f..9b058aef83 100644 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/java/enumiteration/EnumIterationExamples.java +++ b/core-java-modules/core-java-lang/src/test/java/com/baeldung/enums/iteration/EnumIterationExamples.java @@ -1,4 +1,4 @@ -package com.baeldung.java.enumiteration; +package com.baeldung.enums.iteration; import java.util.ArrayList; import java.util.Arrays; diff --git a/core-java-modules/core-java-lang/src/test/java/com/baeldung/objects/CarUnitTest.java b/core-java-modules/core-java-lang/src/test/java/com/baeldung/objects/CarUnitTest.java deleted file mode 100644 index a1ef20523e..0000000000 --- a/core-java-modules/core-java-lang/src/test/java/com/baeldung/objects/CarUnitTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.baeldung.objects; - -import static org.junit.Assert.*; - -import org.junit.Before; -import org.junit.Test; - -public class CarUnitTest { - - private Car car; - - @Before - public void setUp() throws Exception { - car = new Car("Ford", "Focus", "red"); - } - - @Test - public final void when_speedIncreased_then_verifySpeed() { - car.increaseSpeed(30); - assertEquals(30, car.getSpeed()); - - car.increaseSpeed(20); - assertEquals(50, car.getSpeed()); - } - - @Test - public final void when_speedDecreased_then_verifySpeed() { - car.increaseSpeed(50); - assertEquals(50, car.getSpeed()); - - car.decreaseSpeed(30); - assertEquals(20, car.getSpeed()); - - car.decreaseSpeed(20); - assertEquals(0, car.getSpeed()); - } - -} diff --git a/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/DateTimeServiceUnitTest.java b/core-java-modules/core-java-lang/src/test/java/com/baeldung/system/DateTimeServiceUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/DateTimeServiceUnitTest.java rename to core-java-modules/core-java-lang/src/test/java/com/baeldung/system/DateTimeServiceUnitTest.java diff --git a/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/EnvironmentVariablesUnitTest.java b/core-java-modules/core-java-lang/src/test/java/com/baeldung/system/EnvironmentVariablesUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/EnvironmentVariablesUnitTest.java rename to core-java-modules/core-java-lang/src/test/java/com/baeldung/system/EnvironmentVariablesUnitTest.java diff --git a/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/SystemArrayCopyUnitTest.java b/core-java-modules/core-java-lang/src/test/java/com/baeldung/system/SystemArrayCopyUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/SystemArrayCopyUnitTest.java rename to core-java-modules/core-java-lang/src/test/java/com/baeldung/system/SystemArrayCopyUnitTest.java diff --git a/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/SystemNanoUnitTest.java b/core-java-modules/core-java-lang/src/test/java/com/baeldung/system/SystemNanoUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/SystemNanoUnitTest.java rename to core-java-modules/core-java-lang/src/test/java/com/baeldung/system/SystemNanoUnitTest.java diff --git a/core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/SystemPropertiesUnitTest.java b/core-java-modules/core-java-lang/src/test/java/com/baeldung/system/SystemPropertiesUnitTest.java similarity index 100% rename from core-java-modules/core-java-lang-syntax/src/test/java/com/baeldung/system/SystemPropertiesUnitTest.java rename to core-java-modules/core-java-lang/src/test/java/com/baeldung/system/SystemPropertiesUnitTest.java diff --git a/core-java-modules/core-java-networking-2/README.md b/core-java-modules/core-java-networking-2/README.md index 62dec41356..120b111ff5 100644 --- a/core-java-modules/core-java-networking-2/README.md +++ b/core-java-modules/core-java-networking-2/README.md @@ -1,7 +1,14 @@ +## Core Java Networking (Part 2) + +This module contains articles about networking in Java + ### Relevant Articles -- [Checking if a URL Exists in Java](https://www.baeldung.com/java-check-url-exists) -- [Making a JSON POST Request With HttpURLConnection](https://www.baeldung.com/httpurlconnection-post) +- [Checking If a URL Exists in Java](https://www.baeldung.com/java-check-url-exists) +- [Making a JSON POST Request with HttpURLConnection](https://www.baeldung.com/httpurlconnection-post) - [Using Curl in Java](https://www.baeldung.com/java-curl) -- [Do a Simple HTTP Request in Java](http://www.baeldung.com/java-http-request) -- [Sending Emails with Java](http://www.baeldung.com/java-email) +- [Do a Simple HTTP Request in Java](https://www.baeldung.com/java-http-request) +- [Sending Emails with Java](https://www.baeldung.com/java-email) +- [Authentication with HttpUrlConnection](https://www.baeldung.com/java-http-url-connection) +- [Download a File from an URL in Java](https://www.baeldung.com/java-download-file) +- [[<-- Prev]](/core-java-modules/core-java-networking) diff --git a/core-java-modules/core-java-networking-2/pom.xml b/core-java-modules/core-java-networking-2/pom.xml index 2d404a553b..c3a5891066 100644 --- a/core-java-modules/core-java-networking-2/pom.xml +++ b/core-java-modules/core-java-networking-2/pom.xml @@ -6,9 +6,10 @@ jar - com.baeldung.core-java-modules - core-java-modules - 1.0.0-SNAPSHOT + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java @@ -27,6 +28,11 @@ mail ${javax.mail.version} + + org.asynchttpclient + async-http-client + ${async-http-client.version} + @@ -36,5 +42,6 @@ 4.5.9 1.5.0-b01 + 2.4.5 diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/download/FileDownload.java b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/download/FileDownload.java similarity index 99% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/download/FileDownload.java rename to core-java-modules/core-java-networking-2/src/main/java/com/baeldung/download/FileDownload.java index a099406d4c..ebcf7a70f7 100644 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/download/FileDownload.java +++ b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/download/FileDownload.java @@ -4,7 +4,7 @@ import org.apache.commons.io.FileUtils; import org.asynchttpclient.*; import java.io.*; -import java.net.*; +import java.net.URL; import java.nio.channels.Channels; import java.nio.channels.FileChannel; import java.nio.channels.ReadableByteChannel; diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/download/ResumableDownload.java b/core-java-modules/core-java-networking-2/src/main/java/com/baeldung/download/ResumableDownload.java similarity index 100% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/download/ResumableDownload.java rename to core-java-modules/core-java-networking-2/src/main/java/com/baeldung/download/ResumableDownload.java diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java similarity index 98% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java rename to core-java-modules/core-java-networking-2/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java index 81ac391958..16017ee482 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java +++ b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java @@ -1,8 +1,10 @@ package com.baeldung.download; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import org.junit.After; +import org.junit.BeforeClass; +import org.junit.Test; +import javax.xml.bind.DatatypeConverter; import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Files; @@ -11,11 +13,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.concurrent.ExecutionException; -import javax.xml.bind.DatatypeConverter; - -import org.junit.After; -import org.junit.BeforeClass; -import org.junit.Test; +import static org.junit.Assert.assertTrue; public class FileDownloadIntegrationTest { diff --git a/core-java-modules/core-java-networking/README.md b/core-java-modules/core-java-networking/README.md index 33fc3684a3..4038e9803a 100644 --- a/core-java-modules/core-java-networking/README.md +++ b/core-java-modules/core-java-networking/README.md @@ -1,7 +1,7 @@ -========= - ## Core Java Networking +This module contains articles about networking in Java + ### Relevant Articles - [Connecting Through Proxy Servers in Core Java](https://www.baeldung.com/java-connect-via-proxy-server) @@ -14,3 +14,4 @@ - [Guide to Java URL Encoding/Decoding](http://www.baeldung.com/java-url-encoding-decoding) - [Difference between URL and URI](http://www.baeldung.com/java-url-vs-uri) - [Read an InputStream using the Java Server Socket](https://www.baeldung.com/java-inputstream-server-socket) +- [[More -->]](/core-java-modules/core-java-networking-2) diff --git a/core-java-modules/core-java-networking/pom.xml b/core-java-modules/core-java-networking/pom.xml index b5071bf7df..cd84d2a27c 100644 --- a/core-java-modules/core-java-networking/pom.xml +++ b/core-java-modules/core-java-networking/pom.xml @@ -14,11 +14,6 @@ - - commons-io - commons-io - ${commons-io.version} - org.springframework spring-web diff --git a/core-java-modules/core-java-nio-2/README.md b/core-java-modules/core-java-nio-2/README.md new file mode 100644 index 0000000000..8b29c97385 --- /dev/null +++ b/core-java-modules/core-java-nio-2/README.md @@ -0,0 +1,11 @@ +## Core Java NIO + +This module contains articles about core Java non-blocking input and output (IO) + +## Relevant Articles: + +- [A Guide to WatchService in Java NIO2](https://www.baeldung.com/java-nio2-watchservice) +- [Create a Symbolic Link with Java](https://www.baeldung.com/java-symlink) +- [Introduction to the Java NIO Selector](https://www.baeldung.com/java-nio-selector) +- [Using Java MappedByteBuffer](https://www.baeldung.com/java-mapped-byte-buffer) +- [[<-- Prev]](/core-java-modules/core-java-nio) \ No newline at end of file diff --git a/core-java-modules/core-java-io/hard_link.txt b/core-java-modules/core-java-nio-2/hard_link.txt similarity index 100% rename from core-java-modules/core-java-io/hard_link.txt rename to core-java-modules/core-java-nio-2/hard_link.txt diff --git a/core-java-modules/core-java-nio-2/pom.xml b/core-java-modules/core-java-nio-2/pom.xml new file mode 100644 index 0000000000..c1fa423b38 --- /dev/null +++ b/core-java-modules/core-java-nio-2/pom.xml @@ -0,0 +1,17 @@ + + 4.0.0 + core-java-nio-2 + 0.1.0-SNAPSHOT + core-java-nio-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio/selector/EchoClient.java b/core-java-modules/core-java-nio-2/src/main/java/com/baeldung/selector/EchoClient.java similarity index 96% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio/selector/EchoClient.java rename to core-java-modules/core-java-nio-2/src/main/java/com/baeldung/selector/EchoClient.java index 61f339db58..dd0a15ac7e 100644 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio/selector/EchoClient.java +++ b/core-java-modules/core-java-nio-2/src/main/java/com/baeldung/selector/EchoClient.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio.selector; +package com.baeldung.selector; import java.io.IOException; import java.net.InetSocketAddress; diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio/selector/EchoServer.java b/core-java-modules/core-java-nio-2/src/main/java/com/baeldung/selector/EchoServer.java similarity index 98% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio/selector/EchoServer.java rename to core-java-modules/core-java-nio-2/src/main/java/com/baeldung/selector/EchoServer.java index 7c1e291646..8cf2e941fe 100644 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio/selector/EchoServer.java +++ b/core-java-modules/core-java-nio-2/src/main/java/com/baeldung/selector/EchoServer.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio.selector; +package com.baeldung.selector; import java.io.File; import java.io.IOException; diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/symlink/SymLinkExample.java b/core-java-modules/core-java-nio-2/src/main/java/com/baeldung/symlink/SymLinkExample.java similarity index 93% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/symlink/SymLinkExample.java rename to core-java-modules/core-java-nio-2/src/main/java/com/baeldung/symlink/SymLinkExample.java index 63ee0f14b1..4c2c47e085 100644 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/symlink/SymLinkExample.java +++ b/core-java-modules/core-java-nio-2/src/main/java/com/baeldung/symlink/SymLinkExample.java @@ -6,9 +6,11 @@ import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import static java.nio.file.StandardOpenOption.*; import java.util.stream.IntStream; +import static java.nio.file.StandardOpenOption.CREATE; +import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING; + public class SymLinkExample { public void createSymbolicLink(Path link, Path target) throws IOException { diff --git a/core-java-modules/core-java-nio-2/src/main/java/com/baeldung/watcher/DirectoryWatcherExample.java b/core-java-modules/core-java-nio-2/src/main/java/com/baeldung/watcher/DirectoryWatcherExample.java new file mode 100644 index 0000000000..e8a2a401ab --- /dev/null +++ b/core-java-modules/core-java-nio-2/src/main/java/com/baeldung/watcher/DirectoryWatcherExample.java @@ -0,0 +1,23 @@ +package com.baeldung.watcher; + +import java.io.IOException; +import java.nio.file.*; + +public class DirectoryWatcherExample { + + public static void main(String[] args) throws IOException, InterruptedException { + WatchService watchService = FileSystems.getDefault().newWatchService(); + Path path = Paths.get(System.getProperty("user.home")); + path.register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY); + WatchKey key; + while ((key = watchService.take()) != null) { + for (WatchEvent event : key.pollEvents()) { + System.out.println("Event kind:" + event.kind() + ". File affected: " + event.context() + "."); + } + key.reset(); + } + + watchService.close(); + } + +} diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/mappedbytebuffer/MappedByteBufferUnitTest.java b/core-java-modules/core-java-nio-2/src/test/java/com/baeldung/mappedbytebuffer/MappedByteBufferUnitTest.java similarity index 100% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/mappedbytebuffer/MappedByteBufferUnitTest.java rename to core-java-modules/core-java-nio-2/src/test/java/com/baeldung/mappedbytebuffer/MappedByteBufferUnitTest.java diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio/selector/NioEchoLiveTest.java b/core-java-modules/core-java-nio-2/src/test/java/com/baeldung/selector/NioEchoLiveTest.java similarity index 87% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio/selector/NioEchoLiveTest.java rename to core-java-modules/core-java-nio-2/src/test/java/com/baeldung/selector/NioEchoLiveTest.java index 0e1afa87a5..39deb798e5 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio/selector/NioEchoLiveTest.java +++ b/core-java-modules/core-java-nio-2/src/test/java/com/baeldung/selector/NioEchoLiveTest.java @@ -1,13 +1,15 @@ -package com.baeldung.java.nio.selector; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; +package com.baeldung.selector; +import com.baeldung.selector.EchoClient; +import com.baeldung.selector.EchoServer; import org.junit.After; import org.junit.Before; import org.junit.Test; +import java.io.IOException; + +import static org.junit.Assert.assertEquals; + public class NioEchoLiveTest { private Process server; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/symlink/SymLinkExampleManualTest.java b/core-java-modules/core-java-nio-2/src/test/java/com/baeldung/symlink/SymLinkExampleManualTest.java similarity index 100% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/symlink/SymLinkExampleManualTest.java rename to core-java-modules/core-java-nio-2/src/test/java/com/baeldung/symlink/SymLinkExampleManualTest.java index caa7049475..e6723e719c 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/symlink/SymLinkExampleManualTest.java +++ b/core-java-modules/core-java-nio-2/src/test/java/com/baeldung/symlink/SymLinkExampleManualTest.java @@ -1,13 +1,13 @@ package com.baeldung.symlink; -import static org.junit.Assert.*; +import org.junit.Test; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import static org.junit.Assert.*; public class SymLinkExampleManualTest { diff --git a/core-java-modules/core-java-io/src/test/resources/fileToRead.txt b/core-java-modules/core-java-nio-2/src/test/resources/fileToRead.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/fileToRead.txt rename to core-java-modules/core-java-nio-2/src/test/resources/fileToRead.txt diff --git a/core-java-modules/core-java-io/src/test/resources/fileToWriteTo.txt b/core-java-modules/core-java-nio-2/src/test/resources/fileToWriteTo.txt similarity index 100% rename from core-java-modules/core-java-io/src/test/resources/fileToWriteTo.txt rename to core-java-modules/core-java-nio-2/src/test/resources/fileToWriteTo.txt diff --git a/core-java-modules/core-java-nio/README.md b/core-java-modules/core-java-nio/README.md index 1ac3b6c089..b64a436957 100644 --- a/core-java-modules/core-java-nio/README.md +++ b/core-java-modules/core-java-nio/README.md @@ -1,3 +1,17 @@ +## Core Java NIO + +This module contains articles about core Java non-blocking input and output (IO) + ## Relevant Articles: - [Determine File Creation Date in Java](https://www.baeldung.com/java-file-creation-date) +- [Find the Number of Lines in a File Using Java](https://www.baeldung.com/java-file-number-of-lines) +- [A Guide to NIO2 Asynchronous File Channel](https://www.baeldung.com/java-nio2-async-file-channel) +- [A Guide to NIO2 FileVisitor](https://www.baeldung.com/java-nio2-file-visitor) +- [Guide to Java FileChannel](https://www.baeldung.com/java-filechannel) +- [A Guide to NIO2 File Attribute APIs](https://www.baeldung.com/java-nio2-file-attribute) +- [Introduction to the Java NIO2 File API](https://www.baeldung.com/java-nio-2-file-api) +- [Java NIO2 Path API](https://www.baeldung.com/java-nio-2-path) +- [Guide to Java NIO2 Asynchronous Channel APIs](https://www.baeldung.com/java-nio-2-async-channels) +- [A Guide to NIO2 Asynchronous Socket Channel](https://www.baeldung.com/java-nio2-async-socket-channel) +- [[More -->]](/core-java-modules/core-java-nio-2) diff --git a/core-java-modules/core-java-nio/pom.xml b/core-java-modules/core-java-nio/pom.xml index 31433e632f..da8759a956 100644 --- a/core-java-modules/core-java-nio/pom.xml +++ b/core-java-modules/core-java-nio/pom.xml @@ -13,4 +13,5 @@ 0.0.1-SNAPSHOT ../../parent-java + \ No newline at end of file diff --git a/core-java-modules/core-java-nio/src/main/java/com/baeldung/file/Main.java b/core-java-modules/core-java-nio/src/main/java/com/baeldung/file/Main.java deleted file mode 100644 index d8800dd881..0000000000 --- a/core-java-modules/core-java-nio/src/main/java/com/baeldung/file/Main.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.baeldung.file; - -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingApacheCommonsIO; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingBufferedReader; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingGoogleGuava; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingLineNumberReader; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFileChannel; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFiles; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFilesReadAllLines; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingScanner; - -public class Main { - - private static final String INPUT_FILE_NAME = "src/main/resources/input.txt"; - - public static void main(String... args) throws Exception { - System.out.printf("Total Number of Lines Using BufferedReader: %s%n", getTotalNumberOfLinesUsingBufferedReader(INPUT_FILE_NAME)); - System.out.printf("Total Number of Lines Using LineNumberReader: %s%n", getTotalNumberOfLinesUsingLineNumberReader(INPUT_FILE_NAME)); - System.out.printf("Total Number of Lines Using Scanner: %s%n", getTotalNumberOfLinesUsingScanner(INPUT_FILE_NAME)); - System.out.printf("Total Number of Lines Using NIO Files: %s%n", getTotalNumberOfLinesUsingNIOFiles(INPUT_FILE_NAME)); - System.out.printf("Total Number of Lines Using NIO Files#readAllLines: %s%n", getTotalNumberOfLinesUsingNIOFilesReadAllLines(INPUT_FILE_NAME)); - System.out.printf("Total Number of Lines Using NIO FileChannel: %s%n", getTotalNumberOfLinesUsingNIOFileChannel(INPUT_FILE_NAME)); - System.out.printf("Total Number of Lines Using Apache Commons IO: %s%n", getTotalNumberOfLinesUsingApacheCommonsIO(INPUT_FILE_NAME)); - System.out.printf("Total Number of Lines Using NIO Google Guava: %s%n", getTotalNumberOfLinesUsingGoogleGuava(INPUT_FILE_NAME)); - } -} diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio2/visitor/FileSearchExample.java b/core-java-modules/core-java-nio/src/main/java/com/baeldung/filevisitor/FileSearchExample.java similarity index 97% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio2/visitor/FileSearchExample.java rename to core-java-modules/core-java-nio/src/main/java/com/baeldung/filevisitor/FileSearchExample.java index b1b790f541..b49d6eb570 100644 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio2/visitor/FileSearchExample.java +++ b/core-java-modules/core-java-nio/src/main/java/com/baeldung/filevisitor/FileSearchExample.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio2.visitor; +package com.baeldung.filevisitor; import java.io.IOException; import java.nio.file.*; diff --git a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio2/visitor/FileVisitorImpl.java b/core-java-modules/core-java-nio/src/main/java/com/baeldung/filevisitor/FileVisitorImpl.java similarity index 94% rename from core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio2/visitor/FileVisitorImpl.java rename to core-java-modules/core-java-nio/src/main/java/com/baeldung/filevisitor/FileVisitorImpl.java index aa769b5091..d86264720f 100644 --- a/core-java-modules/core-java-io/src/main/java/com/baeldung/java/nio2/visitor/FileVisitorImpl.java +++ b/core-java-modules/core-java-nio/src/main/java/com/baeldung/filevisitor/FileVisitorImpl.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio2.visitor; +package com.baeldung.filevisitor; import java.io.IOException; import java.nio.file.FileVisitResult; diff --git a/core-java-modules/core-java-nio/src/main/java/com/baeldung/lines/Main.java b/core-java-modules/core-java-nio/src/main/java/com/baeldung/lines/Main.java new file mode 100644 index 0000000000..5aa0968ab9 --- /dev/null +++ b/core-java-modules/core-java-nio/src/main/java/com/baeldung/lines/Main.java @@ -0,0 +1,26 @@ +package com.baeldung.lines; + +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingApacheCommonsIO; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingBufferedReader; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingGoogleGuava; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingLineNumberReader; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFileChannel; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFiles; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFilesReadAllLines; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingScanner; + +public class Main { + + private static final String INPUT_FILE_NAME = "src/main/resources/input.txt"; + + public static void main(String... args) throws Exception { + System.out.printf("Total Number of Lines Using BufferedReader: %s%n", getTotalNumberOfLinesUsingBufferedReader(INPUT_FILE_NAME)); + System.out.printf("Total Number of Lines Using LineNumberReader: %s%n", getTotalNumberOfLinesUsingLineNumberReader(INPUT_FILE_NAME)); + System.out.printf("Total Number of Lines Using Scanner: %s%n", getTotalNumberOfLinesUsingScanner(INPUT_FILE_NAME)); + System.out.printf("Total Number of Lines Using NIO Files: %s%n", getTotalNumberOfLinesUsingNIOFiles(INPUT_FILE_NAME)); + System.out.printf("Total Number of Lines Using NIO Files#readAllLines: %s%n", getTotalNumberOfLinesUsingNIOFilesReadAllLines(INPUT_FILE_NAME)); + System.out.printf("Total Number of Lines Using NIO FileChannel: %s%n", getTotalNumberOfLinesUsingNIOFileChannel(INPUT_FILE_NAME)); + System.out.printf("Total Number of Lines Using Apache Commons IO: %s%n", getTotalNumberOfLinesUsingApacheCommonsIO(INPUT_FILE_NAME)); + System.out.printf("Total Number of Lines Using NIO Google Guava: %s%n", getTotalNumberOfLinesUsingGoogleGuava(INPUT_FILE_NAME)); + } +} diff --git a/core-java-modules/core-java-nio/src/main/java/com/baeldung/file/NumberOfLineFinder.java b/core-java-modules/core-java-nio/src/main/java/com/baeldung/lines/NumberOfLineFinder.java similarity index 99% rename from core-java-modules/core-java-nio/src/main/java/com/baeldung/file/NumberOfLineFinder.java rename to core-java-modules/core-java-nio/src/main/java/com/baeldung/lines/NumberOfLineFinder.java index 3abf82f3fa..b355295dab 100644 --- a/core-java-modules/core-java-nio/src/main/java/com/baeldung/file/NumberOfLineFinder.java +++ b/core-java-modules/core-java-nio/src/main/java/com/baeldung/lines/NumberOfLineFinder.java @@ -1,4 +1,4 @@ -package com.baeldung.file; +package com.baeldung.lines; import java.io.BufferedReader; import java.io.File; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoClient.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoClient.java similarity index 98% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoClient.java rename to core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoClient.java index ebab715306..f42f5cdeca 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoClient.java +++ b/core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoClient.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio2.async; +package com.baeldung.async; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoIntegrationTest.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoIntegrationTest.java similarity index 95% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoIntegrationTest.java rename to core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoIntegrationTest.java index 3cfac0e90f..42053cea96 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoIntegrationTest.java +++ b/core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio2.async; +package com.baeldung.async; import org.junit.After; import org.junit.Before; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoServer.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoServer.java similarity index 98% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoServer.java rename to core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoServer.java index 01873b344a..b3f8151b7e 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoServer.java +++ b/core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoServer.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio2.async; +package com.baeldung.async; import java.io.File; import java.io.IOException; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoServer2.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoServer2.java similarity index 98% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoServer2.java rename to core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoServer2.java index 663fc4f2ed..15b98cbf6e 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/async/AsyncEchoServer2.java +++ b/core-java-modules/core-java-nio/src/test/java/com/baeldung/async/AsyncEchoServer2.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio2.async; +package com.baeldung.async; import java.io.File; import java.io.IOException; diff --git a/core-java-modules/core-java-nio/src/test/java/com/baeldung/asyncfilechannel/AsyncFileChannelIntegrationTest.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/asyncfilechannel/AsyncFileChannelIntegrationTest.java new file mode 100644 index 0000000000..68f0afec95 --- /dev/null +++ b/core-java-modules/core-java-nio/src/test/java/com/baeldung/asyncfilechannel/AsyncFileChannelIntegrationTest.java @@ -0,0 +1,125 @@ +package com.baeldung.asyncfilechannel; + +import org.junit.Test; + +import java.io.IOException; +import java.net.URI; +import java.nio.ByteBuffer; +import java.nio.channels.AsynchronousFileChannel; +import java.nio.channels.CompletionHandler; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + +import static org.junit.Assert.assertEquals; + +public class AsyncFileChannelIntegrationTest { + + @Test + public void givenPath_whenReadsContentWithFuture_thenCorrect() throws IOException, ExecutionException, InterruptedException { + final Path path = Paths.get(URI.create(this.getClass().getClassLoader().getResource("file.txt").toString())); + final AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.READ); + + final ByteBuffer buffer = ByteBuffer.allocate(1024); + + final Future operation = fileChannel.read(buffer, 0); + + operation.get(); + + final String fileContent = new String(buffer.array()).trim(); + buffer.clear(); + + assertEquals(fileContent, "baeldung.com"); + } + + @Test + public void givenPath_whenReadsContentWithCompletionHandler_thenCorrect() throws IOException { + final Path path = Paths.get(URI.create(this.getClass().getClassLoader().getResource("file.txt").toString())); + final AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.READ); + + final ByteBuffer buffer = ByteBuffer.allocate(1024); + + fileChannel.read(buffer, 0, buffer, new CompletionHandler() { + @Override + public void completed(Integer result, ByteBuffer attachment) { + // result is number of bytes read + // attachment is the buffer + } + + @Override + public void failed(Throwable exc, ByteBuffer attachment) { + + } + }); + } + + @Test + public void givenPathAndContent_whenWritesToFileWithFuture_thenCorrect() throws IOException, ExecutionException, InterruptedException { + final String fileName = "temp"; + final Path path = Paths.get(fileName); + final AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.WRITE, StandardOpenOption.CREATE); + + final ByteBuffer buffer = ByteBuffer.allocate(1024); + final long position = 0; + + buffer.put("hello world".getBytes()); + buffer.flip(); + + final Future operation = fileChannel.write(buffer, position); + buffer.clear(); + + operation.get(); + + final String content = readContent(path); + assertEquals("hello world", content); + } + + @Test + public void givenPathAndContent_whenWritesToFileWithHandler_thenCorrect() throws IOException { + final String fileName = UUID.randomUUID().toString(); + final Path path = Paths.get(fileName); + final AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.DELETE_ON_CLOSE); + + final ByteBuffer buffer = ByteBuffer.allocate(1024); + buffer.put("hello world".getBytes()); + buffer.flip(); + + fileChannel.write(buffer, 0, buffer, new CompletionHandler() { + @Override + public void completed(Integer result, ByteBuffer attachment) { + // result is number of bytes written + // attachment is the buffer + } + + @Override + public void failed(Throwable exc, ByteBuffer attachment) { + + } + }); + } + + // + + private String readContent(Path file) throws ExecutionException, InterruptedException { + AsynchronousFileChannel fileChannel = null; + try { + fileChannel = AsynchronousFileChannel.open(file, StandardOpenOption.READ); + } catch (IOException e) { + e.printStackTrace(); + } + + final ByteBuffer buffer = ByteBuffer.allocate(1024); + + final Future operation = fileChannel.read(buffer, 0); + + operation.get(); + + final String fileContent = new String(buffer.array()).trim(); + buffer.clear(); + return fileContent; + } + +} \ No newline at end of file diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/attributes/BasicAttribsIntegrationTest.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/attributes/BasicAttribsIntegrationTest.java similarity index 98% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/attributes/BasicAttribsIntegrationTest.java rename to core-java-modules/core-java-nio/src/test/java/com/baeldung/attributes/BasicAttribsIntegrationTest.java index 4b6302e93c..a1f05d107f 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/attributes/BasicAttribsIntegrationTest.java +++ b/core-java-modules/core-java-nio/src/test/java/com/baeldung/attributes/BasicAttribsIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio2.attributes; +package com.baeldung.attributes; import org.junit.BeforeClass; import org.junit.Test; diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/FileIntegrationTest.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/file/FileIntegrationTest.java similarity index 99% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/FileIntegrationTest.java rename to core-java-modules/core-java-nio/src/test/java/com/baeldung/file/FileIntegrationTest.java index d1cf81e4ce..1ae84a4dcf 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/FileIntegrationTest.java +++ b/core-java-modules/core-java-nio/src/test/java/com/baeldung/file/FileIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.nio2; +package com.baeldung.file; import org.apache.commons.io.FileUtils; import org.junit.AfterClass; diff --git a/core-java-modules/core-java-nio/src/test/java/com/baeldung/file/NumberOfLineFinderUnitTest.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/file/NumberOfLineFinderUnitTest.java deleted file mode 100644 index 40ed6d6bba..0000000000 --- a/core-java-modules/core-java-nio/src/test/java/com/baeldung/file/NumberOfLineFinderUnitTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.baeldung.file; - -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingApacheCommonsIO; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingBufferedReader; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingGoogleGuava; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingLineNumberReader; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFileChannel; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFiles; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFilesReadAllLines; -import static com.baeldung.file.NumberOfLineFinder.getTotalNumberOfLinesUsingScanner; -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class NumberOfLineFinderUnitTest { - private static final String INPUT_FILE_NAME = "src/main/resources/input.txt"; - private static final int ACTUAL_LINE_COUNT = 45; - - @Test - public void whenUsingBufferedReader_thenReturnTotalNumberOfLines() { - int lines = getTotalNumberOfLinesUsingBufferedReader(INPUT_FILE_NAME); - assertEquals(ACTUAL_LINE_COUNT, lines); - } - - @Test - public void whenUsingLineNumberReader_thenReturnTotalNumberOfLines() { - int lines = getTotalNumberOfLinesUsingLineNumberReader(INPUT_FILE_NAME); - assertEquals(ACTUAL_LINE_COUNT, lines); - } - - @Test - public void whenUsingScanner_thenReturnTotalNumberOfLines() { - int lines = getTotalNumberOfLinesUsingScanner(INPUT_FILE_NAME); - assertEquals(ACTUAL_LINE_COUNT, lines); - } - - @Test - public void whenUsingNIOFiles_thenReturnTotalNumberOfLines() { - int lines = getTotalNumberOfLinesUsingNIOFiles(INPUT_FILE_NAME); - assertEquals(ACTUAL_LINE_COUNT, lines); - } - - @Test - public void whenUsingNIOFilesReadAllLines_thenReturnTotalNumberOfLines() { - int lines = getTotalNumberOfLinesUsingNIOFilesReadAllLines(INPUT_FILE_NAME); - assertEquals(ACTUAL_LINE_COUNT, lines); - } - - @Test - public void whenUsingNIOFileChannel_thenReturnTotalNumberOfLines() { - int lines = getTotalNumberOfLinesUsingNIOFileChannel(INPUT_FILE_NAME); - assertEquals(ACTUAL_LINE_COUNT, lines); - } - - @Test - public void whenUsingApacheCommonsIO_thenReturnTotalNumberOfLines() { - int lines = getTotalNumberOfLinesUsingApacheCommonsIO(INPUT_FILE_NAME); - assertEquals(ACTUAL_LINE_COUNT, lines); - } - - @Test - public void whenUsingGoogleGuava_thenReturnTotalNumberOfLines() { - int lines = getTotalNumberOfLinesUsingGoogleGuava(INPUT_FILE_NAME); - assertEquals(ACTUAL_LINE_COUNT, lines); - } - -} diff --git a/core-java-modules/core-java-nio/src/test/java/com/baeldung/lines/NumberOfLineFinderUnitTest.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/lines/NumberOfLineFinderUnitTest.java new file mode 100644 index 0000000000..661b42accd --- /dev/null +++ b/core-java-modules/core-java-nio/src/test/java/com/baeldung/lines/NumberOfLineFinderUnitTest.java @@ -0,0 +1,67 @@ +package com.baeldung.lines; + +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingApacheCommonsIO; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingBufferedReader; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingGoogleGuava; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingLineNumberReader; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFileChannel; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFiles; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingNIOFilesReadAllLines; +import static com.baeldung.lines.NumberOfLineFinder.getTotalNumberOfLinesUsingScanner; +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class NumberOfLineFinderUnitTest { + private static final String INPUT_FILE_NAME = "src/main/resources/input.txt"; + private static final int ACTUAL_LINE_COUNT = 45; + + @Test + public void whenUsingBufferedReader_thenReturnTotalNumberOfLines() { + int lines = getTotalNumberOfLinesUsingBufferedReader(INPUT_FILE_NAME); + assertEquals(ACTUAL_LINE_COUNT, lines); + } + + @Test + public void whenUsingLineNumberReader_thenReturnTotalNumberOfLines() { + int lines = getTotalNumberOfLinesUsingLineNumberReader(INPUT_FILE_NAME); + assertEquals(ACTUAL_LINE_COUNT, lines); + } + + @Test + public void whenUsingScanner_thenReturnTotalNumberOfLines() { + int lines = getTotalNumberOfLinesUsingScanner(INPUT_FILE_NAME); + assertEquals(ACTUAL_LINE_COUNT, lines); + } + + @Test + public void whenUsingNIOFiles_thenReturnTotalNumberOfLines() { + int lines = getTotalNumberOfLinesUsingNIOFiles(INPUT_FILE_NAME); + assertEquals(ACTUAL_LINE_COUNT, lines); + } + + @Test + public void whenUsingNIOFilesReadAllLines_thenReturnTotalNumberOfLines() { + int lines = getTotalNumberOfLinesUsingNIOFilesReadAllLines(INPUT_FILE_NAME); + assertEquals(ACTUAL_LINE_COUNT, lines); + } + + @Test + public void whenUsingNIOFileChannel_thenReturnTotalNumberOfLines() { + int lines = getTotalNumberOfLinesUsingNIOFileChannel(INPUT_FILE_NAME); + assertEquals(ACTUAL_LINE_COUNT, lines); + } + + @Test + public void whenUsingApacheCommonsIO_thenReturnTotalNumberOfLines() { + int lines = getTotalNumberOfLinesUsingApacheCommonsIO(INPUT_FILE_NAME); + assertEquals(ACTUAL_LINE_COUNT, lines); + } + + @Test + public void whenUsingGoogleGuava_thenReturnTotalNumberOfLines() { + int lines = getTotalNumberOfLinesUsingGoogleGuava(INPUT_FILE_NAME); + assertEquals(ACTUAL_LINE_COUNT, lines); + } + +} diff --git a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/PathManualTest.java b/core-java-modules/core-java-nio/src/test/java/com/baeldung/path/PathManualTest.java similarity index 97% rename from core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/PathManualTest.java rename to core-java-modules/core-java-nio/src/test/java/com/baeldung/path/PathManualTest.java index 969dff1da2..7017fd42e7 100644 --- a/core-java-modules/core-java-io/src/test/java/com/baeldung/java/nio2/PathManualTest.java +++ b/core-java-modules/core-java-nio/src/test/java/com/baeldung/path/PathManualTest.java @@ -1,8 +1,6 @@ -package com.baeldung.java.nio2; +package com.baeldung.path; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import org.junit.Test; import java.io.IOException; import java.net.URI; @@ -10,7 +8,7 @@ import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import static org.junit.Assert.*; public class PathManualTest { diff --git a/core-java-modules/core-java-nio/src/test/resources/file.txt b/core-java-modules/core-java-nio/src/test/resources/file.txt new file mode 100644 index 0000000000..558d8bbf35 --- /dev/null +++ b/core-java-modules/core-java-nio/src/test/resources/file.txt @@ -0,0 +1 @@ +baeldung.com \ No newline at end of file diff --git a/core-java-modules/core-java-optional/README.md b/core-java-modules/core-java-optional/README.md index b6848b5d33..22ac8736fa 100644 --- a/core-java-modules/core-java-optional/README.md +++ b/core-java-modules/core-java-optional/README.md @@ -4,3 +4,5 @@ ### Relevant Articles: - [Java Optional as Return Type](https://www.baeldung.com/java-optional-return) +- [Guide To Java 8 Optional](https://www.baeldung.com/java-optional) +- [Java Optional – orElse() vs orElseGet()](https://www.baeldung.com/java-optional-or-else-vs-or-else-get) \ No newline at end of file diff --git a/core-java-modules/core-java-optional/pom.xml b/core-java-modules/core-java-optional/pom.xml index ca6158ef5a..38d7565282 100644 --- a/core-java-modules/core-java-optional/pom.xml +++ b/core-java-modules/core-java-optional/pom.xml @@ -27,27 +27,26 @@ jackson-databind ${jackson.version} + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - UTF-8 - 1.8 - 1.8 5.4.0.Final + 1.19 + 1.19 \ No newline at end of file diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Modem.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Modem.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Modem.java rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Modem.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGet.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/OrElseAndOrElseGetBenchmarkRunner.java diff --git a/core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Person.java b/core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Person.java similarity index 100% rename from core-java-modules/core-java-8/src/main/java/com/baeldung/optional/Person.java rename to core-java-modules/core-java-optional/src/main/java/com/baeldung/optional/Person.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java b/core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java rename to core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalChainingUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java b/core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java rename to core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java b/core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java rename to core-java-modules/core-java-optional/src/test/java/com/baeldung/java8/optional/OrElseAndOrElseGetUnitTest.java diff --git a/core-java-modules/core-java-os/README.md b/core-java-modules/core-java-os/README.md index 697af5e4d6..f2ec3f9d48 100644 --- a/core-java-modules/core-java-os/README.md +++ b/core-java-modules/core-java-os/README.md @@ -1,10 +1,16 @@ -========= +## Core Java OS -This module uses Java 9, so make sure to have the JDK 9 installed to run it. +This module contains articles about working with the operating system (OS) in Java -## ### Relevant Articles: + - [Java 9 Process API Improvements](http://www.baeldung.com/java-9-process-api) - [Guide to java.lang.Process API](https://www.baeldung.com/java-process-api) - [Guide to java.lang.ProcessBuilder API](https://www.baeldung.com/java-lang-processbuilder-api) - [Get the Current Working Directory in Java](https://www.baeldung.com/java-current-directory) +- [How to Detect the OS Using Java](http://www.baeldung.com/java-detect-os) +- [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) +- [Pattern Search with Grep in Java](http://www.baeldung.com/grep-in-java) +- [How to Run a Shell Command in Java](http://www.baeldung.com/run-shell-command-in-java) + +This module uses Java 9, so make sure to have the JDK 9 installed to run it. \ No newline at end of file diff --git a/core-java-modules/core-java-os/pom.xml b/core-java-modules/core-java-os/pom.xml index f6c5ef04a5..f09b62ebf2 100644 --- a/core-java-modules/core-java-os/pom.xml +++ b/core-java-modules/core-java-os/pom.xml @@ -42,6 +42,16 @@ ${assertj.version} test + + org.unix4j + unix4j-command + ${unix4j.version} + + + com.googlecode.grep4j + grep4j + ${grep4j.version} + @@ -54,7 +64,7 @@ - + org.apache.maven.plugins maven-compiler-plugin ${maven-compiler-plugin.version} @@ -77,5 +87,7 @@ 1.9 1.9 25.1-jre + 0.4 + 1.8.7 diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/printscreen/Screenshot.java b/core-java-modules/core-java-os/src/main/java/com/baeldung/printscreen/Screenshot.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/printscreen/Screenshot.java rename to core-java-modules/core-java-os/src/main/java/com/baeldung/printscreen/Screenshot.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/system/DetectOS.java b/core-java-modules/core-java-os/src/main/java/com/baeldung/system/DetectOS.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/system/DetectOS.java rename to core-java-modules/core-java-os/src/main/java/com/baeldung/system/DetectOS.java diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/grep/GrepWithUnix4JIntegrationTest.java b/core-java-modules/core-java-os/src/test/java/com/baeldung/grep/GrepWithUnix4JIntegrationTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/grep/GrepWithUnix4JIntegrationTest.java rename to core-java-modules/core-java-os/src/test/java/com/baeldung/grep/GrepWithUnix4JIntegrationTest.java diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/printscreen/ScreenshotLiveTest.java b/core-java-modules/core-java-os/src/test/java/com/baeldung/printscreen/ScreenshotLiveTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/printscreen/ScreenshotLiveTest.java rename to core-java-modules/core-java-os/src/test/java/com/baeldung/printscreen/ScreenshotLiveTest.java diff --git a/core-java-modules/core-java/src/test/java/org/baeldung/java/shell/JavaProcessUnitIntegrationTest.java b/core-java-modules/core-java-os/src/test/java/com/baeldung/shell/JavaProcessUnitIntegrationTest.java similarity index 98% rename from core-java-modules/core-java/src/test/java/org/baeldung/java/shell/JavaProcessUnitIntegrationTest.java rename to core-java-modules/core-java-os/src/test/java/com/baeldung/shell/JavaProcessUnitIntegrationTest.java index efd7dda70f..53e9364207 100644 --- a/core-java-modules/core-java/src/test/java/org/baeldung/java/shell/JavaProcessUnitIntegrationTest.java +++ b/core-java-modules/core-java-os/src/test/java/com/baeldung/shell/JavaProcessUnitIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.shell; +package com.baeldung.java.shell; import org.junit.Assert; import org.junit.Test; diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/system/WhenDetectingOSUnitTest.java b/core-java-modules/core-java-os/src/test/java/com/baeldung/system/WhenDetectingOSUnitTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/system/WhenDetectingOSUnitTest.java rename to core-java-modules/core-java-os/src/test/java/com/baeldung/system/WhenDetectingOSUnitTest.java diff --git a/core-java-modules/core-java-perf/README.md b/core-java-modules/core-java-perf/README.md index 1b3b590bf8..d1d646ac7f 100644 --- a/core-java-modules/core-java-perf/README.md +++ b/core-java-modules/core-java-perf/README.md @@ -1,5 +1,7 @@ ## Core Java Performance +This module contains articles about performance of Java applications + ### Relevant Articles: - [Verbose Garbage Collection in Java](https://www.baeldung.com/java-verbose-gc) - [Different Ways to Capture Java Heap Dumps](https://www.baeldung.com/java-heap-dump-capture) diff --git a/core-java-modules/core-java-perf/pom.xml b/core-java-modules/core-java-perf/pom.xml index b9c9d30ac0..a6e20f198d 100644 --- a/core-java-modules/core-java-perf/pom.xml +++ b/core-java-modules/core-java-perf/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-perf 0.1.0-SNAPSHOT core-java-perf @@ -14,13 +13,4 @@ ../../parent-java - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - - diff --git a/core-java-modules/core-java-security-manager/README.md b/core-java-modules/core-java-security-manager/README.md new file mode 100644 index 0000000000..a4abe7f80a --- /dev/null +++ b/core-java-modules/core-java-security-manager/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Intro to the Java SecurityManager](https://www.baeldung.com/java-security-manager) diff --git a/core-java-modules/core-java-security-manager/pom.xml b/core-java-modules/core-java-security-manager/pom.xml index 51d5e7d78f..f5be1639da 100644 --- a/core-java-modules/core-java-security-manager/pom.xml +++ b/core-java-modules/core-java-security-manager/pom.xml @@ -10,25 +10,5 @@ core-java-modules 1.0.0-SNAPSHOT - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - UTF-8 - 1.8 - 1.8 - diff --git a/core-java-modules/core-java-security/README.md b/core-java-modules/core-java-security/README.md index a833ca30bb..7386d04e8e 100644 --- a/core-java-modules/core-java-security/README.md +++ b/core-java-modules/core-java-security/README.md @@ -1,5 +1,7 @@ ## Core Java Security +This module contains articles about core Java Security + ### Relevant Articles: - [MD5 Hashing in Java](http://www.baeldung.com/java-md5) - [Guide to the Cipher Class](http://www.baeldung.com/java-cipher-class) @@ -11,3 +13,6 @@ - [SHA-256 and SHA3-256 Hashing in Java](https://www.baeldung.com/sha-256-hashing-java) - [Enabling TLS v1.2 in Java 7](https://www.baeldung.com/java-7-tls-v12) - [The Java SecureRandom Class](https://www.baeldung.com/java-secure-random) +- [An Introduction to Java SASL](https://www.baeldung.com/java-sasl) +- [A Guide to Java GSS API](https://www.baeldung.com/java-gss) + diff --git a/core-java-modules/core-java-security/pom.xml b/core-java-modules/core-java-security/pom.xml index d3efb26fe8..e882fd823e 100644 --- a/core-java-modules/core-java-security/pom.xml +++ b/core-java-modules/core-java-security/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-security 0.1.0-SNAPSHOT core-java-security @@ -15,11 +14,6 @@ - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - org.assertj diff --git a/core-java-modules/core-java-streams-2/README.md b/core-java-modules/core-java-streams-2/README.md new file mode 100644 index 0000000000..2ff95045c3 --- /dev/null +++ b/core-java-modules/core-java-streams-2/README.md @@ -0,0 +1,16 @@ +## Core Java streams + +This module contains articles about the Stream API in Java. + +### Relevant Articles: +- [The Java 8 Stream API Tutorial](https://www.baeldung.com/java-8-streams) +- [Introduction to Java 8 Streams](https://www.baeldung.com/java-8-streams-introduction) +- [Java 8 Stream findFirst() vs. findAny()](https://www.baeldung.com/java-stream-findfirst-vs-findany) +- [Guide to Stream.reduce()](https://www.baeldung.com/java-stream-reduce) +- [Java IntStream Conversions](https://www.baeldung.com/java-intstream-convert) +- [Java 8 Streams peek() API](https://www.baeldung.com/java-streams-peek-api) +- [Working With Maps Using Streams](https://www.baeldung.com/java-maps-streams) +- [Collect a Java Stream to an Immutable Collection](https://www.baeldung.com/java-stream-immutable-collection) +- [How to Add a Single Element to a Stream](https://www.baeldung.com/java-stream-append-prepend) +- [Operating on and Removing an Item from Stream](https://www.baeldung.com/java-use-remove-item-stream) +- More articles: [[<-- prev>]](/../core-java-streams) [[next -->]](/../core-java-streams-3) diff --git a/core-java-modules/core-java-streams-2/pom.xml b/core-java-modules/core-java-streams-2/pom.xml new file mode 100644 index 0000000000..20c028edaa --- /dev/null +++ b/core-java-modules/core-java-streams-2/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + core-java-streams-2 + 1.0 + core-java-streams-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + log4j + log4j + ${log4j.version} + + + junit + junit + ${junit.version} + test + jar + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + UTF-8 + 1.9 + 1.9 + 3.11.1 + + \ No newline at end of file diff --git a/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/application/Application.java b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/application/Application.java new file mode 100644 index 0000000000..62d080c32c --- /dev/null +++ b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/application/Application.java @@ -0,0 +1,39 @@ +package com.baeldung.reduce.application; + +import com.baeldung.reduce.entities.User; +import com.baeldung.reduce.utilities.NumberUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class Application { + + public static void main(String[] args) { + List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); + int result1 = numbers.stream().reduce(0, (subtotal, element) -> subtotal + element); + System.out.println(result1); + + int result2 = numbers.stream().reduce(0, Integer::sum); + System.out.println(result2); + + List letters = Arrays.asList("a", "b", "c", "d", "e"); + String result3 = letters.stream().reduce("", (partialString, element) -> partialString + element); + System.out.println(result3); + + String result4 = letters.stream().reduce("", String::concat); + System.out.println(result4); + + String result5 = letters.stream().reduce("", (partialString, element) -> partialString.toUpperCase() + element.toUpperCase()); + System.out.println(result5); + + List users = Arrays.asList(new User("John", 30), new User("Julie", 35)); + int result6 = users.stream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); + System.out.println(result6); + + String result7 = letters.parallelStream().reduce("", String::concat); + System.out.println(result7); + + int result8 = users.parallelStream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); + System.out.println(result8); + } +} diff --git a/java-streams-2/src/main/java/com/baeldung/reduce/benchmarks/JMHStreamReduceBenchMark.java b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/benchmarks/JMHStreamReduceBenchMark.java similarity index 97% rename from java-streams-2/src/main/java/com/baeldung/reduce/benchmarks/JMHStreamReduceBenchMark.java rename to core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/benchmarks/JMHStreamReduceBenchMark.java index af4a9276a9..ecb0347e96 100644 --- a/java-streams-2/src/main/java/com/baeldung/reduce/benchmarks/JMHStreamReduceBenchMark.java +++ b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/benchmarks/JMHStreamReduceBenchMark.java @@ -1,52 +1,52 @@ -package com.baeldung.reduce.benchmarks; - -import com.baeldung.reduce.entities.User; -import java.util.ArrayList; -import java.util.List; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.State; -import org.openjdk.jmh.runner.Runner; -import org.openjdk.jmh.runner.RunnerException; -import org.openjdk.jmh.runner.options.Options; -import org.openjdk.jmh.runner.options.OptionsBuilder; - -@State(Scope.Thread) -@BenchmarkMode(Mode.AverageTime) -public class JMHStreamReduceBenchMark { - - private final List userList = createUsers(); - - public static void main(String[] args) throws RunnerException { - - Options options = new OptionsBuilder() - .include(JMHStreamReduceBenchMark.class.getSimpleName()).threads(1) - .forks(1).shouldFailOnError(true).shouldDoGC(true) - .jvmArgs("-server").build(); - new Runner(options).run(); - } - - private List createUsers() { - List users = new ArrayList<>(); - for (int i = 0; i <= 1000000; i++) { - users.add(new User("John" + i, i)); - } - return users; - } - - @Benchmark - public Integer executeReduceOnParallelizedStream() { - return this.userList - .parallelStream() - .reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - } - - @Benchmark - public Integer executeReduceOnSequentialStream() { - return this.userList - .stream() - .reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - } -} +package com.baeldung.reduce.benchmarks; + +import com.baeldung.reduce.entities.User; +import java.util.ArrayList; +import java.util.List; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.RunnerException; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +@State(Scope.Thread) +@BenchmarkMode(Mode.AverageTime) +public class JMHStreamReduceBenchMark { + + private final List userList = createUsers(); + + public static void main(String[] args) throws RunnerException { + + Options options = new OptionsBuilder() + .include(JMHStreamReduceBenchMark.class.getSimpleName()).threads(1) + .forks(1).shouldFailOnError(true).shouldDoGC(true) + .jvmArgs("-server").build(); + new Runner(options).run(); + } + + private List createUsers() { + List users = new ArrayList<>(); + for (int i = 0; i <= 1000000; i++) { + users.add(new User("John" + i, i)); + } + return users; + } + + @Benchmark + public Integer executeReduceOnParallelizedStream() { + return this.userList + .parallelStream() + .reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); + } + + @Benchmark + public Integer executeReduceOnSequentialStream() { + return this.userList + .stream() + .reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); + } +} diff --git a/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/entities/User.java b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/entities/User.java new file mode 100644 index 0000000000..6e0a529de6 --- /dev/null +++ b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/entities/User.java @@ -0,0 +1,25 @@ +package com.baeldung.reduce.entities; + +public class User { + + private final String name; + private final int age; + + public User(String name, int age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public int getAge() { + return age; + } + + @Override + public String toString() { + return "User{" + "name=" + name + ", age=" + age + '}'; + } +} diff --git a/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/utilities/NumberUtils.java b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/utilities/NumberUtils.java new file mode 100644 index 0000000000..38d5b50120 --- /dev/null +++ b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/reduce/utilities/NumberUtils.java @@ -0,0 +1,52 @@ +package com.baeldung.reduce.utilities; + +import java.util.List; +import java.util.function.BiFunction; +import java.util.logging.Level; +import java.util.logging.Logger; + +public abstract class NumberUtils { + + private static final Logger LOGGER = Logger.getLogger(NumberUtils.class.getName()); + + public static int divideListElements(List values, Integer divider) { + return values.stream() + .reduce(0, (a, b) -> { + try { + return a / divider + b / divider; + } catch (ArithmeticException e) { + LOGGER.log(Level.INFO, "Arithmetic Exception: Division by Zero"); + } + return 0; + }); + } + + public static int divideListElementsWithExtractedTryCatchBlock(List values, int divider) { + return values.stream().reduce(0, (a, b) -> divide(a, divider) + divide(b, divider)); + } + + public static int divideListElementsWithApplyFunctionMethod(List values, int divider) { + BiFunction division = (a, b) -> a / b; + return values.stream().reduce(0, (a, b) -> applyFunction(division, a, divider) + applyFunction(division, b, divider)); + } + + private static int divide(int value, int factor) { + int result = 0; + try { + result = value / factor; + } catch (ArithmeticException e) { + LOGGER.log(Level.INFO, "Arithmetic Exception: Division by Zero"); + } + return result; + } + + private static int applyFunction(BiFunction function, int a, int b) { + try { + return function.apply(a, b); + } + catch(Exception e) { + LOGGER.log(Level.INFO, "Exception thrown!"); + } + return 0; + } +} diff --git a/java-streams/src/test/java/com/baeldung/stream/mycollectors/MyImmutableListCollector.java b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/streams/MyImmutableListCollector.java similarity index 93% rename from java-streams/src/test/java/com/baeldung/stream/mycollectors/MyImmutableListCollector.java rename to core-java-modules/core-java-streams-2/src/main/java/com/baeldung/streams/MyImmutableListCollector.java index cf6b3601c3..6d515bfb46 100644 --- a/java-streams/src/test/java/com/baeldung/stream/mycollectors/MyImmutableListCollector.java +++ b/core-java-modules/core-java-streams-2/src/main/java/com/baeldung/streams/MyImmutableListCollector.java @@ -1,4 +1,4 @@ -package com.baeldung.stream.mycollectors; +package com.baeldung.streams; import java.util.ArrayList; import java.util.Collections; diff --git a/jenkins/hello-world/src/main/resources/logback.xml b/core-java-modules/core-java-streams-2/src/main/resources/logback.xml similarity index 100% rename from jenkins/hello-world/src/main/resources/logback.xml rename to core-java-modules/core-java-streams-2/src/main/resources/logback.xml diff --git a/java-streams-2/src/test/java/com/baeldung/convert/intstreams/IntStreamsConversionsUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/convert/intstreams/IntStreamsConversionsUnitTest.java similarity index 100% rename from java-streams-2/src/test/java/com/baeldung/convert/intstreams/IntStreamsConversionsUnitTest.java rename to core-java-modules/core-java-streams-2/src/test/java/com/baeldung/convert/intstreams/IntStreamsConversionsUnitTest.java diff --git a/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/reduce/StreamReduceUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/reduce/StreamReduceUnitTest.java new file mode 100644 index 0000000000..21eedf953e --- /dev/null +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/reduce/StreamReduceUnitTest.java @@ -0,0 +1,80 @@ +package com.baeldung.reduce; + +import com.baeldung.reduce.entities.User; +import com.baeldung.reduce.utilities.NumberUtils; +import org.junit.Test; + +import java.util.Arrays; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +public class StreamReduceUnitTest { + + @Test + public void givenIntegerList_whenReduceWithSumAccumulatorLambda_thenCorrect() { + List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); + int result = numbers.stream().reduce(0, (subtotal, element) -> subtotal + element); + assertThat(result).isEqualTo(21); + } + + @Test + public void givenIntegerList_whenReduceWithSumAccumulatorMethodReference_thenCorrect() { + List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); + int result = numbers.stream().reduce(0, Integer::sum); + assertThat(result).isEqualTo(21); + } + + @Test + public void givenStringList_whenReduceWithConcatenatorAccumulatorLambda_thenCorrect() { + List letters = Arrays.asList("a", "b", "c", "d", "e"); + String result = letters.stream().reduce("", (partialString, element) -> partialString + element); + assertThat(result).isEqualTo("abcde"); + } + + @Test + public void givenStringList_whenReduceWithConcatenatorAccumulatorMethodReference_thenCorrect() { + List letters = Arrays.asList("a", "b", "c", "d", "e"); + String result = letters.stream().reduce("", String::concat); + assertThat(result).isEqualTo("abcde"); + } + + @Test + public void givenStringList_whenReduceWithUppercaseConcatenatorAccumulator_thenCorrect() { + List letters = Arrays.asList("a", "b", "c", "d", "e"); + String result = letters.stream().reduce("", (partialString, element) -> partialString.toUpperCase() + element.toUpperCase()); + assertThat(result).isEqualTo("ABCDE"); + } + + @Test + public void givenUserList_whenReduceWithAgeAccumulatorAndSumCombiner_thenCorrect() { + List users = Arrays.asList(new User("John", 30), new User("Julie", 35)); + int result = users.stream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); + assertThat(result).isEqualTo(65); + } + + @Test + public void givenStringList_whenReduceWithParallelStream_thenCorrect() { + List letters = Arrays.asList("a", "b", "c", "d", "e"); + String result = letters.parallelStream().reduce("", String::concat); + assertThat(result).isEqualTo("abcde"); + } + + @Test + public void givenNumberUtilsClass_whenCalledDivideListElements_thenCorrect() { + List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); + assertThat(NumberUtils.divideListElements(numbers, 1)).isEqualTo(21); + } + + @Test + public void givenNumberUtilsClass_whenCalledDivideListElementsWithExtractedTryCatchBlock_thenCorrect() { + List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); + assertThat(NumberUtils.divideListElementsWithExtractedTryCatchBlock(numbers, 1)).isEqualTo(21); + } + + @Test + public void givenStream_whneCalleddivideListElementsWithApplyFunctionMethod_thenCorrect() { + List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); + assertThat(NumberUtils.divideListElementsWithApplyFunctionMethod(numbers, 1)).isEqualTo(21); + } +} diff --git a/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Detail.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Detail.java new file mode 100644 index 0000000000..d2f5774b24 --- /dev/null +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Detail.java @@ -0,0 +1,13 @@ +package com.baeldung.streams; + +import java.util.Arrays; +import java.util.List; + +public class Detail { + + private static final List PARTS = Arrays.asList("turbine", "pump"); + + public List getParts() { + return PARTS; + } +} diff --git a/java-streams/src/test/java/com/baeldung/java8/streams/Java8FindAnyFindFirstUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Java8FindAnyFindFirstUnitTest.java similarity index 97% rename from java-streams/src/test/java/com/baeldung/java8/streams/Java8FindAnyFindFirstUnitTest.java rename to core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Java8FindAnyFindFirstUnitTest.java index 5f52fe375e..934d7b3542 100644 --- a/java-streams/src/test/java/com/baeldung/java8/streams/Java8FindAnyFindFirstUnitTest.java +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Java8FindAnyFindFirstUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java8.streams; +package com.baeldung.streams; import org.junit.Test; diff --git a/java-streams/src/test/java/com/baeldung/java8/streams/Java8StreamApiUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Java8StreamApiUnitTest.java similarity index 99% rename from java-streams/src/test/java/com/baeldung/java8/streams/Java8StreamApiUnitTest.java rename to core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Java8StreamApiUnitTest.java index 75cfbc049f..c4e1f2b3cb 100644 --- a/java-streams/src/test/java/com/baeldung/java8/streams/Java8StreamApiUnitTest.java +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Java8StreamApiUnitTest.java @@ -1,6 +1,5 @@ -package com.baeldung.java8.streams; +package com.baeldung.streams; -import com.baeldung.stream.Product; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; diff --git a/java-streams/src/test/java/com/baeldung/java8/Java8StreamsUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Java8StreamsUnitTest.java similarity index 97% rename from java-streams/src/test/java/com/baeldung/java8/Java8StreamsUnitTest.java rename to core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Java8StreamsUnitTest.java index e40f9f9506..f46fa79b08 100644 --- a/java-streams/src/test/java/com/baeldung/java8/Java8StreamsUnitTest.java +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Java8StreamsUnitTest.java @@ -1,6 +1,5 @@ -package com.baeldung.java8; +package com.baeldung.streams; -import com.baeldung.java_8_features.Detail; import org.junit.Before; import org.junit.Test; diff --git a/java-streams/src/test/java/com/baeldung/stream/PeekUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/PeekUnitTest.java similarity index 98% rename from java-streams/src/test/java/com/baeldung/stream/PeekUnitTest.java rename to core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/PeekUnitTest.java index a3a2816e9c..97af4149d3 100644 --- a/java-streams/src/test/java/com/baeldung/stream/PeekUnitTest.java +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/PeekUnitTest.java @@ -1,13 +1,13 @@ -package com.baeldung.stream; +package com.baeldung.streams; -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.StringWriter; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; public class PeekUnitTest { diff --git a/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Product.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Product.java new file mode 100644 index 0000000000..7883f055a1 --- /dev/null +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/Product.java @@ -0,0 +1,48 @@ +package com.baeldung.streams; + +import java.util.List; +import java.util.stream.Stream; + +/** + * Created by Alex Vengr + */ +public class Product { + + private int price; + + private String name; + + private boolean utilize; + + public Product(int price, String name) { + this(price); + this.name = name; + } + + public Product(int price) { + this.price = price; + } + + public Product() { + } + + public int getPrice() { + return price; + } + + public void setPrice(int price) { + this.price = price; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public static Stream streamOf(List list) { + return (list == null || list.isEmpty()) ? Stream.empty() : list.stream(); + } +} diff --git a/java-streams/src/test/java/com/baeldung/stream/StreamAddUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/StreamAddUnitTest.java similarity index 97% rename from java-streams/src/test/java/com/baeldung/stream/StreamAddUnitTest.java rename to core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/StreamAddUnitTest.java index d0745b8bc9..1fada26de5 100644 --- a/java-streams/src/test/java/com/baeldung/stream/StreamAddUnitTest.java +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/StreamAddUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stream; +package com.baeldung.streams; import org.junit.Test; diff --git a/java-streams/src/test/java/com/baeldung/stream/StreamMapUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/StreamMapUnitTest.java similarity index 96% rename from java-streams/src/test/java/com/baeldung/stream/StreamMapUnitTest.java rename to core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/StreamMapUnitTest.java index 5cb2a274d1..509a3a3569 100644 --- a/java-streams/src/test/java/com/baeldung/stream/StreamMapUnitTest.java +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/StreamMapUnitTest.java @@ -1,16 +1,13 @@ -package com.baeldung.stream; +package com.baeldung.streams; import org.junit.Before; import org.junit.Test; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.Stream; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/java-streams/src/test/java/com/baeldung/stream/StreamToImmutableUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/StreamToImmutableUnitTest.java similarity index 81% rename from java-streams/src/test/java/com/baeldung/stream/StreamToImmutableUnitTest.java rename to core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/StreamToImmutableUnitTest.java index bd540201d2..e5339d8327 100644 --- a/java-streams/src/test/java/com/baeldung/stream/StreamToImmutableUnitTest.java +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/StreamToImmutableUnitTest.java @@ -1,20 +1,12 @@ -package com.baeldung.stream; - -import static java.util.stream.Collectors.collectingAndThen; -import static java.util.stream.Collectors.toList; -import static java.util.stream.Collectors.toSet; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.stream.IntStream; +package com.baeldung.streams; +import com.google.common.collect.ImmutableList; import org.junit.Test; -import com.baeldung.stream.mycollectors.MyImmutableListCollector; -import com.google.common.collect.ImmutableList; +import java.util.*; +import java.util.stream.IntStream; + +import static java.util.stream.Collectors.*; public class StreamToImmutableUnitTest { diff --git a/java-streams/src/test/java/com/baeldung/stream/StreamOperateAndRemoveUnitTest.java b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/removeitem/StreamOperateAndRemoveUnitTest.java similarity index 97% rename from java-streams/src/test/java/com/baeldung/stream/StreamOperateAndRemoveUnitTest.java rename to core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/removeitem/StreamOperateAndRemoveUnitTest.java index c5aa9a1651..194d0bd4d6 100644 --- a/java-streams/src/test/java/com/baeldung/stream/StreamOperateAndRemoveUnitTest.java +++ b/core-java-modules/core-java-streams-2/src/test/java/com/baeldung/streams/removeitem/StreamOperateAndRemoveUnitTest.java @@ -1,9 +1,4 @@ -package com.baeldung.stream; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.Predicate; -import java.util.stream.Collectors; +package com.baeldung.streams.removeitem; import org.junit.Assert; import org.junit.Before; @@ -11,6 +6,11 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collectors; + public class StreamOperateAndRemoveUnitTest { private List itemList; diff --git a/core-java-modules/core-java-streams-3/README.md b/core-java-modules/core-java-streams-3/README.md new file mode 100644 index 0000000000..4b2c9ed94c --- /dev/null +++ b/core-java-modules/core-java-streams-3/README.md @@ -0,0 +1,11 @@ +## Core Java streams + +This module contains articles about the Stream API in Java. + +### Relevant Articles: +- [The Difference Between map() and flatMap()](https://www.baeldung.com/java-difference-map-and-flatmap) +- [How to Use if/else Logic in Java 8 Streams](https://www.baeldung.com/java-8-streams-if-else-logic) +- [The Difference Between Collection.stream().forEach() and Collection.forEach()](https://www.baeldung.com/java-collection-stream-foreach) +- [Guide to Java 8’s Collectors](https://www.baeldung.com/java-8-collectors) +- [Primitive Type Streams in Java 8](https://www.baeldung.com/java-8-primitive-streams) +- More articles: [[<-- prev>]](/../core-java-streams-2) \ No newline at end of file diff --git a/core-java-modules/core-java-streams-3/pom.xml b/core-java-modules/core-java-streams-3/pom.xml new file mode 100644 index 0000000000..b5b21a4368 --- /dev/null +++ b/core-java-modules/core-java-streams-3/pom.xml @@ -0,0 +1,53 @@ + + 4.0.0 + core-java-streams-3 + 0.1.0-SNAPSHOT + core-java-streams-3 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-streams-3 + + + src/main/resources + true + + + + + + + 3.6.1 + + 2.22.1 + + diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/debug/entity/Customer.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/debug/entity/Customer.java new file mode 100644 index 0000000000..b8e1b6db5b --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/debug/entity/Customer.java @@ -0,0 +1,19 @@ +package com.baeldung.streams.debug.entity; + +public class Customer { + private final String name; + private final int age; + + public Customer(String name, int age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public int getAge() { + return age; + } +} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/forEach/ReverseList.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/forEach/ReverseList.java similarity index 98% rename from core-java-modules/core-java-8-2/src/main/java/com/baeldung/forEach/ReverseList.java rename to core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/forEach/ReverseList.java index b2ce77a9f6..c4128d9b72 100644 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/forEach/ReverseList.java +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/forEach/ReverseList.java @@ -1,4 +1,4 @@ -package com.baeldung.forEach; +package com.baeldung.streams.forEach; import java.util.ArrayList; import java.util.Arrays; diff --git a/java-streams/src/main/java/com/baeldung/stream/PrimitiveStreams.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/primitivestreams/PrimitiveStreams.java similarity index 90% rename from java-streams/src/main/java/com/baeldung/stream/PrimitiveStreams.java rename to core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/primitivestreams/PrimitiveStreams.java index b0afb65a35..fb2001f10f 100644 --- a/java-streams/src/main/java/com/baeldung/stream/PrimitiveStreams.java +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/primitivestreams/PrimitiveStreams.java @@ -1,4 +1,4 @@ -package com.baeldung.stream; +package com.baeldung.streams.primitivestreams; import java.util.Arrays; import java.util.stream.IntStream; diff --git a/maven/src/main/resources/logback.xml b/core-java-modules/core-java-streams-3/src/main/resources/logback.xml similarity index 100% rename from maven/src/main/resources/logback.xml rename to core-java-modules/core-java-streams-3/src/main/resources/logback.xml diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/collectors/Java8CollectorsUnitTest.java similarity index 99% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java rename to core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/collectors/Java8CollectorsUnitTest.java index e742635758..6afc9f4182 100644 --- a/core-java-modules/core-java-8/src/test/java/com/baeldung/collectors/Java8CollectorsUnitTest.java +++ b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/collectors/Java8CollectorsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.collectors; +package com.baeldung.streams.collectors; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/conditional/StreamForEachIfElseUnitTest.java similarity index 96% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java rename to core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/conditional/StreamForEachIfElseUnitTest.java index b5d26eb6a8..a49a092864 100644 --- a/core-java-modules/core-java-8/src/test/java/com/baeldung/stream/conditional/StreamForEachIfElseUnitTest.java +++ b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/conditional/StreamForEachIfElseUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stream.conditional; +package com.baeldung.streams.conditional; import java.util.Arrays; import java.util.List; diff --git a/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/debug/Example1.java b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/debug/Example1.java new file mode 100644 index 0000000000..d8087bc98a --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/debug/Example1.java @@ -0,0 +1,18 @@ +package com.baeldung.streams.debug; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.stream.IntStream; + +import org.junit.Test; + +public class Example1 { + @Test + public void whenDebugging_thenInformationIsShown() { + int[] listOutputSorted = IntStream.of(-3, 10, -4, 1, 3) + .sorted() + .toArray(); + + assertThat(listOutputSorted).isSorted(); + } +} diff --git a/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/debug/Example2.java b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/debug/Example2.java new file mode 100644 index 0000000000..56cbddf0b4 --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/debug/Example2.java @@ -0,0 +1,36 @@ +package com.baeldung.streams.debug; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + +import org.junit.Test; + +import com.baeldung.streams.debug.entity.Customer; + +public class Example2 { + @Test + public void whenDebugging_thenInformationIsShown() { + List> customers = Arrays.asList( + Optional.of(new Customer("John P.", 15)), + Optional.of(new Customer("Sarah M.", 78)), + Optional.empty(), + Optional.of(new Customer("Mary T.", 20)), + Optional.empty(), + Optional.of(new Customer("Florian G.", 89)), + Optional.empty() + ); + + long numberOf65PlusCustomers = customers.stream() + .flatMap(c -> c.map(Stream::of) + .orElseGet(Stream::empty)) + .mapToInt(Customer::getAge) + .filter(c -> c > 65) + .count(); + + assertThat(numberOf65PlusCustomers).isEqualTo(2); + } +} diff --git a/java-streams/src/test/java/com/baeldung/stream/PrimitiveStreamsUnitTest.java b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/primitivestreams/PrimitiveStreamsUnitTest.java similarity index 98% rename from java-streams/src/test/java/com/baeldung/stream/PrimitiveStreamsUnitTest.java rename to core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/primitivestreams/PrimitiveStreamsUnitTest.java index 67954f0bba..18966425e4 100644 --- a/java-streams/src/test/java/com/baeldung/stream/PrimitiveStreamsUnitTest.java +++ b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/primitivestreams/PrimitiveStreamsUnitTest.java @@ -1,14 +1,14 @@ -package com.baeldung.stream; +package com.baeldung.streams.primitivestreams; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.junit.Test; import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; public class PrimitiveStreamsUnitTest { diff --git a/core-java-modules/core-java-concurrency-advanced/.gitignore b/core-java-modules/core-java-streams/.gitignore similarity index 100% rename from core-java-modules/core-java-concurrency-advanced/.gitignore rename to core-java-modules/core-java-streams/.gitignore diff --git a/core-java-modules/core-java-streams/README.md b/core-java-modules/core-java-streams/README.md new file mode 100644 index 0000000000..e556c231fe --- /dev/null +++ b/core-java-modules/core-java-streams/README.md @@ -0,0 +1,16 @@ +## Core Java streams + +This module contains articles about the Stream API in Java. + +### Relevant Articles: +- [Java 8 and Infinite Streams](https://www.baeldung.com/java-inifinite-streams) +- [How to Get the Last Element of a Stream in Java?](https://www.baeldung.com/java-stream-last-element) +- [“Stream has already been operated upon or closed” Exception in Java](https://www.baeldung.com/java-stream-operated-upon-or-closed-exception) +- [Iterable to Stream in Java](https://www.baeldung.com/java-iterable-to-stream) +- [How to Iterate Over a Stream With Indices](https://www.baeldung.com/java-stream-indices) +- [Stream Ordering in Java](https://www.baeldung.com/java-stream-ordering) +- [Introduction to Protonpack](https://www.baeldung.com/java-protonpack) +- [Java Stream Filter with Lambda Expression](https://www.baeldung.com/java-stream-filter-lambda) +- [Counting Matches on a Stream Filter](https://www.baeldung.com/java-stream-filter-count) +- [Summing Numbers with Java Streams](https://www.baeldung.com/java-stream-sum) +- More articles: [[next -->]](/../core-java-streams-2) \ No newline at end of file diff --git a/core-java-modules/core-java-streams/pom.xml b/core-java-modules/core-java-streams/pom.xml new file mode 100644 index 0000000000..9b68c8dded --- /dev/null +++ b/core-java-modules/core-java-streams/pom.xml @@ -0,0 +1,121 @@ + + 4.0.0 + core-java-streams + 0.1.0-SNAPSHOT + core-java-streams + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + provided + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + log4j + log4j + ${log4j.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj.version} + test + + + com.codepoetics + protonpack + ${protonpack.version} + + + io.vavr + vavr + ${vavr.version} + + + one.util + streamex + ${streamex.version} + + + org.aspectj + aspectjrt + ${asspectj.version} + + + org.aspectj + aspectjweaver + ${asspectj.version} + + + pl.touk + throwing-function + ${throwing-function.version} + + + + + core-java-streams + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + -parameters + + + + + + + + 0.9.0 + 1.15 + 0.6.5 + 2.10 + 1.3 + + 3.11.1 + 1.8.9 + 3.1 + 1.8 + 1.8 + + diff --git a/java-streams/src/main/java/com/baeldung/stream/InfiniteStreams.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/InfiniteStreams.java similarity index 100% rename from java-streams/src/main/java/com/baeldung/stream/InfiniteStreams.java rename to core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/InfiniteStreams.java diff --git a/java-streams/src/main/java/com/baeldung/stream/StreamApi.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/StreamApi.java similarity index 100% rename from java-streams/src/main/java/com/baeldung/stream/StreamApi.java rename to core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/StreamApi.java diff --git a/java-streams/src/main/java/com/baeldung/stream/StreamIndices.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/StreamIndices.java similarity index 100% rename from java-streams/src/main/java/com/baeldung/stream/StreamIndices.java rename to core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/StreamIndices.java diff --git a/java-streams/src/main/java/com/baeldung/stream/filter/Customer.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/filter/Customer.java similarity index 100% rename from java-streams/src/main/java/com/baeldung/stream/filter/Customer.java rename to core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/filter/Customer.java diff --git a/java-streams/src/main/java/com/baeldung/stream/sum/ArithmeticUtils.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/ArithmeticUtils.java similarity index 94% rename from java-streams/src/main/java/com/baeldung/stream/sum/ArithmeticUtils.java rename to core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/ArithmeticUtils.java index 3170b1fb31..c44aaf8005 100644 --- a/java-streams/src/main/java/com/baeldung/stream/sum/ArithmeticUtils.java +++ b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/ArithmeticUtils.java @@ -1,8 +1,8 @@ -package com.baeldung.stream.sum; - -public class ArithmeticUtils { - - public static int add(int a, int b) { - return a + b; - } -} +package com.baeldung.stream.sum; + +public class ArithmeticUtils { + + public static int add(int a, int b) { + return a + b; + } +} diff --git a/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/Item.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/Item.java new file mode 100644 index 0000000000..28a1737db8 --- /dev/null +++ b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/Item.java @@ -0,0 +1,31 @@ +package com.baeldung.stream.sum; + +public class Item { + + private int id; + private Integer price; + + public Item(int id, Integer price) { + super(); + this.id = id; + this.price = price; + } + + // Standard getters and setters + public long getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Integer getPrice() { + return price; + } + + public void setPrice(Integer price) { + this.price = price; + } + +} diff --git a/java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculator.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculator.java similarity index 96% rename from java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculator.java rename to core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculator.java index 2f63cf8629..ea6459d360 100644 --- a/java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculator.java +++ b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculator.java @@ -1,59 +1,59 @@ -package com.baeldung.stream.sum; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -public class StreamSumCalculator { - - public static Integer getSumUsingCustomizedAccumulator(List integers) { - return integers.stream() - .reduce(0, ArithmeticUtils::add); - - } - - public static Integer getSumUsingJavaAccumulator(List integers) { - return integers.stream() - .reduce(0, Integer::sum); - - } - - public static Integer getSumUsingReduce(List integers) { - return integers.stream() - .reduce(0, (a, b) -> a + b); - - } - - public static Integer getSumUsingCollect(List integers) { - - return integers.stream() - .collect(Collectors.summingInt(Integer::intValue)); - - } - - public static Integer getSumUsingSum(List integers) { - - return integers.stream() - .mapToInt(Integer::intValue) - .sum(); - } - - public static Integer getSumOfMapValues(Map map) { - - return map.values() - .stream() - .mapToInt(Integer::valueOf) - .sum(); - } - - public static Integer getSumIntegersFromString(String str) { - - Integer sum = Arrays.stream(str.split(" ")) - .filter((s) -> s.matches("\\d+")) - .mapToInt(Integer::valueOf) - .sum(); - - return sum; - } -} +package com.baeldung.stream.sum; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class StreamSumCalculator { + + public static Integer getSumUsingCustomizedAccumulator(List integers) { + return integers.stream() + .reduce(0, ArithmeticUtils::add); + + } + + public static Integer getSumUsingJavaAccumulator(List integers) { + return integers.stream() + .reduce(0, Integer::sum); + + } + + public static Integer getSumUsingReduce(List integers) { + return integers.stream() + .reduce(0, (a, b) -> a + b); + + } + + public static Integer getSumUsingCollect(List integers) { + + return integers.stream() + .collect(Collectors.summingInt(Integer::intValue)); + + } + + public static Integer getSumUsingSum(List integers) { + + return integers.stream() + .mapToInt(Integer::intValue) + .sum(); + } + + public static Integer getSumOfMapValues(Map map) { + + return map.values() + .stream() + .mapToInt(Integer::valueOf) + .sum(); + } + + public static Integer getSumIntegersFromString(String str) { + + Integer sum = Arrays.stream(str.split(" ")) + .filter((s) -> s.matches("\\d+")) + .mapToInt(Integer::valueOf) + .sum(); + + return sum; + } +} diff --git a/java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculatorWithObject.java b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculatorWithObject.java similarity index 96% rename from java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculatorWithObject.java rename to core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculatorWithObject.java index b83616928e..8a162429d2 100644 --- a/java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculatorWithObject.java +++ b/core-java-modules/core-java-streams/src/main/java/com/baeldung/stream/sum/StreamSumCalculatorWithObject.java @@ -1,38 +1,38 @@ -package com.baeldung.stream.sum; - -import java.util.List; -import java.util.stream.Collectors; - -public class StreamSumCalculatorWithObject { - - public static Integer getSumUsingCustomizedAccumulator(List items) { - return items.stream() - .map(x -> x.getPrice()) - .reduce(0, ArithmeticUtils::add); - } - - public static Integer getSumUsingJavaAccumulator(List items) { - return items.stream() - .map(x -> x.getPrice()) - .reduce(0, Integer::sum); - } - - public static Integer getSumUsingReduce(List items) { - return items.stream() - .map(item -> item.getPrice()) - .reduce(0, (a, b) -> a + b); - } - - public static Integer getSumUsingCollect(List items) { - return items.stream() - .map(x -> x.getPrice()) - .collect(Collectors.summingInt(Integer::intValue)); - } - - public static Integer getSumUsingSum(List items) { - return items.stream() - .mapToInt(x -> x.getPrice()) - .sum(); - } - -} +package com.baeldung.stream.sum; + +import java.util.List; +import java.util.stream.Collectors; + +public class StreamSumCalculatorWithObject { + + public static Integer getSumUsingCustomizedAccumulator(List items) { + return items.stream() + .map(x -> x.getPrice()) + .reduce(0, ArithmeticUtils::add); + } + + public static Integer getSumUsingJavaAccumulator(List items) { + return items.stream() + .map(x -> x.getPrice()) + .reduce(0, Integer::sum); + } + + public static Integer getSumUsingReduce(List items) { + return items.stream() + .map(item -> item.getPrice()) + .reduce(0, (a, b) -> a + b); + } + + public static Integer getSumUsingCollect(List items) { + return items.stream() + .map(x -> x.getPrice()) + .collect(Collectors.summingInt(Integer::intValue)); + } + + public static Integer getSumUsingSum(List items) { + return items.stream() + .mapToInt(x -> x.getPrice()) + .sum(); + } + +} diff --git a/ml/src/main/resources/logback.xml b/core-java-modules/core-java-streams/src/main/resources/logback.xml similarity index 100% rename from ml/src/main/resources/logback.xml rename to core-java-modules/core-java-streams/src/main/resources/logback.xml diff --git a/java-streams/src/test/java/com/baeldung/java/conversion/IterableStreamConversionUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/conversion/IterableStreamConversionUnitTest.java similarity index 96% rename from java-streams/src/test/java/com/baeldung/java/conversion/IterableStreamConversionUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/conversion/IterableStreamConversionUnitTest.java index 99e8088054..f65f91a768 100644 --- a/java-streams/src/test/java/com/baeldung/java/conversion/IterableStreamConversionUnitTest.java +++ b/core-java-modules/core-java-streams/src/test/java/com/baeldung/conversion/IterableStreamConversionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.conversion; +package com.baeldung.conversion; import org.junit.Assert; import org.junit.Test; diff --git a/java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java similarity index 100% rename from java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/protonpack/ProtonpackUnitTest.java diff --git a/java-streams/src/test/java/com/baeldung/stream/InfiniteStreamUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/InfiniteStreamUnitTest.java similarity index 100% rename from java-streams/src/test/java/com/baeldung/stream/InfiniteStreamUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/InfiniteStreamUnitTest.java diff --git a/java-streams/src/test/java/com/baeldung/stream/StreamApiUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/StreamApiUnitTest.java similarity index 100% rename from java-streams/src/test/java/com/baeldung/stream/StreamApiUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/StreamApiUnitTest.java diff --git a/java-streams/src/test/java/com/baeldung/stream/StreamIndicesUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/StreamIndicesUnitTest.java similarity index 100% rename from java-streams/src/test/java/com/baeldung/stream/StreamIndicesUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/StreamIndicesUnitTest.java diff --git a/java-streams/src/test/java/com/baeldung/stream/SupplierStreamUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/SupplierStreamUnitTest.java similarity index 97% rename from java-streams/src/test/java/com/baeldung/stream/SupplierStreamUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/SupplierStreamUnitTest.java index a496e18b2d..69edc4f535 100644 --- a/java-streams/src/test/java/com/baeldung/stream/SupplierStreamUnitTest.java +++ b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/SupplierStreamUnitTest.java @@ -1,35 +1,35 @@ -package com.baeldung.stream; - -import static org.junit.Assert.fail; - -import java.util.Optional; -import java.util.function.Supplier; -import java.util.stream.Stream; - -import org.junit.Test; - -public class SupplierStreamUnitTest { - - @Test(expected = IllegalStateException.class) - public void givenStream_whenStreamUsedTwice_thenThrowException() { - Stream stringStream = Stream.of("A", "B", "C", "D"); - Optional result1 = stringStream.findAny(); - System.out.println(result1.get()); - Optional result2 = stringStream.findFirst(); - System.out.println(result2.get()); - } - - @Test - public void givenStream_whenUsingSupplier_thenNoExceptionIsThrown() { - try { - Supplier> streamSupplier = () -> Stream.of("A", "B", "C", "D"); - Optional result1 = streamSupplier.get().findAny(); - System.out.println(result1.get()); - Optional result2 = streamSupplier.get().findFirst(); - System.out.println(result2.get()); - } catch (IllegalStateException e) { - fail(); - } - } - +package com.baeldung.stream; + +import static org.junit.Assert.fail; + +import java.util.Optional; +import java.util.function.Supplier; +import java.util.stream.Stream; + +import org.junit.Test; + +public class SupplierStreamUnitTest { + + @Test(expected = IllegalStateException.class) + public void givenStream_whenStreamUsedTwice_thenThrowException() { + Stream stringStream = Stream.of("A", "B", "C", "D"); + Optional result1 = stringStream.findAny(); + System.out.println(result1.get()); + Optional result2 = stringStream.findFirst(); + System.out.println(result2.get()); + } + + @Test + public void givenStream_whenUsingSupplier_thenNoExceptionIsThrown() { + try { + Supplier> streamSupplier = () -> Stream.of("A", "B", "C", "D"); + Optional result1 = streamSupplier.get().findAny(); + System.out.println(result1.get()); + Optional result2 = streamSupplier.get().findFirst(); + System.out.println(result2.get()); + } catch (IllegalStateException e) { + fail(); + } + } + } \ No newline at end of file diff --git a/java-streams/src/test/java/com/baeldung/stream/filter/StreamCountUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/filter/StreamCountUnitTest.java similarity index 100% rename from java-streams/src/test/java/com/baeldung/stream/filter/StreamCountUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/filter/StreamCountUnitTest.java diff --git a/java-streams/src/test/java/com/baeldung/stream/filter/StreamFilterUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/filter/StreamFilterUnitTest.java similarity index 100% rename from java-streams/src/test/java/com/baeldung/stream/filter/StreamFilterUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/filter/StreamFilterUnitTest.java diff --git a/java-streams/src/test/java/com/baeldung/stream/sum/StreamSumUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/sum/StreamSumUnitTest.java similarity index 97% rename from java-streams/src/test/java/com/baeldung/stream/sum/StreamSumUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/sum/StreamSumUnitTest.java index 46e1af9a4a..f03703154a 100644 --- a/java-streams/src/test/java/com/baeldung/stream/sum/StreamSumUnitTest.java +++ b/core-java-modules/core-java-streams/src/test/java/com/baeldung/stream/sum/StreamSumUnitTest.java @@ -1,136 +1,136 @@ -package com.baeldung.stream.sum; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.junit.jupiter.api.Test; - -public class StreamSumUnitTest { - - @Test - public void givenListOfIntegersWhenSummingUsingCustomizedAccumulatorThenCorrectValueReturned() { - List integers = Arrays.asList(1, 2, 3, 4, 5); - Integer sum = StreamSumCalculator.getSumUsingCustomizedAccumulator(integers); - assertEquals(15, sum.intValue()); - - } - - @Test - public void givenListOfIntegersWhenSummingUsingJavaAccumulatorThenCorrectValueReturned() { - List integers = Arrays.asList(1, 2, 3, 4, 5); - Integer sum = StreamSumCalculator.getSumUsingJavaAccumulator(integers); - assertEquals(15, sum.intValue()); - } - - @Test - public void givenListOfIntegersWhenSummingUsingReduceThenCorrectValueReturned() { - List integers = Arrays.asList(1, 2, 3, 4, 5); - Integer sum = StreamSumCalculator.getSumUsingReduce(integers); - assertEquals(15, sum.intValue()); - } - - @Test - public void givenListOfIntegersWhenSummingUsingCollectThenCorrectValueReturned() { - List integers = Arrays.asList(1, 2, 3, 4, 5); - Integer sum = StreamSumCalculator.getSumUsingCollect(integers); - assertEquals(15, sum.intValue()); - } - - @Test - public void givenListOfIntegersWhenSummingUsingSumThenCorrectValueReturned() { - List integers = Arrays.asList(1, 2, 3, 4, 5); - Integer sum = StreamSumCalculator.getSumUsingSum(integers); - assertEquals(15, sum.intValue()); - } - - @Test - public void givenListOfItemsWhenSummingUsingCustomizedAccumulatorThenCorrectValueReturned() { - Item item1 = new Item(1, 10); - Item item2 = new Item(2, 15); - Item item3 = new Item(3, 25); - Item item4 = new Item(4, 40); - - List items = Arrays.asList(item1, item2, item3, item4); - - Integer sum = StreamSumCalculatorWithObject.getSumUsingCustomizedAccumulator(items); - assertEquals(90, sum.intValue()); - - } - - @Test - public void givenListOfItemsWhenSummingUsingJavaAccumulatorThenCorrectValueReturned() { - Item item1 = new Item(1, 10); - Item item2 = new Item(2, 15); - Item item3 = new Item(3, 25); - Item item4 = new Item(4, 40); - - List items = Arrays.asList(item1, item2, item3, item4); - - Integer sum = StreamSumCalculatorWithObject.getSumUsingJavaAccumulator(items); - assertEquals(90, sum.intValue()); - } - - @Test - public void givenListOfItemsWhenSummingUsingReduceThenCorrectValueReturned() { - Item item1 = new Item(1, 10); - Item item2 = new Item(2, 15); - Item item3 = new Item(3, 25); - Item item4 = new Item(4, 40); - - List items = Arrays.asList(item1, item2, item3, item4); - - Integer sum = StreamSumCalculatorWithObject.getSumUsingReduce(items); - assertEquals(90, sum.intValue()); - } - - @Test - public void givenListOfItemsWhenSummingUsingCollectThenCorrectValueReturned() { - Item item1 = new Item(1, 10); - Item item2 = new Item(2, 15); - Item item3 = new Item(3, 25); - Item item4 = new Item(4, 40); - - List items = Arrays.asList(item1, item2, item3, item4); - - Integer sum = StreamSumCalculatorWithObject.getSumUsingCollect(items); - assertEquals(90, sum.intValue()); - } - - @Test - public void givenListOfItemsWhenSummingUsingSumThenCorrectValueReturned() { - Item item1 = new Item(1, 10); - Item item2 = new Item(2, 15); - Item item3 = new Item(3, 25); - Item item4 = new Item(4, 40); - - List items = Arrays.asList(item1, item2, item3, item4); - - Integer sum = StreamSumCalculatorWithObject.getSumUsingSum(items); - assertEquals(90, sum.intValue()); - } - - @Test - public void givenMapWhenSummingThenCorrectValueReturned() { - Map map = new HashMap(); - map.put(1, 10); - map.put(2, 15); - map.put(3, 25); - map.put(4, 40); - - Integer sum = StreamSumCalculator.getSumOfMapValues(map); - assertEquals(90, sum.intValue()); - } - - @Test - public void givenStringWhenSummingThenCorrectValueReturned() { - String string = "Item1 10 Item2 25 Item3 30 Item4 45"; - - Integer sum = StreamSumCalculator.getSumIntegersFromString(string); - assertEquals(110, sum.intValue()); - } - -} +package com.baeldung.stream.sum; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +public class StreamSumUnitTest { + + @Test + public void givenListOfIntegersWhenSummingUsingCustomizedAccumulatorThenCorrectValueReturned() { + List integers = Arrays.asList(1, 2, 3, 4, 5); + Integer sum = StreamSumCalculator.getSumUsingCustomizedAccumulator(integers); + assertEquals(15, sum.intValue()); + + } + + @Test + public void givenListOfIntegersWhenSummingUsingJavaAccumulatorThenCorrectValueReturned() { + List integers = Arrays.asList(1, 2, 3, 4, 5); + Integer sum = StreamSumCalculator.getSumUsingJavaAccumulator(integers); + assertEquals(15, sum.intValue()); + } + + @Test + public void givenListOfIntegersWhenSummingUsingReduceThenCorrectValueReturned() { + List integers = Arrays.asList(1, 2, 3, 4, 5); + Integer sum = StreamSumCalculator.getSumUsingReduce(integers); + assertEquals(15, sum.intValue()); + } + + @Test + public void givenListOfIntegersWhenSummingUsingCollectThenCorrectValueReturned() { + List integers = Arrays.asList(1, 2, 3, 4, 5); + Integer sum = StreamSumCalculator.getSumUsingCollect(integers); + assertEquals(15, sum.intValue()); + } + + @Test + public void givenListOfIntegersWhenSummingUsingSumThenCorrectValueReturned() { + List integers = Arrays.asList(1, 2, 3, 4, 5); + Integer sum = StreamSumCalculator.getSumUsingSum(integers); + assertEquals(15, sum.intValue()); + } + + @Test + public void givenListOfItemsWhenSummingUsingCustomizedAccumulatorThenCorrectValueReturned() { + Item item1 = new Item(1, 10); + Item item2 = new Item(2, 15); + Item item3 = new Item(3, 25); + Item item4 = new Item(4, 40); + + List items = Arrays.asList(item1, item2, item3, item4); + + Integer sum = StreamSumCalculatorWithObject.getSumUsingCustomizedAccumulator(items); + assertEquals(90, sum.intValue()); + + } + + @Test + public void givenListOfItemsWhenSummingUsingJavaAccumulatorThenCorrectValueReturned() { + Item item1 = new Item(1, 10); + Item item2 = new Item(2, 15); + Item item3 = new Item(3, 25); + Item item4 = new Item(4, 40); + + List items = Arrays.asList(item1, item2, item3, item4); + + Integer sum = StreamSumCalculatorWithObject.getSumUsingJavaAccumulator(items); + assertEquals(90, sum.intValue()); + } + + @Test + public void givenListOfItemsWhenSummingUsingReduceThenCorrectValueReturned() { + Item item1 = new Item(1, 10); + Item item2 = new Item(2, 15); + Item item3 = new Item(3, 25); + Item item4 = new Item(4, 40); + + List items = Arrays.asList(item1, item2, item3, item4); + + Integer sum = StreamSumCalculatorWithObject.getSumUsingReduce(items); + assertEquals(90, sum.intValue()); + } + + @Test + public void givenListOfItemsWhenSummingUsingCollectThenCorrectValueReturned() { + Item item1 = new Item(1, 10); + Item item2 = new Item(2, 15); + Item item3 = new Item(3, 25); + Item item4 = new Item(4, 40); + + List items = Arrays.asList(item1, item2, item3, item4); + + Integer sum = StreamSumCalculatorWithObject.getSumUsingCollect(items); + assertEquals(90, sum.intValue()); + } + + @Test + public void givenListOfItemsWhenSummingUsingSumThenCorrectValueReturned() { + Item item1 = new Item(1, 10); + Item item2 = new Item(2, 15); + Item item3 = new Item(3, 25); + Item item4 = new Item(4, 40); + + List items = Arrays.asList(item1, item2, item3, item4); + + Integer sum = StreamSumCalculatorWithObject.getSumUsingSum(items); + assertEquals(90, sum.intValue()); + } + + @Test + public void givenMapWhenSummingThenCorrectValueReturned() { + Map map = new HashMap(); + map.put(1, 10); + map.put(2, 15); + map.put(3, 25); + map.put(4, 40); + + Integer sum = StreamSumCalculator.getSumOfMapValues(map); + assertEquals(90, sum.intValue()); + } + + @Test + public void givenStringWhenSummingThenCorrectValueReturned() { + String string = "Item1 10 Item2 25 Item3 30 Item4 45"; + + Integer sum = StreamSumCalculator.getSumIntegersFromString(string); + assertEquals(110, sum.intValue()); + } + +} diff --git a/java-streams/src/test/java/com/baeldung/streamordering/BenchmarkManualTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/streamordering/BenchmarkManualTest.java similarity index 100% rename from java-streams/src/test/java/com/baeldung/streamordering/BenchmarkManualTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/streamordering/BenchmarkManualTest.java diff --git a/java-streams/src/test/java/com/baeldung/streamordering/StreamsOrderingUnitTest.java b/core-java-modules/core-java-streams/src/test/java/com/baeldung/streamordering/StreamsOrderingUnitTest.java similarity index 100% rename from java-streams/src/test/java/com/baeldung/streamordering/StreamsOrderingUnitTest.java rename to core-java-modules/core-java-streams/src/test/java/com/baeldung/streamordering/StreamsOrderingUnitTest.java diff --git a/core-java-modules/core-java-9/.gitignore b/core-java-modules/core-java-streams/src/test/resources/.gitignore similarity index 100% rename from core-java-modules/core-java-9/.gitignore rename to core-java-modules/core-java-streams/src/test/resources/.gitignore diff --git a/core-java-modules/core-java-string-algorithms-2/README.md b/core-java-modules/core-java-string-algorithms-2/README.md new file mode 100644 index 0000000000..94ace77d66 --- /dev/null +++ b/core-java-modules/core-java-string-algorithms-2/README.md @@ -0,0 +1,16 @@ +## Java String Algorithms + +This module contains articles about string-related algorithms. + +### Relevant Articles: +- [How to Remove the Last Character of a String?](https://www.baeldung.com/java-remove-last-character-of-string) +- [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string) +- [Java Check a String for Lowercase/Uppercase Letter, Special Character and Digit](https://www.baeldung.com/java-lowercase-uppercase-special-character-digit-regex) +- [Remove or Replace Part of a String in Java](https://www.baeldung.com/java-remove-replace-string-part) +- [Replace a Character at a Specific Index in a String in Java](https://www.baeldung.com/java-replace-character-at-index) +- [Join Array of Primitives with Separator in Java](https://www.baeldung.com/java-join-primitive-array) +- [Pad a String with Zeros or Spaces in Java](https://www.baeldung.com/java-pad-string) +- [Remove Leading and Trailing Characters from a String](https://www.baeldung.com/java-remove-trailing-characters) +- [Counting Words in a String](https://www.baeldung.com/java-word-counting) +- [Finding the Difference Between Two Strings in Java](https://www.baeldung.com/java-difference-between-two-strings) +- More articles: [[<-- prev]](../core-java-string-algorithms) diff --git a/core-java-modules/core-java-string-algorithms-2/pom.xml b/core-java-modules/core-java-string-algorithms-2/pom.xml new file mode 100644 index 0000000000..5b0e710bb8 --- /dev/null +++ b/core-java-modules/core-java-string-algorithms-2/pom.xml @@ -0,0 +1,67 @@ + + 4.0.0 + core-java-string-algorithms-2 + 0.1.0-SNAPSHOT + jar + core-java-string-algorithms-2 + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + com.google.guava + guava + ${guava.version} + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-core.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.bitbucket.cowwoc + diff-match-patch + ${diff-match-path.version} + test + + + + + core-java-string-algorithms-2 + + + src/main/resources + true + + + + + + 3.8.1 + 3.6.1 + 1.2 + + + diff --git a/java-strings-ops/src/main/java/com/baeldung/string/AppendCharAtPositionX.java b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/addchar/AppendCharAtPositionX.java similarity index 89% rename from java-strings-ops/src/main/java/com/baeldung/string/AppendCharAtPositionX.java rename to core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/addchar/AppendCharAtPositionX.java index bebffe52f1..92bb9a9832 100644 --- a/java-strings-ops/src/main/java/com/baeldung/string/AppendCharAtPositionX.java +++ b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/addchar/AppendCharAtPositionX.java @@ -1,14 +1,14 @@ /** * */ -package com.baeldung.string; +package com.baeldung.addchar; /** * @author swpraman * */ public class AppendCharAtPositionX { - + public String addCharUsingCharArray(String str, char ch, int position) { validate(str, position); int len = str.length(); @@ -30,15 +30,14 @@ public class AppendCharAtPositionX { sb.insert(position, ch); return sb.toString(); } - + private void validate(String str, int position) { if (str == null) { throw new IllegalArgumentException("Str should not be null"); } int len = str.length(); if (position < 0 || position > len) { - throw new IllegalArgumentException("position[" + position + "] should be " - + "in the range 0.." + len + " for string " + str); + throw new IllegalArgumentException("position[" + position + "] should be " + "in the range 0.." + len + " for string " + str); } } diff --git a/java-strings-2/src/main/java/com/baeldung/string/padding/StringPaddingUtil.java b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/padding/StringPaddingUtil.java similarity index 96% rename from java-strings-2/src/main/java/com/baeldung/string/padding/StringPaddingUtil.java rename to core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/padding/StringPaddingUtil.java index 80d05bb42a..1de82620c0 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/padding/StringPaddingUtil.java +++ b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/padding/StringPaddingUtil.java @@ -1,4 +1,4 @@ -package com.baeldung.string.padding; +package com.baeldung.padding; public class StringPaddingUtil { diff --git a/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/removelastchar/StringHelper.java b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/removelastchar/StringHelper.java new file mode 100644 index 0000000000..ebcc283851 --- /dev/null +++ b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/removelastchar/StringHelper.java @@ -0,0 +1,26 @@ +package com.baeldung.removelastchar; + +import java.util.Optional; + +class StringHelper { + static String removeLastChar(String s) { + return (s == null || s.length() == 0) ? s : (s.substring(0, s.length() - 1)); + } + + static String removeLastCharRegex(String s) { + return (s == null) ? s : s.replaceAll(".$", ""); + } + + static String removeLastCharOptional(String s) { + return Optional.ofNullable(s) + .filter(str -> str.length() != 0) + .map(str -> str.substring(0, str.length() - 1)) + .orElse(s); + } + + static String removeLastCharRegexOptional(String s) { + return Optional.ofNullable(s) + .map(str -> str.replaceAll(".$", "")) + .orElse(s); + } +} diff --git a/java-strings-2/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java similarity index 97% rename from java-strings-2/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java rename to core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java index c9d748e897..386d34e0ac 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java +++ b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java @@ -1,9 +1,8 @@ -package com.baeldung.string.removeleadingtrailingchar; +package com.baeldung.removeleadingtrailingchar; -import org.apache.commons.lang3.StringUtils; - import com.google.common.base.CharMatcher; +import org.apache.commons.lang3.StringUtils; public class RemoveLeadingAndTrailingZeroes { diff --git a/java-strings/src/main/java/com/baeldung/string/ReplaceCharacterInString.java b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/replacechar/ReplaceCharacterInString.java similarity index 96% rename from java-strings/src/main/java/com/baeldung/string/ReplaceCharacterInString.java rename to core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/replacechar/ReplaceCharacterInString.java index 2cc67f0b51..29fb28a85b 100644 --- a/java-strings/src/main/java/com/baeldung/string/ReplaceCharacterInString.java +++ b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/replacechar/ReplaceCharacterInString.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.replacechar; public class ReplaceCharacterInString { diff --git a/java-strings-3/src/main/java/com/baeldung/string/wordcount/WordCounter.java b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/wordcount/WordCounter.java similarity index 97% rename from java-strings-3/src/main/java/com/baeldung/string/wordcount/WordCounter.java rename to core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/wordcount/WordCounter.java index 30275773a6..9963c3486b 100644 --- a/java-strings-3/src/main/java/com/baeldung/string/wordcount/WordCounter.java +++ b/core-java-modules/core-java-string-algorithms-2/src/main/java/com/baeldung/wordcount/WordCounter.java @@ -1,4 +1,4 @@ -package com.baeldung.string.wordcount; +package com.baeldung.wordcount; import java.util.StringTokenizer; diff --git a/java-strings-ops/src/test/java/com/baeldung/string/AppendCharAtPositionXUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/addchar/AppendCharAtPositionXUnitTest.java similarity index 85% rename from java-strings-ops/src/test/java/com/baeldung/string/AppendCharAtPositionXUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/addchar/AppendCharAtPositionXUnitTest.java index 2cdf6145d3..e850cf1954 100644 --- a/java-strings-ops/src/test/java/com/baeldung/string/AppendCharAtPositionXUnitTest.java +++ b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/addchar/AppendCharAtPositionXUnitTest.java @@ -1,7 +1,7 @@ /** * */ -package com.baeldung.string; +package com.baeldung.addchar; import static org.junit.Assert.assertEquals; @@ -12,99 +12,99 @@ import org.junit.Test; * */ public class AppendCharAtPositionXUnitTest { - + private AppendCharAtPositionX appendCharAtPosition = new AppendCharAtPositionX(); private String word = "Titanc"; private char letter = 'i'; - + @Test public void whenUsingCharacterArrayAndCharacterAddedAtBeginning_shouldAddCharacter() { assertEquals("iTitanc", appendCharAtPosition.addCharUsingCharArray(word, letter, 0)); } - + @Test public void whenUsingSubstringAndCharacterAddedAtBeginning_shouldAddCharacter() { assertEquals("iTitanc", appendCharAtPosition.addCharUsingSubstring(word, letter, 0)); - } - + } + @Test public void whenUsingStringBuilderAndCharacterAddedAtBeginning_shouldAddCharacter() { assertEquals("iTitanc", appendCharAtPosition.addCharUsingStringBuilder(word, letter, 0)); } - + @Test public void whenUsingCharacterArrayAndCharacterAddedAtMiddle_shouldAddCharacter() { assertEquals("Titianc", appendCharAtPosition.addCharUsingCharArray(word, letter, 3)); } - + @Test public void whenUsingSubstringAndCharacterAddedAtMiddle_shouldAddCharacter() { assertEquals("Titianc", appendCharAtPosition.addCharUsingSubstring(word, letter, 3)); - } - + } + @Test public void whenUsingStringBuilderAndCharacterAddedAtMiddle_shouldAddCharacter() { assertEquals("Titianc", appendCharAtPosition.addCharUsingStringBuilder(word, letter, 3)); } - + @Test public void whenUsingCharacterArrayAndCharacterAddedAtEnd_shouldAddCharacter() { assertEquals("Titanci", appendCharAtPosition.addCharUsingCharArray(word, letter, word.length())); } - + @Test public void whenUsingSubstringAndCharacterAddedAtEnd_shouldAddCharacter() { assertEquals("Titanci", appendCharAtPosition.addCharUsingSubstring(word, letter, word.length())); - } - + } + @Test public void whenUsingStringBuilderAndCharacterAddedAtEnd_shouldAddCharacter() { assertEquals("Titanci", appendCharAtPosition.addCharUsingStringBuilder(word, letter, word.length())); } - - @Test(expected=IllegalArgumentException.class) + + @Test(expected = IllegalArgumentException.class) public void whenUsingCharacterArrayAndCharacterAddedAtNegativePosition_shouldThrowException() { appendCharAtPosition.addCharUsingStringBuilder(word, letter, -1); } - - @Test(expected=IllegalArgumentException.class) + + @Test(expected = IllegalArgumentException.class) public void whenUsingSubstringAndCharacterAddedAtNegativePosition_shouldThrowException() { appendCharAtPosition.addCharUsingStringBuilder(word, letter, -1); - } - - @Test(expected=IllegalArgumentException.class) + } + + @Test(expected = IllegalArgumentException.class) public void whenUsingStringBuilderAndCharacterAddedAtNegativePosition_shouldThrowException() { appendCharAtPosition.addCharUsingStringBuilder(word, letter, -1); } - - @Test(expected=IllegalArgumentException.class) + + @Test(expected = IllegalArgumentException.class) public void whenUsingCharacterArrayAndCharacterAddedAtInvalidPosition_shouldThrowException() { appendCharAtPosition.addCharUsingStringBuilder(word, letter, word.length() + 2); } - - @Test(expected=IllegalArgumentException.class) + + @Test(expected = IllegalArgumentException.class) public void whenUsingSubstringAndCharacterAddedAtInvalidPosition_shouldThrowException() { appendCharAtPosition.addCharUsingStringBuilder(word, letter, word.length() + 2); - } - - @Test(expected=IllegalArgumentException.class) + } + + @Test(expected = IllegalArgumentException.class) public void whenUsingStringBuilderAndCharacterAddedAtInvalidPosition_shouldThrowException() { appendCharAtPosition.addCharUsingStringBuilder(word, letter, word.length() + 2); } - - @Test(expected=IllegalArgumentException.class) + + @Test(expected = IllegalArgumentException.class) public void whenUsingCharacterArrayAndCharacterAddedAtPositionXAndStringIsNull_shouldThrowException() { appendCharAtPosition.addCharUsingStringBuilder(null, letter, 3); } - - @Test(expected=IllegalArgumentException.class) + + @Test(expected = IllegalArgumentException.class) public void whenUsingSubstringAndCharacterAddedAtPositionXAndStringIsNull_shouldThrowException() { appendCharAtPosition.addCharUsingStringBuilder(null, letter, 3); - } - - @Test(expected=IllegalArgumentException.class) + } + + @Test(expected = IllegalArgumentException.class) public void whenUsingStringBuilderAndCharacterAddedAtPositionXAndStringIsNull_shouldThrowException() { appendCharAtPosition.addCharUsingStringBuilder(null, letter, 3); } - + } diff --git a/java-strings/src/test/java/com/baeldung/string/StringContainingCharactersUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/containchar/StringContainingCharactersUnitTest.java similarity index 99% rename from java-strings/src/test/java/com/baeldung/string/StringContainingCharactersUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/containchar/StringContainingCharactersUnitTest.java index be79103e6b..3b0e545584 100644 --- a/java-strings/src/test/java/com/baeldung/string/StringContainingCharactersUnitTest.java +++ b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/containchar/StringContainingCharactersUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.containchar; import org.junit.Test; diff --git a/java-strings-2/src/test/java/com/baeldung/string/StringFromPrimitiveArrayUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/join/StringFromPrimitiveArrayUnitTest.java similarity index 99% rename from java-strings-2/src/test/java/com/baeldung/string/StringFromPrimitiveArrayUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/join/StringFromPrimitiveArrayUnitTest.java index c93089e543..f6c9141c3f 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/StringFromPrimitiveArrayUnitTest.java +++ b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/join/StringFromPrimitiveArrayUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.join; import com.google.common.base.Joiner; import com.google.common.primitives.Chars; diff --git a/java-strings-2/src/test/java/com/baeldung/string/padding/StringPaddingUtilUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/padding/StringPaddingUtilUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/string/padding/StringPaddingUtilUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/padding/StringPaddingUtilUnitTest.java index f6a077a88e..d8ef500b30 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/padding/StringPaddingUtilUnitTest.java +++ b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/padding/StringPaddingUtilUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string.padding; +package com.baeldung.padding; import com.google.common.base.Strings; import org.apache.commons.lang3.StringUtils; diff --git a/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/removelastchar/RemoveLastCharUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/removelastchar/RemoveLastCharUnitTest.java new file mode 100644 index 0000000000..e88158deb9 --- /dev/null +++ b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/removelastchar/RemoveLastCharUnitTest.java @@ -0,0 +1,93 @@ +package com.baeldung.removelastchar; + +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; + +public class RemoveLastCharUnitTest { + + public static final String TEST_STRING = "abcdef"; + public static final String NULL_STRING = null; + public static final String EMPTY_STRING = ""; + public static final String ONE_CHAR_STRING = "a"; + public static final String WHITE_SPACE_AT_THE_END_STRING = "abc "; + public static final String NEW_LINE_AT_THE_END_STRING = "abc\n"; + public static final String MULTIPLE_LINES_STRING = "abc\ndef"; + + @Test + public void givenTestString_whenSubstring_thenGetStingWithoutLastChar() { + assertEquals("abcde", StringHelper.removeLastChar(TEST_STRING)); + assertEquals("abcde", StringUtils.substring(TEST_STRING, 0, TEST_STRING.length() - 1)); + assertEquals("abcde", StringUtils.chop(TEST_STRING)); + assertEquals("abcde", TEST_STRING.replaceAll(".$", "")); + assertEquals("abcde", StringHelper.removeLastCharRegex(TEST_STRING)); + assertEquals("abcde", StringHelper.removeLastCharOptional(TEST_STRING)); + assertEquals("abcde", StringHelper.removeLastCharRegexOptional(TEST_STRING)); + } + + @Test + public void givenNullString_whenSubstring_thenGetNullString() { + assertEquals(NULL_STRING, StringHelper.removeLastChar(NULL_STRING)); + assertEquals(NULL_STRING, StringUtils.chop(NULL_STRING)); + assertEquals(NULL_STRING, StringHelper.removeLastCharRegex(NULL_STRING)); + assertEquals(NULL_STRING, StringHelper.removeLastCharOptional(NULL_STRING)); + assertEquals(NULL_STRING, StringHelper.removeLastCharRegexOptional(NULL_STRING)); + } + + @Test + public void givenEmptyString_whenSubstring_thenGetEmptyString() { + assertEquals(EMPTY_STRING, StringHelper.removeLastChar(EMPTY_STRING)); + assertEquals(EMPTY_STRING, StringUtils.substring(EMPTY_STRING, 0, EMPTY_STRING.length() - 1)); + assertEquals(EMPTY_STRING, StringUtils.chop(EMPTY_STRING)); + assertEquals(EMPTY_STRING, EMPTY_STRING.replaceAll(".$", "")); + assertEquals(EMPTY_STRING, StringHelper.removeLastCharRegex(EMPTY_STRING)); + assertEquals(EMPTY_STRING, StringHelper.removeLastCharOptional(EMPTY_STRING)); + assertEquals(EMPTY_STRING, StringHelper.removeLastCharRegexOptional(EMPTY_STRING)); + } + + @Test + public void givenOneCharString_whenSubstring_thenGetEmptyString() { + assertEquals(EMPTY_STRING, StringHelper.removeLastChar(ONE_CHAR_STRING)); + assertEquals(EMPTY_STRING, StringUtils.substring(ONE_CHAR_STRING, 0, ONE_CHAR_STRING.length() - 1)); + assertEquals(EMPTY_STRING, StringUtils.chop(ONE_CHAR_STRING)); + assertEquals(EMPTY_STRING, ONE_CHAR_STRING.replaceAll(".$", "")); + assertEquals(EMPTY_STRING, StringHelper.removeLastCharRegex(ONE_CHAR_STRING)); + assertEquals(EMPTY_STRING, StringHelper.removeLastCharOptional(ONE_CHAR_STRING)); + assertEquals(EMPTY_STRING, StringHelper.removeLastCharRegexOptional(ONE_CHAR_STRING)); + } + + @Test + public void givenStringWithWhiteSpaceAtTheEnd_whenSubstring_thenGetStringWithoutWhiteSpaceAtTheEnd() { + assertEquals("abc", StringHelper.removeLastChar(WHITE_SPACE_AT_THE_END_STRING)); + assertEquals("abc", StringUtils.substring(WHITE_SPACE_AT_THE_END_STRING, 0, WHITE_SPACE_AT_THE_END_STRING.length() - 1)); + assertEquals("abc", StringUtils.chop(WHITE_SPACE_AT_THE_END_STRING)); + assertEquals("abc", WHITE_SPACE_AT_THE_END_STRING.replaceAll(".$", "")); + assertEquals("abc", StringHelper.removeLastCharRegex(WHITE_SPACE_AT_THE_END_STRING)); + assertEquals("abc", StringHelper.removeLastCharOptional(WHITE_SPACE_AT_THE_END_STRING)); + assertEquals("abc", StringHelper.removeLastCharRegexOptional(WHITE_SPACE_AT_THE_END_STRING)); + } + + @Test + public void givenStringWithNewLineAtTheEnd_whenSubstring_thenGetStringWithoutNewLine() { + assertEquals("abc", StringHelper.removeLastChar(NEW_LINE_AT_THE_END_STRING)); + assertEquals("abc", StringUtils.substring(NEW_LINE_AT_THE_END_STRING, 0, NEW_LINE_AT_THE_END_STRING.length() - 1)); + assertEquals("abc", StringUtils.chop(NEW_LINE_AT_THE_END_STRING)); + assertNotEquals("abc", NEW_LINE_AT_THE_END_STRING.replaceAll(".$", "")); + assertNotEquals("abc", StringHelper.removeLastCharRegex(NEW_LINE_AT_THE_END_STRING)); + assertEquals("abc", StringHelper.removeLastCharOptional(NEW_LINE_AT_THE_END_STRING)); + assertNotEquals("abc", StringHelper.removeLastCharRegexOptional(NEW_LINE_AT_THE_END_STRING)); + } + + @Test + public void givenMultiLineString_whenSubstring_thenGetStringWithoutNewLine() { + assertEquals("abc\nde", StringHelper.removeLastChar(MULTIPLE_LINES_STRING)); + assertEquals("abc\nde", StringUtils.substring(MULTIPLE_LINES_STRING, 0, MULTIPLE_LINES_STRING.length() - 1)); + assertEquals("abc\nde", StringUtils.chop(MULTIPLE_LINES_STRING)); + assertEquals("abc\nde", MULTIPLE_LINES_STRING.replaceAll(".$", "")); + assertEquals("abc\nde", StringHelper.removeLastCharRegex(MULTIPLE_LINES_STRING)); + assertEquals("abc\nde", StringHelper.removeLastCharOptional(MULTIPLE_LINES_STRING)); + assertEquals("abc\nde", StringHelper.removeLastCharRegexOptional(MULTIPLE_LINES_STRING)); + } +} diff --git a/java-strings-2/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java similarity index 99% rename from java-strings-2/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java index 55f932fea1..5dec58eea9 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java +++ b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java @@ -1,13 +1,13 @@ -package com.baeldung.string.removeleadingtrailingchar; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.stream.Stream; +package com.baeldung.removeleadingtrailingchar; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + +import static org.assertj.core.api.Assertions.assertThat; + public class RemoveLeadingAndTrailingZeroesUnitTest { public static Stream leadingZeroTestProvider() { diff --git a/java-strings/src/test/java/com/baeldung/string/ReplaceCharInStringUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/replacechar/ReplaceCharInStringUnitTest.java similarity index 92% rename from java-strings/src/test/java/com/baeldung/string/ReplaceCharInStringUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/replacechar/ReplaceCharInStringUnitTest.java index c234c6953c..1e33a7f09d 100644 --- a/java-strings/src/test/java/com/baeldung/string/ReplaceCharInStringUnitTest.java +++ b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/replacechar/ReplaceCharInStringUnitTest.java @@ -1,8 +1,9 @@ -package com.baeldung.string; +package com.baeldung.replacechar; import org.junit.Test; import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; public class ReplaceCharInStringUnitTest { private ReplaceCharacterInString characterInString = new ReplaceCharacterInString(); diff --git a/java-strings/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/replaceremove/StringReplaceAndRemoveUnitTest.java similarity index 98% rename from java-strings/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/replaceremove/StringReplaceAndRemoveUnitTest.java index 4d2b54241b..fe71aa6974 100644 --- a/java-strings/src/test/java/com/baeldung/string/StringReplaceAndRemoveUnitTest.java +++ b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/replaceremove/StringReplaceAndRemoveUnitTest.java @@ -1,7 +1,7 @@ -package com.baeldung.string; +package com.baeldung.replaceremove; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.RegExUtils; +import org.apache.commons.lang3.StringUtils; import org.junit.Test; import static org.junit.Assert.assertFalse; diff --git a/java-strings-3/src/test/java/com/baeldung/stringdiff/StringDiffBenchmarkUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/stringdiff/StringDiffBenchmarkUnitTest.java similarity index 100% rename from java-strings-3/src/test/java/com/baeldung/stringdiff/StringDiffBenchmarkUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/stringdiff/StringDiffBenchmarkUnitTest.java diff --git a/java-strings-3/src/test/java/com/baeldung/stringdiff/StringDiffUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/stringdiff/StringDiffUnitTest.java similarity index 100% rename from java-strings-3/src/test/java/com/baeldung/stringdiff/StringDiffUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/stringdiff/StringDiffUnitTest.java diff --git a/java-strings-3/src/test/java/com/baeldung/string/wordcount/WordCountUnitTest.java b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/wordcount/WordCountUnitTest.java similarity index 97% rename from java-strings-3/src/test/java/com/baeldung/string/wordcount/WordCountUnitTest.java rename to core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/wordcount/WordCountUnitTest.java index fdd045978f..bdfee61d5a 100644 --- a/java-strings-3/src/test/java/com/baeldung/string/wordcount/WordCountUnitTest.java +++ b/core-java-modules/core-java-string-algorithms-2/src/test/java/com/baeldung/wordcount/WordCountUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string.wordcount; +package com.baeldung.wordcount; import static org.junit.Assert.assertEquals; diff --git a/core-java-modules/core-java-string-algorithms/README.md b/core-java-modules/core-java-string-algorithms/README.md new file mode 100644 index 0000000000..70a4b5ffaf --- /dev/null +++ b/core-java-modules/core-java-string-algorithms/README.md @@ -0,0 +1,16 @@ +## Java String Algorithms + +This module contains articles about string-related algorithms. + +### Relevant Articles: +- [Check If a String Is a Palindrome](https://www.baeldung.com/java-palindrome) +- [Count Occurrences of a Char in a String](https://www.baeldung.com/java-count-chars) +- [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences) +- [Removing Stopwords from a String in Java](https://www.baeldung.com/java-string-remove-stopwords) +- [Removing Repeated Characters from a String](https://www.baeldung.com/java-remove-repeated-char) +- [How to Reverse a String in Java](https://www.baeldung.com/java-reverse-string) +- [Check If a String Is a Pangram in Java](https://www.baeldung.com/java-string-pangram) +- [Check If a String Contains Multiple Keywords](https://www.baeldung.com/string-contains-multiple-words) +- [Checking If a String Is a Repeated Substring](https://www.baeldung.com/java-repeated-substring) +- [Remove Emojis from a Java String](https://www.baeldung.com/java-string-remove-emojis) +- More articles: [[next -->]](../core-java-string-algorithms-2) diff --git a/core-java-modules/core-java-string-algorithms/pom.xml b/core-java-modules/core-java-string-algorithms/pom.xml new file mode 100644 index 0000000000..f1b7499b6d --- /dev/null +++ b/core-java-modules/core-java-string-algorithms/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + core-java-string-algorithms + 0.1.0-SNAPSHOT + jar + core-java-string-algorithms + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + com.google.guava + guava + ${guava.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.ahocorasick + ahocorasick + ${ahocorasick.version} + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-core.version} + + + com.vdurmont + emoji-java + ${emoji-java.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-string-algorithms + + + src/main/resources + true + + + + + + 3.8.1 + 27.0.1-jre + 0.4.0 + 3.6.1 + 4.0.0 + + + diff --git a/java-strings-2/src/main/java/com/baeldung/string/MatchWords.java b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/matchwords/MatchWords.java similarity index 92% rename from java-strings-2/src/main/java/com/baeldung/string/MatchWords.java rename to core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/matchwords/MatchWords.java index 0cad52c320..b5b7e92d8e 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/MatchWords.java +++ b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/matchwords/MatchWords.java @@ -1,14 +1,12 @@ -package com.baeldung.string; +package com.baeldung.matchwords; import org.ahocorasick.trie.Emit; -import org.ahocorasick.trie.Token; import org.ahocorasick.trie.Trie; -import java.util.*; -import java.util.function.Function; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; public class MatchWords { diff --git a/java-strings-ops/src/main/java/com/baeldung/string/Palindrome.java b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/palindrom/Palindrome.java similarity index 98% rename from java-strings-ops/src/main/java/com/baeldung/string/Palindrome.java rename to core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/palindrom/Palindrome.java index 97d4d36d07..4a98e6583a 100644 --- a/java-strings-ops/src/main/java/com/baeldung/string/Palindrome.java +++ b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/palindrom/Palindrome.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.palindrom; import java.util.stream.IntStream; diff --git a/java-strings-2/src/main/java/com/baeldung/string/Pangram.java b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/pangram/Pangram.java similarity index 98% rename from java-strings-2/src/main/java/com/baeldung/string/Pangram.java rename to core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/pangram/Pangram.java index c09b0c1d29..ca2a44280c 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/Pangram.java +++ b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/pangram/Pangram.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.pangram; import java.util.Arrays; import java.util.Map; diff --git a/java-strings-2/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/removeduplicates/RemoveDuplicateFromString.java similarity index 98% rename from java-strings-2/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java rename to core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/removeduplicates/RemoveDuplicateFromString.java index d8fd9c4b14..a000f4dbd6 100644 --- a/java-strings-2/src/main/java/com/baeldung/stringduplicates/RemoveDuplicateFromString.java +++ b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/removeduplicates/RemoveDuplicateFromString.java @@ -1,4 +1,4 @@ -package com.baeldung.stringduplicates; +package com.baeldung.removeduplicates; import java.util.Arrays; import java.util.HashSet; diff --git a/java-strings-2/src/main/java/com/baeldung/string/repetition/SubstringRepetition.java b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/repetition/SubstringRepetition.java similarity index 94% rename from java-strings-2/src/main/java/com/baeldung/string/repetition/SubstringRepetition.java rename to core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/repetition/SubstringRepetition.java index 466ce9146b..6715367a19 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/repetition/SubstringRepetition.java +++ b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/repetition/SubstringRepetition.java @@ -1,4 +1,4 @@ -package com.baeldung.string.repetition; +package com.baeldung.repetition; public class SubstringRepetition { diff --git a/java-strings-2/src/main/java/com/baeldung/string/reverse/ReverseStringExamples.java b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/reverse/ReverseStringExamples.java similarity index 97% rename from java-strings-2/src/main/java/com/baeldung/string/reverse/ReverseStringExamples.java rename to core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/reverse/ReverseStringExamples.java index 1a58d09598..5236f14ccd 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/reverse/ReverseStringExamples.java +++ b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/reverse/ReverseStringExamples.java @@ -1,4 +1,4 @@ -package com.baeldung.string.reverse; +package com.baeldung.reverse; import org.apache.commons.lang3.StringUtils; diff --git a/java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/searching/WordIndexer.java similarity index 96% rename from java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java rename to core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/searching/WordIndexer.java index 1bcad6dd32..c7550f8e16 100644 --- a/java-strings/src/main/java/com/baeldung/string/searching/WordIndexer.java +++ b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/searching/WordIndexer.java @@ -1,4 +1,4 @@ -package com.baeldung.string.searching; +package com.baeldung.searching; import java.util.ArrayList; import java.util.List; diff --git a/java-strings-2/src/main/java/com/baeldung/string/performance/RemovingStopwordsPerformanceComparison.java b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/stopwords/RemovingStopwordsPerformanceComparison.java similarity index 82% rename from java-strings-2/src/main/java/com/baeldung/string/performance/RemovingStopwordsPerformanceComparison.java rename to core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/stopwords/RemovingStopwordsPerformanceComparison.java index 5b455459cd..7df64de3f1 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/performance/RemovingStopwordsPerformanceComparison.java +++ b/core-java-modules/core-java-string-algorithms/src/main/java/com/baeldung/stopwords/RemovingStopwordsPerformanceComparison.java @@ -1,4 +1,6 @@ -package com.baeldung.string.performance; +package com.baeldung.stopwords; + +import org.openjdk.jmh.annotations.*; import java.io.IOException; import java.nio.file.Files; @@ -9,15 +11,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.OutputTimeUnit; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.Setup; -import org.openjdk.jmh.annotations.State; - @Fork(value = 3, warmups = 1) @State(Scope.Benchmark) diff --git a/java-strings-2/src/main/resources/english_stopwords.txt b/core-java-modules/core-java-string-algorithms/src/main/resources/english_stopwords.txt similarity index 100% rename from java-strings-2/src/main/resources/english_stopwords.txt rename to core-java-modules/core-java-string-algorithms/src/main/resources/english_stopwords.txt diff --git a/java-strings-2/src/main/resources/shakespeare-hamlet.txt b/core-java-modules/core-java-string-algorithms/src/main/resources/shakespeare-hamlet.txt similarity index 100% rename from java-strings-2/src/main/resources/shakespeare-hamlet.txt rename to core-java-modules/core-java-string-algorithms/src/main/resources/shakespeare-hamlet.txt diff --git a/java-strings-ops/src/test/java/com/baeldung/java/countingChars/CountCharsExampleUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/countingchars/CountCharsExampleUnitTest.java similarity index 88% rename from java-strings-ops/src/test/java/com/baeldung/java/countingChars/CountCharsExampleUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/countingchars/CountCharsExampleUnitTest.java index e2dd0ac1db..8a5f1181b5 100644 --- a/java-strings-ops/src/test/java/com/baeldung/java/countingChars/CountCharsExampleUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/countingchars/CountCharsExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.countingChars; +package com.baeldung.countingchars; import static org.junit.Assert.assertEquals; @@ -10,7 +10,6 @@ import org.junit.Test; import com.google.common.base.CharMatcher; - /*** * Example of counting chars in a String. */ @@ -78,16 +77,21 @@ public class CountCharsExampleUnitTest { @Test public void givenString_whenUsingJava8Features_thenCountChars() { String someString = "elephant"; - long count = someString.chars().filter(ch -> ch == 'e').count(); + long count = someString.chars() + .filter(ch -> ch == 'e') + .count(); assertEquals(2, count); - long count2 = someString.codePoints().filter(ch -> ch == 'e').count(); + long count2 = someString.codePoints() + .filter(ch -> ch == 'e') + .count(); assertEquals(2, count2); } @Test public void givenString_whenUsingGuavaCharMatcher_thenCountChars() { - int count = CharMatcher.is('e').countIn("elephant"); + int count = CharMatcher.is('e') + .countIn("elephant"); assertEquals(2, count); } diff --git a/java-strings-2/src/test/java/com/baeldung/string/MatchWordsUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/matchwords/MatchWordsUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/string/MatchWordsUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/matchwords/MatchWordsUnitTest.java index 385aadaa5d..9ff1066a12 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/MatchWordsUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/matchwords/MatchWordsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.matchwords; import org.junit.Test; diff --git a/java-strings-ops/src/test/java/com/baeldung/string/PalindromeUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/palindrom/PalindromeUnitTest.java similarity index 97% rename from java-strings-ops/src/test/java/com/baeldung/string/PalindromeUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/palindrom/PalindromeUnitTest.java index 49f2542f39..43334ad0fd 100644 --- a/java-strings-ops/src/test/java/com/baeldung/string/PalindromeUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/palindrom/PalindromeUnitTest.java @@ -1,6 +1,7 @@ -package com.baeldung.string; +package com.baeldung.palindrom; + +import static org.junit.Assert.assertTrue; -import static org.junit.Assert.*; import org.junit.Test; public class PalindromeUnitTest { @@ -20,9 +21,9 @@ public class PalindromeUnitTest { "No mists or frost Simon", "Stella won no wallets" }; - + private Palindrome palindrome = new Palindrome(); - + @Test public void whenWord_shouldBePalindrome() { for (String word : words) diff --git a/java-strings-2/src/test/java/com/baeldung/string/PangramUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/pangram/PangramUnitTest.java similarity index 97% rename from java-strings-2/src/test/java/com/baeldung/string/PangramUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/pangram/PangramUnitTest.java index 36e603b535..b081a425e2 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/PangramUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/pangram/PangramUnitTest.java @@ -1,8 +1,9 @@ -package com.baeldung.string; +package com.baeldung.pangram; + +import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import org.junit.Test; public class PangramUnitTest { diff --git a/java-strings-2/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/removeduplicates/RemoveDuplicateFromStringUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/removeduplicates/RemoveDuplicateFromStringUnitTest.java index 895ecc4a3b..2372a5e569 100644 --- a/java-strings-2/src/test/java/com/baeldung/stringduplicates/RemoveDuplicateFromStringUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/removeduplicates/RemoveDuplicateFromStringUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stringduplicates; +package com.baeldung.removeduplicates; import org.junit.Assert; import org.junit.Before; diff --git a/java-strings-2/src/test/java/com/baeldung/string/RemovingEmojiFromStringUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/removeemojis/RemovingEmojiFromStringUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/string/RemovingEmojiFromStringUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/removeemojis/RemovingEmojiFromStringUnitTest.java index 8688f9dcf5..2c5f83400e 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/RemovingEmojiFromStringUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/removeemojis/RemovingEmojiFromStringUnitTest.java @@ -1,13 +1,12 @@ -package com.baeldung.string; +package com.baeldung.removeemojis; -import static org.junit.Assert.assertEquals; +import com.vdurmont.emoji.EmojiParser; +import org.junit.Test; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.junit.Test; - -import com.vdurmont.emoji.EmojiParser; +import static org.junit.Assert.assertEquals; public class RemovingEmojiFromStringUnitTest { String text = "la conférence, commencera à 10 heures 😅"; diff --git a/java-strings-2/src/test/java/com/baeldung/string/repetition/SubstringRepetitionUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/repetition/SubstringRepetitionUnitTest.java similarity index 93% rename from java-strings-2/src/test/java/com/baeldung/string/repetition/SubstringRepetitionUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/repetition/SubstringRepetitionUnitTest.java index f382a24a7f..5ecb7315c2 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/repetition/SubstringRepetitionUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/repetition/SubstringRepetitionUnitTest.java @@ -1,10 +1,10 @@ -package com.baeldung.string.repetition; - -import static com.baeldung.string.repetition.SubstringRepetition.*; -import static org.junit.Assert.*; +package com.baeldung.repetition; import org.junit.Test; +import static com.baeldung.repetition.SubstringRepetition.*; +import static org.junit.Assert.*; + public class SubstringRepetitionUnitTest { private String validString = "aa"; diff --git a/java-strings-2/src/test/java/com/baeldung/string/reverse/ReverseStringExamplesUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/reverse/ReverseStringExamplesUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/string/reverse/ReverseStringExamplesUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/reverse/ReverseStringExamplesUnitTest.java index 020ead02db..c122163174 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/reverse/ReverseStringExamplesUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/reverse/ReverseStringExamplesUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string.reverse; +package com.baeldung.reverse; import org.apache.commons.lang3.StringUtils; import org.junit.Test; diff --git a/java-strings/src/test/java/com/baeldung/string/searching/WordIndexerUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/searching/WordIndexerUnitTest.java similarity index 98% rename from java-strings/src/test/java/com/baeldung/string/searching/WordIndexerUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/searching/WordIndexerUnitTest.java index f3f76db01f..774d5a2121 100644 --- a/java-strings/src/test/java/com/baeldung/string/searching/WordIndexerUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/searching/WordIndexerUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string.searching; +package com.baeldung.searching; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/java-strings-2/src/test/java/com/baeldung/string/RemoveStopwordsUnitTest.java b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/stopwords/RemoveStopwordsUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/string/RemoveStopwordsUnitTest.java rename to core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/stopwords/RemoveStopwordsUnitTest.java index edda2ec9d7..d90a70a9f5 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/RemoveStopwordsUnitTest.java +++ b/core-java-modules/core-java-string-algorithms/src/test/java/com/baeldung/stopwords/RemoveStopwordsUnitTest.java @@ -1,6 +1,7 @@ -package com.baeldung.string; +package com.baeldung.stopwords; -import static org.junit.Assert.assertEquals; +import org.junit.BeforeClass; +import org.junit.Test; import java.io.IOException; import java.nio.file.Files; @@ -10,8 +11,7 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.junit.BeforeClass; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class RemoveStopwordsUnitTest { final String original = "The quick brown fox jumps over the lazy dog"; diff --git a/core-java-modules/core-java-string-apis/README.md b/core-java-modules/core-java-string-apis/README.md new file mode 100644 index 0000000000..fc36ba8640 --- /dev/null +++ b/core-java-modules/core-java-string-apis/README.md @@ -0,0 +1,12 @@ +## Java String APIs + +This module contains articles about string APIs. + +### Relevant Articles: +- [Java 8 StringJoiner](https://www.baeldung.com/java-string-joiner) +- [Quick Guide to the Java StringTokenizer](https://www.baeldung.com/java-stringtokenizer) +- [Guide to java.util.Formatter](https://www.baeldung.com/java-string-formatter) +- [Guide to StreamTokenizer](https://www.baeldung.com/java-streamtokenizer) +- [CharSequence vs. String in Java](https://www.baeldung.com/java-char-sequence-string) +- [StringBuilder and StringBuffer in Java](https://www.baeldung.com/java-string-builder-string-buffer) +- [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password) diff --git a/core-java-modules/core-java-string-apis/pom.xml b/core-java-modules/core-java-string-apis/pom.xml new file mode 100644 index 0000000000..7d9d888fa1 --- /dev/null +++ b/core-java-modules/core-java-string-apis/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + core-java-string-apis + 0.1.0-SNAPSHOT + jar + core-java-string-apis + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + + org.passay + passay + ${passay.version} + + + org.apache.commons + commons-text + ${commons-text.version} + + + + + core-java-string-apis + + + src/main/resources + true + + + + + + 1.3.1 + 1.4 + + + diff --git a/java-strings-2/src/main/java/com/baeldung/string/password/RandomPasswordGenerator.java b/core-java-modules/core-java-string-apis/src/main/java/com/baeldung/password/RandomPasswordGenerator.java similarity index 99% rename from java-strings-2/src/main/java/com/baeldung/string/password/RandomPasswordGenerator.java rename to core-java-modules/core-java-string-apis/src/main/java/com/baeldung/password/RandomPasswordGenerator.java index 46af4d7c51..d49b13c9c9 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/password/RandomPasswordGenerator.java +++ b/core-java-modules/core-java-string-apis/src/main/java/com/baeldung/password/RandomPasswordGenerator.java @@ -1,4 +1,11 @@ -package com.baeldung.string.password; +package com.baeldung.password; + +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.text.RandomStringGenerator; +import org.passay.CharacterRule; +import org.passay.EnglishCharacterData; +import org.passay.CharacterData; +import org.passay.PasswordGenerator; import java.security.SecureRandom; import java.util.Collections; @@ -8,13 +15,6 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.text.RandomStringGenerator; -import org.passay.CharacterData; -import org.passay.CharacterRule; -import org.passay.EnglishCharacterData; -import org.passay.PasswordGenerator; - public class RandomPasswordGenerator { /** diff --git a/java-strings-2/src/main/java/com/baeldung/string/streamtokenizer/StreamTokenizerDemo.java b/core-java-modules/core-java-string-apis/src/main/java/com/baeldung/streamtokenizer/StreamTokenizerDemo.java similarity index 98% rename from java-strings-2/src/main/java/com/baeldung/string/streamtokenizer/StreamTokenizerDemo.java rename to core-java-modules/core-java-string-apis/src/main/java/com/baeldung/streamtokenizer/StreamTokenizerDemo.java index 3bb0ff5b77..5ab506f259 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/streamtokenizer/StreamTokenizerDemo.java +++ b/core-java-modules/core-java-string-apis/src/main/java/com/baeldung/streamtokenizer/StreamTokenizerDemo.java @@ -1,4 +1,4 @@ -package com.baeldung.string.streamtokenizer; +package com.baeldung.streamtokenizer; import java.io.*; import java.util.ArrayList; diff --git a/core-java-modules/core-java-string-apis/src/main/java/com/baeldung/stringbuilderstringbuffer/StringBuilderStringBuffer.java b/core-java-modules/core-java-string-apis/src/main/java/com/baeldung/stringbuilderstringbuffer/StringBuilderStringBuffer.java new file mode 100644 index 0000000000..50c139e2d3 --- /dev/null +++ b/core-java-modules/core-java-string-apis/src/main/java/com/baeldung/stringbuilderstringbuffer/StringBuilderStringBuffer.java @@ -0,0 +1,46 @@ +package com.baeldung.stringbuilderstringbuffer; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.RunnerException; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +public class StringBuilderStringBuffer { + + public static void main(String[] args) throws RunnerException { + + Options opt = new OptionsBuilder() + .include(StringBuilderStringBuffer.class.getSimpleName()) + .build(); + + new Runner(opt).run(); + } + + @State(Scope.Benchmark) + public static class MyState { + int iterations = 1000; + String initial = "abc"; + String suffix = "def"; + } + + @Benchmark + public StringBuffer benchmarkStringBuffer(MyState state) { + StringBuffer stringBuffer = new StringBuffer(state.initial); + for (int i = 0; i < state.iterations; i++) { + stringBuffer.append(state.suffix); + } + return stringBuffer; + } + + @Benchmark + public StringBuilder benchmarkStringBuilder(MyState state) { + StringBuilder stringBuilder = new StringBuilder(state.initial); + for (int i = 0; i < state.iterations; i++) { + stringBuilder.append(state.suffix); + } + return stringBuilder; + } +} \ No newline at end of file diff --git a/java-strings/src/main/java/com/baeldung/stringtokenizer/MyTokenizer.java b/core-java-modules/core-java-string-apis/src/main/java/com/baeldung/stringtokenizer/MyTokenizer.java similarity index 100% rename from java-strings/src/main/java/com/baeldung/stringtokenizer/MyTokenizer.java rename to core-java-modules/core-java-string-apis/src/main/java/com/baeldung/stringtokenizer/MyTokenizer.java diff --git a/java-strings-ops/src/test/java/com/baeldung/string/CharSequenceVsStringUnitTest.java b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/charsequence/CharSequenceVsStringUnitTest.java similarity index 97% rename from java-strings-ops/src/test/java/com/baeldung/string/CharSequenceVsStringUnitTest.java rename to core-java-modules/core-java-string-apis/src/test/java/com/baeldung/charsequence/CharSequenceVsStringUnitTest.java index 916a3c79ff..aa15345bcb 100644 --- a/java-strings-ops/src/test/java/com/baeldung/string/CharSequenceVsStringUnitTest.java +++ b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/charsequence/CharSequenceVsStringUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.charsequence; import org.junit.Test; diff --git a/java-strings-2/src/test/java/com/baeldung/string/formatter/StringFormatterExampleUnitTest.java b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/formatter/StringFormatterExampleUnitTest.java similarity index 96% rename from java-strings-2/src/test/java/com/baeldung/string/formatter/StringFormatterExampleUnitTest.java rename to core-java-modules/core-java-string-apis/src/test/java/com/baeldung/formatter/StringFormatterExampleUnitTest.java index 648fdaf65a..549c889028 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/formatter/StringFormatterExampleUnitTest.java +++ b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/formatter/StringFormatterExampleUnitTest.java @@ -1,12 +1,12 @@ -package com.baeldung.string.formatter; +package com.baeldung.formatter; + +import org.junit.Test; import java.util.Calendar; import java.util.Formatter; import java.util.GregorianCalendar; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import org.junit.Test; + +import static org.junit.Assert.*; public class StringFormatterExampleUnitTest { diff --git a/java-strings-2/src/test/java/com/baeldung/string/password/StringPasswordUnitTest.java b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/password/StringPasswordUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/string/password/StringPasswordUnitTest.java rename to core-java-modules/core-java-string-apis/src/test/java/com/baeldung/password/StringPasswordUnitTest.java index bfd4b0fe8e..7fb55ad1cb 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/password/StringPasswordUnitTest.java +++ b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/password/StringPasswordUnitTest.java @@ -1,9 +1,9 @@ -package com.baeldung.string.password; - -import static org.junit.Assert.assertTrue; +package com.baeldung.password; import org.junit.Test; +import static org.junit.Assert.assertTrue; + /** * Examples of passwords conforming to various specifications, using different libraries. * diff --git a/java-strings-2/src/test/java/com/baeldung/string/streamtokenizer/StreamTokenizerDemoUnitTest.java b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/streamtokenizer/StreamTokenizerDemoUnitTest.java similarity index 96% rename from java-strings-2/src/test/java/com/baeldung/string/streamtokenizer/StreamTokenizerDemoUnitTest.java rename to core-java-modules/core-java-string-apis/src/test/java/com/baeldung/streamtokenizer/StreamTokenizerDemoUnitTest.java index 01091ec629..29214167be 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/streamtokenizer/StreamTokenizerDemoUnitTest.java +++ b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/streamtokenizer/StreamTokenizerDemoUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string.streamtokenizer; +package com.baeldung.streamtokenizer; import org.junit.Test; diff --git a/java-strings/src/test/java/com/baeldung/string/StringUnitTest.java b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/stringapi/StringUnitTest.java similarity index 96% rename from java-strings/src/test/java/com/baeldung/string/StringUnitTest.java rename to core-java-modules/core-java-string-apis/src/test/java/com/baeldung/stringapi/StringUnitTest.java index 0d4fd6eff9..5c1fe2fbda 100644 --- a/java-strings/src/test/java/com/baeldung/string/StringUnitTest.java +++ b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/stringapi/StringUnitTest.java @@ -1,16 +1,13 @@ -package com.baeldung.string; +package com.baeldung.stringapi; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import org.junit.Test; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.IllegalFormatException; import java.util.regex.PatternSyntaxException; -import org.junit.Test; +import static org.junit.Assert.*; public class StringUnitTest { diff --git a/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java new file mode 100644 index 0000000000..89f91acd6e --- /dev/null +++ b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java @@ -0,0 +1,101 @@ +package com.baeldung.stringjoiner; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +import static org.junit.Assert.assertEquals; + +public class StringJoinerUnitTest { + private final String DELIMITER_COMMA = ","; + private final String DELIMITER_HYPHEN = "-"; + private final String PREFIX = "["; + private final String SUFFIX = "]"; + private final String EMPTY_JOINER = "empty"; + + @Test + public void whenJoinerWithoutPrefixSuffixWithoutEmptyValue_thenReturnDefault() { + StringJoiner commaSeparatedJoiner = new StringJoiner(DELIMITER_COMMA); + assertEquals(0, commaSeparatedJoiner.toString().length()); + } + + @Test + public void whenJoinerWithPrefixSuffixWithoutEmptyValue_thenReturnDefault() { + StringJoiner commaSeparatedPrefixSuffixJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); + assertEquals(commaSeparatedPrefixSuffixJoiner.toString(), PREFIX + SUFFIX); + } + + @Test + public void whenJoinerWithoutPrefixSuffixWithEmptyValue_thenReturnDefault() { + StringJoiner commaSeparatedJoiner = new StringJoiner(DELIMITER_COMMA); + commaSeparatedJoiner.setEmptyValue(EMPTY_JOINER); + + assertEquals(commaSeparatedJoiner.toString(), EMPTY_JOINER); + } + + @Test + public void whenJoinerWithPrefixSuffixWithEmptyValue_thenReturnDefault() { + StringJoiner commaSeparatedPrefixSuffixJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); + commaSeparatedPrefixSuffixJoiner.setEmptyValue(EMPTY_JOINER); + + assertEquals(commaSeparatedPrefixSuffixJoiner.toString(), EMPTY_JOINER); + } + + @Test + public void whenAddElements_thenJoinElements() { + StringJoiner rgbJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); + rgbJoiner.add("Red") + .add("Green") + .add("Blue"); + + assertEquals(rgbJoiner.toString(), "[Red,Green,Blue]"); + } + + @Test + public void whenAddListElements_thenJoinListElements() { + List rgbList = new ArrayList(); + rgbList.add("Red"); + rgbList.add("Green"); + rgbList.add("Blue"); + + StringJoiner rgbJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); + + for (String color : rgbList) { + rgbJoiner.add(color); + } + + assertEquals(rgbJoiner.toString(), "[Red,Green,Blue]"); + } + + @Test + public void whenMergeJoiners_thenReturnMerged() { + StringJoiner rgbJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); + StringJoiner cmybJoiner = new StringJoiner(DELIMITER_HYPHEN, PREFIX, SUFFIX); + + rgbJoiner.add("Red") + .add("Green") + .add("Blue"); + cmybJoiner.add("Cyan") + .add("Magenta") + .add("Yellow") + .add("Black"); + + rgbJoiner.merge(cmybJoiner); + + assertEquals(rgbJoiner.toString(), "[Red,Green,Blue,Cyan-Magenta-Yellow-Black]"); + } + + @Test + public void whenUsedWithinCollectors_thenJoin() { + List rgbList = Arrays.asList("Red", "Green", "Blue"); + String commaSeparatedRGB = rgbList.stream() + .map(color -> color.toString()) + .collect(Collectors.joining(",")); + + assertEquals(commaSeparatedRGB, "Red,Green,Blue"); + } +} diff --git a/java-strings/src/test/java/com/baeldung/stringtokenizer/TokenizerUnitTest.java b/core-java-modules/core-java-string-apis/src/test/java/com/baeldung/stringtokenizer/TokenizerUnitTest.java similarity index 100% rename from java-strings/src/test/java/com/baeldung/stringtokenizer/TokenizerUnitTest.java rename to core-java-modules/core-java-string-apis/src/test/java/com/baeldung/stringtokenizer/TokenizerUnitTest.java diff --git a/core-java-modules/core-java-io/src/main/resources/data.csv b/core-java-modules/core-java-string-apis/src/test/resources/data.csv similarity index 100% rename from core-java-modules/core-java-io/src/main/resources/data.csv rename to core-java-modules/core-java-string-apis/src/test/resources/data.csv diff --git a/java-strings-2/src/main/resources/stream-tokenizer-example.txt b/core-java-modules/core-java-string-apis/src/test/resources/stream-tokenizer-example.txt similarity index 100% rename from java-strings-2/src/main/resources/stream-tokenizer-example.txt rename to core-java-modules/core-java-string-apis/src/test/resources/stream-tokenizer-example.txt diff --git a/core-java-modules/core-java-string-conversions-2/README.md b/core-java-modules/core-java-string-conversions-2/README.md new file mode 100644 index 0000000000..afdd7e5760 --- /dev/null +++ b/core-java-modules/core-java-string-conversions-2/README.md @@ -0,0 +1,9 @@ +## Java String Conversions + +This module contains articles about string conversions from/to another type. + +### Relevant Articles: +- [Java String Conversions](https://www.baeldung.com/java-string-conversions) +- [Convert String to Byte Array and Reverse in Java](https://www.baeldung.com/java-string-to-byte-array) +- [Convert Character Array to String in Java](https://www.baeldung.com/java-char-array-to-string) +- More articles: [[<-- prev]](/core-java-string-conversions) diff --git a/core-java-modules/core-java-string-conversions-2/pom.xml b/core-java-modules/core-java-string-conversions-2/pom.xml new file mode 100644 index 0000000000..396d836e6b --- /dev/null +++ b/core-java-modules/core-java-string-conversions-2/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + core-java-string-conversions-2 + 0.1.0-SNAPSHOT + jar + core-java-string-conversions-2 + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + com.google.guava + guava + ${guava.version} + + + junit + junit + ${junit.version} + test + + + org.hamcrest + hamcrest-library + ${org.hamcrest.version} + test + + + + + core-java-string-conversions-2 + + + src/main/resources + true + + + + + + diff --git a/core-java-modules/core-java-string-conversions-2/src/main/java/com/baeldung/stringconversions/UseLocalDateTime.java b/core-java-modules/core-java-string-conversions-2/src/main/java/com/baeldung/stringconversions/UseLocalDateTime.java new file mode 100644 index 0000000000..7b43c3b588 --- /dev/null +++ b/core-java-modules/core-java-string-conversions-2/src/main/java/com/baeldung/stringconversions/UseLocalDateTime.java @@ -0,0 +1,11 @@ +package com.baeldung.stringconversions; + +import java.time.LocalDateTime; + +public class UseLocalDateTime { + + public LocalDateTime getLocalDateTimeUsingParseMethod(String representation) { + return LocalDateTime.parse(representation); + } + +} diff --git a/java-strings-3/src/test/java/com/baeldung/string/charArrayToString/CharArrayToStringConversionUnitTest.java b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/chararraytostring/CharArrayToStringConversionUnitTest.java similarity index 97% rename from java-strings-3/src/test/java/com/baeldung/string/charArrayToString/CharArrayToStringConversionUnitTest.java rename to core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/chararraytostring/CharArrayToStringConversionUnitTest.java index 1030185c3e..dc68632f0b 100644 --- a/java-strings-3/src/test/java/com/baeldung/string/charArrayToString/CharArrayToStringConversionUnitTest.java +++ b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/chararraytostring/CharArrayToStringConversionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string.charArrayToString; +package com.baeldung.chararraytostring; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; diff --git a/java-strings-ops/src/test/java/com/baeldung/java/conversion/StringConversionUnitTest.java b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringconversions/StringConversionUnitTest.java similarity index 97% rename from java-strings-ops/src/test/java/com/baeldung/java/conversion/StringConversionUnitTest.java rename to core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringconversions/StringConversionUnitTest.java index fbbbb21ccd..d896b92b5c 100644 --- a/java-strings-ops/src/test/java/com/baeldung/java/conversion/StringConversionUnitTest.java +++ b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringconversions/StringConversionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.conversion; +package com.baeldung.stringconversions; import static org.junit.Assert.assertEquals; @@ -13,8 +13,6 @@ import java.util.GregorianCalendar; import org.junit.Test; -import com.baeldung.datetime.UseLocalDateTime; - public class StringConversionUnitTest { @Test diff --git a/java-strings-ops/src/test/java/com/baeldung/string/conversion/ByteArrayToStringUnitTest.java b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobytearray/ByteArrayToStringUnitTest.java similarity index 98% rename from java-strings-ops/src/test/java/com/baeldung/string/conversion/ByteArrayToStringUnitTest.java rename to core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobytearray/ByteArrayToStringUnitTest.java index a9f8a04c8d..e5efffd8f7 100644 --- a/java-strings-ops/src/test/java/com/baeldung/string/conversion/ByteArrayToStringUnitTest.java +++ b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobytearray/ByteArrayToStringUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string.conversion; +package com.baeldung.stringtobytearray; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobytearray/StringToByteArrayUnitTest.java b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobytearray/StringToByteArrayUnitTest.java new file mode 100644 index 0000000000..961c99bbde --- /dev/null +++ b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobytearray/StringToByteArrayUnitTest.java @@ -0,0 +1,122 @@ +package com.baeldung.stringtobytearray; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.UnsupportedEncodingException; +import java.nio.CharBuffer; +import java.nio.charset.CharacterCodingException; +import java.nio.charset.Charset; +import java.nio.charset.CharsetEncoder; +import java.nio.charset.CodingErrorAction; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; + +import org.junit.Test; + +public class StringToByteArrayUnitTest { + + @Test + public void whenGetBytesWithDefaultCharset_thenOK() { + final String inputString = "Hello World!"; + final String defaultCharSet = Charset.defaultCharset() + .displayName(); + + byte[] byteArrray = inputString.getBytes(); + + System.out.printf( + "Using default charset:%s, Input String:%s, Output byte array:%s\n", + defaultCharSet, inputString, Arrays.toString(byteArrray)); + + assertNotNull(byteArrray); + assert (byteArrray.length >= inputString.length()); + } + + @Test + public void whenGetBytesWithNamedCharset_thenOK() + throws UnsupportedEncodingException { + final String inputString = "Hello World!"; + final String charsetName = "IBM01140"; + + byte[] byteArrray = inputString.getBytes("IBM01140"); + + System.out.printf( + "Using named charset:%s, Input String:%s, Output byte array:%s\n", + charsetName, inputString, Arrays.toString(byteArrray)); + + assertArrayEquals(new byte[] { -56, -123, -109, -109, -106, 64, -26, + -106, -103, -109, -124, 90 }, + byteArrray); + } + + @Test + public void whenGetBytesWithCharset_thenOK() { + final String inputString = "Hello ਸੰਸਾਰ!"; + final Charset charset = Charset.forName("ASCII"); + + byte[] byteArrray = inputString.getBytes(charset); + + System.out.printf( + "Using Charset:%s, Input String:%s, Output byte array:%s\n", + charset, inputString, Arrays.toString(byteArrray)); + + assertArrayEquals( + new byte[] { 72, 101, 108, 108, 111, 32, 63, 63, 63, 63, 63, 33 }, + byteArrray); + } + + @Test + public void whenGetBytesWithStandardCharset_thenOK() { + final String inputString = "Hello World!"; + final Charset charset = StandardCharsets.UTF_16; + + byte[] byteArrray = inputString.getBytes(charset); + + System.out.printf( + "Using Standard Charset:%s, Input String:%s, Output byte array:%s\n", + charset, inputString, Arrays.toString(byteArrray)); + + assertArrayEquals(new byte[] { -2, -1, 0, 72, 0, 101, 0, 108, 0, 108, 0, + 111, 0, 32, 0, 87, 0, 111, 0, 114, 0, 108, 0, 100, 0, 33 }, + byteArrray); + } + + @Test + public void whenEncodeWithCharset_thenOK() { + final String inputString = "Hello ਸੰਸਾਰ!"; + final Charset charset = StandardCharsets.US_ASCII; + + byte[] byteArrray = charset.encode(inputString) + .array(); + + System.out.printf( + "Using encode with Charset:%s, Input String:%s, Output byte array:%s\n", + charset, inputString, Arrays.toString(byteArrray)); + + assertArrayEquals( + new byte[] { 72, 101, 108, 108, 111, 32, 63, 63, 63, 63, 63, 33 }, + byteArrray); + } + + @Test + public void whenUsingCharsetEncoder_thenOK() + throws CharacterCodingException { + final String inputString = "Hello ਸੰਸਾਰ!"; + CharsetEncoder encoder = StandardCharsets.US_ASCII.newEncoder(); + encoder.onMalformedInput(CodingErrorAction.IGNORE) + .onUnmappableCharacter(CodingErrorAction.REPLACE) + .replaceWith(new byte[] { 0 }); + + byte[] byteArrray = encoder.encode(CharBuffer.wrap(inputString)) + .array(); + + System.out.printf( + "Using encode with CharsetEncoder:%s, Input String:%s, Output byte array:%s\n", + encoder, inputString, Arrays.toString(byteArrray)); + + assertArrayEquals( + new byte[] { 72, 101, 108, 108, 111, 32, 0, 0, 0, 0, 0, 33 }, + byteArrray); + } + +} diff --git a/core-java-modules/core-java-string-conversions/README.md b/core-java-modules/core-java-string-conversions/README.md new file mode 100644 index 0000000000..849660e482 --- /dev/null +++ b/core-java-modules/core-java-string-conversions/README.md @@ -0,0 +1,16 @@ +## Java String Conversions + +This module contains articles about string conversions from/to another type. + +### Relevant Articles: +- [Converting String to Stream of chars](https://www.baeldung.com/java-string-to-stream) +- [Converting Strings to Enums in Java](https://www.baeldung.com/java-string-to-enum) +- [Convert a String to Title Case](https://www.baeldung.com/java-string-title-case) +- [Convert java.util.Date to String](https://www.baeldung.com/java-util-date-to-string) +- [Converting a Stack Trace to a String in Java](https://www.baeldung.com/java-stacktrace-to-string) +- [Image to Base64 String Conversion](https://www.baeldung.com/java-base64-image-string) +- [Convert a Comma Separated String to a List in Java](https://www.baeldung.com/java-string-with-separator-to-list) +- [Converting Java String to Double](https://www.baeldung.com/java-string-to-double) +- [Convert Char to String in Java](https://www.baeldung.com/java-convert-char-to-string) +- [Convert String to int or Integer in Java](https://www.baeldung.com/java-convert-string-to-int-or-integer) +- More articles: [[next -->]](/core-java-string-conversions-2) \ No newline at end of file diff --git a/core-java-modules/core-java-string-conversions/pom.xml b/core-java-modules/core-java-string-conversions/pom.xml new file mode 100644 index 0000000000..9c968b7f1c --- /dev/null +++ b/core-java-modules/core-java-string-conversions/pom.xml @@ -0,0 +1,67 @@ + + 4.0.0 + core-java-string-conversions + 0.1.0-SNAPSHOT + jar + core-java-string-conversions + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + com.ibm.icu + icu4j + ${icu4j.version} + + + commons-io + commons-io + ${commons-io.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + com.google.guava + guava + ${guava.version} + + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.hamcrest + hamcrest-library + ${org.hamcrest.version} + test + + + + + core-java-string-conversions + + + src/main/resources + true + + + + + + 61.1 + 3.6.1 + + + diff --git a/java-strings/src/main/java/com/baeldung/enums/PizzaStatusEnum.java b/core-java-modules/core-java-string-conversions/src/main/java/com/baeldung/stringtoenum/PizzaStatusEnum.java similarity index 95% rename from java-strings/src/main/java/com/baeldung/enums/PizzaStatusEnum.java rename to core-java-modules/core-java-string-conversions/src/main/java/com/baeldung/stringtoenum/PizzaStatusEnum.java index a84829c38d..02646ef997 100644 --- a/java-strings/src/main/java/com/baeldung/enums/PizzaStatusEnum.java +++ b/core-java-modules/core-java-string-conversions/src/main/java/com/baeldung/stringtoenum/PizzaStatusEnum.java @@ -1,4 +1,4 @@ -package com.baeldung.enums; +package com.baeldung.stringtoenum; public enum PizzaStatusEnum { ORDERED(5) { diff --git a/java-strings/src/main/java/com/baeldung/string/TitleCaseConverter.java b/core-java-modules/core-java-string-conversions/src/main/java/com/baeldung/titlecase/TitleCaseConverter.java similarity index 98% rename from java-strings/src/main/java/com/baeldung/string/TitleCaseConverter.java rename to core-java-modules/core-java-string-conversions/src/main/java/com/baeldung/titlecase/TitleCaseConverter.java index 81043f6dac..1c35e1a2d6 100644 --- a/java-strings/src/main/java/com/baeldung/string/TitleCaseConverter.java +++ b/core-java-modules/core-java-string-conversions/src/main/java/com/baeldung/titlecase/TitleCaseConverter.java @@ -1,12 +1,11 @@ -package com.baeldung.string; - -import java.util.Arrays; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.text.WordUtils; +package com.baeldung.titlecase; import com.ibm.icu.lang.UCharacter; import com.ibm.icu.text.BreakIterator; +import org.apache.commons.lang3.text.WordUtils; + +import java.util.Arrays; +import java.util.stream.Collectors; public class TitleCaseConverter { diff --git a/java-strings-ops/src/test/java/com/baeldung/CharToStringUnitTest.java b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/chartostring/CharToStringUnitTest.java similarity index 97% rename from java-strings-ops/src/test/java/com/baeldung/CharToStringUnitTest.java rename to core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/chartostring/CharToStringUnitTest.java index 78742e356d..db7c8a16ec 100644 --- a/java-strings-ops/src/test/java/com/baeldung/CharToStringUnitTest.java +++ b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/chartostring/CharToStringUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.chartostring; import org.junit.Test; diff --git a/java-strings-2/src/test/java/com/baeldung/string/formatter/DateToStringFormatterUnitTest.java b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/datetostring/DateToStringFormatterUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/string/formatter/DateToStringFormatterUnitTest.java rename to core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/datetostring/DateToStringFormatterUnitTest.java index d760510c73..221900fb0e 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/formatter/DateToStringFormatterUnitTest.java +++ b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/datetostring/DateToStringFormatterUnitTest.java @@ -1,6 +1,7 @@ -package com.baeldung.string.formatter; +package com.baeldung.datetostring; -import static org.junit.Assert.assertEquals; +import org.junit.BeforeClass; +import org.junit.Test; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -13,8 +14,7 @@ import java.util.Date; import java.util.Locale; import java.util.TimeZone; -import org.junit.BeforeClass; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class DateToStringFormatterUnitTest { diff --git a/java-strings-2/src/test/java/com/baeldung/fileToBase64StringConversion/FileToBase64StringConversionUnitTest.java b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/filetobase64conversion/FileToBase64StringConversionUnitTest.java similarity index 96% rename from java-strings-2/src/test/java/com/baeldung/fileToBase64StringConversion/FileToBase64StringConversionUnitTest.java rename to core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/filetobase64conversion/FileToBase64StringConversionUnitTest.java index eef21a98c9..9b165069d6 100644 --- a/java-strings-2/src/test/java/com/baeldung/fileToBase64StringConversion/FileToBase64StringConversionUnitTest.java +++ b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/filetobase64conversion/FileToBase64StringConversionUnitTest.java @@ -1,13 +1,13 @@ -package com.baeldung.fileToBase64StringConversion; +package com.baeldung.filetobase64conversion; -import static org.junit.Assert.assertTrue; +import org.apache.commons.io.FileUtils; +import org.junit.Test; import java.io.File; import java.io.IOException; import java.util.Base64; -import org.apache.commons.io.FileUtils; -import org.junit.Test; +import static org.junit.Assert.assertTrue; public class FileToBase64StringConversionUnitTest { diff --git a/java-strings-3/src/test/java/com/baeldung/string/todouble/StringToDoubleConversionUnitTest.java b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtodouble/StringToDoubleConversionUnitTest.java similarity index 97% rename from java-strings-3/src/test/java/com/baeldung/string/todouble/StringToDoubleConversionUnitTest.java rename to core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtodouble/StringToDoubleConversionUnitTest.java index 2c87af53f8..e29b55d52a 100644 --- a/java-strings-3/src/test/java/com/baeldung/string/todouble/StringToDoubleConversionUnitTest.java +++ b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtodouble/StringToDoubleConversionUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string.todouble; +package com.baeldung.stringtodouble; import static org.junit.Assert.assertEquals; diff --git a/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtoenum/StringToEnumUnitTest.java b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtoenum/StringToEnumUnitTest.java new file mode 100644 index 0000000000..f6b3bf2aa6 --- /dev/null +++ b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtoenum/StringToEnumUnitTest.java @@ -0,0 +1,27 @@ +package com.baeldung.stringtoenum; + +import static junit.framework.TestCase.assertTrue; + +import org.junit.Test; + +public class StringToEnumUnitTest { + + @Test + public void whenConvertedIntoEnum_thenGetsConvertedCorrectly() { + String pizzaEnumValue = "READY"; + PizzaStatusEnum pizzaStatusEnum = PizzaStatusEnum.valueOf(pizzaEnumValue); + assertTrue(pizzaStatusEnum == PizzaStatusEnum.READY); + } + + @Test(expected = IllegalArgumentException.class) + public void whenConvertedIntoEnum_thenThrowsException() { + String pizzaEnumValue = "rEAdY"; + PizzaStatusEnum pizzaStatusEnum = PizzaStatusEnum.valueOf(pizzaEnumValue); + } + + @Test(expected = IllegalArgumentException.class) + public void givenInvalidEnumValueContentWiseAsString_whenConvertedIntoEnum_thenThrowsException() { + String pizzaEnumValue = "invalid"; + PizzaStatusEnum pizzaStatusEnum = PizzaStatusEnum.valueOf(pizzaEnumValue); + } +} \ No newline at end of file diff --git a/java-strings/src/test/java/com/baeldung/StringToIntOrIntegerUnitTest.java b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtoint/StringToIntOrIntegerUnitTest.java similarity index 97% rename from java-strings/src/test/java/com/baeldung/StringToIntOrIntegerUnitTest.java rename to core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtoint/StringToIntOrIntegerUnitTest.java index a7ad0bf114..106f1fc974 100644 --- a/java-strings/src/test/java/com/baeldung/StringToIntOrIntegerUnitTest.java +++ b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtoint/StringToIntOrIntegerUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.stringtoint; import static org.assertj.core.api.Assertions.assertThat; diff --git a/java-strings-2/src/test/java/com/baeldung/ConvertStringToListUnitTest.java b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtolist/ConvertStringToListUnitTest.java similarity index 96% rename from java-strings-2/src/test/java/com/baeldung/ConvertStringToListUnitTest.java rename to core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtolist/ConvertStringToListUnitTest.java index 47357a99cc..b9e0cede31 100644 --- a/java-strings-2/src/test/java/com/baeldung/ConvertStringToListUnitTest.java +++ b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtolist/ConvertStringToListUnitTest.java @@ -1,135 +1,134 @@ -package com.baeldung; - -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.apache.commons.lang3.StringUtils; -import org.junit.Test; - -import com.google.common.base.Function; -import com.google.common.base.Splitter; -import com.google.common.collect.Lists; - -public class ConvertStringToListUnitTest { - - private final String countries = "Russia,Germany,England,France,Italy"; - private final String ranks = "1,2,3,4,5, 6,7"; - private final String emptyStrings = ",,,,,"; - private final List expectedCountriesList = Arrays.asList("Russia", "Germany", "England", "France", "Italy"); - private final List expectedRanksList = Arrays.asList(1, 2, 3, 4, 5, 6, 7); - private final List expectedEmptyStringsList = Arrays.asList("", "", "", "", "", ""); - - @Test - public void givenString_thenGetListOfStringByJava() { - List convertedCountriesList = Arrays.asList(countries.split(",", -1)); - - assertEquals(expectedCountriesList, convertedCountriesList); - } - - @Test - public void givenString_thenGetListOfStringByApache() { - List convertedCountriesList = Arrays.asList(StringUtils.splitPreserveAllTokens(countries, ",")); - - assertEquals(expectedCountriesList, convertedCountriesList); - } - - @Test - public void givenString_thenGetListOfStringByGuava() { - List convertedCountriesList = Splitter.on(",") - .trimResults() - .splitToList(countries); - - assertEquals(expectedCountriesList, convertedCountriesList); - } - - @Test - public void givenString_thenGetListOfStringByJava8() { - List convertedCountriesList = Stream.of(countries.split(",", -1)) - .collect(Collectors.toList()); - - assertEquals(expectedCountriesList, convertedCountriesList); - } - - @Test - public void givenString_thenGetListOfIntegerByJava() { - String[] convertedRankArray = ranks.split(","); - List convertedRankList = new ArrayList(); - for (String number : convertedRankArray) { - convertedRankList.add(Integer.parseInt(number.trim())); - } - - assertEquals(expectedRanksList, convertedRankList); - } - - @Test - public void givenString_thenGetListOfIntegerByGuava() { - List convertedRankList = Lists.transform(Splitter.on(",") - .trimResults() - .splitToList(ranks), new Function() { - @Override - public Integer apply(String input) { - return Integer.parseInt(input.trim()); - } - }); - - assertEquals(expectedRanksList, convertedRankList); - } - - @Test - public void givenString_thenGetListOfIntegerByJava8() { - List convertedRankList = Stream.of(ranks.split(",")) - .map(String::trim) - .map(Integer::parseInt) - .collect(Collectors.toList()); - - assertEquals(expectedRanksList, convertedRankList); - } - - @Test - public void givenString_thenGetListOfIntegerByApache() { - String[] convertedRankArray = StringUtils.split(ranks, ","); - List convertedRankList = new ArrayList(); - for (String number : convertedRankArray) { - convertedRankList.add(Integer.parseInt(number.trim())); - } - - assertEquals(expectedRanksList, convertedRankList); - } - - @Test - public void givenEmptyStrings_thenGetListOfStringByJava() { - List convertedEmptyStringsList = Arrays.asList(emptyStrings.split(",", -1)); - - assertEquals(expectedEmptyStringsList, convertedEmptyStringsList); - } - - @Test - public void givenEmptyStrings_thenGetListOfStringByApache() { - List convertedEmptyStringsList = Arrays.asList(StringUtils.splitPreserveAllTokens(emptyStrings, ",")); - - assertEquals(expectedEmptyStringsList, convertedEmptyStringsList); - } - - @Test - public void givenEmptyStrings_thenGetListOfStringByGuava() { - List convertedEmptyStringsList = Splitter.on(",") - .trimResults() - .splitToList(emptyStrings); - - assertEquals(expectedEmptyStringsList, convertedEmptyStringsList); - } - - @Test - public void givenEmptyStrings_thenGetListOfStringByJava8() { - List convertedEmptyStringsList = Stream.of(emptyStrings.split(",", -1)) - .collect(Collectors.toList()); - - assertEquals(expectedEmptyStringsList, convertedEmptyStringsList); - } - -} +package com.baeldung.stringtolist; + +import com.google.common.base.Function; +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.junit.Assert.assertEquals; + +public class ConvertStringToListUnitTest { + + private final String countries = "Russia,Germany,England,France,Italy"; + private final String ranks = "1,2,3,4,5, 6,7"; + private final String emptyStrings = ",,,,,"; + private final List expectedCountriesList = Arrays.asList("Russia", "Germany", "England", "France", "Italy"); + private final List expectedRanksList = Arrays.asList(1, 2, 3, 4, 5, 6, 7); + private final List expectedEmptyStringsList = Arrays.asList("", "", "", "", "", ""); + + @Test + public void givenString_thenGetListOfStringByJava() { + List convertedCountriesList = Arrays.asList(countries.split(",", -1)); + + assertEquals(expectedCountriesList, convertedCountriesList); + } + + @Test + public void givenString_thenGetListOfStringByApache() { + List convertedCountriesList = Arrays.asList(StringUtils.splitPreserveAllTokens(countries, ",")); + + assertEquals(expectedCountriesList, convertedCountriesList); + } + + @Test + public void givenString_thenGetListOfStringByGuava() { + List convertedCountriesList = Splitter.on(",") + .trimResults() + .splitToList(countries); + + assertEquals(expectedCountriesList, convertedCountriesList); + } + + @Test + public void givenString_thenGetListOfStringByJava8() { + List convertedCountriesList = Stream.of(countries.split(",", -1)) + .collect(Collectors.toList()); + + assertEquals(expectedCountriesList, convertedCountriesList); + } + + @Test + public void givenString_thenGetListOfIntegerByJava() { + String[] convertedRankArray = ranks.split(","); + List convertedRankList = new ArrayList(); + for (String number : convertedRankArray) { + convertedRankList.add(Integer.parseInt(number.trim())); + } + + assertEquals(expectedRanksList, convertedRankList); + } + + @Test + public void givenString_thenGetListOfIntegerByGuava() { + List convertedRankList = Lists.transform(Splitter.on(",") + .trimResults() + .splitToList(ranks), new Function() { + @Override + public Integer apply(String input) { + return Integer.parseInt(input.trim()); + } + }); + + assertEquals(expectedRanksList, convertedRankList); + } + + @Test + public void givenString_thenGetListOfIntegerByJava8() { + List convertedRankList = Stream.of(ranks.split(",")) + .map(String::trim) + .map(Integer::parseInt) + .collect(Collectors.toList()); + + assertEquals(expectedRanksList, convertedRankList); + } + + @Test + public void givenString_thenGetListOfIntegerByApache() { + String[] convertedRankArray = StringUtils.split(ranks, ","); + List convertedRankList = new ArrayList(); + for (String number : convertedRankArray) { + convertedRankList.add(Integer.parseInt(number.trim())); + } + + assertEquals(expectedRanksList, convertedRankList); + } + + @Test + public void givenEmptyStrings_thenGetListOfStringByJava() { + List convertedEmptyStringsList = Arrays.asList(emptyStrings.split(",", -1)); + + assertEquals(expectedEmptyStringsList, convertedEmptyStringsList); + } + + @Test + public void givenEmptyStrings_thenGetListOfStringByApache() { + List convertedEmptyStringsList = Arrays.asList(StringUtils.splitPreserveAllTokens(emptyStrings, ",")); + + assertEquals(expectedEmptyStringsList, convertedEmptyStringsList); + } + + @Test + public void givenEmptyStrings_thenGetListOfStringByGuava() { + List convertedEmptyStringsList = Splitter.on(",") + .trimResults() + .splitToList(emptyStrings); + + assertEquals(expectedEmptyStringsList, convertedEmptyStringsList); + } + + @Test + public void givenEmptyStrings_thenGetListOfStringByJava8() { + List convertedEmptyStringsList = Stream.of(emptyStrings.split(",", -1)) + .collect(Collectors.toList()); + + assertEquals(expectedEmptyStringsList, convertedEmptyStringsList); + } + +} diff --git a/java-strings/src/test/java/com/baeldung/string/StringToCharStreamUnitTest.java b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtostream/StringToCharStreamUnitTest.java similarity index 98% rename from java-strings/src/test/java/com/baeldung/string/StringToCharStreamUnitTest.java rename to core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtostream/StringToCharStreamUnitTest.java index 1b02e5d291..cd5727dcf8 100644 --- a/java-strings/src/test/java/com/baeldung/string/StringToCharStreamUnitTest.java +++ b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/stringtostream/StringToCharStreamUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.stringtostream; import org.junit.Test; diff --git a/java-strings/src/test/java/com/baeldung/string/TitleCaseConverterUnitTest.java b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/titlecase/TitleCaseConverterUnitTest.java similarity index 99% rename from java-strings/src/test/java/com/baeldung/string/TitleCaseConverterUnitTest.java rename to core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/titlecase/TitleCaseConverterUnitTest.java index 2272565cd3..73694d2c1c 100644 --- a/java-strings/src/test/java/com/baeldung/string/TitleCaseConverterUnitTest.java +++ b/core-java-modules/core-java-string-conversions/src/test/java/com/baeldung/titlecase/TitleCaseConverterUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.titlecase; import org.junit.Assert; import org.junit.Test; diff --git a/java-strings-2/src/test/resources/test_image.jpg b/core-java-modules/core-java-string-conversions/src/test/resources/test_image.jpg similarity index 100% rename from java-strings-2/src/test/resources/test_image.jpg rename to core-java-modules/core-java-string-conversions/src/test/resources/test_image.jpg diff --git a/core-java-modules/core-java-string-operations-2/README.md b/core-java-modules/core-java-string-operations-2/README.md new file mode 100644 index 0000000000..50f40ac2af --- /dev/null +++ b/core-java-modules/core-java-string-operations-2/README.md @@ -0,0 +1,11 @@ +## Java String Operations + +This module contains articles about string operations. + +### Relevant Articles: +- [Concatenating Strings In Java](https://www.baeldung.com/java-strings-concatenation) +- [Checking for Empty or Blank Strings in Java](https://www.baeldung.com/java-blank-empty-strings) +- [String Initialization in Java](https://www.baeldung.com/java-string-initialization) +- [String toLowerCase and toUpperCase Methods in Java](https://www.baeldung.com/java-string-convert-case) +- [Java String equalsIgnoreCase()](https://www.baeldung.com/java-string-equalsignorecase) +- More articles: [[<-- prev]](../core-java-string-operations) diff --git a/core-java-modules/core-java-string-operations-2/pom.xml b/core-java-modules/core-java-string-operations-2/pom.xml new file mode 100644 index 0000000000..95aeec8fcb --- /dev/null +++ b/core-java-modules/core-java-string-operations-2/pom.xml @@ -0,0 +1,81 @@ + + 4.0.0 + core-java-string-operations-2 + 0.1.0-SNAPSHOT + jar + core-java-string-operations-2 + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + javax.validation + validation-api + ${validation-api.version} + + + com.google.guava + guava + ${guava.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.hibernate.validator + hibernate-validator + ${hibernate-validator.version} + + + javax.el + javax.el-api + ${javax.el-api.version} + + + org.glassfish.web + javax.el + ${javax.el.version} + + + org.hamcrest + hamcrest-library + ${org.hamcrest.version} + test + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-string-operations-2 + + + src/main/resources + true + + + + + + 3.6.1 + 2.0.0.Final + 3.8.1 + 27.0.1-jre + 6.0.2.Final + 3.0.0 + 2.2.6 + + + diff --git a/java-strings-2/src/main/java/com/baeldung/string/emptystrings/EmptyStringCheck.java b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/EmptyStringCheck.java similarity index 75% rename from java-strings-2/src/main/java/com/baeldung/string/emptystrings/EmptyStringCheck.java rename to core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/EmptyStringCheck.java index 6d3234a4ec..85689eff99 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/emptystrings/EmptyStringCheck.java +++ b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/EmptyStringCheck.java @@ -1,4 +1,4 @@ -package com.baeldung.string.emptystrings; +package com.baeldung.emptystrings; class EmptyStringCheck { diff --git a/java-strings-2/src/main/java/com/baeldung/string/emptystrings/Java5EmptyStringCheck.java b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/Java5EmptyStringCheck.java similarity index 76% rename from java-strings-2/src/main/java/com/baeldung/string/emptystrings/Java5EmptyStringCheck.java rename to core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/Java5EmptyStringCheck.java index 096b83acea..0c7997c075 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/emptystrings/Java5EmptyStringCheck.java +++ b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/Java5EmptyStringCheck.java @@ -1,4 +1,4 @@ -package com.baeldung.string.emptystrings; +package com.baeldung.emptystrings; class Java5EmptyStringCheck { diff --git a/java-strings-2/src/main/java/com/baeldung/string/emptystrings/PlainJavaBlankStringCheck.java b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/PlainJavaBlankStringCheck.java similarity index 77% rename from java-strings-2/src/main/java/com/baeldung/string/emptystrings/PlainJavaBlankStringCheck.java rename to core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/PlainJavaBlankStringCheck.java index 26e281c9b7..315ce4613a 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/emptystrings/PlainJavaBlankStringCheck.java +++ b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/PlainJavaBlankStringCheck.java @@ -1,4 +1,4 @@ -package com.baeldung.string.emptystrings; +package com.baeldung.emptystrings; class PlainJavaBlankStringCheck { diff --git a/java-strings-2/src/main/java/com/baeldung/string/emptystrings/SomeClassWithValidations.java b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/SomeClassWithValidations.java similarity index 87% rename from java-strings-2/src/main/java/com/baeldung/string/emptystrings/SomeClassWithValidations.java rename to core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/SomeClassWithValidations.java index 8c484efb43..058d53ba82 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/emptystrings/SomeClassWithValidations.java +++ b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/emptystrings/SomeClassWithValidations.java @@ -1,4 +1,4 @@ -package com.baeldung.string.emptystrings; +package com.baeldung.emptystrings; import javax.validation.constraints.Pattern; diff --git a/java-strings-2/src/test/java/com/baeldung/string/changecase/ToLowerCaseUnitTest.java b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/changecase/ToLowerCaseUnitTest.java similarity index 91% rename from java-strings-2/src/test/java/com/baeldung/string/changecase/ToLowerCaseUnitTest.java rename to core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/changecase/ToLowerCaseUnitTest.java index c395b61068..4826ba2ef7 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/changecase/ToLowerCaseUnitTest.java +++ b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/changecase/ToLowerCaseUnitTest.java @@ -1,29 +1,29 @@ -package com.baeldung.string.changecase; - -import static org.junit.Assert.assertEquals; - -import java.util.Locale; - -import org.junit.Test; - -public class ToLowerCaseUnitTest { - - private static final Locale TURKISH = new Locale("tr"); - private String name = "John Doe"; - private String foreignUppercase = "\u0049"; - - @Test - public void givenMixedCaseString_WhenToLowerCase_ThenResultIsLowerCase() { - assertEquals("john doe", name.toLowerCase()); - } - - @Test - public void givenForeignString_WhenToLowerCaseWithoutLocale_ThenResultIsLowerCase() { - assertEquals("\u0069", foreignUppercase.toLowerCase()); - } - - @Test - public void givenForeignString_WhenToLowerCaseWithLocale_ThenResultIsLowerCase() { - assertEquals("\u0131", foreignUppercase.toLowerCase(TURKISH)); - } -} +package com.baeldung.changecase; + +import org.junit.Test; + +import java.util.Locale; + +import static org.junit.Assert.assertEquals; + +public class ToLowerCaseUnitTest { + + private static final Locale TURKISH = new Locale("tr"); + private String name = "John Doe"; + private String foreignUppercase = "\u0049"; + + @Test + public void givenMixedCaseString_WhenToLowerCase_ThenResultIsLowerCase() { + assertEquals("john doe", name.toLowerCase()); + } + + @Test + public void givenForeignString_WhenToLowerCaseWithoutLocale_ThenResultIsLowerCase() { + assertEquals("\u0069", foreignUppercase.toLowerCase()); + } + + @Test + public void givenForeignString_WhenToLowerCaseWithLocale_ThenResultIsLowerCase() { + assertEquals("\u0131", foreignUppercase.toLowerCase(TURKISH)); + } +} diff --git a/java-strings-2/src/test/java/com/baeldung/string/changecase/ToUpperCaseUnitTest.java b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/changecase/ToUpperCaseUnitTest.java similarity index 91% rename from java-strings-2/src/test/java/com/baeldung/string/changecase/ToUpperCaseUnitTest.java rename to core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/changecase/ToUpperCaseUnitTest.java index 1807f854b2..ab740f19b1 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/changecase/ToUpperCaseUnitTest.java +++ b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/changecase/ToUpperCaseUnitTest.java @@ -1,29 +1,29 @@ -package com.baeldung.string.changecase; - -import static org.junit.Assert.assertEquals; - -import java.util.Locale; - -import org.junit.Test; - -public class ToUpperCaseUnitTest { - - private static final Locale TURKISH = new Locale("tr"); - private String name = "John Doe"; - private String foreignLowercase = "\u0069"; - - @Test - public void givenMixedCaseString_WhenToUpperCase_ThenResultIsUpperCase() { - assertEquals("JOHN DOE", name.toUpperCase()); - } - - @Test - public void givenForeignString_WhenToUpperCaseWithoutLocale_ThenResultIsUpperCase() { - assertEquals("\u0049", foreignLowercase.toUpperCase()); - } - - @Test - public void givenForeignString_WhenToUpperCaseWithLocale_ThenResultIsUpperCase() { - assertEquals("\u0130", foreignLowercase.toUpperCase(TURKISH)); - } -} +package com.baeldung.changecase; + +import org.junit.Test; + +import java.util.Locale; + +import static org.junit.Assert.assertEquals; + +public class ToUpperCaseUnitTest { + + private static final Locale TURKISH = new Locale("tr"); + private String name = "John Doe"; + private String foreignLowercase = "\u0069"; + + @Test + public void givenMixedCaseString_WhenToUpperCase_ThenResultIsUpperCase() { + assertEquals("JOHN DOE", name.toUpperCase()); + } + + @Test + public void givenForeignString_WhenToUpperCaseWithoutLocale_ThenResultIsUpperCase() { + assertEquals("\u0049", foreignLowercase.toUpperCase()); + } + + @Test + public void givenForeignString_WhenToUpperCaseWithLocale_ThenResultIsUpperCase() { + assertEquals("\u0130", foreignLowercase.toUpperCase(TURKISH)); + } +} diff --git a/java-strings-2/src/test/java/com/baeldung/string/emptystrings/EmptyStringsUnitTest.java b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/emptystrings/EmptyStringsUnitTest.java similarity index 96% rename from java-strings-2/src/test/java/com/baeldung/string/emptystrings/EmptyStringsUnitTest.java rename to core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/emptystrings/EmptyStringsUnitTest.java index 96b1d681dd..d772c38341 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/emptystrings/EmptyStringsUnitTest.java +++ b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/emptystrings/EmptyStringsUnitTest.java @@ -1,21 +1,17 @@ -package com.baeldung.string.emptystrings; +package com.baeldung.emptystrings; -import static org.hamcrest.Matchers.iterableWithSize; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - -import java.util.Set; +import com.google.common.base.Strings; +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; import javax.validation.ConstraintViolation; import javax.validation.Validation; import javax.validation.Validator; import javax.validation.ValidatorFactory; +import java.util.Set; -import org.apache.commons.lang3.StringUtils; -import org.junit.Test; - -import com.google.common.base.Strings; +import static org.hamcrest.Matchers.iterableWithSize; +import static org.junit.Assert.*; public class EmptyStringsUnitTest { diff --git a/java-strings-3/src/test/java/com/baeldung/string/equalsIgnoreCase/StringEqualsIgnoreCaseUnitTest.java b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/equalsIgnoreCase/StringEqualsIgnoreCaseUnitTest.java similarity index 94% rename from java-strings-3/src/test/java/com/baeldung/string/equalsIgnoreCase/StringEqualsIgnoreCaseUnitTest.java rename to core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/equalsIgnoreCase/StringEqualsIgnoreCaseUnitTest.java index 5aab63db94..14fbf20c1d 100644 --- a/java-strings-3/src/test/java/com/baeldung/string/equalsIgnoreCase/StringEqualsIgnoreCaseUnitTest.java +++ b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/equalsIgnoreCase/StringEqualsIgnoreCaseUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string.equalsIgnoreCase; +package com.baeldung.equalsIgnoreCase; import org.apache.commons.lang3.StringUtils; import org.junit.Test; diff --git a/java-strings-2/src/test/java/com/baeldung/initialization/StringInitializationUnitTest.java b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/initialization/StringInitializationUnitTest.java similarity index 91% rename from java-strings-2/src/test/java/com/baeldung/initialization/StringInitializationUnitTest.java rename to core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/initialization/StringInitializationUnitTest.java index 50d9a2b058..02beaa690a 100644 --- a/java-strings-2/src/test/java/com/baeldung/initialization/StringInitializationUnitTest.java +++ b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/initialization/StringInitializationUnitTest.java @@ -1,11 +1,9 @@ package com.baeldung.initialization; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertFalse; - import org.junit.Test; +import static org.junit.Assert.*; + public class StringInitializationUnitTest { private String fieldString; diff --git a/java-strings-2/src/test/java/com/baeldung/StringConcatenationUnitTest.java b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/stringconcatenation/StringConcatenationUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/StringConcatenationUnitTest.java rename to core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/stringconcatenation/StringConcatenationUnitTest.java index c25d4ce8f9..9a444e8229 100644 --- a/java-strings-2/src/test/java/com/baeldung/StringConcatenationUnitTest.java +++ b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/stringconcatenation/StringConcatenationUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.stringconcatenation; import org.junit.Test; diff --git a/core-java-modules/core-java-string-operations/README.md b/core-java-modules/core-java-string-operations/README.md new file mode 100644 index 0000000000..18a2649a6a --- /dev/null +++ b/core-java-modules/core-java-string-operations/README.md @@ -0,0 +1,16 @@ +## Java String Operations + +This module contains articles about string operations. + +### Relevant Articles: +- [Comparing Strings in Java](https://www.baeldung.com/java-compare-strings) +- [Check If a String Is Numeric in Java](https://www.baeldung.com/java-check-string-number) +- [Get Substring from String in Java](https://www.baeldung.com/java-substring) +- [Split a String in Java](https://www.baeldung.com/java-split-string) +- [Common String Operations in Java](https://www.baeldung.com/java-string-operations) +- [Java toString() Method](https://www.baeldung.com/java-tostring) +- [String Operations with Java Streams](https://www.baeldung.com/java-stream-operations-on-strings) +- [Adding a Newline Character to a String in Java](https://www.baeldung.com/java-string-newline) +- [Check If a String Contains a Substring](https://www.baeldung.com/java-string-contains-substring) +- [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) +- More articles: [[next -->]](../core-java-string-operations-2) diff --git a/core-java-modules/core-java-string-operations/pom.xml b/core-java-modules/core-java-string-operations/pom.xml new file mode 100644 index 0000000000..fdddd99433 --- /dev/null +++ b/core-java-modules/core-java-string-operations/pom.xml @@ -0,0 +1,66 @@ + + 4.0.0 + core-java-string-operations + 0.1.0-SNAPSHOT + jar + core-java-string-operations + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + log4j + log4j + ${log4j.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + commons-codec + commons-codec + ${commons-codec.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-string-operations + + + src/main/resources + true + + + + + + 3.8.1 + 3.6.1 + 1.10 + + + diff --git a/java-strings/src/main/java/com/baeldung/stringisnumeric/Benchmarking.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/Benchmarking.java similarity index 85% rename from java-strings/src/main/java/com/baeldung/stringisnumeric/Benchmarking.java rename to core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/Benchmarking.java index 4ae1f5aa83..97e7a46757 100644 --- a/java-strings/src/main/java/com/baeldung/stringisnumeric/Benchmarking.java +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/Benchmarking.java @@ -1,4 +1,4 @@ -package com.baeldung.stringisnumeric; +package com.baeldung.isnumeric; import java.util.concurrent.TimeUnit; @@ -13,13 +13,11 @@ import org.openjdk.jmh.runner.RunnerException; import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; - public class Benchmarking { public static void main(String[] args) throws RunnerException { - Options opt = new OptionsBuilder() - .include(Benchmarking.class.getSimpleName()) - .forks(1) - .build(); + Options opt = new OptionsBuilder().include(Benchmarking.class.getSimpleName()) + .forks(1) + .build(); new Runner(opt).run(); } @@ -28,45 +26,45 @@ public class Benchmarking { public static class ExecutionPlan { public String number = Integer.toString(Integer.MAX_VALUE); public boolean isNumber = false; - public IsNumeric isNumeric= new IsNumeric(); + public IsNumeric isNumeric = new IsNumeric(); } - - @Benchmark + + @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void usingCoreJava(ExecutionPlan plan) { plan.isNumber = plan.isNumeric.usingCoreJava(plan.number); } - - @Benchmark + + @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void usingRegularExpressions(ExecutionPlan plan) { plan.isNumber = plan.isNumeric.usingRegularExpressions(plan.number); } - - @Benchmark + + @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void usingNumberUtils_isCreatable(ExecutionPlan plan) { plan.isNumber = plan.isNumeric.usingNumberUtils_isCreatable(plan.number); } - - @Benchmark + + @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void usingNumberUtils_isParsable(ExecutionPlan plan) { plan.isNumber = plan.isNumeric.usingNumberUtils_isParsable(plan.number); } - - @Benchmark + + @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void usingStringUtils_isNumeric(ExecutionPlan plan) { plan.isNumber = plan.isNumeric.usingStringUtils_isNumeric(plan.number); } - - @Benchmark + + @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void usingStringUtils_isNumericSpace(ExecutionPlan plan) { diff --git a/java-strings/src/main/java/com/baeldung/string/checkinputs/CheckIntegerInput.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/CheckIntegerInput.java similarity index 89% rename from java-strings/src/main/java/com/baeldung/string/checkinputs/CheckIntegerInput.java rename to core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/CheckIntegerInput.java index 9462244bbb..6c08615c74 100644 --- a/java-strings/src/main/java/com/baeldung/string/checkinputs/CheckIntegerInput.java +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/CheckIntegerInput.java @@ -1,14 +1,13 @@ -package com.baeldung.string.checkinputs; +package com.baeldung.isnumeric; import java.util.Scanner; public class CheckIntegerInput { public static void main(String[] args) { - try (Scanner scanner = new Scanner(System.in)) { System.out.println("Enter an integer : "); - + if (scanner.hasNextInt()) { System.out.println("You entered : " + scanner.nextInt()); } else { diff --git a/java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumeric.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/IsNumeric.java similarity index 88% rename from java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumeric.java rename to core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/IsNumeric.java index c438071e42..6eed0d777d 100644 --- a/java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumeric.java +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/IsNumeric.java @@ -1,4 +1,4 @@ -package com.baeldung.stringisnumeric; +package com.baeldung.isnumeric; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -6,29 +6,29 @@ import org.apache.commons.lang3.math.NumberUtils; public class IsNumeric { public boolean usingCoreJava(String strNum) { try { - double d = Double.parseDouble(strNum); + Double.parseDouble(strNum); } catch (NumberFormatException | NullPointerException nfe) { return false; } return true; } - + public boolean usingRegularExpressions(String strNum) { return strNum.matches("-?\\d+(\\.\\d+)?"); } - + public boolean usingNumberUtils_isCreatable(String strNum) { return NumberUtils.isCreatable(strNum); } - + public boolean usingNumberUtils_isParsable(String strNum) { return NumberUtils.isParsable(strNum); } - + public boolean usingStringUtils_isNumeric(String strNum) { return StringUtils.isNumeric(strNum); } - + public boolean usingStringUtils_isNumericSpace(String strNum) { return StringUtils.isNumericSpace(strNum); } diff --git a/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/IsNumericDriver.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/IsNumericDriver.java new file mode 100644 index 0000000000..a6c5449696 --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/isnumeric/IsNumericDriver.java @@ -0,0 +1,31 @@ +package com.baeldung.isnumeric; + +import org.apache.log4j.Logger; + +public class IsNumericDriver { + private static Logger LOG = Logger.getLogger(IsNumericDriver.class); + + private static IsNumeric isNumeric = new IsNumeric(); + + public static void main(String[] args) { + LOG.info("Testing all methods..."); + + boolean res = isNumeric.usingCoreJava("1001"); + LOG.info("Using Core Java : " + res); + + res = isNumeric.usingRegularExpressions("1001"); + LOG.info("Using Regular Expressions : " + res); + + res = isNumeric.usingNumberUtils_isCreatable("1001"); + LOG.info("Using NumberUtils.isCreatable : " + res); + + res = isNumeric.usingNumberUtils_isParsable("1001"); + LOG.info("Using NumberUtils.isParsable : " + res); + + res = isNumeric.usingStringUtils_isNumeric("1001"); + LOG.info("Using StringUtils.isNumeric : " + res); + + res = isNumeric.usingStringUtils_isNumericSpace("1001"); + LOG.info("Using StringUtils.isNumericSpace : " + res); + } +} diff --git a/java-strings/src/main/java/com/baeldung/string/newline/AddingNewLineToString.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/newline/AddingNewLineToString.java similarity index 98% rename from java-strings/src/main/java/com/baeldung/string/newline/AddingNewLineToString.java rename to core-java-modules/core-java-string-operations/src/main/java/com/baeldung/newline/AddingNewLineToString.java index 48b71eed12..f701ab2e45 100644 --- a/java-strings/src/main/java/com/baeldung/string/newline/AddingNewLineToString.java +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/newline/AddingNewLineToString.java @@ -1,4 +1,4 @@ -package com.baeldung.string.newline; +package com.baeldung.newline; public class AddingNewLineToString { diff --git a/java-strings/src/main/java/com/baeldung/string/JoinerSplitter.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/streamoperations/JoinerSplitter.java similarity index 96% rename from java-strings/src/main/java/com/baeldung/string/JoinerSplitter.java rename to core-java-modules/core-java-string-operations/src/main/java/com/baeldung/streamoperations/JoinerSplitter.java index cdbba1ef53..8a105188ad 100644 --- a/java-strings/src/main/java/com/baeldung/string/JoinerSplitter.java +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/streamoperations/JoinerSplitter.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.streamoperations; import java.util.Arrays; import java.util.List; diff --git a/java-strings-2/src/main/java/com/baeldung/string/search/performance/SubstringSearchPerformanceComparison.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/substringsearch/SubstringSearchPerformanceComparison.java similarity index 79% rename from java-strings-2/src/main/java/com/baeldung/string/search/performance/SubstringSearchPerformanceComparison.java rename to core-java-modules/core-java-string-operations/src/main/java/com/baeldung/substringsearch/SubstringSearchPerformanceComparison.java index bf33c47a7e..92aef0b879 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/search/performance/SubstringSearchPerformanceComparison.java +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/substringsearch/SubstringSearchPerformanceComparison.java @@ -1,18 +1,11 @@ -package com.baeldung.string.search.performance; +package com.baeldung.substringsearch; + +import org.apache.commons.lang3.StringUtils; +import org.openjdk.jmh.annotations.*; import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; -import org.apache.commons.lang3.StringUtils; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.OutputTimeUnit; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.Setup; -import org.openjdk.jmh.annotations.State; - /** * Based on https://github.com/tedyoung/indexof-contains-benchmark */ diff --git a/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/Customer.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/Customer.java new file mode 100644 index 0000000000..16e2b05a7c --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/Customer.java @@ -0,0 +1,22 @@ +package com.baeldung.tostring; + +public class Customer { + private String firstName; + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerArrayToString.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerArrayToString.java new file mode 100644 index 0000000000..c942f978da --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerArrayToString.java @@ -0,0 +1,20 @@ +package com.baeldung.tostring; + +import java.util.Arrays; + +public class CustomerArrayToString extends Customer { + private Order[] orders; + + public Order[] getOrders() { + return orders; + } + + public void setOrders(Order[] orders) { + this.orders = orders; + } + + @Override + public String toString() { + return "Customer [orders=" + Arrays.toString(orders) + ", getFirstName()=" + getFirstName() + ", getLastName()=" + getLastName() + "]"; + } +} diff --git a/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerComplexObjectToString.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerComplexObjectToString.java new file mode 100644 index 0000000000..3ca11779c4 --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerComplexObjectToString.java @@ -0,0 +1,18 @@ +package com.baeldung.tostring; + +public class CustomerComplexObjectToString extends Customer { + private Order order; + + public Order getOrder() { + return order; + } + + public void setOrder(Order order) { + this.order = order; + } + + @Override + public String toString() { + return "Customer [order=" + order + ", getFirstName()=" + getFirstName() + ", getLastName()=" + getLastName() + "]"; + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerPrimitiveToString.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerPrimitiveToString.java new file mode 100644 index 0000000000..38555aa236 --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerPrimitiveToString.java @@ -0,0 +1,18 @@ +package com.baeldung.tostring; + +public class CustomerPrimitiveToString extends Customer { + private long balance; + + public long getBalance() { + return balance; + } + + public void setBalance(long balance) { + this.balance = balance; + } + + @Override + public String toString() { + return "Customer [balance=" + balance + ", getFirstName()=" + getFirstName() + ", getLastName()=" + getLastName() + "]"; + } +} diff --git a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerReflectionToString.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerReflectionToString.java similarity index 85% rename from java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerReflectionToString.java rename to core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerReflectionToString.java index 2da1163c63..ad0c57351a 100644 --- a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerReflectionToString.java +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerReflectionToString.java @@ -1,39 +1,39 @@ -package com.baeldung.string.tostring; +package com.baeldung.tostring; import java.util.List; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -public class CustomerReflectionToString extends Customer{ +public class CustomerReflectionToString extends Customer { private Integer score; private List orders; private StringBuffer fullname; - + public Integer getScore() { return score; } - + public void setScore(Integer score) { this.score = score; } - + public List getOrders() { return orders; } - + public void setOrders(List orders) { this.orders = orders; } - + public StringBuffer getFullname() { return fullname; } - + public void setFullname(StringBuffer fullname) { this.fullname = fullname; } - + @Override public String toString() { return ReflectionToStringBuilder.toString(this); diff --git a/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerWrapperCollectionToString.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerWrapperCollectionToString.java new file mode 100644 index 0000000000..7b7d9e4e7d --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/CustomerWrapperCollectionToString.java @@ -0,0 +1,38 @@ +package com.baeldung.tostring; + +import java.util.List; + +public class CustomerWrapperCollectionToString extends Customer { + private Integer score; + private List orders; + private StringBuffer fullname; + + public Integer getScore() { + return score; + } + + public void setScore(Integer score) { + this.score = score; + } + + public List getOrders() { + return orders; + } + + public void setOrders(List orders) { + this.orders = orders; + } + + public StringBuffer getFullname() { + return fullname; + } + + public void setFullname(StringBuffer fullname) { + this.fullname = fullname; + } + + @Override + public String toString() { + return "Customer [score=" + score + ", orders=" + orders + ", fullname=" + fullname + ", getFirstName()=" + getFirstName() + ", getLastName()=" + getLastName() + "]"; + } +} diff --git a/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/Order.java b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/Order.java new file mode 100644 index 0000000000..85a5dd169f --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/main/java/com/baeldung/tostring/Order.java @@ -0,0 +1,47 @@ +package com.baeldung.tostring; + +public class Order { + + private String orderId; + private String desc; + private long value; + private String status; + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public long getValue() { + return value; + } + + public void setValue(long value) { + this.value = value; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public String toString() { + return "Order [orderId=" + orderId + ", desc=" + desc + ", value=" + value + "]"; + } + +} diff --git a/core-java-modules/core-java-string-operations/src/main/resources/log4j.properties b/core-java-modules/core-java-string-operations/src/main/resources/log4j.properties new file mode 100644 index 0000000000..2ea9fa9209 --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/main/resources/log4j.properties @@ -0,0 +1,8 @@ +# Root logger option +log4j.rootLogger=DEBUG, stdout + +# Redirect log messages to console +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n \ No newline at end of file diff --git a/java-strings-2/src/test/java/com/baeldung/base64encodinganddecoding/ApacheCommonsEncodeDecodeUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/base64encodinganddecoding/ApacheCommonsEncodeDecodeUnitTest.java similarity index 100% rename from java-strings-2/src/test/java/com/baeldung/base64encodinganddecoding/ApacheCommonsEncodeDecodeUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/base64encodinganddecoding/ApacheCommonsEncodeDecodeUnitTest.java diff --git a/java-strings-2/src/test/java/com/baeldung/base64encodinganddecoding/Java8EncodeDecodeUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/base64encodinganddecoding/Java8EncodeDecodeUnitTest.java similarity index 100% rename from java-strings-2/src/test/java/com/baeldung/base64encodinganddecoding/Java8EncodeDecodeUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/base64encodinganddecoding/Java8EncodeDecodeUnitTest.java diff --git a/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/base64encodinganddecoding/StringToByteArrayUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/base64encodinganddecoding/StringToByteArrayUnitTest.java new file mode 100644 index 0000000000..6f8a17e316 --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/base64encodinganddecoding/StringToByteArrayUnitTest.java @@ -0,0 +1,58 @@ +package com.baeldung.base64encodinganddecoding; + +import org.junit.Test; + +import javax.xml.bind.DatatypeConverter; +import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Base64; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class StringToByteArrayUnitTest { + + @Test + public void whenConvertStringToByteArrayUsingStringClass_thenOk() { + final String originalInput = "test input"; + byte[] result = originalInput.getBytes(); + System.out.println(Arrays.toString(result)); + + assertEquals(originalInput.length(), result.length); + } + + @Test + public void givenCharset_whenConvertStringToByteArrayUsingStringClass_thenOk() throws UnsupportedEncodingException { + final String originalInput = "test input"; + byte[] result = originalInput.getBytes(StandardCharsets.UTF_16); + System.out.println(Arrays.toString(result)); + + assertTrue(originalInput.length() < result.length); + } + + @Test + public void whenConvertStringToByteArrayUsingBase64Decoder_thenOk() { + final String originalInput = "dGVzdCBpbnB1dA=="; + byte[] result = Base64.getDecoder().decode(originalInput); + + assertEquals("test input", new String(result)); + } + + @Test + public void whenConvertStringToByteArrayUsingDatatypeConverter_thenOk() { + final String originalInput = "dGVzdCBpbnB1dA=="; + byte[] result = DatatypeConverter.parseBase64Binary(originalInput); + + assertEquals("test input", new String(result)); + } + + @Test + public void whenConvertStringToByteArray_thenOk(){ + String originalInput = "7465737420696E707574"; + byte[] result = DatatypeConverter.parseHexBinary(originalInput); + System.out.println(Arrays.toString(result)); + + assertEquals("test input", new String(result)); + } +} diff --git a/java-strings-ops/src/test/java/com/baeldung/stringisnumeric/CoreJavaIsNumericUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/CoreJavaIsNumericUnitTest.java similarity index 89% rename from java-strings-ops/src/test/java/com/baeldung/stringisnumeric/CoreJavaIsNumericUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/CoreJavaIsNumericUnitTest.java index 808d3c45b0..6c03b00e69 100644 --- a/java-strings-ops/src/test/java/com/baeldung/stringisnumeric/CoreJavaIsNumericUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/CoreJavaIsNumericUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stringisnumeric; +package com.baeldung.isnumeric; import static org.assertj.core.api.Assertions.assertThat; @@ -13,16 +13,16 @@ public class CoreJavaIsNumericUnitTest { } return true; } - + @Test public void whenUsingCoreJava_thenTrue() { // Valid Numbers assertThat(isNumeric("22")).isTrue(); assertThat(isNumeric("5.05")).isTrue(); - assertThat(isNumeric("-200")).isTrue(); + assertThat(isNumeric("-200")).isTrue(); assertThat(isNumeric("10.0d")).isTrue(); assertThat(isNumeric(" 22 ")).isTrue(); - + // Invalid Numbers assertThat(isNumeric(null)).isFalse(); assertThat(isNumeric("")).isFalse(); diff --git a/java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsCreatableUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/NumberUtilsIsCreatableUnitTest.java similarity index 95% rename from java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsCreatableUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/NumberUtilsIsCreatableUnitTest.java index 467d58837a..3b88721ad4 100644 --- a/java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsCreatableUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/NumberUtilsIsCreatableUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stringisnumeric; +package com.baeldung.isnumeric; import static org.assertj.core.api.Assertions.assertThat; @@ -17,7 +17,7 @@ public class NumberUtilsIsCreatableUnitTest { assertThat(NumberUtils.isCreatable("0xFF")).isTrue(); assertThat(NumberUtils.isCreatable("07")).isTrue(); assertThat(NumberUtils.isCreatable("2.99e+8")).isTrue(); - + // Invalid Numbers assertThat(NumberUtils.isCreatable(null)).isFalse(); assertThat(NumberUtils.isCreatable("")).isFalse(); diff --git a/java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsParsableUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/NumberUtilsIsParsableUnitTest.java similarity index 95% rename from java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsParsableUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/NumberUtilsIsParsableUnitTest.java index 141a761158..6b96a6efa1 100644 --- a/java-strings/src/test/java/com/baeldung/stringisnumeric/NumberUtilsIsParsableUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/NumberUtilsIsParsableUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stringisnumeric; +package com.baeldung.isnumeric; import static org.assertj.core.api.Assertions.assertThat; @@ -13,7 +13,7 @@ public class NumberUtilsIsParsableUnitTest { assertThat(NumberUtils.isParsable("-23")).isTrue(); assertThat(NumberUtils.isParsable("2.2")).isTrue(); assertThat(NumberUtils.isParsable("09")).isTrue(); - + // Invalid Numbers assertThat(NumberUtils.isParsable(null)).isFalse(); assertThat(NumberUtils.isParsable("")).isFalse(); diff --git a/java-strings/src/test/java/com/baeldung/stringisnumeric/RegularExpressionsUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/RegularExpressionsUnitTest.java similarity index 91% rename from java-strings/src/test/java/com/baeldung/stringisnumeric/RegularExpressionsUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/RegularExpressionsUnitTest.java index c3aa43ac94..04f3de8dc5 100644 --- a/java-strings/src/test/java/com/baeldung/stringisnumeric/RegularExpressionsUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/RegularExpressionsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.stringisnumeric; +package com.baeldung.isnumeric; import static org.assertj.core.api.Assertions.assertThat; @@ -8,14 +8,14 @@ public class RegularExpressionsUnitTest { public static boolean isNumeric(String strNum) { return strNum.matches("-?\\d+(\\.\\d+)?"); } - + @Test public void whenUsingRegularExpressions_thenTrue() { // Valid Numbers assertThat(isNumeric("22")).isTrue(); assertThat(isNumeric("5.05")).isTrue(); assertThat(isNumeric("-200")).isTrue(); - + // Invalid Numbers assertThat(isNumeric("abc")).isFalse(); } diff --git a/java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericSpaceUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/StringUtilsIsNumericSpaceUnitTest.java similarity index 94% rename from java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericSpaceUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/StringUtilsIsNumericSpaceUnitTest.java index 135780d9ad..0c5e52580f 100644 --- a/java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericSpaceUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/StringUtilsIsNumericSpaceUnitTest.java @@ -1,8 +1,9 @@ -package com.baeldung.stringisnumeric; +package com.baeldung.isnumeric; + +import static org.assertj.core.api.Assertions.assertThat; import org.apache.commons.lang3.StringUtils; import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; public class StringUtilsIsNumericSpaceUnitTest { @Test @@ -13,7 +14,7 @@ public class StringUtilsIsNumericSpaceUnitTest { assertThat(StringUtils.isNumericSpace("")).isTrue(); assertThat(StringUtils.isNumericSpace(" ")).isTrue(); assertThat(StringUtils.isNumericSpace("12 3")).isTrue(); - + // Invalid Numbers assertThat(StringUtils.isNumericSpace(null)).isFalse(); assertThat(StringUtils.isNumericSpace("ab2c")).isFalse(); diff --git a/java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/StringUtilsIsNumericUnitTest.java similarity index 95% rename from java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/StringUtilsIsNumericUnitTest.java index b667dda906..660426cdbb 100644 --- a/java-strings/src/test/java/com/baeldung/stringisnumeric/StringUtilsIsNumericUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/isnumeric/StringUtilsIsNumericUnitTest.java @@ -1,8 +1,9 @@ -package com.baeldung.stringisnumeric; +package com.baeldung.isnumeric; + +import static org.assertj.core.api.Assertions.assertThat; import org.apache.commons.lang3.StringUtils; import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; public class StringUtilsIsNumericUnitTest { @Test @@ -11,7 +12,7 @@ public class StringUtilsIsNumericUnitTest { assertThat(StringUtils.isNumeric("123")).isTrue(); assertThat(StringUtils.isNumeric("١٢٣")).isTrue(); assertThat(StringUtils.isNumeric("१२३")).isTrue(); - + // Invalid Numbers assertThat(StringUtils.isNumeric(null)).isFalse(); assertThat(StringUtils.isNumeric("")).isFalse(); diff --git a/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/split/SplitUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/split/SplitUnitTest.java new file mode 100644 index 0000000000..eaa61e5041 --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/split/SplitUnitTest.java @@ -0,0 +1,65 @@ +package com.baeldung.split; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.junit.jupiter.api.Test; + +import com.google.common.base.Splitter; + +public class SplitUnitTest { + + @Test + public void givenString_whenSplit_thenReturnsArray_through_JavaLangString() { + assertThat("peter,james,thomas".split(",")).containsExactly("peter", "james", "thomas"); + + assertThat("car jeep scooter".split(" ")).containsExactly("car", "jeep", "scooter"); + + assertThat("1-120-232323".split("-")).containsExactly("1", "120", "232323"); + + assertThat("192.168.1.178".split("\\.")).containsExactly("192", "168", "1", "178"); + + assertThat("b a, e, l.d u, n g".split("\\s+|,\\s*|\\.\\s*")).containsExactly("b", "a", "e", "l", "d", "u", "n", "g"); + } + + @Test + public void givenString_whenSplit_thenReturnsArray_through_StringUtils() { + StringUtils.split("car jeep scooter"); + + assertThat(StringUtils.split("car jeep scooter")).containsExactly("car", "jeep", "scooter"); + + assertThat(StringUtils.split("car jeep scooter")).containsExactly("car", "jeep", "scooter"); + + assertThat(StringUtils.split("car:jeep:scooter", ":")).containsExactly("car", "jeep", "scooter"); + + assertThat(StringUtils.split("car.jeep.scooter", ".")).containsExactly("car", "jeep", "scooter"); + } + + @Test + public void givenString_whenSplit_thenReturnsList_Splitter() { + // given + List resultList = Splitter.on(',') + .trimResults() + .omitEmptyStrings() + .splitToList("car,jeep,, scooter"); + + assertThat(resultList).containsExactly("car", "jeep", "scooter"); + } + + @Test + public void givenStringContainsSpaces_whenSplitAndTrim_thenReturnsArray_using_Regex() { + assertThat(" car , jeep, scooter ".trim() + .split("\\s*,\\s*")).containsExactly("car", "jeep", "scooter"); + + } + + @Test + public void givenStringContainsSpaces_whenSplitAndTrim_thenReturnsArray_using_java_8() { + assertThat(Arrays.stream(" car , jeep, scooter ".split(",")) + .map(String::trim) + .toArray(String[]::new)).containsExactly("car", "jeep", "scooter"); + } +} diff --git a/java-strings/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/streamoperations/JoinerSplitterUnitTest.java similarity index 98% rename from java-strings/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/streamoperations/JoinerSplitterUnitTest.java index a9488e27a4..2a0f03d3a8 100644 --- a/java-strings/src/test/java/com/baeldung/string/JoinerSplitterUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/streamoperations/JoinerSplitterUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.streamoperations; import org.junit.Test; diff --git a/java-strings-ops/src/test/java/com/baeldung/string/StringComparisonUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/stringcomparison/StringComparisonUnitTest.java similarity index 92% rename from java-strings-ops/src/test/java/com/baeldung/string/StringComparisonUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/stringcomparison/StringComparisonUnitTest.java index 539f66d9b4..0bab708fde 100644 --- a/java-strings-ops/src/test/java/com/baeldung/string/StringComparisonUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/stringcomparison/StringComparisonUnitTest.java @@ -1,16 +1,16 @@ -package com.baeldung.string; +package com.baeldung.stringcomparison; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Objects; import org.apache.commons.lang3.StringUtils; import org.junit.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; - public class StringComparisonUnitTest { @Test - public void whenUsingComparisonOperator_ThenComparingStrings(){ + public void whenUsingComparisonOperator_ThenComparingStrings() { String string1 = "using comparison operator"; String string2 = "using comparison operator"; @@ -21,7 +21,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingEqualsMethod_ThenComparingStrings(){ + public void whenUsingEqualsMethod_ThenComparingStrings() { String string1 = "using equals method"; String string2 = "using equals method"; @@ -37,7 +37,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingEqualsIgnoreCase_ThenComparingStrings(){ + public void whenUsingEqualsIgnoreCase_ThenComparingStrings() { String string1 = "using equals ignore case"; String string2 = "USING EQUALS IGNORE CASE"; @@ -46,7 +46,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingCompareTo_ThenComparingStrings(){ + public void whenUsingCompareTo_ThenComparingStrings() { String author = "author"; String book = "book"; @@ -58,7 +58,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingCompareToIgnoreCase_ThenComparingStrings(){ + public void whenUsingCompareToIgnoreCase_ThenComparingStrings() { String author = "Author"; String book = "book"; @@ -70,7 +70,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingObjectsEqualsMethod_ThenComparingStrings(){ + public void whenUsingObjectsEqualsMethod_ThenComparingStrings() { String string1 = "using objects equals"; String string2 = "using objects equals"; @@ -84,7 +84,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingEqualsOfApacheCommons_ThenComparingStrings(){ + public void whenUsingEqualsOfApacheCommons_ThenComparingStrings() { assertThat(StringUtils.equals(null, null)).isTrue(); assertThat(StringUtils.equals(null, "equals method")).isFalse(); @@ -93,7 +93,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingEqualsIgnoreCaseOfApacheCommons_ThenComparingStrings(){ + public void whenUsingEqualsIgnoreCaseOfApacheCommons_ThenComparingStrings() { assertThat(StringUtils.equalsIgnoreCase(null, null)).isTrue(); assertThat(StringUtils.equalsIgnoreCase(null, "equals method")).isFalse(); @@ -102,7 +102,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingEqualsAnyOf_ThenComparingStrings(){ + public void whenUsingEqualsAnyOf_ThenComparingStrings() { assertThat(StringUtils.equalsAny(null, null, null)).isTrue(); assertThat(StringUtils.equalsAny("equals any", "equals any", "any")).isTrue(); @@ -112,18 +112,17 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingEqualsAnyIgnoreCase_ThenComparingStrings(){ + public void whenUsingEqualsAnyIgnoreCase_ThenComparingStrings() { assertThat(StringUtils.equalsAnyIgnoreCase(null, null, null)).isTrue(); assertThat(StringUtils.equalsAnyIgnoreCase("equals any", "equals any", "any")).isTrue(); assertThat(StringUtils.equalsAnyIgnoreCase("equals any", null, "equals any")).isTrue(); assertThat(StringUtils.equalsAnyIgnoreCase(null, "equals", "any")).isFalse(); - assertThat(StringUtils.equalsAnyIgnoreCase( - "equals any ignore case", "EQUALS ANY IGNORE CASE", "any")).isTrue(); + assertThat(StringUtils.equalsAnyIgnoreCase("equals any ignore case", "EQUALS ANY IGNORE CASE", "any")).isTrue(); } @Test - public void whenUsingCompare_thenComparingStringsWithNulls(){ + public void whenUsingCompare_thenComparingStringsWithNulls() { assertThat(StringUtils.compare(null, null)).isEqualTo(0); assertThat(StringUtils.compare(null, "abc")).isEqualTo(-1); @@ -134,7 +133,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingCompareIgnoreCase_ThenComparingStringsWithNulls(){ + public void whenUsingCompareIgnoreCase_ThenComparingStringsWithNulls() { assertThat(StringUtils.compareIgnoreCase(null, null)).isEqualTo(0); assertThat(StringUtils.compareIgnoreCase(null, "abc")).isEqualTo(-1); @@ -145,7 +144,7 @@ public class StringComparisonUnitTest { } @Test - public void whenUsingCompareWithNullIsLessOption_ThenComparingStrings(){ + public void whenUsingCompareWithNullIsLessOption_ThenComparingStrings() { assertThat(StringUtils.compare(null, "abc", true)).isEqualTo(-1); assertThat(StringUtils.compare(null, "abc", false)).isEqualTo(1); diff --git a/java-strings-ops/src/test/java/com/baeldung/string/SubstringUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/substring/SubstringUnitTest.java similarity index 98% rename from java-strings-ops/src/test/java/com/baeldung/string/SubstringUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/substring/SubstringUnitTest.java index eb397f2a3f..00340ba7cc 100644 --- a/java-strings-ops/src/test/java/com/baeldung/string/SubstringUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/substring/SubstringUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.substring; import java.util.Scanner; import java.util.regex.Matcher; diff --git a/java-strings-2/src/test/java/com/baeldung/string/search/SubstringSearchUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/substringsearch/SubstringSearchUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/string/search/SubstringSearchUnitTest.java rename to core-java-modules/core-java-string-operations/src/test/java/com/baeldung/substringsearch/SubstringSearchUnitTest.java index 293e6d2125..c641ccbe07 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/search/SubstringSearchUnitTest.java +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/substringsearch/SubstringSearchUnitTest.java @@ -1,12 +1,12 @@ -package com.baeldung.string.search; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; +package com.baeldung.substringsearch; import org.apache.commons.lang3.StringUtils; import org.junit.Assert; import org.junit.Test; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * BAEL-2832: Different ways to check if a Substring could be found in a String. */ diff --git a/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerArrayToStringUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerArrayToStringUnitTest.java new file mode 100644 index 0000000000..a754ed3c68 --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerArrayToStringUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.tostring; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class CustomerArrayToStringUnitTest { + private static final String CUSTOMER_ARRAY_TO_STRING = "Customer [orders=[Order [orderId=A1111, desc=Game, value=0]], getFirstName()=Rajesh, getLastName()=Bhojwani]"; + + @Test + public void givenArray_whenToString_thenCustomerDetails() { + CustomerArrayToString customer = new CustomerArrayToString(); + customer.setFirstName("Rajesh"); + customer.setLastName("Bhojwani"); + Order[] orders = new Order[1]; + orders[0] = new Order(); + orders[0].setOrderId("A1111"); + orders[0].setDesc("Game"); + orders[0].setStatus("In-Shiping"); + customer.setOrders(orders); + + assertEquals(CUSTOMER_ARRAY_TO_STRING, customer.toString()); + } + +} diff --git a/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerComplexObjectToStringUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerComplexObjectToStringUnitTest.java new file mode 100644 index 0000000000..1b26d3e0a2 --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerComplexObjectToStringUnitTest.java @@ -0,0 +1,24 @@ +package com.baeldung.tostring; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class CustomerComplexObjectToStringUnitTest { + private static final String CUSTOMER_COMPLEX_TO_STRING = "Customer [order=Order [orderId=A1111, desc=Game, value=0], getFirstName()=Rajesh, getLastName()=Bhojwani]"; + + @Test + public void givenComplex_whenToString_thenCustomerDetails() { + CustomerComplexObjectToString customer = new CustomerComplexObjectToString(); + customer.setFirstName("Rajesh"); + customer.setLastName("Bhojwani"); + Order order = new Order(); + order.setOrderId("A1111"); + order.setDesc("Game"); + order.setStatus("In-Shiping"); + customer.setOrder(order); + + assertEquals(CUSTOMER_COMPLEX_TO_STRING, customer.toString()); + } + +} diff --git a/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerPrimitiveToStringUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerPrimitiveToStringUnitTest.java new file mode 100644 index 0000000000..a21ab1616f --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerPrimitiveToStringUnitTest.java @@ -0,0 +1,20 @@ +package com.baeldung.tostring; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class CustomerPrimitiveToStringUnitTest { + + private static final String CUSTOMER_PRIMITIVE_TO_STRING = "Customer [balance=110, getFirstName()=Rajesh, getLastName()=Bhojwani]"; + + @Test + public void givenPrimitive_whenToString_thenCustomerDetails() { + CustomerPrimitiveToString customer = new CustomerPrimitiveToString(); + customer.setFirstName("Rajesh"); + customer.setLastName("Bhojwani"); + customer.setBalance(110); + + assertEquals(CUSTOMER_PRIMITIVE_TO_STRING, customer.toString()); + } +} diff --git a/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerWrapperCollectionToStringUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerWrapperCollectionToStringUnitTest.java new file mode 100644 index 0000000000..da4937ccdd --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/tostring/CustomerWrapperCollectionToStringUnitTest.java @@ -0,0 +1,32 @@ +package com.baeldung.tostring; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.Test; + +public class CustomerWrapperCollectionToStringUnitTest { + private static final String CUSTOMER_WRAPPER_COLLECTION_TO_STRING = "Customer [score=8, orders=[Book, Pen], fullname=Bhojwani, Rajesh, getFirstName()=Rajesh, getLastName()=Bhojwani]"; + + @Test + public void givenWrapperCollectionStrBuffer_whenToString_thenCustomerDetails() { + CustomerWrapperCollectionToString customer = new CustomerWrapperCollectionToString(); + customer.setFirstName("Rajesh"); + customer.setLastName("Bhojwani"); + customer.setScore(8); + + List orders = new ArrayList(); + orders.add("Book"); + orders.add("Pen"); + customer.setOrders(orders); + + StringBuffer fullname = new StringBuffer(); + fullname.append(customer.getLastName() + ", " + customer.getFirstName()); + customer.setFullname(fullname); + + assertEquals(CUSTOMER_WRAPPER_COLLECTION_TO_STRING, customer.toString()); + } + +} diff --git a/core-java-modules/core-java-strings/README.md b/core-java-modules/core-java-strings/README.md new file mode 100644 index 0000000000..4a418db29f --- /dev/null +++ b/core-java-modules/core-java-strings/README.md @@ -0,0 +1,14 @@ +## Java Strings + +This module contains articles about strings in Java. + +### Relevant Articles: +- [Use char[] Array over a String for Manipulating Passwords in Java?](https://www.baeldung.com/java-storing-passwords) +- [Compact Strings in Java 9](https://www.baeldung.com/java-9-compact-string) +- [String Not Empty Test Assertions in Java](https://www.baeldung.com/java-assert-string-not-empty) +- [String Performance Hints](https://www.baeldung.com/java-string-performance) +- [Java Localization – Formatting Messages](https://www.baeldung.com/java-localization-messages-formatting) +- [Java – Generate Random String](https://www.baeldung.com/java-random-string) +- [Java String Interview Questions and Answers](https://www.baeldung.com/java-string-interview-questions) +- [Java Multi-line String](https://www.baeldung.com/java-multiline-string) +- [Guide to Java String Pool](https://www.baeldung.com/java-string-pool) diff --git a/core-java-modules/core-java-strings/pom.xml b/core-java-modules/core-java-strings/pom.xml new file mode 100644 index 0000000000..6a80886549 --- /dev/null +++ b/core-java-modules/core-java-strings/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + core-java-strings + 0.1.0-SNAPSHOT + jar + core-java-strings + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + com.ibm.icu + icu4j + ${icu4j.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-strings + + + src/main/resources + true + + + + + + 3.6.1 + 61.1 + + + diff --git a/java-strings/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java b/core-java-modules/core-java-strings/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java similarity index 97% rename from java-strings/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java rename to core-java-modules/core-java-strings/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java index cb24511f72..eae75eaa2b 100644 --- a/java-strings/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java +++ b/core-java-modules/core-java-strings/src/main/java/com/baeldung/java9/compactstring/CompactStringDemo.java @@ -1,9 +1,10 @@ package com.baeldung.java9.compactstring; import java.util.List; -import static java.util.stream.Collectors.toList; import java.util.stream.IntStream; +import static java.util.stream.Collectors.toList; + public class CompactStringDemo { public static void main(String[] args) { @@ -11,14 +12,14 @@ public class CompactStringDemo { List strings = IntStream.rangeClosed(1, 10_000_000) .mapToObj(Integer::toString).collect(toList()); long totalTime = System.currentTimeMillis() - startTime; - System.out.println("Generated " + strings.size() + " strings in " + System.out.println("Generated " + strings.size() + " strings in " + totalTime + " ms."); startTime = System.currentTimeMillis(); String appended = (String) strings.stream().limit(100_000) .reduce("", (left, right) -> left.toString() + right.toString()); totalTime = System.currentTimeMillis() - startTime; - System.out.println("Created string of length " + appended.length() + System.out.println("Created string of length " + appended.length() + " in " + totalTime + " ms."); } } diff --git a/java-strings-2/src/main/java/com/baeldung/localization/App.java b/core-java-modules/core-java-strings/src/main/java/com/baeldung/localization/App.java similarity index 100% rename from java-strings-2/src/main/java/com/baeldung/localization/App.java rename to core-java-modules/core-java-strings/src/main/java/com/baeldung/localization/App.java diff --git a/java-strings-2/src/main/java/com/baeldung/localization/ICUFormat.java b/core-java-modules/core-java-strings/src/main/java/com/baeldung/localization/ICUFormat.java similarity index 100% rename from java-strings-2/src/main/java/com/baeldung/localization/ICUFormat.java rename to core-java-modules/core-java-strings/src/main/java/com/baeldung/localization/ICUFormat.java index f7bc357933..c82af30c87 100644 --- a/java-strings-2/src/main/java/com/baeldung/localization/ICUFormat.java +++ b/core-java-modules/core-java-strings/src/main/java/com/baeldung/localization/ICUFormat.java @@ -1,11 +1,11 @@ package com.baeldung.localization; +import com.ibm.icu.text.MessageFormat; + import java.util.List; import java.util.Locale; import java.util.ResourceBundle; -import com.ibm.icu.text.MessageFormat; - public class ICUFormat { public static String getLabel(Locale locale, Object[] data) { diff --git a/java-strings-2/src/main/java/com/baeldung/localization/JavaSEFormat.java b/core-java-modules/core-java-strings/src/main/java/com/baeldung/localization/JavaSEFormat.java similarity index 100% rename from java-strings-2/src/main/java/com/baeldung/localization/JavaSEFormat.java rename to core-java-modules/core-java-strings/src/main/java/com/baeldung/localization/JavaSEFormat.java diff --git a/java-strings-2/src/main/java/com/baeldung/localization/Localization.java b/core-java-modules/core-java-strings/src/main/java/com/baeldung/localization/Localization.java similarity index 100% rename from java-strings-2/src/main/java/com/baeldung/localization/Localization.java rename to core-java-modules/core-java-strings/src/main/java/com/baeldung/localization/Localization.java diff --git a/java-strings-2/src/main/java/com/baeldung/string/multiline/MultiLineString.java b/core-java-modules/core-java-strings/src/main/java/com/baeldung/multiline/MultiLineString.java similarity index 98% rename from java-strings-2/src/main/java/com/baeldung/string/multiline/MultiLineString.java rename to core-java-modules/core-java-strings/src/main/java/com/baeldung/multiline/MultiLineString.java index 1bde2dcb63..987bc751cd 100644 --- a/java-strings-2/src/main/java/com/baeldung/string/multiline/MultiLineString.java +++ b/core-java-modules/core-java-strings/src/main/java/com/baeldung/multiline/MultiLineString.java @@ -1,4 +1,7 @@ -package com.baeldung.string.multiline; +package com.baeldung.multiline; + +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableList; import java.io.IOException; import java.io.PrintWriter; @@ -6,9 +9,6 @@ import java.io.StringWriter; import java.nio.file.Files; import java.nio.file.Paths; -import com.google.common.base.Joiner; -import com.google.common.collect.ImmutableList; - public class MultiLineString { String newLine = System.getProperty("line.separator"); diff --git a/java-strings/src/main/java/com/baeldung/string/StringPerformance.java b/core-java-modules/core-java-strings/src/main/java/com/baeldung/stringperformance/StringPerformance.java similarity index 99% rename from java-strings/src/main/java/com/baeldung/string/StringPerformance.java rename to core-java-modules/core-java-strings/src/main/java/com/baeldung/stringperformance/StringPerformance.java index 3b0c32991c..8e9d3afdde 100644 --- a/java-strings/src/main/java/com/baeldung/string/StringPerformance.java +++ b/core-java-modules/core-java-strings/src/main/java/com/baeldung/stringperformance/StringPerformance.java @@ -1,4 +1,4 @@ -package com.baeldung.string; +package com.baeldung.stringperformance; import com.google.common.base.Splitter; import org.apache.commons.lang3.StringUtils; diff --git a/java-strings-2/src/main/resources/formats_en.properties b/core-java-modules/core-java-strings/src/main/resources/formats_en.properties similarity index 100% rename from java-strings-2/src/main/resources/formats_en.properties rename to core-java-modules/core-java-strings/src/main/resources/formats_en.properties diff --git a/java-strings-2/src/main/resources/formats_fr.properties b/core-java-modules/core-java-strings/src/main/resources/formats_fr.properties similarity index 100% rename from java-strings-2/src/main/resources/formats_fr.properties rename to core-java-modules/core-java-strings/src/main/resources/formats_fr.properties diff --git a/java-strings-2/src/main/resources/formats_it.properties b/core-java-modules/core-java-strings/src/main/resources/formats_it.properties similarity index 100% rename from java-strings-2/src/main/resources/formats_it.properties rename to core-java-modules/core-java-strings/src/main/resources/formats_it.properties diff --git a/java-strings-2/src/main/resources/formats_pl.properties b/core-java-modules/core-java-strings/src/main/resources/formats_pl.properties similarity index 100% rename from java-strings-2/src/main/resources/formats_pl.properties rename to core-java-modules/core-java-strings/src/main/resources/formats_pl.properties diff --git a/rxjava-2/src/main/resources/logback.xml b/core-java-modules/core-java-strings/src/main/resources/logback.xml similarity index 100% rename from rxjava-2/src/main/resources/logback.xml rename to core-java-modules/core-java-strings/src/main/resources/logback.xml diff --git a/java-strings-2/src/main/resources/messages_en.properties b/core-java-modules/core-java-strings/src/main/resources/messages_en.properties similarity index 100% rename from java-strings-2/src/main/resources/messages_en.properties rename to core-java-modules/core-java-strings/src/main/resources/messages_en.properties diff --git a/java-strings-2/src/main/resources/messages_fr.properties b/core-java-modules/core-java-strings/src/main/resources/messages_fr.properties similarity index 100% rename from java-strings-2/src/main/resources/messages_fr.properties rename to core-java-modules/core-java-strings/src/main/resources/messages_fr.properties diff --git a/java-strings-2/src/main/resources/messages_it.properties b/core-java-modules/core-java-strings/src/main/resources/messages_it.properties similarity index 100% rename from java-strings-2/src/main/resources/messages_it.properties rename to core-java-modules/core-java-strings/src/main/resources/messages_it.properties diff --git a/java-strings-2/src/main/resources/messages_pl.properties b/core-java-modules/core-java-strings/src/main/resources/messages_pl.properties similarity index 100% rename from java-strings-2/src/main/resources/messages_pl.properties rename to core-java-modules/core-java-strings/src/main/resources/messages_pl.properties diff --git a/java-strings-2/src/main/resources/stephenking.txt b/core-java-modules/core-java-strings/src/main/resources/stephenking.txt similarity index 100% rename from java-strings-2/src/main/resources/stephenking.txt rename to core-java-modules/core-java-strings/src/main/resources/stephenking.txt diff --git a/java-strings/src/test/java/com/baeldung/chararraypassword/PasswordStoreExamplesUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/chararraypassword/PasswordStoreExamplesUnitTest.java similarity index 100% rename from java-strings/src/test/java/com/baeldung/chararraypassword/PasswordStoreExamplesUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/chararraypassword/PasswordStoreExamplesUnitTest.java diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/LocaleUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/LocaleUnitTest.java similarity index 93% rename from java-strings-2/src/test/java/com/baeldung/string/interview/LocaleUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/LocaleUnitTest.java index 1d221056fd..5655d2536d 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/LocaleUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/LocaleUnitTest.java @@ -1,11 +1,12 @@ -package com.baeldung.string.interview; +package com.baeldung.interview; + +import org.junit.Test; import java.math.BigDecimal; import java.text.NumberFormat; import java.util.Locale; -import static org.junit.Assert.assertEquals; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class LocaleUnitTest { @Test diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringAnagramUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringAnagramUnitTest.java similarity index 94% rename from java-strings-2/src/test/java/com/baeldung/string/interview/StringAnagramUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringAnagramUnitTest.java index aadfade737..8f3bacc267 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringAnagramUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringAnagramUnitTest.java @@ -1,10 +1,10 @@ -package com.baeldung.string.interview; +package com.baeldung.interview; -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; import java.util.Arrays; -import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; public class StringAnagramUnitTest { public boolean isAnagram(String s1, String s2) { diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringChangeCaseUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringChangeCaseUnitTest.java similarity index 92% rename from java-strings-2/src/test/java/com/baeldung/string/interview/StringChangeCaseUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringChangeCaseUnitTest.java index 2c7ec500fe..4c3815a2e4 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringChangeCaseUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringChangeCaseUnitTest.java @@ -1,9 +1,9 @@ -package com.baeldung.string.interview; - -import static org.junit.Assert.assertEquals; +package com.baeldung.interview; import org.junit.Test; +import static org.junit.Assert.assertEquals; + public class StringChangeCaseUnitTest { @Test public void givenString_whenChangingToUppercase_thenCaseChanged() { diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringCountOccurrencesUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringCountOccurrencesUnitTest.java similarity index 94% rename from java-strings-2/src/test/java/com/baeldung/string/interview/StringCountOccurrencesUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringCountOccurrencesUnitTest.java index 6c17643ac8..cb92c06d32 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringCountOccurrencesUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringCountOccurrencesUnitTest.java @@ -1,9 +1,9 @@ -package com.baeldung.string.interview; - -import static org.junit.Assert.assertEquals; +package com.baeldung.interview; import org.junit.Test; +import static org.junit.Assert.assertEquals; + public class StringCountOccurrencesUnitTest { public int countOccurrences(String s, char c) { int count = 0; diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringFormatUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringFormatUnitTest.java similarity index 90% rename from java-strings-2/src/test/java/com/baeldung/string/interview/StringFormatUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringFormatUnitTest.java index 787017791c..8492db0dc0 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringFormatUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringFormatUnitTest.java @@ -1,9 +1,9 @@ -package com.baeldung.string.interview; - -import static org.junit.Assert.assertEquals; +package com.baeldung.interview; import org.junit.Test; +import static org.junit.Assert.assertEquals; + public class StringFormatUnitTest { @Test public void givenString_whenUsingStringFormat_thenStringFormatted() { diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringInternUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringInternUnitTest.java similarity index 91% rename from java-strings-2/src/test/java/com/baeldung/string/interview/StringInternUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringInternUnitTest.java index c5bffb7573..3092a72399 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringInternUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringInternUnitTest.java @@ -1,9 +1,9 @@ -package com.baeldung.string.interview; - -import static org.assertj.core.api.Assertions.assertThat; +package com.baeldung.interview; import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; + public class StringInternUnitTest { @Test public void whenCallingStringIntern_thenStringsInterned() { diff --git a/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringJoinerUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringJoinerUnitTest.java new file mode 100644 index 0000000000..b5556f588c --- /dev/null +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringJoinerUnitTest.java @@ -0,0 +1,19 @@ +package com.baeldung.interview; + +import org.junit.Test; + +import java.util.StringJoiner; + +import static org.junit.Assert.assertEquals; + +public class StringJoinerUnitTest { + @Test + public void whenUsingStringJoiner_thenStringsJoined() { + StringJoiner joiner = new StringJoiner(",", "[", "]"); + joiner.add("Red") + .add("Green") + .add("Blue"); + + assertEquals(joiner.toString(), "[Red,Green,Blue]"); + } +} diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringPalindromeUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringPalindromeUnitTest.java similarity index 95% rename from java-strings-2/src/test/java/com/baeldung/string/interview/StringPalindromeUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringPalindromeUnitTest.java index 79ed14cd99..760939932a 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringPalindromeUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringPalindromeUnitTest.java @@ -1,9 +1,9 @@ -package com.baeldung.string.interview; - -import static org.assertj.core.api.Assertions.assertThat; +package com.baeldung.interview; import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; + public class StringPalindromeUnitTest { public boolean isPalindrome(String text) { diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringReverseUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringReverseUnitTest.java similarity index 88% rename from java-strings-2/src/test/java/com/baeldung/string/interview/StringReverseUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringReverseUnitTest.java index bb9b45dc97..484a6d0d68 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringReverseUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringReverseUnitTest.java @@ -1,9 +1,9 @@ -package com.baeldung.string.interview; - -import static org.junit.Assert.assertEquals; +package com.baeldung.interview; import org.junit.Test; +import static org.junit.Assert.assertEquals; + public class StringReverseUnitTest { @Test public void whenUsingInbuildMethods_thenStringReversed() { diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringSplitUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringSplitUnitTest.java similarity index 95% rename from java-strings-2/src/test/java/com/baeldung/string/interview/StringSplitUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringSplitUnitTest.java index e1cea62462..5aff593e3e 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringSplitUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringSplitUnitTest.java @@ -1,7 +1,8 @@ -package com.baeldung.string.interview; +package com.baeldung.interview; import org.apache.commons.lang3.StringUtils; import org.junit.Test; + import static org.junit.Assert.assertArrayEquals; public class StringSplitUnitTest { diff --git a/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringToByteArrayUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringToByteArrayUnitTest.java new file mode 100644 index 0000000000..90c5ca25c2 --- /dev/null +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringToByteArrayUnitTest.java @@ -0,0 +1,24 @@ +package com.baeldung.interview; + +import org.junit.Test; + +import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; + +import static org.junit.Assert.assertArrayEquals; + +public class StringToByteArrayUnitTest { + @Test + public void whenGetBytes_thenCorrect() throws UnsupportedEncodingException { + byte[] byteArray1 = "abcd".getBytes(); + byte[] byteArray2 = "efgh".getBytes(StandardCharsets.US_ASCII); + byte[] byteArray3 = "ijkl".getBytes("UTF-8"); + byte[] expected1 = new byte[] { 97, 98, 99, 100 }; + byte[] expected2 = new byte[] { 101, 102, 103, 104 }; + byte[] expected3 = new byte[] { 105, 106, 107, 108 }; + + assertArrayEquals(expected1, byteArray1); + assertArrayEquals(expected2, byteArray2); + assertArrayEquals(expected3, byteArray3); + } +} diff --git a/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringToCharArrayUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringToCharArrayUnitTest.java new file mode 100644 index 0000000000..5ebd7448f1 --- /dev/null +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringToCharArrayUnitTest.java @@ -0,0 +1,17 @@ +package com.baeldung.interview; + +import org.junit.Test; + +import java.util.Arrays; + +import static org.junit.Assert.assertEquals; + +public class StringToCharArrayUnitTest { + @Test + public void whenConvertingStringToCharArray_thenConversionSuccessful() { + String beforeConvStr = "hello"; + char[] afterConvCharArr = { 'h', 'e', 'l', 'l', 'o' }; + + assertEquals(Arrays.equals(beforeConvStr.toCharArray(), afterConvCharArr), true); + } +} diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringToIntegerUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringToIntegerUnitTest.java similarity index 89% rename from java-strings-2/src/test/java/com/baeldung/string/interview/StringToIntegerUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringToIntegerUnitTest.java index a905438a84..24a715dc75 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringToIntegerUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/interview/StringToIntegerUnitTest.java @@ -1,6 +1,7 @@ -package com.baeldung.string.interview; +package com.baeldung.interview; import org.junit.Test; + import static org.assertj.core.api.Assertions.assertThat; public class StringToIntegerUnitTest { diff --git a/java-strings-2/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java similarity index 98% rename from java-strings-2/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java index 2c8f9b47f3..3c5c5fcb55 100644 --- a/java-strings-2/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java @@ -1,12 +1,10 @@ package com.baeldung.localization; -import static org.junit.Assert.assertEquals; - -import java.util.Locale; - import org.junit.Test; -import com.baeldung.localization.ICUFormat; +import java.util.Locale; + +import static org.junit.Assert.assertEquals; public class ICUFormatUnitTest { diff --git a/java-strings-2/src/test/java/com/baeldung/string/multiline/MultiLineStringUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/multiline/MultiLineStringUnitTest.java similarity index 85% rename from java-strings-2/src/test/java/com/baeldung/string/multiline/MultiLineStringUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/multiline/MultiLineStringUnitTest.java index 3ebee9b5d1..04d318c71b 100644 --- a/java-strings-2/src/test/java/com/baeldung/string/multiline/MultiLineStringUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/multiline/MultiLineStringUnitTest.java @@ -1,11 +1,10 @@ -package com.baeldung.string.multiline; +package com.baeldung.multiline; import org.junit.Test; -import static org.junit.Assert.assertEquals; import java.io.IOException; -import com.baeldung.string.multiline.MultiLineString; +import static org.junit.Assert.assertEquals; public class MultiLineStringUnitTest { diff --git a/core-java-modules/core-java-strings/src/test/java/com/baeldung/randomstrings/RandomStringsUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/randomstrings/RandomStringsUnitTest.java new file mode 100644 index 0000000000..2806635d03 --- /dev/null +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/randomstrings/RandomStringsUnitTest.java @@ -0,0 +1,72 @@ +package com.baeldung.randomstrings; + +import org.apache.commons.lang3.RandomStringUtils; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.Charset; +import java.util.Random; + +public class RandomStringsUnitTest { + + private static final Logger LOG = LoggerFactory.getLogger(RandomStringsUnitTest.class); + + @Test + public void givenUsingPlainJava_whenGeneratingRandomStringUnbounded_thenCorrect() { + final byte[] array = new byte[7]; // length is bounded by 7 + new Random().nextBytes(array); + final String generatedString = new String(array, Charset.forName("UTF-8")); + + LOG.debug(generatedString); + } + + @Test + public void givenUsingPlainJava_whenGeneratingRandomStringBounded_thenCorrect() { + final int leftLimit = 97; // letter 'a' + final int rightLimit = 122; // letter 'z' + final int targetStringLength = 10; + final Random random = new Random(); + final StringBuilder buffer = new StringBuilder(targetStringLength); + + for (int i = 0; i < targetStringLength; i++) { + final int randomLimitedInt = leftLimit + (int) (random.nextFloat() * (rightLimit - leftLimit + 1)); + buffer.append((char) randomLimitedInt); + } + final String generatedString = buffer.toString(); + + LOG.debug(generatedString); + } + + @Test + public void givenUsingApache_whenGeneratingRandomString_thenCorrect() { + final String generatedString = RandomStringUtils.random(10); + + LOG.debug(generatedString); + } + + @Test + public void givenUsingApache_whenGeneratingRandomAlphabeticString_thenCorrect() { + final String generatedString = RandomStringUtils.randomAlphabetic(10); + + LOG.debug(generatedString); + } + + @Test + public void givenUsingApache_whenGeneratingRandomAlphanumericString_thenCorrect() { + final String generatedString = RandomStringUtils.randomAlphanumeric(10); + + LOG.debug(generatedString); + } + + @Test + public void givenUsingApache_whenGeneratingRandomStringBounded_thenCorrect() { + final int length = 10; + final boolean useLetters = true; + final boolean useNumbers = false; + final String generatedString = RandomStringUtils.random(length, useLetters, useNumbers); + + LOG.debug(generatedString); + } + +} diff --git a/core-java-modules/core-java-strings/src/test/java/com/baeldung/stringnotempty/StringNotEmptyUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/stringnotempty/StringNotEmptyUnitTest.java new file mode 100644 index 0000000000..482105cc40 --- /dev/null +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/stringnotempty/StringNotEmptyUnitTest.java @@ -0,0 +1,46 @@ +package com.baeldung.stringnotempty; + +import com.google.common.base.Strings; +import org.apache.commons.lang3.StringUtils; +import org.assertj.core.api.Assertions; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.text.IsEmptyString.isEmptyOrNullString; +import static org.hamcrest.text.IsEmptyString.isEmptyString; +import static org.junit.Assert.*; + +public class StringNotEmptyUnitTest { + + private String text = "baeldung"; + + @Test + public void givenAString_whenCheckedForEmptyUsingJunit_shouldAssertSuccessfully() { + assertTrue(!text.isEmpty()); + assertFalse(text.isEmpty()); + assertNotEquals("", text); + assertNotSame("", text); + } + + @Test + public void givenAString_whenCheckedForEmptyUsingHamcrest_shouldAssertSuccessfully() { + assertThat(text, not(isEmptyString())); + assertThat(text, not(isEmptyOrNullString())); + } + + @Test + public void givenAString_whenCheckedForEmptyUsingCommonsLang_shouldAssertSuccessfully() { + assertTrue(StringUtils.isNotBlank(text)); + } + + @Test + public void givenAString_whenCheckedForEmptyUsingAssertJ_shouldAssertSuccessfully() { + Assertions.assertThat(text).isNotEmpty(); + } + + @Test + public void givenAString_whenCheckedForEmptyUsingGuava_shouldAssertSuccessfully() { + assertFalse(Strings.isNullOrEmpty(text)); + } + +} diff --git a/java-strings-ops/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java similarity index 95% rename from java-strings-ops/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java rename to core-java-modules/core-java-strings/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java index 4bbf63f87e..ca56d5aab5 100644 --- a/java-strings-ops/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java +++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/stringpool/StringPoolUnitTest.java @@ -1,7 +1,8 @@ package com.baeldung.stringpool; +import static org.assertj.core.api.Assertions.assertThat; + import org.junit.Test; -import static org.assertj.core.api.Assertions.*; public class StringPoolUnitTest { diff --git a/core-java-modules/core-java-sun/README.md b/core-java-modules/core-java-sun/README.md index e2dba76b41..107035cbe8 100644 --- a/core-java-modules/core-java-sun/README.md +++ b/core-java-modules/core-java-sun/README.md @@ -1,7 +1,8 @@ -========= +## Core Java Sun -## Core Java Cookbooks and Examples +This module contains articles about the sun package ### Relevant Articles: + - [Creating a Java Compiler Plugin](http://www.baeldung.com/java-build-compiler-plugin) - [Guide to sun.misc.Unsafe](http://www.baeldung.com/java-unsafe) \ No newline at end of file diff --git a/core-java-modules/core-java-sun/pom.xml b/core-java-modules/core-java-sun/pom.xml index ab5f945114..7774d1f9b3 100644 --- a/core-java-modules/core-java-sun/pom.xml +++ b/core-java-modules/core-java-sun/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-sun 0.1.0-SNAPSHOT core-java-sun @@ -15,76 +14,6 @@ - - - net.sourceforge.collections - collections-generic - ${collections-generic.version} - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - - - commons-io - commons-io - ${commons-io.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.apache.commons - commons-math3 - ${commons-math3.version} - - - org.decimal4j - decimal4j - ${decimal4j.version} - - - org.bouncycastle - bcprov-jdk15on - ${bouncycastle.version} - - - org.unix4j - unix4j-command - ${unix4j.version} - - - com.googlecode.grep4j - grep4j - ${grep4j.version} - - - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - - log4j - log4j - ${log4j.version} - - - org.slf4j - log4j-over-slf4j - ${org.slf4j.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - org.assertj @@ -92,62 +21,6 @@ ${assertj.version} test - - com.jayway.awaitility - awaitility - ${avaitility.version} - test - - - commons-codec - commons-codec - ${commons-codec.version} - - - org.javamoney - moneta - ${moneta.version} - - - org.owasp.esapi - esapi - ${esapi.version} - - - com.sun.messaging.mq - fscontext - ${fscontext.version} - - - com.codepoetics - protonpack - ${protonpack.version} - - - one.util - streamex - ${streamex.version} - - - io.vavr - vavr - ${vavr.version} - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator.version} - - - org.springframework - spring-web - ${spring-web.version} - com.sun tools @@ -204,32 +77,6 @@ integration - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - json - - - org.codehaus.mojo exec-maven-plugin @@ -261,29 +108,11 @@ - - - 23.0 - 1.55 - 1.10 - 3.6.1 - 1.0.3 - 4.1 - 4.01 - 0.4 - 1.8.7 - 4.6-b01 - 1.13 - 0.6.5 - 0.9.0 - 4.3.4.RELEASE - 3.6.1 1.7.0 - 2.21.0 1.8.0 3.0.2 diff --git a/core-java-modules/core-java-text/README.md b/core-java-modules/core-java-text/README.md new file mode 100644 index 0000000000..5a6db4e8fd --- /dev/null +++ b/core-java-modules/core-java-text/README.md @@ -0,0 +1,6 @@ +========= + +## Core Java 8 Cookbooks and Examples + +### Relevant Articles: +- [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance) \ No newline at end of file diff --git a/core-java-modules/core-java-text/pom.xml b/core-java-modules/core-java-text/pom.xml new file mode 100644 index 0000000000..43b0df6309 --- /dev/null +++ b/core-java-modules/core-java-text/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + core-java-text + 0.1.0-SNAPSHOT + core-java-text + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + core-java-text + + + src/main/resources + true + + + + + diff --git a/rxjava/src/main/resources/logback.xml b/core-java-modules/core-java-text/src/main/resources/logback.xml similarity index 100% rename from rxjava/src/main/resources/logback.xml rename to core-java-modules/core-java-text/src/main/resources/logback.xml diff --git a/core-java-modules/core-java-time-measurements/README.md b/core-java-modules/core-java-time-measurements/README.md new file mode 100644 index 0000000000..1bd277b6b1 --- /dev/null +++ b/core-java-modules/core-java-time-measurements/README.md @@ -0,0 +1,8 @@ +## Java Time Measurements + +This module contains articles about the measurement of time in Java. + +### Relevant Articles: +- [Guide to the Java Clock Class](http://www.baeldung.com/java-clock) +- [Measure Elapsed Time in Java](http://www.baeldung.com/java-measure-elapsed-time) +- [Overriding System Time for Testing in Java](https://www.baeldung.com/java-override-system-time) diff --git a/core-java-modules/core-java-time-measurements/pom.xml b/core-java-modules/core-java-time-measurements/pom.xml new file mode 100644 index 0000000000..0ff3787051 --- /dev/null +++ b/core-java-modules/core-java-time-measurements/pom.xml @@ -0,0 +1,102 @@ + + 4.0.0 + com.baeldung.exception.numberformat + core-java-time-measurements + 0.0.1-SNAPSHOT + jar + core-java-time-measurements + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + org.assertj + assertj-core + ${assertj.version} + test + + + joda-time + joda-time + ${joda.version} + + + org.aspectj + aspectjrt + ${asspectj.version} + + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + org.powermock + powermock-api-mockito2 + ${powermock.version} + test + + + org.jmockit + jmockit + ${jmockit.version} + test + + + + + core-java-time-measurements + + + src/main/resources + true + + + + + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar + + true + + + + + + + + 3.6.1 + 2.10 + + 3.6.1 + 1.8.9 + 2.0.0-RC.4 + 1.44 + + 2.22.1 + + diff --git a/spring-boot-angular-ecommerce/src/main/resources/logback.xml b/core-java-modules/core-java-time-measurements/src/main/resources/logback.xml similarity index 100% rename from spring-boot-angular-ecommerce/src/main/resources/logback.xml rename to core-java-modules/core-java-time-measurements/src/main/resources/logback.xml diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/java/clock/ClockUnitTest.java b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/java/clock/ClockUnitTest.java similarity index 100% rename from core-java-modules/core-java/src/test/java/com/baeldung/java/clock/ClockUnitTest.java rename to core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/java/clock/ClockUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/time/ElapsedTimeUnitTest.java b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/ElapsedTimeUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/time/ElapsedTimeUnitTest.java rename to core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/ElapsedTimeUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/time/InstantUnitTest.java b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/InstantUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/time/InstantUnitTest.java rename to core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/InstantUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/time/InstantWithJMockUnitTest.java b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/InstantWithJMockUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/time/InstantWithJMockUnitTest.java rename to core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/InstantWithJMockUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java rename to core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/time/LocalDateTimeWithJMockUnitTest.java b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/LocalDateTimeWithJMockUnitTest.java similarity index 100% rename from core-java-modules/core-java-8/src/test/java/com/baeldung/time/LocalDateTimeWithJMockUnitTest.java rename to core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/LocalDateTimeWithJMockUnitTest.java diff --git a/core-java-modules/core-java/README.md b/core-java-modules/core-java/README.md index 436a481803..dd5e7dc14e 100644 --- a/core-java-modules/core-java/README.md +++ b/core-java-modules/core-java/README.md @@ -1,19 +1,12 @@ -========= - ## Core Java Cookbooks and Examples ### Relevant Articles: - [Java Timer](http://www.baeldung.com/java-timer-and-timertask) -- [How to Run a Shell Command in Java](http://www.baeldung.com/run-shell-command-in-java) -- [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) - [A Guide To Java Regular Expressions API](http://www.baeldung.com/regular-expressions-java) - [Getting Started with Java Properties](http://www.baeldung.com/java-properties) -- [Pattern Search with Grep in Java](http://www.baeldung.com/grep-in-java) -- [How to Create an Executable JAR with Maven](http://www.baeldung.com/executable-jar-with-maven) - [Introduction to Nashorn](http://www.baeldung.com/java-nashorn) - [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency) - [JVM Log Forging](http://www.baeldung.com/jvm-log-forging) -- [How to Add a Single Element to a Stream](http://www.baeldung.com/java-stream-append-prepend) - [How to Find all Getters Returning Null](http://www.baeldung.com/java-getters-returning-null) - [How to Get a Name of a Method Being Executed?](http://www.baeldung.com/java-name-of-executing-method) - [Introduction to Java Serialization](http://www.baeldung.com/java-serialization) @@ -24,31 +17,22 @@ - [Compiling Java *.class Files with javac](http://www.baeldung.com/javac) - [Introduction to Javadoc](http://www.baeldung.com/javadoc) - [Guide to the Externalizable Interface in Java](http://www.baeldung.com/java-externalizable) -- [How to Detect the OS Using Java](http://www.baeldung.com/java-detect-os) - [ASCII Art in Java](http://www.baeldung.com/ascii-art-in-java) - [What is the serialVersionUID?](http://www.baeldung.com/java-serial-version-uid) - [A Guide to the ResourceBundle](http://www.baeldung.com/java-resourcebundle) -- [Class Loaders in Java](http://www.baeldung.com/java-classloaders) -- [Guide to the Java Clock Class](http://www.baeldung.com/java-clock) -- [Importance of Main Manifest Attribute in a Self-Executing JAR](http://www.baeldung.com/java-jar-executable-manifest-main-class) - [Java Global Exception Handler](http://www.baeldung.com/java-global-exception-handler) - [How to Get the Size of an Object in Java](http://www.baeldung.com/java-size-of-object) -- [Guide to Java Instrumentation](http://www.baeldung.com/java-instrumentation) - [Common Java Exceptions](http://www.baeldung.com/java-common-exceptions) - [Throw Exception in Optional in Java 8](https://www.baeldung.com/java-optional-throw-exception) - [Merging java.util.Properties Objects](https://www.baeldung.com/java-merging-properties) - [Java – Try with Resources](https://www.baeldung.com/java-try-with-resources) -- [Abstract Classes in Java](https://www.baeldung.com/java-abstract-class) - [Guide to Character Encoding](https://www.baeldung.com/java-char-encoding) - [Graphs in Java](https://www.baeldung.com/java-graphs) -- [Console I/O in Java](http://www.baeldung.com/java-console-input-output) +- [Read and Write User Input in Java](http://www.baeldung.com/java-console-input-output) - [Formatting with printf() in Java](https://www.baeldung.com/java-printstream-printf) - [Retrieve Fields from a Java Class Using Reflection](https://www.baeldung.com/java-reflection-class-fields) -- [Introduction to Basic Syntax in Java](https://www.baeldung.com/java-syntax) - [Using Curl in Java](https://www.baeldung.com/java-curl) - [Finding Leap Years in Java](https://www.baeldung.com/java-leap-year) -- [Java Bitwise Operators](https://www.baeldung.com/java-bitwise-operators) -- [Guide to Creating and Running a Jar File in Java](https://www.baeldung.com/java-create-jar) - [Making a JSON POST Request With HttpURLConnection](https://www.baeldung.com/httpurlconnection-post) - [How to Find an Exception’s Root Cause in Java](https://www.baeldung.com/java-exception-root-cause) - [Convert Hex to ASCII in Java](https://www.baeldung.com/java-convert-hex-to-ascii) diff --git a/core-java-modules/core-java/pom.xml b/core-java-modules/core-java/pom.xml index 2a2cb3a6af..9d4bee081e 100644 --- a/core-java-modules/core-java/pom.xml +++ b/core-java-modules/core-java/pom.xml @@ -14,16 +14,6 @@ - - commons-io - commons-io - ${commons-io.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - org.unix4j unix4j-command @@ -41,11 +31,6 @@ jackson-databind ${jackson.version} - - com.google.code.gson - gson - ${gson.version} - log4j @@ -75,59 +60,6 @@ moneta ${javamoney.moneta.version} - - org.owasp.esapi - esapi - ${esapi.version} - - - com.sun.messaging.mq - fscontext - ${fscontext.version} - - - com.codepoetics - protonpack - ${protonpack.version} - - - one.util - streamex - ${streamex.version} - - - io.vavr - vavr - ${vavr.version} - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator-annprocess.version} - - - com.h2database - h2 - ${h2.version} - - - - org.javassist - javassist - ${javaassist.version} - - - com.sun - tools - ${sun.tools.version} - system - ${java.home}/../lib/tools.jar - @@ -448,41 +380,21 @@ - - - 2.8.2 - - 3.6.1 - 1.0.3 0.4 1.8.7 - 4.6-b01 - 1.13 - 0.6.5 - 0.9.0 - + 3.10.0 - 2.21.0 - 1.1 - 2.1.0.1 - 1.19 - - 1.19 + 3.0.0-M1 3.0.2 1.4.4 3.1.1 2.0.3.RELEASE 1.6.0 - 61.1 - - 3.21.0-GA - - 1.8.0 diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/encoding/CharacterEncodingExamples.java b/core-java-modules/core-java/src/main/java/com/baeldung/encoding/CharacterEncodingExamples.java index bdd92e37f6..1ed5f9e62a 100644 --- a/core-java-modules/core-java/src/main/java/com/baeldung/encoding/CharacterEncodingExamples.java +++ b/core-java-modules/core-java/src/main/java/com/baeldung/encoding/CharacterEncodingExamples.java @@ -1,10 +1,15 @@ package com.baeldung.encoding; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CodingErrorAction; public class CharacterEncodingExamples { @@ -29,4 +34,12 @@ public class CharacterEncodingExamples { } return buffer.toString(); } + + static String decodeText(String input, Charset charset, CodingErrorAction codingErrorAction) throws IOException { + CharsetDecoder charsetDecoder = charset.newDecoder(); + charsetDecoder.onMalformedInput(codingErrorAction); + return new BufferedReader( + new InputStreamReader( + new ByteArrayInputStream(input.getBytes()), charsetDecoder)).readLine(); + } } diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/BufferedReaderExample.java b/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/BufferedReaderExample.java deleted file mode 100644 index 45ff486a79..0000000000 --- a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/BufferedReaderExample.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.fileparser; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; -import java.util.ArrayList; - -public class BufferedReaderExample { - - protected static ArrayList generateArrayListFromFile(String filename) throws IOException { - - ArrayList result = new ArrayList<>(); - - try (BufferedReader br = new BufferedReader(new FileReader(filename))) { - - while (br.ready()) { - result.add(br.readLine()); - } - return result; - } - - } - -} diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/FileReaderExample.java b/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/FileReaderExample.java deleted file mode 100644 index f9dd2a9ec5..0000000000 --- a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/FileReaderExample.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.baeldung.fileparser; - -import java.io.FileReader; -import java.io.IOException; -import java.util.ArrayList; - -public class FileReaderExample { - - protected static ArrayList generateArrayListFromFile(String filename) throws IOException { - - ArrayList result = new ArrayList<>(); - - try (FileReader f = new FileReader(filename)) { - StringBuffer sb = new StringBuffer(); - while (f.ready()) { - char c = (char) f.read(); - if (c == '\n') { - result.add(sb.toString()); - sb = new StringBuffer(); - } else { - sb.append(c); - } - } - if (sb.length() > 0) { - result.add(sb.toString()); - } - } - - return result; - } -} diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/FilesReadLinesExample.java b/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/FilesReadLinesExample.java deleted file mode 100644 index 8e74f7d386..0000000000 --- a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/FilesReadLinesExample.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.fileparser; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; - -public class FilesReadLinesExample { - - protected static ArrayList generateArrayListFromFile(String filename) throws IOException { - - List result = Files.readAllLines(Paths.get(filename)); - - return (ArrayList) result; - } - -} diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/ScannerIntExample.java b/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/ScannerIntExample.java deleted file mode 100644 index 25d17af4ea..0000000000 --- a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/ScannerIntExample.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.fileparser; - -import java.io.FileReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Scanner; - -public class ScannerIntExample { - - protected static ArrayList generateArrayListFromFile(String filename) throws IOException { - - ArrayList result = new ArrayList<>(); - - try (Scanner s = new Scanner(new FileReader(filename))) { - - while (s.hasNext()) { - result.add(s.nextInt()); - } - return result; - } - - } - -} diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/ScannerStringExample.java b/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/ScannerStringExample.java deleted file mode 100644 index ec213c9490..0000000000 --- a/core-java-modules/core-java/src/main/java/com/baeldung/fileparser/ScannerStringExample.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.fileparser; - -import java.io.FileReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Scanner; - -public class ScannerStringExample { - - protected static ArrayList generateArrayListFromFile(String filename) throws IOException { - - ArrayList result = new ArrayList<>(); - - try (Scanner s = new Scanner(new FileReader(filename))) { - - while (s.hasNext()) { - result.add(s.nextLine()); - } - return result; - } - - } - -} diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/printscreen/README.md b/core-java-modules/core-java/src/main/java/com/baeldung/printscreen/README.md deleted file mode 100644 index 7b3b40c102..0000000000 --- a/core-java-modules/core-java/src/main/java/com/baeldung/printscreen/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [How to Print Screen in Java](http://www.baeldung.com/print-screen-in-java) diff --git a/core-java-modules/core-java/src/main/resources/ESAPI.properties b/core-java-modules/core-java/src/main/resources/ESAPI.properties deleted file mode 100644 index 24dcaa9dfa..0000000000 --- a/core-java-modules/core-java/src/main/resources/ESAPI.properties +++ /dev/null @@ -1,453 +0,0 @@ -# -# OWASP Enterprise Security API (ESAPI) Properties file -- PRODUCTION Version -# -# This file is part of the Open Web Application Security Project (OWASP) -# Enterprise Security API (ESAPI) project. For details, please see -# http://www.owasp.org/index.php/ESAPI. -# -# Copyright (c) 2008,2009 - The OWASP Foundation -# -# DISCUSS: This may cause a major backwards compatibility issue, etc. but -# from a name space perspective, we probably should have prefaced -# all the property names with ESAPI or at least OWASP. Otherwise -# there could be problems is someone loads this properties file into -# the System properties. We could also put this file into the -# esapi.jar file (perhaps as a ResourceBundle) and then allow an external -# ESAPI properties be defined that would overwrite these defaults. -# That keeps the application's properties relatively simple as usually -# they will only want to override a few properties. If looks like we -# already support multiple override levels of this in the -# DefaultSecurityConfiguration class, but I'm suggesting placing the -# defaults in the esapi.jar itself. That way, if the jar is signed, -# we could detect if those properties had been tampered with. (The -# code to check the jar signatures is pretty simple... maybe 70-90 LOC, -# but off course there is an execution penalty (similar to the way -# that the separate sunjce.jar used to be when a class from it was -# first loaded). Thoughts? -############################################################################### -# -# WARNING: Operating system protection should be used to lock down the .esapi -# resources directory and all the files inside and all the directories all the -# way up to the root directory of the file system. Note that if you are using -# file-based implementations, that some files may need to be read-write as they -# get updated dynamically. -# -# Before using, be sure to update the MasterKey and MasterSalt as described below. -# N.B.: If you had stored data that you have previously encrypted with ESAPI 1.4, -# you *must* FIRST decrypt it using ESAPI 1.4 and then (if so desired) -# re-encrypt it with ESAPI 2.0. If you fail to do this, you will NOT be -# able to decrypt your data with ESAPI 2.0. -# -# YOU HAVE BEEN WARNED!!! More details are in the ESAPI 2.0 Release Notes. -# -#=========================================================================== -# ESAPI Configuration -# -# If true, then print all the ESAPI properties set here when they are loaded. -# If false, they are not printed. Useful to reduce output when running JUnit tests. -# If you need to troubleshoot a properties related problem, turning this on may help. -# This is 'false' in the src/test/resources/.esapi version. It is 'true' by -# default for reasons of backward compatibility with earlier ESAPI versions. -ESAPI.printProperties=true - -# ESAPI is designed to be easily extensible. You can use the reference implementation -# or implement your own providers to take advantage of your enterprise's security -# infrastructure. The functions in ESAPI are referenced using the ESAPI locator, like: -# -# String ciphertext = -# ESAPI.encryptor().encrypt("Secret message"); // Deprecated in 2.0 -# CipherText cipherText = -# ESAPI.encryptor().encrypt(new PlainText("Secret message")); // Preferred -# -# Below you can specify the classname for the provider that you wish to use in your -# application. The only requirement is that it implement the appropriate ESAPI interface. -# This allows you to switch security implementations in the future without rewriting the -# entire application. -# -# ExperimentalAccessController requires ESAPI-AccessControlPolicy.xml in .esapi directory -ESAPI.AccessControl=org.owasp.esapi.reference.DefaultAccessController -# FileBasedAuthenticator requires users.txt file in .esapi directory -ESAPI.Authenticator=org.owasp.esapi.reference.FileBasedAuthenticator -ESAPI.Encoder=org.owasp.esapi.reference.DefaultEncoder -ESAPI.Encryptor=org.owasp.esapi.reference.crypto.JavaEncryptor - -ESAPI.Executor=org.owasp.esapi.reference.DefaultExecutor -ESAPI.HTTPUtilities=org.owasp.esapi.reference.DefaultHTTPUtilities -ESAPI.IntrusionDetector=org.owasp.esapi.reference.DefaultIntrusionDetector -# Log4JFactory Requires log4j.xml or log4j.properties in classpath - http://www.laliluna.de/log4j-tutorial.html -ESAPI.Logger=org.owasp.esapi.reference.Log4JLogFactory -#ESAPI.Logger=org.owasp.esapi.reference.JavaLogFactory -ESAPI.Randomizer=org.owasp.esapi.reference.DefaultRandomizer -ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator - -#=========================================================================== -# ESAPI Authenticator -# -Authenticator.AllowedLoginAttempts=3 -Authenticator.MaxOldPasswordHashes=13 -Authenticator.UsernameParameterName=username -Authenticator.PasswordParameterName=password -# RememberTokenDuration (in days) -Authenticator.RememberTokenDuration=14 -# Session Timeouts (in minutes) -Authenticator.IdleTimeoutDuration=20 -Authenticator.AbsoluteTimeoutDuration=120 - -#=========================================================================== -# ESAPI Encoder -# -# ESAPI canonicalizes input before validation to prevent bypassing filters with encoded attacks. -# Failure to canonicalize input is a very common mistake when implementing validation schemes. -# Canonicalization is automatic when using the ESAPI Validator, but you can also use the -# following code to canonicalize data. -# -# ESAPI.Encoder().canonicalize( "%22hello world"" ); -# -# Multiple encoding is when a single encoding format is applied multiple times. Allowing -# multiple encoding is strongly discouraged. -Encoder.AllowMultipleEncoding=false - -# Mixed encoding is when multiple different encoding formats are applied, or when -# multiple formats are nested. Allowing multiple encoding is strongly discouraged. -Encoder.AllowMixedEncoding=false - -# The default list of codecs to apply when canonicalizing untrusted data. The list should include the codecs -# for all downstream interpreters or decoders. For example, if the data is likely to end up in a URL, HTML, or -# inside JavaScript, then the list of codecs below is appropriate. The order of the list is not terribly important. -Encoder.DefaultCodecList=HTMLEntityCodec,PercentCodec,JavaScriptCodec - - -#=========================================================================== -# ESAPI Encryption -# -# The ESAPI Encryptor provides basic cryptographic functions with a simplified API. -# To get started, generate a new key using java -classpath esapi.jar org.owasp.esapi.reference.crypto.JavaEncryptor -# There is not currently any support for key rotation, so be careful when changing your key and salt as it -# will invalidate all signed, encrypted, and hashed data. -# -# WARNING: Not all combinations of algorithms and key lengths are supported. -# If you choose to use a key length greater than 128, you MUST download the -# unlimited strength policy files and install in the lib directory of your JRE/JDK. -# See http://java.sun.com/javase/downloads/index.jsp for more information. -# -# Backward compatibility with ESAPI Java 1.4 is supported by the two deprecated API -# methods, Encryptor.encrypt(String) and Encryptor.decrypt(String). However, whenever -# possible, these methods should be avoided as they use ECB cipher mode, which in almost -# all circumstances a poor choice because of it's weakness. CBC cipher mode is the default -# for the new Encryptor encrypt / decrypt methods for ESAPI Java 2.0. In general, you -# should only use this compatibility setting if you have persistent data encrypted with -# version 1.4 and even then, you should ONLY set this compatibility mode UNTIL -# you have decrypted all of your old encrypted data and then re-encrypted it with -# ESAPI 2.0 using CBC mode. If you have some reason to mix the deprecated 1.4 mode -# with the new 2.0 methods, make sure that you use the same cipher algorithm for both -# (256-bit AES was the default for 1.4; 128-bit is the default for 2.0; see below for -# more details.) Otherwise, you will have to use the new 2.0 encrypt / decrypt methods -# where you can specify a SecretKey. (Note that if you are using the 256-bit AES, -# that requires downloading the special jurisdiction policy files mentioned above.) -# -# ***** IMPORTANT: Do NOT forget to replace these with your own values! ***** -# To calculate these values, you can run: -# java -classpath esapi.jar org.owasp.esapi.reference.crypto.JavaEncryptor -# -Encryptor.MasterKey=tzfztf56ftv -Encryptor.MasterSalt=123456ztrewq - -# Provides the default JCE provider that ESAPI will "prefer" for its symmetric -# encryption and hashing. (That is it will look to this provider first, but it -# will defer to other providers if the requested algorithm is not implemented -# by this provider.) If left unset, ESAPI will just use your Java VM's current -# preferred JCE provider, which is generally set in the file -# "$JAVA_HOME/jre/lib/security/java.security". -# -# The main intent of this is to allow ESAPI symmetric encryption to be -# used with a FIPS 140-2 compliant crypto-module. For details, see the section -# "Using ESAPI Symmetric Encryption with FIPS 140-2 Cryptographic Modules" in -# the ESAPI 2.0 Symmetric Encryption User Guide, at: -# http://owasp-esapi-java.googlecode.com/svn/trunk/documentation/esapi4java-core-2.0-symmetric-crypto-user-guide.html -# However, this property also allows you to easily use an alternate JCE provider -# such as "Bouncy Castle" without having to make changes to "java.security". -# See Javadoc for SecurityProviderLoader for further details. If you wish to use -# a provider that is not known to SecurityProviderLoader, you may specify the -# fully-qualified class name of the JCE provider class that implements -# java.security.Provider. If the name contains a '.', this is interpreted as -# a fully-qualified class name that implements java.security.Provider. -# -# NOTE: Setting this property has the side-effect of changing it in your application -# as well, so if you are using JCE in your application directly rather than -# through ESAPI (you wouldn't do that, would you? ;-), it will change the -# preferred JCE provider there as well. -# -# Default: Keeps the JCE provider set to whatever JVM sets it to. -Encryptor.PreferredJCEProvider= - -# AES is the most widely used and strongest encryption algorithm. This -# should agree with your Encryptor.CipherTransformation property. -# By default, ESAPI Java 1.4 uses "PBEWithMD5AndDES" and which is -# very weak. It is essentially a password-based encryption key, hashed -# with MD5 around 1K times and then encrypted with the weak DES algorithm -# (56-bits) using ECB mode and an unspecified padding (it is -# JCE provider specific, but most likely "NoPadding"). However, 2.0 uses -# "AES/CBC/PKCSPadding". If you want to change these, change them here. -# Warning: This property does not control the default reference implementation for -# ESAPI 2.0 using JavaEncryptor. Also, this property will be dropped -# in the future. -# @deprecated -Encryptor.EncryptionAlgorithm=AES -# For ESAPI Java 2.0 - New encrypt / decrypt methods use this. -Encryptor.CipherTransformation=AES/CBC/PKCS5Padding - -# Applies to ESAPI 2.0 and later only! -# Comma-separated list of cipher modes that provide *BOTH* -# confidentiality *AND* message authenticity. (NIST refers to such cipher -# modes as "combined modes" so that's what we shall call them.) If any of these -# cipher modes are used then no MAC is calculated and stored -# in the CipherText upon encryption. Likewise, if one of these -# cipher modes is used with decryption, no attempt will be made -# to validate the MAC contained in the CipherText object regardless -# of whether it contains one or not. Since the expectation is that -# these cipher modes support support message authenticity already, -# injecting a MAC in the CipherText object would be at best redundant. -# -# Note that as of JDK 1.5, the SunJCE provider does not support *any* -# of these cipher modes. Of these listed, only GCM and CCM are currently -# NIST approved. YMMV for other JCE providers. E.g., Bouncy Castle supports -# GCM and CCM with "NoPadding" mode, but not with "PKCS5Padding" or other -# padding modes. -Encryptor.cipher_modes.combined_modes=GCM,CCM,IAPM,EAX,OCB,CWC - -# Applies to ESAPI 2.0 and later only! -# Additional cipher modes allowed for ESAPI 2.0 encryption. These -# cipher modes are in _addition_ to those specified by the property -# 'Encryptor.cipher_modes.combined_modes'. -# Note: We will add support for streaming modes like CFB & OFB once -# we add support for 'specified' to the property 'Encryptor.ChooseIVMethod' -# (probably in ESAPI 2.1). -# DISCUSS: Better name? -Encryptor.cipher_modes.additional_allowed=CBC - -# 128-bit is almost always sufficient and appears to be more resistant to -# related key attacks than is 256-bit AES. Use '_' to use default key size -# for cipher algorithms (where it makes sense because the algorithm supports -# a variable key size). Key length must agree to what's provided as the -# cipher transformation, otherwise this will be ignored after logging a -# warning. -# -# NOTE: This is what applies BOTH ESAPI 1.4 and 2.0. See warning above about mixing! -Encryptor.EncryptionKeyLength=128 - -# Because 2.0 uses CBC mode by default, it requires an initialization vector (IV). -# (All cipher modes except ECB require an IV.) There are two choices: we can either -# use a fixed IV known to both parties or allow ESAPI to choose a random IV. While -# the IV does not need to be hidden from adversaries, it is important that the -# adversary not be allowed to choose it. Also, random IVs are generally much more -# secure than fixed IVs. (In fact, it is essential that feed-back cipher modes -# such as CFB and OFB use a different IV for each encryption with a given key so -# in such cases, random IVs are much preferred. By default, ESAPI 2.0 uses random -# IVs. If you wish to use 'fixed' IVs, set 'Encryptor.ChooseIVMethod=fixed' and -# uncomment the Encryptor.fixedIV. -# -# Valid values: random|fixed|specified 'specified' not yet implemented; planned for 2.1 -Encryptor.ChooseIVMethod=random -# If you choose to use a fixed IV, then you must place a fixed IV here that -# is known to all others who are sharing your secret key. The format should -# be a hex string that is the same length as the cipher block size for the -# cipher algorithm that you are using. The following is an *example* for AES -# from an AES test vector for AES-128/CBC as described in: -# NIST Special Publication 800-38A (2001 Edition) -# "Recommendation for Block Cipher Modes of Operation". -# (Note that the block size for AES is 16 bytes == 128 bits.) -# -Encryptor.fixedIV=0x000102030405060708090a0b0c0d0e0f - -# Whether or not CipherText should use a message authentication code (MAC) with it. -# This prevents an adversary from altering the IV as well as allowing a more -# fool-proof way of determining the decryption failed because of an incorrect -# key being supplied. This refers to the "separate" MAC calculated and stored -# in CipherText, not part of any MAC that is calculated as a result of a -# "combined mode" cipher mode. -# -# If you are using ESAPI with a FIPS 140-2 cryptographic module, you *must* also -# set this property to false. -Encryptor.CipherText.useMAC=true - -# Whether or not the PlainText object may be overwritten and then marked -# eligible for garbage collection. If not set, this is still treated as 'true'. -Encryptor.PlainText.overwrite=true - -# Do not use DES except in a legacy situations. 56-bit is way too small key size. -#Encryptor.EncryptionKeyLength=56 -#Encryptor.EncryptionAlgorithm=DES - -# TripleDES is considered strong enough for most purposes. -# Note: There is also a 112-bit version of DESede. Using the 168-bit version -# requires downloading the special jurisdiction policy from Sun. -#Encryptor.EncryptionKeyLength=168 -#Encryptor.EncryptionAlgorithm=DESede - -Encryptor.HashAlgorithm=SHA-512 -Encryptor.HashIterations=1024 -Encryptor.DigitalSignatureAlgorithm=SHA1withDSA -Encryptor.DigitalSignatureKeyLength=1024 -Encryptor.RandomAlgorithm=SHA1PRNG -Encryptor.CharacterEncoding=UTF-8 - -# This is the Pseudo Random Function (PRF) that ESAPI's Key Derivation Function -# (KDF) normally uses. Note this is *only* the PRF used for ESAPI's KDF and -# *not* what is used for ESAPI's MAC. (Currently, HmacSHA1 is always used for -# the MAC, mostly to keep the overall size at a minimum.) -# -# Currently supported choices for JDK 1.5 and 1.6 are: -# HmacSHA1 (160 bits), HmacSHA256 (256 bits), HmacSHA384 (384 bits), and -# HmacSHA512 (512 bits). -# Note that HmacMD5 is *not* supported for the PRF used by the KDF even though -# the JDKs support it. See the ESAPI 2.0 Symmetric Encryption User Guide -# further details. -Encryptor.KDF.PRF=HmacSHA256 -#=========================================================================== -# ESAPI HttpUtilties -# -# The HttpUtilities provide basic protections to HTTP requests and responses. Primarily these methods -# protect against malicious data from attackers, such as unprintable characters, escaped characters, -# and other simple attacks. The HttpUtilities also provides utility methods for dealing with cookies, -# headers, and CSRF tokens. -# -# Default file upload location (remember to escape backslashes with \\) -HttpUtilities.UploadDir=C:\\ESAPI\\testUpload -HttpUtilities.UploadTempDir=C:\\temp -# Force flags on cookies, if you use HttpUtilities to set cookies -HttpUtilities.ForceHttpOnlySession=false -HttpUtilities.ForceSecureSession=false -HttpUtilities.ForceHttpOnlyCookies=true -HttpUtilities.ForceSecureCookies=true -# Maximum size of HTTP headers -HttpUtilities.MaxHeaderSize=4096 -# File upload configuration -HttpUtilities.ApprovedUploadExtensions=.zip,.pdf,.doc,.docx,.ppt,.pptx,.tar,.gz,.tgz,.rar,.war,.jar,.ear,.xls,.rtf,.properties,.java,.class,.txt,.xml,.jsp,.jsf,.exe,.dll -HttpUtilities.MaxUploadFileBytes=500000000 -# Using UTF-8 throughout your stack is highly recommended. That includes your database driver, -# container, and any other technologies you may be using. Failure to do this may expose you -# to Unicode transcoding injection attacks. Use of UTF-8 does not hinder internationalization. -HttpUtilities.ResponseContentType=text/html; charset=UTF-8 -# This is the name of the cookie used to represent the HTTP session -# Typically this will be the default "JSESSIONID" -HttpUtilities.HttpSessionIdName=JSESSIONID - - - -#=========================================================================== -# ESAPI Executor -# CHECKME - Not sure what this is used for, but surely it should be made OS independent. -Executor.WorkingDirectory=C:\\Windows\\Temp -Executor.ApprovedExecutables=C:\\Windows\\System32\\cmd.exe,C:\\Windows\\System32\\runas.exe - - -#=========================================================================== -# ESAPI Logging -# Set the application name if these logs are combined with other applications -Logger.ApplicationName=ExampleApplication -# If you use an HTML log viewer that does not properly HTML escape log data, you can set LogEncodingRequired to true -Logger.LogEncodingRequired=false -# Determines whether ESAPI should log the application name. This might be clutter in some single-server/single-app environments. -Logger.LogApplicationName=true -# Determines whether ESAPI should log the server IP and port. This might be clutter in some single-server environments. -Logger.LogServerIP=true -# LogFileName, the name of the logging file. Provide a full directory path (e.g., C:\\ESAPI\\ESAPI_logging_file) if you -# want to place it in a specific directory. -Logger.LogFileName=ESAPI_logging_file -# MaxLogFileSize, the max size (in bytes) of a single log file before it cuts over to a new one (default is 10,000,000) -Logger.MaxLogFileSize=10000000 - - -#=========================================================================== -# ESAPI Intrusion Detection -# -# Each event has a base to which .count, .interval, and .action are added -# The IntrusionException will fire if we receive "count" events within "interval" seconds -# The IntrusionDetector is configurable to take the following actions: log, logout, and disable -# (multiple actions separated by commas are allowed e.g. event.test.actions=log,disable -# -# Custom Events -# Names must start with "event." as the base -# Use IntrusionDetector.addEvent( "test" ) in your code to trigger "event.test" here -# You can also disable intrusion detection completely by changing -# the following parameter to true -# -IntrusionDetector.Disable=false -# -IntrusionDetector.event.test.count=2 -IntrusionDetector.event.test.interval=10 -IntrusionDetector.event.test.actions=disable,log - -# Exception Events -# All EnterpriseSecurityExceptions are registered automatically -# Call IntrusionDetector.getInstance().addException(e) for Exceptions that do not extend EnterpriseSecurityException -# Use the fully qualified classname of the exception as the base - -# any intrusion is an attack -IntrusionDetector.org.owasp.esapi.errors.IntrusionException.count=1 -IntrusionDetector.org.owasp.esapi.errors.IntrusionException.interval=1 -IntrusionDetector.org.owasp.esapi.errors.IntrusionException.actions=log,disable,logout - -# for test purposes -# CHECKME: Shouldn't there be something in the property name itself that designates -# that these are for testing??? -IntrusionDetector.org.owasp.esapi.errors.IntegrityException.count=10 -IntrusionDetector.org.owasp.esapi.errors.IntegrityException.interval=5 -IntrusionDetector.org.owasp.esapi.errors.IntegrityException.actions=log,disable,logout - -# rapid validation errors indicate scans or attacks in progress -# org.owasp.esapi.errors.ValidationException.count=10 -# org.owasp.esapi.errors.ValidationException.interval=10 -# org.owasp.esapi.errors.ValidationException.actions=log,logout - -# sessions jumping between hosts indicates session hijacking -IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.count=2 -IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.interval=10 -IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.actions=log,logout - - -#=========================================================================== -# ESAPI Validation -# -# The ESAPI Validator works on regular expressions with defined names. You can define names -# either here, or you may define application specific patterns in a separate file defined below. -# This allows enterprises to specify both organizational standards as well as application specific -# validation rules. -# -Validator.ConfigurationFile=validation.properties - -# Validators used by ESAPI -Validator.AccountName=^[a-zA-Z0-9]{3,20}$ -Validator.SystemCommand=^[a-zA-Z\\-\\/]{1,64}$ -Validator.RoleName=^[a-z]{1,20}$ - -#the word TEST below should be changed to your application -#name - only relative URL's are supported -Validator.Redirect=^\\/test.*$ - -# Global HTTP Validation Rules -# Values with Base64 encoded data (e.g. encrypted state) will need at least [a-zA-Z0-9\/+=] -Validator.HTTPScheme=^(http|https)$ -Validator.HTTPServerName=^[a-zA-Z0-9_.\\-]*$ -Validator.HTTPParameterName=^[a-zA-Z0-9_]{1,32}$ -Validator.HTTPParameterValue=^[a-zA-Z0-9.\\-\\/+=@_ ]*$ -Validator.HTTPCookieName=^[a-zA-Z0-9\\-_]{1,32}$ -Validator.HTTPCookieValue=^[a-zA-Z0-9\\-\\/+=_ ]*$ -Validator.HTTPHeaderName=^[a-zA-Z0-9\\-_]{1,32}$ -Validator.HTTPHeaderValue=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$ -Validator.HTTPContextPath=^\\/?[a-zA-Z0-9.\\-\\/_]*$ -Validator.HTTPServletPath=^[a-zA-Z0-9.\\-\\/_]*$ -Validator.HTTPPath=^[a-zA-Z0-9.\\-_]*$ -Validator.HTTPQueryString=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ %]*$ -Validator.HTTPURI=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$ -Validator.HTTPURL=^.*$ -Validator.HTTPJSESSIONID=^[A-Z0-9]{10,30}$ - -# Validation of file related input -Validator.FileName=^[a-zA-Z0-9!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$ -Validator.DirectoryName=^[a-zA-Z0-9:/\\\\!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$ - -# Validation of dates. Controls whether or not 'lenient' dates are accepted. -# See DataFormat.setLenient(boolean flag) for further details. -Validator.AcceptLenientDates=false - diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/encoding/CharacterEncodingExamplesUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/encoding/CharacterEncodingExamplesUnitTest.java index 95b3605d95..fe3867a3c3 100644 --- a/core-java-modules/core-java/src/test/java/com/baeldung/encoding/CharacterEncodingExamplesUnitTest.java +++ b/core-java-modules/core-java/src/test/java/com/baeldung/encoding/CharacterEncodingExamplesUnitTest.java @@ -1,9 +1,24 @@ package com.baeldung.encoding; +import java.io.BufferedReader; import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CodingErrorAction; +import java.nio.charset.MalformedInputException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import org.junit.Assert; import org.junit.Test; +import org.junit.jupiter.api.Assertions; public class CharacterEncodingExamplesUnitTest { @@ -58,4 +73,52 @@ public class CharacterEncodingExamplesUnitTest { "0 0 10001010 10011110 "); } + @Test + public void givenUTF8String_whenDecodeByUS_ASCII_thenIgnoreMalformedInputSequence() throws IOException { + Assertions.assertEquals("The faade pattern is a software design pattern.", CharacterEncodingExamples.decodeText("The façade pattern is a software design pattern.", StandardCharsets.US_ASCII, CodingErrorAction.IGNORE)); + } + + @Test + public void givenUTF8String_whenDecodeByUS_ASCII_thenReplaceMalformedInputSequence() throws IOException { + Assertions.assertEquals( + "The fa��ade pattern is a software design pattern.", + CharacterEncodingExamples.decodeText( + "The façade pattern is a software design pattern.", + StandardCharsets.US_ASCII, + CodingErrorAction.REPLACE)); + } + + @Test + public void givenUTF8String_whenDecodeByUS_ASCII_thenReportMalformedInputSequence() { + Assertions.assertThrows( + MalformedInputException.class, + () -> CharacterEncodingExamples.decodeText( + "The façade pattern is a software design pattern.", + StandardCharsets.US_ASCII, + CodingErrorAction.REPORT)); + } + + @Test + public void givenTextFile_whenLoopOverAllCandidateEncodings_thenProduceSuitableCandidateEncodings() { + Path path = Paths.get("src/test/resources/encoding.txt"); + List allCandidateCharSets = Arrays.asList( + StandardCharsets.US_ASCII, StandardCharsets.UTF_8, StandardCharsets.ISO_8859_1); + + List suitableCharsets = new ArrayList<>(); + allCandidateCharSets.forEach(charset -> { + try { + CharsetDecoder charsetDecoder = charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); + Reader reader = new InputStreamReader(Files.newInputStream(path), charsetDecoder); + BufferedReader bufferedReader = new BufferedReader(reader); + bufferedReader.readLine(); + suitableCharsets.add(charset); + } catch (MalformedInputException ignored) { + } catch (IOException ex) { + ex.printStackTrace(); + } + }); + + Assertions.assertEquals(suitableCharsets, Arrays.asList(StandardCharsets.UTF_8, StandardCharsets.ISO_8859_1)); + } + } diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/BufferedReaderUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/BufferedReaderUnitTest.java deleted file mode 100644 index 78f900d796..0000000000 --- a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/BufferedReaderUnitTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.fileparser; - -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; - -import org.junit.Test; - -public class BufferedReaderUnitTest { - - protected static final String TEXT_FILENAME = "src/test/resources/sampleTextFile.txt"; - - @Test - public void whenParsingExistingTextFile_thenGetArrayList() throws IOException { - List lines = BufferedReaderExample.generateArrayListFromFile(TEXT_FILENAME); - assertTrue("File does not has 2 lines", lines.size() == 2); - } -} diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/FileReaderUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/FileReaderUnitTest.java deleted file mode 100644 index a38e58d348..0000000000 --- a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/FileReaderUnitTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.fileparser; - -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; - -import org.junit.Test; - -public class FileReaderUnitTest { - - protected static final String TEXT_FILENAME = "src/test/resources/sampleTextFile.txt"; - - @Test - public void whenParsingExistingTextFile_thenGetArrayList() throws IOException { - List lines = FileReaderExample.generateArrayListFromFile(TEXT_FILENAME); - assertTrue("File does not has 2 lines", lines.size() == 2); - } -} diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/FilesReadAllLinesUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/FilesReadAllLinesUnitTest.java deleted file mode 100644 index c0b742fd47..0000000000 --- a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/FilesReadAllLinesUnitTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.fileparser; - -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; - -import org.junit.Test; - -public class FilesReadAllLinesUnitTest { - - protected static final String TEXT_FILENAME = "src/test/resources/sampleTextFile.txt"; - - @Test - public void whenParsingExistingTextFile_thenGetArrayList() throws IOException { - List lines = FilesReadLinesExample.generateArrayListFromFile(TEXT_FILENAME); - assertTrue("File does not has 2 lines", lines.size() == 2); - } -} diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/ScannerIntUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/ScannerIntUnitTest.java deleted file mode 100644 index 0a398ba7c6..0000000000 --- a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/ScannerIntUnitTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.fileparser; - -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; - -import org.junit.Test; - -public class ScannerIntUnitTest { - - protected static final String NUMBER_FILENAME = "src/test/resources/sampleNumberFile.txt"; - - @Test - public void whenParsingExistingTextFile_thenGetIntArrayList() throws IOException { - List numbers = ScannerIntExample.generateArrayListFromFile(NUMBER_FILENAME); - assertTrue("File does not has 2 lines", numbers.size() == 2); - } -} diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/ScannerStringUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/ScannerStringUnitTest.java deleted file mode 100644 index 8f9b0a56c0..0000000000 --- a/core-java-modules/core-java/src/test/java/com/baeldung/fileparser/ScannerStringUnitTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.fileparser; - -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; - -import org.junit.Test; - -public class ScannerStringUnitTest { - - protected static final String TEXT_FILENAME = "src/test/resources/sampleTextFile.txt"; - - @Test - public void whenParsingExistingTextFile_thenGetArrayList() throws IOException { - List lines = ScannerStringExample.generateArrayListFromFile(TEXT_FILENAME); - assertTrue("File does not has 2 lines", lines.size() == 2); - } -} diff --git a/core-java-modules/core-java/src/test/java/org/baeldung/java/JavaIoUnitTest.java b/core-java-modules/core-java/src/test/java/org/baeldung/java/JavaIoUnitTest.java deleted file mode 100644 index 5da68aa746..0000000000 --- a/core-java-modules/core-java/src/test/java/org/baeldung/java/JavaIoUnitTest.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.baeldung.java; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.Scanner; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.LineIterator; -import org.junit.Ignore; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.base.Charsets; -import com.google.common.io.Files; - -@Ignore("need large file for testing") -public class JavaIoUnitTest { - protected final Logger logger = LoggerFactory.getLogger(getClass()); - - // tests - iterate lines in a file - - @Test - public final void givenUsingGuava_whenIteratingAFile_thenCorrect() throws IOException { - final String path = "G:\\full\\train\\input\\" + "trainDataNegative.csv"; - // final String path = "G:\\full\\train\\input\\" + "trainDataPositive.csv"; - - logMemory(); - Files.readLines(new File(path), Charsets.UTF_8); - logMemory(); - } - - @Test - public final void givenUsingCommonsIo_whenIteratingAFileInMemory_thenCorrect() throws IOException { - // final String path = "G:\\full\\train\\input\\" + "trainDataNegative.csv"; - final String path = "G:\\full\\train\\input\\" + "trainDataPositive.csv"; - - logMemory(); - FileUtils.readLines(new File(path)); - logMemory(); - } - - @Test - public final void whenStreamingThroughAFile_thenCorrect() throws IOException { - final String path = "G:\\full\\train\\input\\" + "trainDataNegative.csv"; - // final String path = "G:\\full\\train\\input\\" + "trainDataPositive.csv"; - - logMemory(); - - FileInputStream inputStream = null; - Scanner sc = null; - try { - inputStream = new FileInputStream(path); - sc = new Scanner(inputStream, "UTF-8"); - while (sc.hasNextLine()) { - final String line = sc.nextLine(); - // System.out.println(line); - } - // note that Scanner suppresses exceptions - if (sc.ioException() != null) { - throw sc.ioException(); - } - } finally { - if (inputStream != null) { - inputStream.close(); - } - if (sc != null) { - sc.close(); - } - } - - logMemory(); - } - - @Test - public final void givenUsingApacheIo_whenStreamingThroughAFile_thenCorrect() throws IOException { - final String path = "G:\\full\\train\\input\\" + "trainDataNegative.csv"; - // final String path = "G:\\full\\train\\input\\" + "trainDataPositive.csv"; - - logMemory(); - - final LineIterator it = FileUtils.lineIterator(new File(path), "UTF-8"); - try { - while (it.hasNext()) { - final String line = it.nextLine(); - // do something with line - } - } finally { - LineIterator.closeQuietly(it); - } - - logMemory(); - } - - // utils - - private final void logMemory() { - logger.info("Max Memory: {} Mb", Runtime.getRuntime() - .maxMemory() / 1048576); - logger.info("Total Memory: {} Mb", Runtime.getRuntime() - .totalMemory() / 1048576); - logger.info("Free Memory: {} Mb", Runtime.getRuntime() - .freeMemory() / 1048576); - } - -} diff --git a/core-java-modules/core-java/src/test/resources/sampleNumberFile.txt b/core-java-modules/core-java/src/test/resources/sampleNumberFile.txt deleted file mode 100644 index 7787faa3c1..0000000000 --- a/core-java-modules/core-java/src/test/resources/sampleNumberFile.txt +++ /dev/null @@ -1,2 +0,0 @@ -111 -222 \ No newline at end of file diff --git a/core-java-modules/core-java/src/test/resources/sampleTextFile.txt b/core-java-modules/core-java/src/test/resources/sampleTextFile.txt deleted file mode 100644 index 75cb50aafa..0000000000 --- a/core-java-modules/core-java/src/test/resources/sampleTextFile.txt +++ /dev/null @@ -1,2 +0,0 @@ -Hello -World \ No newline at end of file diff --git a/core-java-modules/pom.xml b/core-java-modules/pom.xml index 082ffbef53..16ec19835a 100644 --- a/core-java-modules/pom.xml +++ b/core-java-modules/pom.xml @@ -15,11 +15,11 @@ pre-jpms - core-java-exceptions core-java-optional core-java-lang-operators core-java-networking-2 core-java-security-manager + core-java-date-operations diff --git a/core-java-modules/pre-jpms/pom.xml b/core-java-modules/pre-jpms/pom.xml index 380d94fbf1..f37daed0a5 100644 --- a/core-java-modules/pre-jpms/pom.xml +++ b/core-java-modules/pre-jpms/pom.xml @@ -69,7 +69,4 @@ - - UTF-8 - diff --git a/core-kotlin-2/README.md b/core-kotlin-2/README.md index d75dd2208a..06dda396d9 100644 --- a/core-kotlin-2/README.md +++ b/core-kotlin-2/README.md @@ -1,4 +1,8 @@ -## Relevant articles: +## Core Kotlin + +This module contains articles about core Kotlin. + +### Relevant articles: - [Void Type in Kotlin](https://www.baeldung.com/kotlin-void-type) - [How to use Kotlin Range Expressions](https://www.baeldung.com/kotlin-ranges) @@ -8,3 +12,5 @@ - [Split a List into Parts in Kotlin](https://www.baeldung.com/kotlin-split-list-into-parts) - [String Comparison in Kotlin](https://www.baeldung.com/kotlin-string-comparison) - [Guide to JVM Platform Annotations in Kotlin](https://www.baeldung.com/kotlin-jvm-annotations) +- [Finding an Element in a List Using Kotlin](https://www.baeldung.com/kotlin-finding-element-in-list) +- More articles: [[<-- prev]](/core-kotlin) diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt new file mode 100644 index 0000000000..6fa7983689 --- /dev/null +++ b/core-kotlin-2/src/test/kotlin/com/baeldung/lists/ListsUnitTest.kt @@ -0,0 +1,34 @@ +package com.baeldung.lists + +import org.junit.jupiter.api.Test +import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertTrue + +class ListsUnitTest { + + var batmans: List = listOf("Christian Bale", "Michael Keaton", "Ben Affleck", "George Clooney") + + @Test + fun whenFindASpecificItem_thenItemIsReturned() { + //Returns the first element matching the given predicate, or null if no such element was found. + val theFirstBatman = batmans.find { actor -> "Michael Keaton".equals(actor) } + assertEquals(theFirstBatman, "Michael Keaton") + } + + @Test + fun whenFilterWithPredicate_thenMatchingItemsAreReturned() { + //Returns a list containing only elements matching the given predicate. + val theCoolestBatmans = batmans.filter { actor -> actor.contains("a") } + assertTrue(theCoolestBatmans.contains("Christian Bale") && theCoolestBatmans.contains("Michael Keaton")) + } + + @Test + fun whenFilterNotWithPredicate_thenMatchingItemsAreReturned() { + //Returns a list containing only elements not matching the given predicate. + val theMehBatmans = batmans.filterNot { actor -> actor.contains("a") } + assertFalse(theMehBatmans.contains("Christian Bale") && theMehBatmans.contains("Michael Keaton")) + assertTrue(theMehBatmans.contains("Ben Affleck") && theMehBatmans.contains("George Clooney")) + } + +} \ No newline at end of file diff --git a/core-kotlin-io/README.md b/core-kotlin-io/README.md index cb4dac7e4d..ad4c503895 100644 --- a/core-kotlin-io/README.md +++ b/core-kotlin-io/README.md @@ -1,4 +1,8 @@ -## Relevant articles: +## Core Kotlin I/O + +This module contains articles about core Kotlin I/O. + +### Relevant articles: - [InputStream to String in Kotlin](https://www.baeldung.com/kotlin-inputstream-to-string) - [Console I/O in Kotlin](https://www.baeldung.com/kotlin-console-io) diff --git a/core-kotlin/README.md b/core-kotlin/README.md index 3392db9171..bdff95d36d 100644 --- a/core-kotlin/README.md +++ b/core-kotlin/README.md @@ -1,36 +1,40 @@ -## Relevant articles: +## Core Kotlin -- [Introduction to the Kotlin Language](http://www.baeldung.com/kotlin) -- [Guide to the “when{}” Block in Kotlin](http://www.baeldung.com/kotlin-when) -- [Comprehensive Guide to Null Safety in Kotlin](http://www.baeldung.com/kotlin-null-safety) -- [Kotlin Java Interoperability](http://www.baeldung.com/kotlin-java-interoperability) -- [Difference Between “==” and “===” operators in Kotlin](http://www.baeldung.com/kotlin-equality-operators) -- [Generics in Kotlin](http://www.baeldung.com/kotlin-generics) -- [Introduction to Kotlin Coroutines](http://www.baeldung.com/kotlin-coroutines) -- [Destructuring Declarations in Kotlin](http://www.baeldung.com/kotlin-destructuring-declarations) -- [Lazy Initialization in Kotlin](http://www.baeldung.com/kotlin-lazy-initialization) -- [Overview of Kotlin Collections API](http://www.baeldung.com/kotlin-collections-api) -- [Converting a List to Map in Kotlin](http://www.baeldung.com/kotlin-list-to-map) -- [Data Classes in Kotlin](http://www.baeldung.com/kotlin-data-classes) -- [Delegated Properties in Kotlin](http://www.baeldung.com/kotlin-delegated-properties) -- [Sealed Classes in Kotlin](http://www.baeldung.com/kotlin-sealed-classes) -- [JUnit 5 for Kotlin Developers](http://www.baeldung.com/junit-5-kotlin) -- [Extension Methods in Kotlin](http://www.baeldung.com/kotlin-extension-methods) -- [Infix Functions in Kotlin](http://www.baeldung.com/kotlin-infix-functions) -- [Try-with-resources in Kotlin](http://www.baeldung.com/kotlin-try-with-resources) -- [Regular Expressions in Kotlin](http://www.baeldung.com/kotlin-regular-expressions) -- [Objects in Kotlin](http://www.baeldung.com/kotlin-objects) -- [Reading from a File in Kotlin](http://www.baeldung.com/kotlin-read-file) -- [Guide to Kotlin @JvmField](http://www.baeldung.com/kotlin-jvm-field-annotation) -- [Filtering Kotlin Collections](http://www.baeldung.com/kotlin-filter-collection) -- [Writing to a File in Kotlin](http://www.baeldung.com/kotlin-write-file) -- [Lambda Expressions in Kotlin](http://www.baeldung.com/kotlin-lambda-expressions) -- [Kotlin String Templates](http://www.baeldung.com/kotlin-string-template) -- [Working with Enums in Kotlin](http://www.baeldung.com/kotlin-enum) -- [Create a Java and Kotlin Project with Maven](http://www.baeldung.com/kotlin-maven-java-project) -- [Reflection with Kotlin](http://www.baeldung.com/kotlin-reflection) -- [Get a Random Number in Kotlin](http://www.baeldung.com/kotlin-random-number) -- [Idiomatic Logging in Kotlin](http://www.baeldung.com/kotlin-logging) +This module contains articles about core Kotlin. + +### Relevant articles: + +- [Introduction to the Kotlin Language](https://www.baeldung.com/kotlin) +- [Guide to the “when{}” Block in Kotlin](https://www.baeldung.com/kotlin-when) +- [Comprehensive Guide to Null Safety in Kotlin](https://www.baeldung.com/kotlin-null-safety) +- [Kotlin Java Interoperability](https://www.baeldung.com/kotlin-java-interoperability) +- [Difference Between “==” and “===” operators in Kotlin](https://www.baeldung.com/kotlin-equality-operators) +- [Generics in Kotlin](https://www.baeldung.com/kotlin-generics) +- [Introduction to Kotlin Coroutines](https://www.baeldung.com/kotlin-coroutines) +- [Destructuring Declarations in Kotlin](https://www.baeldung.com/kotlin-destructuring-declarations) +- [Lazy Initialization in Kotlin](https://www.baeldung.com/kotlin-lazy-initialization) +- [Overview of Kotlin Collections API](https://www.baeldung.com/kotlin-collections-api) +- [Converting a List to Map in Kotlin](https://www.baeldung.com/kotlin-list-to-map) +- [Data Classes in Kotlin](https://www.baeldung.com/kotlin-data-classes) +- [Delegated Properties in Kotlin](https://www.baeldung.com/kotlin-delegated-properties) +- [Sealed Classes in Kotlin](https://www.baeldung.com/kotlin-sealed-classes) +- [JUnit 5 for Kotlin Developers](https://www.baeldung.com/junit-5-kotlin) +- [Extension Methods in Kotlin](https://www.baeldung.com/kotlin-extension-methods) +- [Infix Functions in Kotlin](https://www.baeldung.com/kotlin-infix-functions) +- [Try-with-resources in Kotlin](https://www.baeldung.com/kotlin-try-with-resources) +- [Regular Expressions in Kotlin](https://www.baeldung.com/kotlin-regular-expressions) +- [Objects in Kotlin](https://www.baeldung.com/kotlin-objects) +- [Reading from a File in Kotlin](https://www.baeldung.com/kotlin-read-file) +- [Guide to Kotlin @JvmField](https://www.baeldung.com/kotlin-jvm-field-annotation) +- [Filtering Kotlin Collections](https://www.baeldung.com/kotlin-filter-collection) +- [Writing to a File in Kotlin](https://www.baeldung.com/kotlin-write-file) +- [Lambda Expressions in Kotlin](https://www.baeldung.com/kotlin-lambda-expressions) +- [Kotlin String Templates](https://www.baeldung.com/kotlin-string-template) +- [Working with Enums in Kotlin](https://www.baeldung.com/kotlin-enum) +- [Create a Java and Kotlin Project with Maven](https://www.baeldung.com/kotlin-maven-java-project) +- [Reflection with Kotlin](https://www.baeldung.com/kotlin-reflection) +- [Get a Random Number in Kotlin](https://www.baeldung.com/kotlin-random-number) +- [Idiomatic Logging in Kotlin](https://www.baeldung.com/kotlin-logging) - [Kotlin Constructors](https://www.baeldung.com/kotlin-constructors) - [Creational Design Patterns in Kotlin: Builder](https://www.baeldung.com/kotlin-builder-pattern) - [Kotlin Nested and Inner Classes](https://www.baeldung.com/kotlin-inner-classes) @@ -56,3 +60,4 @@ - [Static Methods Behavior in Kotlin](https://www.baeldung.com/kotlin-static-methods) - [Inline Functions in Kotlin](https://www.baeldung.com/kotlin-inline-functions) - [Delegation Pattern in Kotlin](https://www.baeldung.com/kotlin-delegation-pattern) +- More articles: [[next -->]](/core-kotlin-2) diff --git a/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrder.kt b/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrder.kt index 1384cd9937..3a8a4b9857 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrder.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrder.kt @@ -1,6 +1,6 @@ package com.baeldung.builder -class FoodOrder( +class FoodOrder private constructor( val bread: String?, val condiments: String?, val meat: String?, diff --git a/core-scala/README.md b/core-scala/README.md index eed344193f..e6fc75d59e 100644 --- a/core-scala/README.md +++ b/core-scala/README.md @@ -1,3 +1,7 @@ +## Core Scala + +This module contains articles about Scala's core features + ### Relevant Articles: - [Introduction to Scala](https://www.baeldung.com/scala-intro) diff --git a/couchbase/README.md b/couchbase/README.md index 7a99ce4299..913c413132 100644 --- a/couchbase/README.md +++ b/couchbase/README.md @@ -1,11 +1,13 @@ -## Couchbase SDK Tutorial Project +## Couchbase + +This module contains articles about Couchbase ### Relevant Articles: -- [Introduction to Couchbase SDK for Java](http://www.baeldung.com/java-couchbase-sdk) -- [Using Couchbase in a Spring Application](http://www.baeldung.com/couchbase-sdk-spring) -- [Asynchronous Batch Operations in Couchbase](http://www.baeldung.com/async-batch-operations-in-couchbase) -- [Querying Couchbase with MapReduce Views](http://www.baeldung.com/couchbase-query-mapreduce-view) -- [Querying Couchbase with N1QL](http://www.baeldung.com/n1ql-couchbase) +- [Introduction to Couchbase SDK for Java](https://www.baeldung.com/java-couchbase-sdk) +- [Using Couchbase in a Spring Application](https://www.baeldung.com/couchbase-sdk-spring) +- [Asynchronous Batch Operations in Couchbase](https://www.baeldung.com/async-batch-operations-in-couchbase) +- [Querying Couchbase with MapReduce Views](https://www.baeldung.com/couchbase-query-mapreduce-view) +- [Querying Couchbase with N1QL](https://www.baeldung.com/n1ql-couchbase) ### Overview This Maven project contains the Java code for the Couchbase entities and Spring services diff --git a/custom-pmd/README.md b/custom-pmd/README.md index 065a1128f3..0c42106fe8 100644 --- a/custom-pmd/README.md +++ b/custom-pmd/README.md @@ -1 +1,7 @@ ## Custom PMD Rules + +This module contains articles about PMD + +### Relevant Articles: + +- [Introduction To PMD](https://www.baeldung.com/pmd) \ No newline at end of file diff --git a/dagger/README.md b/dagger/README.md index 72cba3d3f2..d942622d0a 100644 --- a/dagger/README.md +++ b/dagger/README.md @@ -1,3 +1,7 @@ +## Dagger + +This module contains articles about Dagger + ### Relevant articles: -- [Introduction to Dagger 2](http://www.baeldung.com/dagger-2) +- [Introduction to Dagger 2](https://www.baeldung.com/dagger-2) diff --git a/data-structures/README.md b/data-structures/README.md index 5ea9657173..b7f15c2eb8 100644 --- a/data-structures/README.md +++ b/data-structures/README.md @@ -1,3 +1,7 @@ +## Data Structures + +This module contains articles about data structures in Java + ## Relevant articles: - [The Trie Data Structure in Java](https://www.baeldung.com/trie-java) diff --git a/ddd/README.md b/ddd/README.md index 6b68fe2205..daeb663e3b 100644 --- a/ddd/README.md +++ b/ddd/README.md @@ -1,3 +1,7 @@ +## Domain-driven Design (DDD) + +This module contains articles about Domain-driven Design (DDD) + ### Relevant articles - [Persisting DDD Aggregates](https://www.baeldung.com/spring-persisting-ddd-aggregates) diff --git a/ddd/pom.xml b/ddd/pom.xml index 4ac65ea841..c249007ba4 100644 --- a/ddd/pom.xml +++ b/ddd/pom.xml @@ -3,7 +3,6 @@ 4.0.0 com.baeldung.ddd ddd - 0.0.1-SNAPSHOT ddd jar DDD series examples @@ -35,7 +34,6 @@ org.junit.platform junit-platform-launcher - ${junit-platform.version} test @@ -85,8 +83,6 @@ 1.0.1 - 2.22.0 - 2.0.6.RELEASE \ No newline at end of file diff --git a/deeplearning4j/README.md b/deeplearning4j/README.md index 14e585cd97..47c2d8167d 100644 --- a/deeplearning4j/README.md +++ b/deeplearning4j/README.md @@ -1,5 +1,7 @@ -### Sample deeplearning4j Project -This is a sample project for the [deeplearning4j](https://deeplearning4j.org) library. +## Deeplearning4j + +This module contains articles about Deeplearning4j. ### Relevant Articles: -- [A Guide to Deeplearning4j](http://www.baeldung.com/deeplearning4j) +- [A Guide to Deeplearning4j](https://www.baeldung.com/deeplearning4j) +- [Logistic Regression in Java](https://www.baeldung.com/java-logistic-regression) diff --git a/deeplearning4j/pom.xml b/deeplearning4j/pom.xml index 181dbc871c..a8663865e0 100644 --- a/deeplearning4j/pom.xml +++ b/deeplearning4j/pom.xml @@ -14,6 +14,11 @@ + + org.nd4j + nd4j-api + ${dl4j.version} + org.nd4j nd4j-native-platform @@ -24,10 +29,26 @@ deeplearning4j-core ${dl4j.version} + + org.deeplearning4j + deeplearning4j-nn + ${dl4j.version} + + + + org.datavec + datavec-api + ${dl4j.version} + + + org.apache.httpcomponents + httpclient + 4.3.5 + - 0.9.1 + 0.9.1 - \ No newline at end of file + diff --git a/deeplearning4j/src/main/java/com/baeldung/deeplearning4j/IrisClassifier.java b/deeplearning4j/src/main/java/com/baeldung/deeplearning4j/IrisClassifier.java index bf341209e1..dcc81eda6e 100644 --- a/deeplearning4j/src/main/java/com/baeldung/deeplearning4j/IrisClassifier.java +++ b/deeplearning4j/src/main/java/com/baeldung/deeplearning4j/IrisClassifier.java @@ -3,9 +3,9 @@ package com.baeldung.deeplearning4j; import org.datavec.api.records.reader.RecordReader; import org.datavec.api.records.reader.impl.csv.CSVRecordReader; import org.datavec.api.split.FileSplit; -import org.datavec.api.util.ClassPathResource; import org.deeplearning4j.datasets.datavec.RecordReaderDataSetIterator; import org.deeplearning4j.eval.Evaluation; +import org.deeplearning4j.nn.conf.BackpropType; import org.deeplearning4j.nn.conf.MultiLayerConfiguration; import org.deeplearning4j.nn.conf.NeuralNetConfiguration; import org.deeplearning4j.nn.conf.layers.DenseLayer; @@ -19,6 +19,7 @@ import org.nd4j.linalg.dataset.SplitTestAndTrain; import org.nd4j.linalg.dataset.api.iterator.DataSetIterator; import org.nd4j.linalg.dataset.api.preprocessor.DataNormalization; import org.nd4j.linalg.dataset.api.preprocessor.NormalizerStandardize; +import org.nd4j.linalg.io.ClassPathResource; import org.nd4j.linalg.lossfunctions.LossFunctions; import java.io.IOException; @@ -52,8 +53,8 @@ public class IrisClassifier { .iterations(1000) .activation(Activation.TANH) .weightInit(WeightInit.XAVIER) - .learningRate(0.1) - .regularization(true).l2(0.0001) + .regularization(true) + .learningRate(0.1).l2(0.0001) .list() .layer(0, new DenseLayer.Builder().nIn(FEATURES_COUNT).nOut(3) .build()) @@ -62,14 +63,14 @@ public class IrisClassifier { .layer(2, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD) .activation(Activation.SOFTMAX) .nIn(3).nOut(CLASSES_COUNT).build()) - .backprop(true).pretrain(false) + .backpropType(BackpropType.Standard).pretrain(false) .build(); MultiLayerNetwork model = new MultiLayerNetwork(configuration); model.init(); model.fit(trainingData); - INDArray output = model.output(testData.getFeatureMatrix()); + INDArray output = model.output(testData.getFeatures()); Evaluation eval = new Evaluation(CLASSES_COUNT); eval.eval(testData.getLabels(), output); diff --git a/ml/src/main/java/com/baeldung/logreg/MnistClassifier.java b/deeplearning4j/src/main/java/com/baeldung/logreg/MnistClassifier.java similarity index 93% rename from ml/src/main/java/com/baeldung/logreg/MnistClassifier.java rename to deeplearning4j/src/main/java/com/baeldung/logreg/MnistClassifier.java index 1246de973f..c8580b9c27 100644 --- a/ml/src/main/java/com/baeldung/logreg/MnistClassifier.java +++ b/deeplearning4j/src/main/java/com/baeldung/logreg/MnistClassifier.java @@ -10,6 +10,7 @@ import org.datavec.api.split.FileSplit; import org.datavec.image.loader.NativeImageLoader; import org.datavec.image.recordreader.ImageRecordReader; import org.deeplearning4j.datasets.datavec.RecordReaderDataSetIterator; +import org.deeplearning4j.eval.Evaluation; import org.deeplearning4j.nn.conf.MultiLayerConfiguration; import org.deeplearning4j.nn.conf.NeuralNetConfiguration; import org.deeplearning4j.nn.conf.inputs.InputType; @@ -21,15 +22,12 @@ import org.deeplearning4j.nn.multilayer.MultiLayerNetwork; import org.deeplearning4j.nn.weights.WeightInit; import org.deeplearning4j.optimize.listeners.ScoreIterationListener; import org.deeplearning4j.util.ModelSerializer; -import org.nd4j.evaluation.classification.Evaluation; import org.nd4j.linalg.activations.Activation; import org.nd4j.linalg.dataset.api.iterator.DataSetIterator; import org.nd4j.linalg.dataset.api.preprocessor.DataNormalization; import org.nd4j.linalg.dataset.api.preprocessor.ImagePreProcessingScaler; import org.nd4j.linalg.learning.config.Nesterovs; import org.nd4j.linalg.lossfunctions.LossFunctions; -import org.nd4j.linalg.schedule.MapSchedule; -import org.nd4j.linalg.schedule.ScheduleType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,7 +42,7 @@ import org.slf4j.LoggerFactory; public class MnistClassifier { private static final Logger logger = LoggerFactory.getLogger(MnistClassifier.class); - private static final String basePath = System.getProperty("java.io.tmpdir") + "mnist" + File.separator; + private static final String basePath = System.getProperty("java.io.tmpdir") + File.separator + "mnist" + File.separator; private static final File modelPath = new File(basePath + "mnist-model.zip"); private static final String dataUrl = "http://github.com/myleott/mnist_png/raw/master/mnist_png.tar.gz"; @@ -71,8 +69,7 @@ public class MnistClassifier { String localFilePath = basePath + "mnist_png.tar.gz"; File file = new File(localFilePath); if (!file.exists()) { - file.getParentFile() - .mkdirs(); + file.getParentFile().mkdirs(); Utils.downloadAndSave(dataUrl, file); Utils.extractTarArchive(file, basePath); } @@ -135,15 +132,15 @@ public class MnistClassifier { .build(); final MultiLayerConfiguration config = new NeuralNetConfiguration.Builder().seed(seed) .l2(0.0005) // ridge regression value - .updater(new Nesterovs(new MapSchedule(ScheduleType.ITERATION, learningRateSchedule))) + .updater(new Nesterovs()) //TODO new MapSchedule(ScheduleType.ITERATION, learningRateSchedule) .weightInit(WeightInit.XAVIER) .list() - .layer(layer1) - .layer(layer2) - .layer(layer3) - .layer(layer2) - .layer(layer4) - .layer(layer5) + .layer(0, layer1) + .layer(1, layer2) + .layer(2, layer3) + .layer(3, layer2) + .layer(4, layer4) + .layer(5, layer5) .setInputType(InputType.convolutionalFlat(height, width, channels)) .build(); @@ -165,4 +162,4 @@ public class MnistClassifier { ModelSerializer.writeModel(model, modelPath, true); logger.info("The MINIST model has been saved in {}", modelPath.getPath()); } -} \ No newline at end of file +} diff --git a/ml/src/main/java/com/baeldung/logreg/MnistPrediction.java b/deeplearning4j/src/main/java/com/baeldung/logreg/MnistPrediction.java similarity index 100% rename from ml/src/main/java/com/baeldung/logreg/MnistPrediction.java rename to deeplearning4j/src/main/java/com/baeldung/logreg/MnistPrediction.java diff --git a/ml/src/main/java/com/baeldung/logreg/Utils.java b/deeplearning4j/src/main/java/com/baeldung/logreg/Utils.java similarity index 100% rename from ml/src/main/java/com/baeldung/logreg/Utils.java rename to deeplearning4j/src/main/java/com/baeldung/logreg/Utils.java diff --git a/disruptor/README.md b/disruptor/README.md index 779b1e89c4..7d2fca4672 100644 --- a/disruptor/README.md +++ b/disruptor/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## Disruptor -- [Concurrency with LMAX Disruptor – An Introduction](http://www.baeldung.com/lmax-disruptor-concurrency) +This module contains articles about LMAX Disruptor + +### Relevant articles: + +- [Concurrency with LMAX Disruptor – An Introduction](https://www.baeldung.com/lmax-disruptor-concurrency) diff --git a/disruptor/pom.xml b/disruptor/pom.xml index e1d78e7ed6..213331f25c 100644 --- a/disruptor/pom.xml +++ b/disruptor/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung disruptor 0.1.0-SNAPSHOT disruptor @@ -116,10 +115,7 @@ 3.3.6 - - 6.10 - 3.6.1 - + 2.4.3 3.0.2 1.4.4 diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000000..7948b3d663 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,3 @@ +## Relevant Articles: + +- [Introduction to Docker Compose](https://www.baeldung.com/docker-compose) diff --git a/dozer/README.md b/dozer/README.md index 5e104d914c..e87e889ce3 100644 --- a/dozer/README.md +++ b/dozer/README.md @@ -1,2 +1,7 @@ +## Dozer + +This module contains articles about Dozer + ### Relevant Articles: -- [A Guide to Mapping With Dozer](http://www.baeldung.com/dozer) + +- [A Guide to Mapping With Dozer](https://www.baeldung.com/dozer) diff --git a/dozer/pom.xml b/dozer/pom.xml index 8234eb4c79..c781962d83 100644 --- a/dozer/pom.xml +++ b/dozer/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung dozer 1.0 dozer diff --git a/drools/README.MD b/drools/README.MD index 5efbe0d3c3..bcec0cc2f0 100644 --- a/drools/README.MD +++ b/drools/README.MD @@ -1,4 +1,9 @@ +## Drools + +This module contains articles about Drools + ### Relevant Articles: -- [Introduction to Drools](http://www.baeldung.com/drools) -- [Drools Using Rules from Excel Files](http://www.baeldung.com/drools-excel) -- [An Example of Backward Chaining in Drools](http://www.baeldung.com/drools-backward-chaining) + +- [Introduction to Drools](https://www.baeldung.com/drools) +- [Drools Using Rules from Excel Files](https://www.baeldung.com/drools-excel) +- [An Example of Backward Chaining in Drools](https://www.baeldung.com/drools-backward-chaining) diff --git a/dubbo/README.md b/dubbo/README.md index 0a4cd9a204..3ccca4960a 100644 --- a/dubbo/README.md +++ b/dubbo/README.md @@ -1,4 +1,8 @@ -## Relevant articles: +## Dubbo -- [Introduction to Dubbo](http://www.baeldung.com/dubbo) +This module contains articles about Dubbo + +### Relevant articles: + +- [Introduction to Dubbo](https://www.baeldung.com/dubbo) diff --git a/dubbo/pom.xml b/dubbo/pom.xml index 9fe228bf89..947175b6a0 100644 --- a/dubbo/pom.xml +++ b/dubbo/pom.xml @@ -32,7 +32,6 @@ 2.5.7 3.4.11 0.10 - 2.19.1 diff --git a/ethereum/README.md b/ethereum/README.md index d06ca09636..5bae4bbebd 100644 --- a/ethereum/README.md +++ b/ethereum/README.md @@ -1,6 +1,8 @@ ## Ethereum +This module contains articles about the Ethereum blockchain + ### Relevant Articles: -- [Introduction to EthereumJ](http://www.baeldung.com/ethereumj) -- [Creating and Deploying Smart Contracts with Solidity](http://www.baeldung.com/smart-contracts-ethereum-solidity) -- [Lightweight Ethereum Clients Using Web3j](http://www.baeldung.com/web3j) +- [Introduction to EthereumJ](https://www.baeldung.com/ethereumj) +- [Creating and Deploying Smart Contracts with Solidity](https://www.baeldung.com/smart-contracts-ethereum-solidity) +- [Lightweight Ethereum Clients Using Web3j](https://www.baeldung.com/web3j) diff --git a/ethereum/pom.xml b/ethereum/pom.xml index 80e1c04676..148909e787 100644 --- a/ethereum/pom.xml +++ b/ethereum/pom.xml @@ -1,9 +1,8 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.ethereum ethereum - 0.0.1-SNAPSHOT ethereum @@ -207,8 +206,6 @@ - UTF-8 - 8.5.4 1.5.0-RELEASE 3.3.1 1.5.6.RELEASE @@ -218,5 +215,4 @@ 1.7.25 2.0.4.RELEASE - diff --git a/feign/README.md b/feign/README.md index da04c40cdc..03051671d5 100644 --- a/feign/README.md +++ b/feign/README.md @@ -1,10 +1,8 @@ -## Feign Hypermedia Client ## +## Feign -This is the implementation of a [spring-hypermedia-api][1] client using Feign. - -[1]: https://github.com/eugenp/spring-hypermedia-api +This module contains articles about Feign ### Relevant Articles: -- [Intro to Feign](http://www.baeldung.com/intro-to-feign) -- [Introduction to SLF4J](http://www.baeldung.com/slf4j-with-log4j2-logback) +- [Intro to Feign](https://www.baeldung.com/intro-to-feign) + diff --git a/flyway-cdi-extension/README.md b/flyway-cdi-extension/README.md index 3e03d5aee8..2f4e8cdb7a 100644 --- a/flyway-cdi-extension/README.md +++ b/flyway-cdi-extension/README.md @@ -1,3 +1,7 @@ +## Flyway CDI Extension + +This module contains articles about context and dependency injection (CDI) with Flyway + ### Relevant articles - [CDI Portable Extension and Flyway](https://www.baeldung.com/cdi-portable-extension) diff --git a/flyway-cdi-extension/pom.xml b/flyway-cdi-extension/pom.xml index e8b327e35f..49bd6bd9fd 100644 --- a/flyway-cdi-extension/pom.xml +++ b/flyway-cdi-extension/pom.xml @@ -3,7 +3,6 @@ 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"> 4.0.0 - com.baeldung flyway-cdi-extension 1.0-SNAPSHOT flyway-cdi-extension @@ -51,8 +50,6 @@ - 1.8 - 1.8 2.0.SP1 3.0.5.Final 5.1.4 diff --git a/geotools/README.md b/geotools/README.md index 188ff0fddb..5529386070 100644 --- a/geotools/README.md +++ b/geotools/README.md @@ -1,3 +1,7 @@ +## GeoTools + +This module contains articles about GeoTools + ### Relevant Articles -[Introduction to GeoTools](http://www.baeldung.com/geo-tools) +[Introduction to GeoTools](https://www.baeldung.com/geo-tools) diff --git a/google-cloud/README.md b/google-cloud/README.md index 87ca17eac4..5458fb1a93 100644 --- a/google-cloud/README.md +++ b/google-cloud/README.md @@ -1,16 +1,16 @@ -## Google Cloud Tutorial Project +## Google Cloud + +This module contains articles about Google Cloud ### Relevant Article: -- [Intro to Google Cloud Storage With Java](http://www.baeldung.com/java-google-cloud-storage) + +- [Intro to Google Cloud Storage With Java](https://www.baeldung.com/java-google-cloud-storage) ### Overview + This Maven project contains the Java code for the article linked above. ### Package Organization + Java classes for the intro tutorial are in the org.baeldung.google.cloud package. Please note that Google Cloud requires a user account and credentials, as explained in the tutorial. - - -### Running the tests - -``` diff --git a/google-web-toolkit/README.md b/google-web-toolkit/README.md index 3526fe9962..df9158cddc 100644 --- a/google-web-toolkit/README.md +++ b/google-web-toolkit/README.md @@ -1,2 +1,7 @@ +## Google Web Toolkit + +This module contains articles about Google Web Toolkit (GWT) + ### Relevant Articles: -- [Introduction to GWT](http://www.baeldung.com/gwt) + +- [Introduction to GWT](https://www.baeldung.com/gwt) diff --git a/google-web-toolkit/pom.xml b/google-web-toolkit/pom.xml index 0723cd3be2..8a7cb87701 100644 --- a/google-web-toolkit/pom.xml +++ b/google-web-toolkit/pom.xml @@ -5,7 +5,6 @@ 4.0.0 - com.baeldung google-web-toolkit 1.0-SNAPSHOT google-web-toolkit diff --git a/gradle-5/README.md b/gradle-5/README.md new file mode 100644 index 0000000000..7c9aeff07e --- /dev/null +++ b/gradle-5/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Run a Java main Method Using Gradle](https://www.baeldung.com/gradle-run-java-main) diff --git a/gradle/README.md b/gradle/README.md index 14e460f225..84a8508e2c 100644 --- a/gradle/README.md +++ b/gradle/README.md @@ -1,6 +1,10 @@ +## Gradle + +This module contains articles about Gradle + ## Relevant articles: -- [Introduction to Gradle](http://www.baeldung.com/gradle) -- [Writing Custom Gradle Plugins](http://www.baeldung.com/gradle-create-plugin) -- [Creating a Fat Jar in Gradle](http://www.baeldung.com/gradle-fat-jar) -- [A Custom Task in Gradle](http://www.baeldung.com/gradle-custom-task) +- [Introduction to Gradle](https://www.baeldung.com/gradle) +- [Writing Custom Gradle Plugins](https://www.baeldung.com/gradle-create-plugin) +- [Creating a Fat Jar in Gradle](https://www.baeldung.com/gradle-fat-jar) +- [A Custom Task in Gradle](https://www.baeldung.com/gradle-custom-task) - [Using JUnit 5 with Gradle](https://www.baeldung.com/junit-5-gradle) diff --git a/grails/README.md b/grails/README.md index faa50a7efd..ec9bb2a504 100644 --- a/grails/README.md +++ b/grails/README.md @@ -1,3 +1,7 @@ +## Grails + +This module contains articles about Grails + ### Relevant articles -- [Build an MVC Web Application with Grails](http://www.baeldung.com/grails-mvc-application) +- [Build an MVC Web Application with Grails](https://www.baeldung.com/grails-mvc-application) diff --git a/graphql/graphql-java/README.md b/graphql/graphql-java/README.md index 0033524209..e3fd818400 100644 --- a/graphql/graphql-java/README.md +++ b/graphql/graphql-java/README.md @@ -1,3 +1,7 @@ +## GraphQL Java + +This module contains articles about GraphQL with Java + ## Relevant articles: -- [Introduction to GraphQL](http://www.baeldung.com/graphql) +- [Introduction to GraphQL](https://www.baeldung.com/graphql) diff --git a/grpc/README.md b/grpc/README.md index 5a60ca2e7e..d65dc03e54 100644 --- a/grpc/README.md +++ b/grpc/README.md @@ -1,2 +1,6 @@ +## gRPC + +This module contains articles about gRPC + ### Relevant Articles: -- [Introduction to gRPC](http://www.baeldung.com/grpc-introduction) +- [Introduction to gRPC](https://www.baeldung.com/grpc-introduction) diff --git a/gson/README.md b/gson/README.md index 268116a2ac..df6ba0f516 100644 --- a/gson/README.md +++ b/gson/README.md @@ -1,12 +1,12 @@ -========= - -## GSON Cookbooks and Examples +## GSON +This module contains articles about Gson ### Relevant Articles: -- [Gson Deserialization Cookbook](http://www.baeldung.com/gson-deserialization-guide) -- [Jackson vs Gson](http://www.baeldung.com/jackson-vs-gson) -- [Exclude Fields from Serialization in Gson](http://www.baeldung.com/gson-exclude-fields-serialization) + +- [Gson Deserialization Cookbook](https://www.baeldung.com/gson-deserialization-guide) +- [Jackson vs Gson](https://www.baeldung.com/jackson-vs-gson) +- [Exclude Fields from Serialization in Gson](https://www.baeldung.com/gson-exclude-fields-serialization) - [Save Data to a JSON File with Gson](https://www.baeldung.com/gson-save-file) - [Convert JSON to a Map Using Gson](https://www.baeldung.com/gson-json-to-map) - [Working with Primitive Values in Gson](https://www.baeldung.com/java-gson-primitives) diff --git a/gson/pom.xml b/gson/pom.xml index 9d2cf630d0..4aa6c00458 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -2,7 +2,6 @@ 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"> 4.0.0 - com.baeldung gson 0.1-SNAPSHOT gson diff --git a/guava-collections-map/README.md b/guava-collections-map/README.md new file mode 100644 index 0000000000..b3ec5e2157 --- /dev/null +++ b/guava-collections-map/README.md @@ -0,0 +1,12 @@ +========= + +## Guava Collections Map examples + +This module contains articles about map collections in Guava + +### Relevant Articles: +- [Guava – Maps](https://www.baeldung.com/guava-maps) +- [Guide to Guava Multimap](https://www.baeldung.com/guava-multimap) +- [Guide to Guava RangeMap](https://www.baeldung.com/guava-rangemap) +- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) +- [Guide to Guava ClassToInstanceMap](https://www.baeldung.com/guava-class-to-instance-map) \ No newline at end of file diff --git a/guava-collections-map/pom.xml b/guava-collections-map/pom.xml new file mode 100644 index 0000000000..21597d0e28 --- /dev/null +++ b/guava-collections-map/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + com.baeldung.guava + guava-collections-map + 0.1.0-SNAPSHOT + guava-collections-map + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + guava-collections-map + + + src/main/resources + true + + + + + \ No newline at end of file diff --git a/guava-collections/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/classtoinstancemap/ClassToInstanceMapUnitTest.java similarity index 97% rename from guava-collections/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java rename to guava-collections-map/src/test/java/com/baeldung/guava/classtoinstancemap/ClassToInstanceMapUnitTest.java index 295672d7ad..b9807379eb 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/ClassToInstanceMapUnitTest.java +++ b/guava-collections-map/src/test/java/com/baeldung/guava/classtoinstancemap/ClassToInstanceMapUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.classtoinstancemap; import com.google.common.collect.ClassToInstanceMap; import com.google.common.collect.ImmutableClassToInstanceMap; import com.google.common.collect.MutableClassToInstanceMap; diff --git a/guava-collections/src/test/java/org/baeldung/guava/maps/initialize/GuavaMapInitializeUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/initializemaps/GuavaMapInitializeUnitTest.java similarity index 95% rename from guava-collections/src/test/java/org/baeldung/guava/maps/initialize/GuavaMapInitializeUnitTest.java rename to guava-collections-map/src/test/java/com/baeldung/guava/initializemaps/GuavaMapInitializeUnitTest.java index 2414afb720..0866496ef5 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/maps/initialize/GuavaMapInitializeUnitTest.java +++ b/guava-collections-map/src/test/java/com/baeldung/guava/initializemaps/GuavaMapInitializeUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava.maps.initialize; +package com.baeldung.guava.initializemaps; import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.*; diff --git a/guava-collections-map/src/test/java/com/baeldung/guava/maps/GuavaMapsUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/maps/GuavaMapsUnitTest.java new file mode 100644 index 0000000000..4108df8c96 --- /dev/null +++ b/guava-collections-map/src/test/java/com/baeldung/guava/maps/GuavaMapsUnitTest.java @@ -0,0 +1,105 @@ +package com.baeldung.guava.maps; + +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.util.List; +import java.util.Map; + +import org.junit.Test; + +import com.google.common.base.Function; +import com.google.common.collect.*; + +public class GuavaMapsUnitTest { + + @Test + public void whenCreateImmutableMap_thenCreated() { + final Map salary = ImmutableMap. builder().put("John", 1000).put("Jane", 1500).put("Adam", 2000).put("Tom", 2000).build(); + + assertEquals(1000, salary.get("John").intValue()); + assertEquals(2000, salary.get("Tom").intValue()); + } + + @Test + public void whenUseSortedMap_thenKeysAreSorted() { + final ImmutableSortedMap salary = new ImmutableSortedMap.Builder(Ordering.natural()).put("John", 1000).put("Jane", 1500).put("Adam", 2000).put("Tom", 2000).build(); + + assertEquals("Adam", salary.firstKey()); + assertEquals(2000, salary.lastEntry().getValue().intValue()); + } + + @Test + public void whenCreateBiMap_thenCreated() { + final BiMap words = HashBiMap.create(); + words.put("First", 1); + words.put("Second", 2); + words.put("Third", 3); + + assertEquals(2, words.get("Second").intValue()); + assertEquals("Third", words.inverse().get(3)); + } + + @Test + public void whenCreateMultimap_thenCreated() { + final Multimap multimap = ArrayListMultimap.create(); + multimap.put("fruit", "apple"); + multimap.put("fruit", "banana"); + multimap.put("pet", "cat"); + multimap.put("pet", "dog"); + + assertThat(multimap.get("fruit"), containsInAnyOrder("apple", "banana")); + assertThat(multimap.get("pet"), containsInAnyOrder("cat", "dog")); + } + + @Test + public void whenGroupListUsingMultimap_thenGrouped() { + final List names = Lists.newArrayList("John", "Adam", "Tom"); + final Function function = new Function() { + @Override + public final Integer apply(final String input) { + return input.length(); + } + }; + final Multimap groups = Multimaps.index(names, function); + + assertThat(groups.get(3), containsInAnyOrder("Tom")); + assertThat(groups.get(4), containsInAnyOrder("John", "Adam")); + } + + @Test + public void whenCreateTable_thenCreated() { + final Table distance = HashBasedTable.create(); + distance.put("London", "Paris", 340); + distance.put("New York", "Los Angeles", 3940); + distance.put("London", "New York", 5576); + + assertEquals(3940, distance.get("New York", "Los Angeles").intValue()); + assertThat(distance.columnKeySet(), containsInAnyOrder("Paris", "New York", "Los Angeles")); + assertThat(distance.rowKeySet(), containsInAnyOrder("London", "New York")); + } + + @Test + public void whenTransposeTable_thenCorrect() { + final Table distance = HashBasedTable.create(); + distance.put("London", "Paris", 340); + distance.put("New York", "Los Angeles", 3940); + distance.put("London", "New York", 5576); + + final Table transposed = Tables.transpose(distance); + assertThat(transposed.rowKeySet(), containsInAnyOrder("Paris", "New York", "Los Angeles")); + assertThat(transposed.columnKeySet(), containsInAnyOrder("London", "New York")); + } + + @Test + public void whenCreateClassToInstanceMap_thenCreated() { + final ClassToInstanceMap numbers = MutableClassToInstanceMap.create(); + numbers.putInstance(Integer.class, 1); + numbers.putInstance(Double.class, 1.5); + + assertEquals(1, numbers.get(Integer.class)); + assertEquals(1.5, numbers.get(Double.class)); + } + +} diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/multimap/GuavaMultiMapUnitTest.java similarity index 97% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java rename to guava-collections-map/src/test/java/com/baeldung/guava/multimap/GuavaMultiMapUnitTest.java index f51dcadefc..06e85e41e5 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaMultiMapUnitTest.java +++ b/guava-collections-map/src/test/java/com/baeldung/guava/multimap/GuavaMultiMapUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.multimap; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/rangemap/GuavaRangeMapUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java rename to guava-collections-map/src/test/java/com/baeldung/guava/rangemap/GuavaRangeMapUnitTest.java index c0c5efea23..f221a2dcf8 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java +++ b/guava-collections-map/src/test/java/com/baeldung/guava/rangemap/GuavaRangeMapUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.rangemap; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; diff --git a/guava-collections-set/README.md b/guava-collections-set/README.md index c36d9e0b61..2e8e1ecdd0 100644 --- a/guava-collections-set/README.md +++ b/guava-collections-set/README.md @@ -1,8 +1,10 @@ -# Guava +## Guava Collections Set + +This module contains articles about Google Guava sets ## Relevant Articles: -- [Guava – Sets](http://www.baeldung.com/guava-sets) -- [Guide to Guava RangeSet](http://www.baeldung.com/guava-rangeset) -- [Guava Set + Function = Map](http://www.baeldung.com/guava-set-function-map-tutorial) +- [Guava – Sets](https://www.baeldung.com/guava-sets) +- [Guide to Guava RangeSet](https://www.baeldung.com/guava-rangeset) +- [Guava Set + Function = Map](https://www.baeldung.com/guava-set-function-map-tutorial) - [Guide to Guava Multiset](https://www.baeldung.com/guava-multiset) diff --git a/guava-collections-set/pom.xml b/guava-collections-set/pom.xml index 46dcae492d..640a28c4c1 100644 --- a/guava-collections-set/pom.xml +++ b/guava-collections-set/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung guava-collections-set 0.1.0-SNAPSHOT guava-collections-set @@ -28,8 +27,6 @@ - - 27.1-jre 3.6.1 diff --git a/guava-collections/README.md b/guava-collections/README.md index e919a98c2b..51731d7db7 100644 --- a/guava-collections/README.md +++ b/guava-collections/README.md @@ -1,20 +1,16 @@ -========= - -## Guava and Hamcrest Cookbooks and Examples +## Guava Collections +This module contains articles about Google Guava collections ### Relevant Articles: -- [Guava Collections Cookbook](http://www.baeldung.com/guava-collections) -- [Guava Ordering Cookbook](http://www.baeldung.com/guava-order) -- [Hamcrest Collections Cookbook](http://www.baeldung.com/hamcrest-collections-arrays) -- [Partition a List in Java](http://www.baeldung.com/java-list-split) -- [Filtering and Transforming Collections in Guava](http://www.baeldung.com/guava-filter-and-transform-a-collection) -- [Guava – Join and Split Collections](http://www.baeldung.com/guava-joiner-and-splitter-tutorial) -- [Guava – Lists](http://www.baeldung.com/guava-lists) -- [Guava – Maps](http://www.baeldung.com/guava-maps) -- [Guide to Guava Multimap](http://www.baeldung.com/guava-multimap) -- [Guide to Guava RangeMap](http://www.baeldung.com/guava-rangemap) -- [Guide to Guava MinMaxPriorityQueue and EvictingQueue](http://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue) -- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) -- [Guide to Guava Table](http://www.baeldung.com/guava-table) -- [Guide to Guava ClassToInstanceMap](http://www.baeldung.com/guava-class-to-instance-map) \ No newline at end of file + +- [Guava Collections Cookbook](https://www.baeldung.com/guava-collections) +- [Guava Ordering Cookbook](https://www.baeldung.com/guava-order) +- [Guide to Guava’s Ordering](https://www.baeldung.com/guava-ordering) +- [Hamcrest Collections Cookbook](https://www.baeldung.com/hamcrest-collections-arrays) +- [Partition a List in Java](https://www.baeldung.com/java-list-split) +- [Filtering and Transforming Collections in Guava](https://www.baeldung.com/guava-filter-and-transform-a-collection) +- [Guava – Join and Split Collections](https://www.baeldung.com/guava-joiner-and-splitter-tutorial) +- [Guava – Lists](https://www.baeldung.com/guava-lists) +- [Guide to Guava MinMaxPriorityQueue and EvictingQueue](https://www.baeldung.com/guava-minmax-priority-queue-and-evicting-queue) +- [Guide to Guava Table](https://www.baeldung.com/guava-table) diff --git a/guava-collections/pom.xml b/guava-collections/pom.xml index ecda3c9595..9dfcceaab8 100644 --- a/guava-collections/pom.xml +++ b/guava-collections/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung guava-collections 0.1.0-SNAPSHOT guava-collections @@ -43,7 +42,7 @@ - guava + guava-collections src/main/resources @@ -54,7 +53,6 @@ - 24.0-jre 4.1 diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/collections/GuavaCollectionsExamplesUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/collections/GuavaCollectionsExamplesUnitTest.java index 7b5cef6055..86e8dea21c 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionsExamplesUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/collections/GuavaCollectionsExamplesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.collections; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/filtertransform/GuavaFilterTransformCollectionsUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/filtertransform/GuavaFilterTransformCollectionsUnitTest.java index 8562193665..447149f002 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaFilterTransformCollectionsUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/filtertransform/GuavaFilterTransformCollectionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.filtertransform; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java index a08efd7c31..73c4c3291e 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaStringUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/joinsplit/GuavaStringUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.joinsplit; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsString; diff --git a/guava-collections/src/test/java/com/baeldung/guava/lists/GuavaListsUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/lists/GuavaListsUnitTest.java new file mode 100644 index 0000000000..2f414dcdb1 --- /dev/null +++ b/guava-collections/src/test/java/com/baeldung/guava/lists/GuavaListsUnitTest.java @@ -0,0 +1,82 @@ +package com.baeldung.guava.lists; + +import com.google.common.base.Predicates; +import com.google.common.collect.*; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.hamcrest.Matchers.contains; + +public class GuavaListsUnitTest { + + @Test + public void whenCreateList_thenCreated() { + final List names = Lists.newArrayList("John", "Adam", "Jane"); + + names.add("Tom"); + assertEquals(4, names.size()); + + names.remove("Adam"); + assertThat(names, contains("John", "Jane", "Tom")); + } + + @Test + public void whenReverseList_thenReversed() { + final List names = Lists.newArrayList("John", "Adam", "Jane"); + + final List reversed = Lists.reverse(names); + assertThat(reversed, contains("Jane", "Adam", "John")); + } + + @Test + public void whenCreateCharacterListFromString_thenCreated() { + final List chars = Lists.charactersOf("John"); + + assertEquals(4, chars.size()); + assertThat(chars, contains('J', 'o', 'h', 'n')); + } + + @Test + public void whenPartitionList_thenPartitioned() { + final List names = Lists.newArrayList("John", "Jane", "Adam", "Tom", "Viki", "Tyler"); + final List> result = Lists.partition(names, 2); + + assertEquals(3, result.size()); + assertThat(result.get(0), contains("John", "Jane")); + assertThat(result.get(1), contains("Adam", "Tom")); + assertThat(result.get(2), contains("Viki", "Tyler")); + } + + @Test + public void whenRemoveDuplicatesFromList_thenRemoved() { + final List chars = Lists.newArrayList('h', 'e', 'l', 'l', 'o'); + assertEquals(5, chars.size()); + + final List result = ImmutableSet.copyOf(chars).asList(); + assertThat(result, contains('h', 'e', 'l', 'o')); + } + + @Test + public void whenRemoveNullFromList_thenRemoved() { + final List names = Lists.newArrayList("John", null, "Adam", null, "Jane"); + Iterables.removeIf(names, Predicates.isNull()); + + assertEquals(3, names.size()); + assertThat(names, contains("John", "Adam", "Jane")); + } + + @Test + public void whenCreateImmutableList_thenCreated() { + final List names = Lists.newArrayList("John", "Adam", "Jane"); + + names.add("Tom"); + assertEquals(4, names.size()); + + final ImmutableList immutable = ImmutableList.copyOf(names); + assertThat(immutable, contains("John", "Adam", "Jane", "Tom")); + } + +} diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingExamplesUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingExamplesUnitTest.java index b8be06deb4..46ceccd7ba 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingExamplesUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingExamplesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.ordering; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingUnitTest.java similarity index 98% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingUnitTest.java index dd250898fd..73d464bde5 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaOrderingUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/ordering/GuavaOrderingUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.ordering; import com.google.common.base.Function; import com.google.common.collect.Ordering; diff --git a/guava-collections/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionApachePartitionUnitTest.java similarity index 97% rename from guava-collections/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/partition/CollectionApachePartitionUnitTest.java index 1071d4a5fb..1cb566dd6b 100644 --- a/guava-collections/src/test/java/org/baeldung/java/CollectionApachePartitionUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionApachePartitionUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java; +package com.baeldung.guava.partition; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/guava-collections/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionGuavaPartitionUnitTest.java similarity index 98% rename from guava-collections/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/partition/CollectionGuavaPartitionUnitTest.java index c4ddb35da2..8eb259b490 100644 --- a/guava-collections/src/test/java/org/baeldung/java/CollectionGuavaPartitionUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionGuavaPartitionUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java; +package com.baeldung.guava.partition; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/guava-collections/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionJavaPartitionUnitTest.java similarity index 98% rename from guava-collections/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/partition/CollectionJavaPartitionUnitTest.java index 63583987ea..d62ca275c1 100644 --- a/guava-collections/src/test/java/org/baeldung/java/CollectionJavaPartitionUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/partition/CollectionJavaPartitionUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java; +package com.baeldung.guava.partition; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/guava-collections/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/queues/EvictingQueueUnitTest.java similarity index 95% rename from guava-collections/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/queues/EvictingQueueUnitTest.java index e4d29d2e92..b9abef8d1f 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/EvictingQueueUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/queues/EvictingQueueUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.queues; import com.google.common.collect.EvictingQueue; diff --git a/guava-collections/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/queues/MinMaxPriorityQueueUnitTest.java similarity index 97% rename from guava-collections/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/queues/MinMaxPriorityQueueUnitTest.java index 1c4df03c86..95446e0d44 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/MinMaxPriorityQueueUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/queues/MinMaxPriorityQueueUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.queues; import com.google.common.collect.MinMaxPriorityQueue; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java b/guava-collections/src/test/java/com/baeldung/guava/table/GuavaTableUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java rename to guava-collections/src/test/java/com/baeldung/guava/table/GuavaTableUnitTest.java index 28e132074e..e9a9560afd 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaTableUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/guava/table/GuavaTableUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava.table; import static org.assertj.core.api.Assertions.*; import java.util.List; diff --git a/guava-collections/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java b/guava-collections/src/test/java/com/baeldung/hamcrest/HamcrestExamplesUnitTest.java similarity index 99% rename from guava-collections/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java rename to guava-collections/src/test/java/com/baeldung/hamcrest/HamcrestExamplesUnitTest.java index 82b6b8c87c..820f065957 100644 --- a/guava-collections/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java +++ b/guava-collections/src/test/java/com/baeldung/hamcrest/HamcrestExamplesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.hamcrest; +package com.baeldung.hamcrest; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java deleted file mode 100644 index ab38afa5c4..0000000000 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaCollectionTypesUnitTest.java +++ /dev/null @@ -1,202 +0,0 @@ -package org.baeldung.guava; - -import static org.hamcrest.Matchers.contains; -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.junit.Test; - -import com.google.common.base.Function; -import com.google.common.base.Joiner; -import com.google.common.base.Predicates; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.BiMap; -import com.google.common.collect.ClassToInstanceMap; -import com.google.common.collect.ContiguousSet; -import com.google.common.collect.DiscreteDomain; -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.HashBiMap; -import com.google.common.collect.HashMultiset; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSortedMap; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Multimap; -import com.google.common.collect.Multimaps; -import com.google.common.collect.Multiset; -import com.google.common.collect.Multisets; -import com.google.common.collect.MutableClassToInstanceMap; -import com.google.common.collect.Ordering; -import com.google.common.collect.Range; -import com.google.common.collect.RangeSet; -import com.google.common.collect.Sets; -import com.google.common.collect.Table; -import com.google.common.collect.Tables; -import com.google.common.collect.TreeRangeSet; - -public class GuavaCollectionTypesUnitTest { - - @Test - public void whenCreateList_thenCreated() { - final List names = Lists.newArrayList("John", "Adam", "Jane"); - - names.add("Tom"); - assertEquals(4, names.size()); - - names.remove("Adam"); - assertThat(names, contains("John", "Jane", "Tom")); - } - - @Test - public void whenReverseList_thenReversed() { - final List names = Lists.newArrayList("John", "Adam", "Jane"); - - final List reversed = Lists.reverse(names); - assertThat(reversed, contains("Jane", "Adam", "John")); - } - - @Test - public void whenCreateCharacterListFromString_thenCreated() { - final List chars = Lists.charactersOf("John"); - - assertEquals(4, chars.size()); - assertThat(chars, contains('J', 'o', 'h', 'n')); - } - - @Test - public void whenPartitionList_thenPartitioned() { - final List names = Lists.newArrayList("John", "Jane", "Adam", "Tom", "Viki", "Tyler"); - final List> result = Lists.partition(names, 2); - - assertEquals(3, result.size()); - assertThat(result.get(0), contains("John", "Jane")); - assertThat(result.get(1), contains("Adam", "Tom")); - assertThat(result.get(2), contains("Viki", "Tyler")); - } - - @Test - public void whenRemoveDuplicatesFromList_thenRemoved() { - final List chars = Lists.newArrayList('h', 'e', 'l', 'l', 'o'); - assertEquals(5, chars.size()); - - final List result = ImmutableSet.copyOf(chars).asList(); - assertThat(result, contains('h', 'e', 'l', 'o')); - } - - @Test - public void whenRemoveNullFromList_thenRemoved() { - final List names = Lists.newArrayList("John", null, "Adam", null, "Jane"); - Iterables.removeIf(names, Predicates.isNull()); - - assertEquals(3, names.size()); - assertThat(names, contains("John", "Adam", "Jane")); - } - - @Test - public void whenCreateImmutableList_thenCreated() { - final List names = Lists.newArrayList("John", "Adam", "Jane"); - - names.add("Tom"); - assertEquals(4, names.size()); - - final ImmutableList immutable = ImmutableList.copyOf(names); - assertThat(immutable, contains("John", "Adam", "Jane", "Tom")); - } - - @Test - public void whenCreateImmutableMap_thenCreated() { - final Map salary = ImmutableMap. builder().put("John", 1000).put("Jane", 1500).put("Adam", 2000).put("Tom", 2000).build(); - - assertEquals(1000, salary.get("John").intValue()); - assertEquals(2000, salary.get("Tom").intValue()); - } - - @Test - public void whenUseSortedMap_thenKeysAreSorted() { - final ImmutableSortedMap salary = new ImmutableSortedMap.Builder(Ordering.natural()).put("John", 1000).put("Jane", 1500).put("Adam", 2000).put("Tom", 2000).build(); - - assertEquals("Adam", salary.firstKey()); - assertEquals(2000, salary.lastEntry().getValue().intValue()); - } - - @Test - public void whenCreateBiMap_thenCreated() { - final BiMap words = HashBiMap.create(); - words.put("First", 1); - words.put("Second", 2); - words.put("Third", 3); - - assertEquals(2, words.get("Second").intValue()); - assertEquals("Third", words.inverse().get(3)); - } - - @Test - public void whenCreateMultimap_thenCreated() { - final Multimap multimap = ArrayListMultimap.create(); - multimap.put("fruit", "apple"); - multimap.put("fruit", "banana"); - multimap.put("pet", "cat"); - multimap.put("pet", "dog"); - - assertThat(multimap.get("fruit"), containsInAnyOrder("apple", "banana")); - assertThat(multimap.get("pet"), containsInAnyOrder("cat", "dog")); - } - - @Test - public void whenGroupListUsingMultimap_thenGrouped() { - final List names = Lists.newArrayList("John", "Adam", "Tom"); - final Function function = new Function() { - @Override - public final Integer apply(final String input) { - return input.length(); - } - }; - final Multimap groups = Multimaps.index(names, function); - - assertThat(groups.get(3), containsInAnyOrder("Tom")); - assertThat(groups.get(4), containsInAnyOrder("John", "Adam")); - } - - @Test - public void whenCreateTable_thenCreated() { - final Table distance = HashBasedTable.create(); - distance.put("London", "Paris", 340); - distance.put("New York", "Los Angeles", 3940); - distance.put("London", "New York", 5576); - - assertEquals(3940, distance.get("New York", "Los Angeles").intValue()); - assertThat(distance.columnKeySet(), containsInAnyOrder("Paris", "New York", "Los Angeles")); - assertThat(distance.rowKeySet(), containsInAnyOrder("London", "New York")); - } - - @Test - public void whenTransposeTable_thenCorrect() { - final Table distance = HashBasedTable.create(); - distance.put("London", "Paris", 340); - distance.put("New York", "Los Angeles", 3940); - distance.put("London", "New York", 5576); - - final Table transposed = Tables.transpose(distance); - assertThat(transposed.rowKeySet(), containsInAnyOrder("Paris", "New York", "Los Angeles")); - assertThat(transposed.columnKeySet(), containsInAnyOrder("London", "New York")); - } - - @Test - public void whenCreateClassToInstanceMap_thenCreated() { - final ClassToInstanceMap numbers = MutableClassToInstanceMap.create(); - numbers.putInstance(Integer.class, 1); - numbers.putInstance(Double.class, 1.5); - - assertEquals(1, numbers.get(Integer.class)); - assertEquals(1.5, numbers.get(Double.class)); - } - -} diff --git a/guava-collections/src/test/resources/.gitignore b/guava-collections/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/guava-collections/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/guava-io/README.md b/guava-io/README.md index df7775a36d..81188295e7 100644 --- a/guava-io/README.md +++ b/guava-io/README.md @@ -1,4 +1,8 @@ +## Guava IO + +This module contains articles about input/output (IO) with Google Guava + ### Relevant Articles: -- [Using Guava CountingOutputStream](http://www.baeldung.com/guava-counting-outputstream) -- [Guava – Write to File, Read from File](http://www.baeldung.com/guava-write-to-file-read-from-file) +- [Using Guava CountingOutputStream](https://www.baeldung.com/guava-counting-outputstream) +- [Guava – Write to File, Read from File](https://www.baeldung.com/guava-write-to-file-read-from-file) diff --git a/guava-io/pom.xml b/guava-io/pom.xml index 2a66baba80..aaaf7edd4e 100644 --- a/guava-io/pom.xml +++ b/guava-io/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung guava-io 0.1.0-SNAPSHOT guava-io diff --git a/guava-modules/README.md b/guava-modules/README.md index 79e45a89e7..898b8b7d9f 100644 --- a/guava-modules/README.md +++ b/guava-modules/README.md @@ -1,3 +1,4 @@ - ## Guava Modules +This module contains other modules about Google Guava + diff --git a/guava/README.md b/guava/README.md index d3bbbf6de5..c67a3604ea 100644 --- a/guava/README.md +++ b/guava/README.md @@ -1,15 +1,15 @@ +## Guava -## Guava Examples +This module contains articles a Google Guava ### Relevant Articles: -- [Guava Functional Cookbook](http://www.baeldung.com/guava-functions-predicates) -- [Guide to Guava’s Ordering](http://www.baeldung.com/guava-ordering) -- [Guide to Guava’s PreConditions](http://www.baeldung.com/guava-preconditions) -- [Introduction to Guava CacheLoader](http://www.baeldung.com/guava-cacheloader) -- [Introduction to Guava Memoizer](http://www.baeldung.com/guava-memoizer) -- [Guide to Guava’s EventBus](http://www.baeldung.com/guava-eventbus) -- [Guide to Guava’s Reflection Utilities](http://www.baeldung.com/guava-reflection) -- [Guide to Mathematical Utilities in Guava](http://www.baeldung.com/guava-math) -- [Bloom Filter in Java using Guava](http://www.baeldung.com/guava-bloom-filter) -- [Quick Guide to the Guava RateLimiter](http://www.baeldung.com/guava-rate-limiter) +- [Guava Functional Cookbook](https://www.baeldung.com/guava-functions-predicates) +- [Guide to Guava’s PreConditions](https://www.baeldung.com/guava-preconditions) +- [Introduction to Guava CacheLoader](https://www.baeldung.com/guava-cacheloader) +- [Introduction to Guava Memoizer](https://www.baeldung.com/guava-memoizer) +- [Guide to Guava’s EventBus](https://www.baeldung.com/guava-eventbus) +- [Guide to Guava’s Reflection Utilities](https://www.baeldung.com/guava-reflection) +- [Guide to Mathematical Utilities in Guava](https://www.baeldung.com/guava-math) +- [Bloom Filter in Java using Guava](https://www.baeldung.com/guava-bloom-filter) +- [Quick Guide to the Guava RateLimiter](https://www.baeldung.com/guava-rate-limiter) diff --git a/guava/pom.xml b/guava/pom.xml index 3a19901a02..4ca9918455 100644 --- a/guava/pom.xml +++ b/guava/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung guava 0.1.0-SNAPSHOT guava @@ -26,8 +25,6 @@ ${assertj.version} test - - @@ -41,9 +38,6 @@ - - 24.0-jre - 3.6.1 diff --git a/guice/README.md b/guice/README.md index 77c788c363..712639dfce 100644 --- a/guice/README.md +++ b/guice/README.md @@ -1,5 +1,8 @@ -## Google Guice Tutorials Project +## Google Guice + +This module contains articles about Google Guice ### Relevant Articles -- [Guide to Google Guice](http://www.baeldung.com/guice) + +- [Guide to Google Guice](https://www.baeldung.com/guice) - [Guice vs Spring – Dependency Injection](https://www.baeldung.com/guice-spring-dependency-injection) diff --git a/hazelcast/README.md b/hazelcast/README.md index 7adb13f2af..a37009ef7e 100644 --- a/hazelcast/README.md +++ b/hazelcast/README.md @@ -1,3 +1,7 @@ +## Hazelcast + +This module contains articles about Hazelcast + ### Relevant Articles: -- [Guide to Hazelcast with Java](http://www.baeldung.com/java-hazelcast) +- [Guide to Hazelcast with Java](https://www.baeldung.com/java-hazelcast) - [Introduction to Hazelcast Jet](https://www.baeldung.com/hazelcast-jet) diff --git a/hazelcast/pom.xml b/hazelcast/pom.xml index 705792ad05..9e0b0671d0 100644 --- a/hazelcast/pom.xml +++ b/hazelcast/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung hazelcast 0.0.1-SNAPSHOT hazelcast diff --git a/helidon/README.md b/helidon/README.md index a092faf9f2..fa5bade4fe 100644 --- a/helidon/README.md +++ b/helidon/README.md @@ -1,3 +1,7 @@ +## Helidon + +This module contains articles about Helidon + ### Relevant articles - [Microservices with Oracle Helidon](https://www.baeldung.com/microservices-oracle-helidon) diff --git a/httpclient-simple/README.md b/httpclient-simple/README.md index e3535a133e..098d5f278e 100644 --- a/httpclient-simple/README.md +++ b/httpclient-simple/README.md @@ -1,12 +1,15 @@ -========= -## This module contains articles that are part of the HTTPClient Ebook +## HTTPClient Ebook -- [HttpClient 4 – Get the Status Code](http://www.baeldung.com/httpclient-status-code) -- [HttpClient with SSL](http://www.baeldung.com/httpclient-ssl) -- [HttpClient Timeout](http://www.baeldung.com/httpclient-timeout) -- [HttpClient 4 – Send Custom Cookie](http://www.baeldung.com/httpclient-4-cookies) -- [Custom HTTP Header with the HttpClient](http://www.baeldung.com/httpclient-custom-http-header) -- [HttpClient Basic Authentication](http://www.baeldung.com/httpclient-4-basic-authentication) +This module contains articles about HTTPClient that are part of the HTTPClient Ebook. + +### Relevant Articles + +- [HttpClient 4 – Get the Status Code](https://www.baeldung.com/httpclient-status-code) +- [HttpClient with SSL](https://www.baeldung.com/httpclient-ssl) +- [HttpClient Timeout](https://www.baeldung.com/httpclient-timeout) +- [HttpClient 4 – Send Custom Cookie](https://www.baeldung.com/httpclient-4-cookies) +- [Custom HTTP Header with the HttpClient](https://www.baeldung.com/httpclient-custom-http-header) +- [HttpClient Basic Authentication](https://www.baeldung.com/httpclient-4-basic-authentication) - [Posting with HttpClient](https://www.baeldung.com/httpclient-post-http-request) diff --git a/httpclient-simple/pom.xml b/httpclient-simple/pom.xml index b2b0f98dd1..183c4438de 100644 --- a/httpclient-simple/pom.xml +++ b/httpclient-simple/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung httpclient-simple 0.1-SNAPSHOT httpclient-simple diff --git a/httpclient-simple/src/test/java/com/baeldung/client/RestClientLiveManualTest.java b/httpclient-simple/src/test/java/com/baeldung/client/RestClientLiveManualTest.java index a485641b34..d133bc376c 100644 --- a/httpclient-simple/src/test/java/com/baeldung/client/RestClientLiveManualTest.java +++ b/httpclient-simple/src/test/java/com/baeldung/client/RestClientLiveManualTest.java @@ -6,9 +6,9 @@ import static org.junit.Assert.assertThat; import java.io.IOException; import java.security.GeneralSecurityException; -import java.security.cert.X509Certificate; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLPeerUnverifiedException; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; @@ -46,7 +46,7 @@ public class RestClientLiveManualTest { // old httpClient will throw UnsupportedOperationException @Ignore @Test - public final void givenAcceptingAllCertificates_whenHttpsUrlIsConsumed_thenOk_1() throws GeneralSecurityException { + public final void givenAcceptingAllCertificates_whenHttpsUrlIsConsumed_thenOk() throws GeneralSecurityException { final HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); final CloseableHttpClient httpClient = (CloseableHttpClient) requestFactory.getHttpClient(); @@ -92,7 +92,7 @@ public class RestClientLiveManualTest { } @Test - public final void givenAcceptingAllCertificatesUsing4_4_whenHttpsUrlIsConsumedUsingRestTemplate_thenCorrect() throws ClientProtocolException, IOException { + public final void givenAcceptingAllCertificatesUsing4_4_whenUsingRestTemplate_thenCorrect() throws ClientProtocolException, IOException { final CloseableHttpClient httpClient = HttpClients.custom().setSSLHostnameVerifier(new NoopHostnameVerifier()).build(); final HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); requestFactory.setHttpClient(httpClient); @@ -101,4 +101,12 @@ public class RestClientLiveManualTest { assertThat(response.getStatusCode().value(), equalTo(200)); } + @Test(expected = SSLPeerUnverifiedException.class) + public void whenHttpsUrlIsConsumed_thenException() throws ClientProtocolException, IOException { + CloseableHttpClient httpClient = HttpClients.createDefault(); + String urlOverHttps = "https://localhost:8082/httpclient-simple"; + HttpGet getMethod = new HttpGet(urlOverHttps); + HttpResponse response = httpClient.execute(getMethod); + assertThat(response.getStatusLine().getStatusCode(), equalTo(200)); + } } diff --git a/httpclient/README.md b/httpclient/README.md index a5fc29b089..d88739e901 100644 --- a/httpclient/README.md +++ b/httpclient/README.md @@ -1,19 +1,20 @@ -========= -## HttpClient 4.x Cookbooks and Examples +## HttpClient 4.x + +This module contains articles about HttpClient 4.x + +### The Course -###The Course The "REST With Spring" Classes: http://bit.ly/restwithspring - ### Relevant Articles: -- [HttpClient 4 – Cancel Request](http://www.baeldung.com/httpclient-cancel-request) -- [HttpClient 4 Cookbook](http://www.baeldung.com/httpclient4) -- [Unshorten URLs with HttpClient](http://www.baeldung.com/unshorten-url-httpclient) -- [HttpClient 4 – Follow Redirects for POST](http://www.baeldung.com/httpclient-redirect-on-http-post) -- [Multipart Upload with HttpClient 4](http://www.baeldung.com/httpclient-multipart-upload) -- [HttpAsyncClient Tutorial](http://www.baeldung.com/httpasyncclient-tutorial) -- [HttpClient 4 Tutorial](http://www.baeldung.com/httpclient-guide) -- [Advanced HttpClient Configuration](http://www.baeldung.com/httpclient-advanced-config) -- [HttpClient 4 – Do Not Follow Redirects](http://www.baeldung.com/httpclient-stop-follow-redirect) -- [Custom User-Agent in HttpClient 4](http://www.baeldung.com/httpclient-user-agent-header) +- [HttpClient 4 – Cancel Request](https://www.baeldung.com/httpclient-cancel-request) +- [HttpClient 4 Cookbook](https://www.baeldung.com/httpclient4) +- [Unshorten URLs with HttpClient](https://www.baeldung.com/unshorten-url-httpclient) +- [HttpClient 4 – Follow Redirects for POST](https://www.baeldung.com/httpclient-redirect-on-http-post) +- [Multipart Upload with HttpClient 4](https://www.baeldung.com/httpclient-multipart-upload) +- [HttpAsyncClient Tutorial](https://www.baeldung.com/httpasyncclient-tutorial) +- [HttpClient 4 Tutorial](https://www.baeldung.com/httpclient-guide) +- [Advanced HttpClient Configuration](https://www.baeldung.com/httpclient-advanced-config) +- [HttpClient 4 – Do Not Follow Redirects](https://www.baeldung.com/httpclient-stop-follow-redirect) +- [Custom User-Agent in HttpClient 4](https://www.baeldung.com/httpclient-user-agent-header) diff --git a/httpclient/pom.xml b/httpclient/pom.xml index 8cd483cfc6..6316ee4eed 100644 --- a/httpclient/pom.xml +++ b/httpclient/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung httpclient 0.1-SNAPSHOT httpclient @@ -48,11 +47,6 @@ httpmime ${httpclient.version} - - commons-codec - commons-codec - ${commons-codec.version} - org.apache.httpcomponents httpasyncclient @@ -82,51 +76,12 @@ - - - live - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - - - **/*LiveTest.java - - - - - - - json - - - - - - - - - 19.0 - 1.10 4.1.4 2.5.1 4.5.8 - - 1.6.1 \ No newline at end of file diff --git a/hystrix/README.md b/hystrix/README.md index cc5c8a197f..d53baee957 100644 --- a/hystrix/README.md +++ b/hystrix/README.md @@ -1,3 +1,7 @@ +## Hystrix + +This module contains articles about Hystrix. + ### Relevant Articles: -- [Hystrix Integration with Existing Spring Application](http://www.baeldung.com/hystrix-integration-with-spring-aop) -- [Introduction to Hystrix](http://www.baeldung.com/introduction-to-hystrix) +- [Hystrix Integration with Existing Spring Application](https://www.baeldung.com/hystrix-integration-with-spring-aop) +- [Introduction to Hystrix](https://www.baeldung.com/introduction-to-hystrix) diff --git a/hystrix/pom.xml b/hystrix/pom.xml index e08af2c40f..4aeb47f095 100644 --- a/hystrix/pom.xml +++ b/hystrix/pom.xml @@ -41,23 +41,11 @@ hystrix-metrics-event-stream ${hystrix-metrics-event-stream.version} - com.netflix.rxjava rxjava-core ${rxjava-core.version} - - org.hamcrest - hamcrest-all - ${hamcrest-all.version} - test - - - org.springframework - spring-test - test - @@ -65,9 +53,7 @@ 1.5.8 0.20.7 - 2.7 1.5.8 - 1.5.8 diff --git a/hystrix/src/test/java/com/baeldung/hystrix/SpringAndHystrixIntegrationTest.java b/hystrix/src/test/java/com/baeldung/hystrix/SpringAndHystrixIntegrationTest.java index 004314b0ed..c8910878a9 100644 --- a/hystrix/src/test/java/com/baeldung/hystrix/SpringAndHystrixIntegrationTest.java +++ b/hystrix/src/test/java/com/baeldung/hystrix/SpringAndHystrixIntegrationTest.java @@ -13,7 +13,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; @RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, classes = AppConfig.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = AppConfig.class) public class SpringAndHystrixIntegrationTest { @Autowired diff --git a/image-processing/README.md b/image-processing/README.md index 48604bdb1f..adb35c2318 100644 --- a/image-processing/README.md +++ b/image-processing/README.md @@ -1,2 +1,6 @@ +## Image Processing + +This module contains articles about image processing. + ### Relevant Articles: -- [Working with Images in Java](http://www.baeldung.com/java-images) +- [Working with Images in Java](https://www.baeldung.com/java-images) diff --git a/immutables/README.md b/immutables/README.md index b69a14f035..a93a342f9c 100644 --- a/immutables/README.md +++ b/immutables/README.md @@ -1,2 +1,6 @@ +## Immutables + +This module contains articles about the Immutables library. + ### Relevant Articles: -- [Introduction to Immutables](http://www.baeldung.com/immutables) +- [Introduction to Immutables](https://www.baeldung.com/immutables) diff --git a/jackson-2/README.md b/jackson-2/README.md index 920eaa91e8..5e0cb4ec37 100644 --- a/jackson-2/README.md +++ b/jackson-2/README.md @@ -1,7 +1,7 @@ -========= - ## Jackson Cookbooks and Examples +This module contains articles about Jackson. + ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring @@ -12,3 +12,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Converting JSON to CSV in Java](https://www.baeldung.com/java-converting-json-to-csv) - [Compare Two JSON Objects with Jackson](https://www.baeldung.com/jackson-compare-two-json-objects) - [Calling Default Serializer from Custom Serializer in Jackson](https://www.baeldung.com/jackson-call-default-serializer-from-custom-serializer) +- More articles: [[<-- prev]](/../jackson) diff --git a/jackson-simple/README.md b/jackson-simple/README.md index be647e22d5..9d24a20e4a 100644 --- a/jackson-simple/README.md +++ b/jackson-simple/README.md @@ -1,13 +1,15 @@ -========= ### Jackson Articles that are also part of the e-book -###The Course +This module contains articles about Jackson that are also part of the Jackson Ebook. + +### The Course + The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [Jackson Ignore Properties on Marshalling](http://www.baeldung.com/jackson-ignore-properties-on-serialization) -- [Jackson Unmarshalling json with Unknown Properties](http://www.baeldung.com/jackson-deserialize-json-unknown-properties) -- [Jackson Annotation Examples](http://www.baeldung.com/jackson-annotations) -- [Intro to the Jackson ObjectMapper](http://www.baeldung.com/jackson-object-mapper-tutorial) -- [Ignore Null Fields with Jackson](http://www.baeldung.com/jackson-ignore-null-fields) -- [Jackson – Change Name of Field](http://www.baeldung.com/jackson-name-of-property) +- [Jackson Ignore Properties on Marshalling](https://www.baeldung.com/jackson-ignore-properties-on-serialization) +- [Jackson Unmarshalling json with Unknown Properties](https://www.baeldung.com/jackson-deserialize-json-unknown-properties) +- [Jackson Annotation Examples](https://www.baeldung.com/jackson-annotations) +- [Intro to the Jackson ObjectMapper](https://www.baeldung.com/jackson-object-mapper-tutorial) +- [Ignore Null Fields with Jackson](https://www.baeldung.com/jackson-ignore-null-fields) +- [Jackson – Change Name of Field](https://www.baeldung.com/jackson-name-of-property) diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/MyBean.java b/jackson-simple/src/test/java/com/baeldung/jackson/annotation/MyBean.java index 5d4ce4202c..e4e78ce445 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/MyBean.java +++ b/jackson-simple/src/test/java/com/baeldung/jackson/annotation/MyBean.java @@ -1,8 +1,10 @@ package com.baeldung.jackson.annotation; +import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; @JsonInclude(Include.NON_NULL) @JsonPropertyOrder({ "name", "id" }) @@ -18,4 +20,14 @@ public class MyBean { this.id = id; this.name = name; } + + @JsonGetter("name") + public String getTheName() { + return name; + } + + @JsonSetter("name") + public void setTheName(String name) { + this.name = name; + } } diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java index 2745e4f767..a339ddf2c5 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java +++ b/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java @@ -1,20 +1,29 @@ package com.baeldung.jackson.objectmapper; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; + +import java.io.File; +import java.net.URL; +import java.util.List; +import java.util.Map; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + import com.baeldung.jackson.objectmapper.dto.Car; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.Test; - -import java.util.List; -import java.util.Map; - -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; public class JavaReadWriteJsonExampleUnitTest { + @Rule + public TemporaryFolder folder = new TemporaryFolder(); + final String EXAMPLE_JSON = "{ \"color\" : \"Black\", \"type\" : \"BMW\" }"; final String LOCAL_JSON = "[{ \"color\" : \"Black\", \"type\" : \"BMW\" }, { \"color\" : \"Red\", \"type\" : \"BMW\" }]"; @@ -27,6 +36,19 @@ public class JavaReadWriteJsonExampleUnitTest { assertThat(carAsString, containsString("renault")); } + @Test + public void whenWriteToFile_thanCorrect() throws Exception { + File resultFile = folder.newFile("car.json"); + + ObjectMapper objectMapper = new ObjectMapper(); + Car car = new Car("yellow", "renault"); + objectMapper.writeValue(resultFile, car); + + Car fromFile = objectMapper.readValue(resultFile, Car.class); + assertEquals(car.getType(), fromFile.getType()); + assertEquals(car.getColor(), fromFile.getColor()); + } + @Test public void whenReadJsonToJava_thanCorrect() throws Exception { final ObjectMapper objectMapper = new ObjectMapper(); @@ -66,4 +88,26 @@ public class JavaReadWriteJsonExampleUnitTest { assertNotNull(key); } } + + @Test + public void wheReadFromFile_thanCorrect() throws Exception { + File resource = new File("src/test/resources/json_car.json"); + + ObjectMapper objectMapper = new ObjectMapper(); + Car fromFile = objectMapper.readValue(resource, Car.class); + + assertEquals("BMW", fromFile.getType()); + assertEquals("Black", fromFile.getColor()); + } + + @Test + public void wheReadFromUrl_thanCorrect() throws Exception { + URL resource = new URL("file:src/test/resources/json_car.json"); + + ObjectMapper objectMapper = new ObjectMapper(); + Car fromFile = objectMapper.readValue(resource, Car.class); + + assertEquals("BMW", fromFile.getType()); + assertEquals("Black", fromFile.getColor()); + } } diff --git a/jackson-simple/src/test/resources/.gitignore b/jackson-simple/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/jackson-simple/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/jackson-simple/src/test/resources/json_car.json b/jackson-simple/src/test/resources/json_car.json new file mode 100644 index 0000000000..2f6b35b523 --- /dev/null +++ b/jackson-simple/src/test/resources/json_car.json @@ -0,0 +1,4 @@ +{ + "color": "Black", + "type": "BMW" +} \ No newline at end of file diff --git a/jackson/README.md b/jackson/README.md index 01d9419a27..a62a788c41 100644 --- a/jackson/README.md +++ b/jackson/README.md @@ -1,35 +1,38 @@ -========= - ## Jackson Cookbooks and Examples -###The Course +This module contains articles about Jackson. + +### The Course + The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: -- [Jackson – Unmarshall to Collection/Array](http://www.baeldung.com/jackson-collection-array) -- [Jackson – Custom Serializer](http://www.baeldung.com/jackson-custom-serialization) -- [Getting Started with Custom Deserialization in Jackson](http://www.baeldung.com/jackson-deserialization) -- [Jackson Exceptions – Problems and Solutions](http://www.baeldung.com/jackson-exception) -- [Jackson Date](http://www.baeldung.com/jackson-serialize-dates) -- [Jackson – Bidirectional Relationships](http://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion) -- [Jackson JSON Tutorial](http://www.baeldung.com/jackson) -- [Jackson – Working with Maps and nulls](http://www.baeldung.com/jackson-map-null-values-or-null-key) -- [Jackson – Decide What Fields Get Serialized/Deserialized](http://www.baeldung.com/jackson-field-serializable-deserializable-or-not) -- [Jackson vs Gson](http://www.baeldung.com/jackson-vs-gson) -- [XML Serialization and Deserialization with Jackson](http://www.baeldung.com/jackson-xml-serialization-and-deserialization) -- [More Jackson Annotations](http://www.baeldung.com/jackson-advanced-annotations) -- [Inheritance with Jackson](http://www.baeldung.com/jackson-inheritance) -- [Guide to @JsonFormat in Jackson](http://www.baeldung.com/jackson-jsonformat) -- [Using Optional with Jackson](http://www.baeldung.com/jackson-optional) -- [Map Serialization and Deserialization with Jackson](http://www.baeldung.com/jackson-map) -- [Jackson Streaming API](http://www.baeldung.com/jackson-streaming-api) -- [Jackson – JsonMappingException (No serializer found for class)](http://www.baeldung.com/jackson-jsonmappingexception) -- [How To Serialize Enums as JSON Objects with Jackson](http://www.baeldung.com/jackson-serialize-enums) -- [Jackson – Marshall String to JsonNode](http://www.baeldung.com/jackson-json-to-jsonnode) -- [Jackson – Unmarshall to Collection/Array](http://www.baeldung.com/jackson-collection-array) -- [Serialize Only Fields that meet a Custom Criteria with Jackson](http://www.baeldung.com/jackson-serialize-field-custom-criteria) -- [Mapping Nested Values with Jackson](http://www.baeldung.com/jackson-nested-values) + +- [Jackson – Unmarshall to Collection/Array](https://www.baeldung.com/jackson-collection-array) +- [Jackson – Custom Serializer](https://www.baeldung.com/jackson-custom-serialization) +- [Getting Started with Custom Deserialization in Jackson](https://www.baeldung.com/jackson-deserialization) +- [Jackson Exceptions – Problems and Solutions](https://www.baeldung.com/jackson-exception) +- [Jackson Date](https://www.baeldung.com/jackson-serialize-dates) +- [Jackson – Bidirectional Relationships](https://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion) +- [Jackson JSON Tutorial](https://www.baeldung.com/jackson) +- [Jackson – Working with Maps and nulls](https://www.baeldung.com/jackson-map-null-values-or-null-key) +- [Jackson – Decide What Fields Get Serialized/Deserialized](https://www.baeldung.com/jackson-field-serializable-deserializable-or-not) +- [Jackson vs Gson](https://www.baeldung.com/jackson-vs-gson) +- [XML Serialization and Deserialization with Jackson](https://www.baeldung.com/jackson-xml-serialization-and-deserialization) +- [More Jackson Annotations](https://www.baeldung.com/jackson-advanced-annotations) +- [Inheritance with Jackson](https://www.baeldung.com/jackson-inheritance) +- [Guide to @JsonFormat in Jackson](https://www.baeldung.com/jackson-jsonformat) +- [Using Optional with Jackson](https://www.baeldung.com/jackson-optional) +- [Map Serialization and Deserialization with Jackson](https://www.baeldung.com/jackson-map) +- [Jackson Streaming API](https://www.baeldung.com/jackson-streaming-api) +- [Jackson – JsonMappingException (No serializer found for class)](https://www.baeldung.com/jackson-jsonmappingexception) +- [How To Serialize and Deserialize Enums with Jackson](https://www.baeldung.com/jackson-serialize-enums) +- [Jackson – Marshall String to JsonNode](https://www.baeldung.com/jackson-json-to-jsonnode) +- [Jackson – Unmarshall to Collection/Array](https://www.baeldung.com/jackson-collection-array) +- [Serialize Only Fields that meet a Custom Criteria with Jackson](https://www.baeldung.com/jackson-serialize-field-custom-criteria) +- [Mapping Nested Values with Jackson](https://www.baeldung.com/jackson-nested-values) - [Convert XML to JSON Using Jackson](https://www.baeldung.com/jackson-convert-xml-json) - [Deserialize Immutable Objects with Jackson](https://www.baeldung.com/jackson-deserialize-immutable-objects) - [Mapping a Dynamic JSON Object with Jackson](https://www.baeldung.com/jackson-mapping-dynamic-object) +- More articles: [[next -->]](/../jackson-2) diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/dynamicobject/Product.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/dynamicobject/Product.java new file mode 100644 index 0000000000..9c997886e5 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/dynamicobject/Product.java @@ -0,0 +1,39 @@ +package com.baeldung.jackson.deserialization.dynamicobject; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnySetter; + +public class Product { + + private String name; + private String category; + private Map details = new LinkedHashMap<>(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public Map getDetails() { + return details; + } + + @JsonAnySetter + public void setDetail(String key, Object value) { + details.put(key, value); + } + +} diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/dynamicobject/ProductJsonAnySetter.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/dynamicobject/ProductJsonAnySetter.java deleted file mode 100644 index 13c21e37af..0000000000 --- a/jackson/src/main/java/com/baeldung/jackson/deserialization/dynamicobject/ProductJsonAnySetter.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.baeldung.jackson.deserialization.dynamicobject; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnySetter; - -public class ProductJsonAnySetter { - - private String name; - private String category; - private Map details = new LinkedHashMap<>(); - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCategory() { - return category; - } - - public void setCategory(String category) { - this.category = category; - } - - public Map getDetails() { - return details; - } - - @JsonAnySetter - public void setDetail(String key, Object value) { - details.put(key, value); - } - -} diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/City.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/City.java new file mode 100644 index 0000000000..2bbef534c3 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/City.java @@ -0,0 +1,15 @@ +package com.baeldung.jackson.deserialization.enums; + +public class City { + + private Distance distance; + + public Distance getDistance() { + return distance; + } + + public void setDistance(Distance distance) { + this.distance = distance; + } + +} diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/Distance.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/Distance.java new file mode 100644 index 0000000000..2c96b6eb80 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/Distance.java @@ -0,0 +1,31 @@ +package com.baeldung.jackson.deserialization.enums; + +public enum Distance { + + KILOMETER("km", 1000), MILE("miles", 1609.34), METER("meters", 1), INCH("inches", 0.0254), CENTIMETER("cm", 0.01), MILLIMETER("mm", 0.001); + + private String unit; + private double meters; + + private Distance(String unit, double meters) { + this.unit = unit; + this.meters = meters; + } + + public void setMeters(double meters) { + this.meters = meters; + } + + public double getMeters() { + return meters; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } +} + diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/customdeserializer/City.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/customdeserializer/City.java new file mode 100644 index 0000000000..36ef7e244a --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/customdeserializer/City.java @@ -0,0 +1,15 @@ +package com.baeldung.jackson.deserialization.enums.customdeserializer; + +public class City { + + private Distance distance; + + public Distance getDistance() { + return distance; + } + + public void setDistance(Distance distance) { + this.distance = distance; + } + +} diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/customdeserializer/CustomEnumDeserializer.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/customdeserializer/CustomEnumDeserializer.java new file mode 100644 index 0000000000..bae0c0df34 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/customdeserializer/CustomEnumDeserializer.java @@ -0,0 +1,42 @@ +package com.baeldung.jackson.deserialization.enums.customdeserializer; + +import java.io.IOException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + +public class CustomEnumDeserializer extends StdDeserializer { + + private static final long serialVersionUID = -1166032307856492833L; + + public CustomEnumDeserializer() { + this(null); + } + + public CustomEnumDeserializer(Class c) { + super(c); + } + + @Override + public Distance deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException { + + JsonNode node = jsonParser.getCodec().readTree(jsonParser); + + String unit = node.get("unit").asText(); + double meters = node.get("meters").asDouble(); + + for (Distance distance : Distance.values()) { + + if (distance.getUnit().equals(unit) && + Double.compare(distance.getMeters(), meters) == 0) { + + return distance; + } + } + + return null; + } + +} diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/customdeserializer/Distance.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/customdeserializer/Distance.java new file mode 100644 index 0000000000..9cb3a0c391 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/customdeserializer/Distance.java @@ -0,0 +1,33 @@ +package com.baeldung.jackson.deserialization.enums.customdeserializer; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +@JsonDeserialize(using = CustomEnumDeserializer.class) +public enum Distance { + + KILOMETER("km", 1000), MILE("miles", 1609.34), METER("meters", 1), INCH("inches", 0.0254), CENTIMETER("cm", 0.01), MILLIMETER("mm", 0.001); + + private String unit; + private double meters; + + private Distance(String unit, double meters) { + this.unit = unit; + this.meters = meters; + } + + public double getMeters() { + return meters; + } + + public void setMeters(double meters) { + this.meters = meters; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } +} \ No newline at end of file diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsoncreator/City.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsoncreator/City.java new file mode 100644 index 0000000000..6a478dd263 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsoncreator/City.java @@ -0,0 +1,15 @@ +package com.baeldung.jackson.deserialization.enums.jsoncreator; + +public class City { + + private Distance distance; + + public Distance getDistance() { + return distance; + } + + public void setDistance(Distance distance) { + this.distance = distance; + } + +} diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsoncreator/Distance.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsoncreator/Distance.java new file mode 100644 index 0000000000..18235fb5c6 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsoncreator/Distance.java @@ -0,0 +1,48 @@ +package com.baeldung.jackson.deserialization.enums.jsoncreator; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +public enum Distance { + + KILOMETER("km", 1000), MILE("miles", 1609.34), METER("meters", 1), INCH("inches", 0.0254), CENTIMETER("cm", 0.01), MILLIMETER("mm", 0.001); + + private String unit; + private double meters; + + private Distance(String unit, double meters) { + this.unit = unit; + this.meters = meters; + } + + public void setMeters(double meters) { + this.meters = meters; + } + + public double getMeters() { + return meters; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + @JsonCreator + public static Distance forValues(@JsonProperty("unit") String unit, @JsonProperty("meters") double meters) { + + for (Distance distance : Distance.values()) { + if (distance.unit.equals(unit) && Double.compare(distance.meters, meters) == 0) { + + return distance; + } + } + + return null; + + } +} + diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonproperty/City.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonproperty/City.java new file mode 100644 index 0000000000..7f763f97c4 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonproperty/City.java @@ -0,0 +1,15 @@ +package com.baeldung.jackson.deserialization.enums.jsonproperty; + +public class City { + + private Distance distance; + + public Distance getDistance() { + return distance; + } + + public void setDistance(Distance distance) { + this.distance = distance; + } + +} diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonproperty/Distance.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonproperty/Distance.java new file mode 100644 index 0000000000..e671a9ae5b --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonproperty/Distance.java @@ -0,0 +1,51 @@ +package com.baeldung.jackson.deserialization.enums.jsonproperty; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public enum Distance { + + @JsonProperty("distance-in-km") + KILOMETER("km", 1000), + + @JsonProperty("distance-in-miles") + MILE("miles", 1609.34), + + @JsonProperty("distance-in-meters") + METER("meters", 1), + + @JsonProperty("distance-in-inches") + INCH("inches", 0.0254), + + @JsonProperty("distance-in-cm") + CENTIMETER("cm", 0.01), + + @JsonProperty("distance-in-mm") + MILLIMETER("mm", 0.001); + + private String unit; + private double meters; + + private Distance(String unit, double meters) { + this.unit = unit; + this.meters = meters; + } + + public void setMeters(double meters) { + this.meters = meters; + } + + public double getMeters() { + return meters; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + +} + + diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonvalue/City.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonvalue/City.java new file mode 100644 index 0000000000..014668ea8c --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonvalue/City.java @@ -0,0 +1,15 @@ +package com.baeldung.jackson.deserialization.enums.jsonvalue; + +public class City { + + private Distance distance; + + public Distance getDistance() { + return distance; + } + + public void setDistance(Distance distance) { + this.distance = distance; + } + +} diff --git a/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonvalue/Distance.java b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonvalue/Distance.java new file mode 100644 index 0000000000..44bb5f20c3 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/deserialization/enums/jsonvalue/Distance.java @@ -0,0 +1,35 @@ +package com.baeldung.jackson.deserialization.enums.jsonvalue; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum Distance { + + KILOMETER("km", 1000), MILE("miles", 1609.34), METER("meters", 1), INCH("inches", 0.0254), CENTIMETER("cm", 0.01), MILLIMETER("mm", 0.001); + + private String unit; + private double meters; + + private Distance(String unit, double meters) { + this.unit = unit; + this.meters = meters; + } + + public void setMeters(double meters) { + this.meters = meters; + } + + @JsonValue + public double getMeters() { + return meters; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + +} + diff --git a/jackson/src/test/java/com/baeldung/jackson/deserialization/dynamicobject/DynamicObjectDeserializationUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/deserialization/dynamicobject/DynamicObjectDeserializationUnitTest.java index d49677c1a2..c9536bc35a 100644 --- a/jackson/src/test/java/com/baeldung/jackson/deserialization/dynamicobject/DynamicObjectDeserializationUnitTest.java +++ b/jackson/src/test/java/com/baeldung/jackson/deserialization/dynamicobject/DynamicObjectDeserializationUnitTest.java @@ -59,7 +59,7 @@ public class DynamicObjectDeserializationUnitTest { String json = readResource("/deserialize-dynamic-object/flat.json"); // when - ProductJsonAnySetter product = objectMapper.readValue(json, ProductJsonAnySetter.class); + Product product = objectMapper.readValue(json, Product.class); // then assertThat(product.getName()).isEqualTo("Pear yPhone 72"); diff --git a/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/DefaultEnumDeserializationUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/DefaultEnumDeserializationUnitTest.java new file mode 100644 index 0000000000..c7ce96e013 --- /dev/null +++ b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/DefaultEnumDeserializationUnitTest.java @@ -0,0 +1,19 @@ +package com.baeldung.jackson.deserialization.enums; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.io.IOException; +import org.junit.Test; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class DefaultEnumDeserializationUnitTest { + + @Test + public void givenEnum_whenDeserializingJson_thenCorrectRepresentation() throws JsonParseException, IOException { + String json = "{\"distance\":\"KILOMETER\"}"; + City city = new ObjectMapper().readValue(json, City.class); + + assertEquals(Distance.KILOMETER, city.getDistance()); + } + +} diff --git a/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/customdeserializer/EnumCustomDeserializationUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/customdeserializer/EnumCustomDeserializationUnitTest.java new file mode 100644 index 0000000000..e8dbfa8df8 --- /dev/null +++ b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/customdeserializer/EnumCustomDeserializationUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.jackson.deserialization.enums.customdeserializer; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.io.IOException; +import org.junit.Test; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class EnumCustomDeserializationUnitTest { + + @Test + public void givenEnumWithCustomDeserializer_whenDeserializingJson_thenCorrectRepresentation() throws JsonParseException, IOException { + String json = "{\"distance\": {\"unit\":\"miles\",\"meters\":1609.34}}"; + + City city = new ObjectMapper().readValue(json, City.class); + assertEquals(Distance.MILE, city.getDistance()); + } +} diff --git a/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/jsoncreator/EnumDeserializationUsingJsonCreatorUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/jsoncreator/EnumDeserializationUsingJsonCreatorUnitTest.java new file mode 100644 index 0000000000..d778cbe26b --- /dev/null +++ b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/jsoncreator/EnumDeserializationUsingJsonCreatorUnitTest.java @@ -0,0 +1,19 @@ +package com.baeldung.jackson.deserialization.enums.jsoncreator; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.io.IOException; +import org.junit.Test; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class EnumDeserializationUsingJsonCreatorUnitTest { + + @Test + public void givenEnumWithJsonCreator_whenDeserializingJson_thenCorrectRepresentation() throws JsonParseException, IOException { + String json = "{\"distance\": {\"unit\":\"miles\",\"meters\":1609.34}}"; + + City city = new ObjectMapper().readValue(json, City.class); + assertEquals(Distance.MILE, city.getDistance()); + } + +} diff --git a/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/jsonproperty/EnumDeserializationUsingJsonPropertyUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/jsonproperty/EnumDeserializationUsingJsonPropertyUnitTest.java new file mode 100644 index 0000000000..134f4a29cc --- /dev/null +++ b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/jsonproperty/EnumDeserializationUsingJsonPropertyUnitTest.java @@ -0,0 +1,20 @@ +package com.baeldung.jackson.deserialization.enums.jsonproperty; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.io.IOException; +import org.junit.Test; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class EnumDeserializationUsingJsonPropertyUnitTest { + + @Test + public void givenEnumWithJsonProperty_whenDeserializingJson_thenCorrectRepresentation() throws JsonParseException, IOException { + String json = "{\"distance\": \"distance-in-km\"}"; + + City city = new ObjectMapper().readValue(json, City.class); + assertEquals(Distance.KILOMETER, city.getDistance()); + + } + +} diff --git a/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/jsonvalue/EnumDeserializationUsingJsonValueUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/jsonvalue/EnumDeserializationUsingJsonValueUnitTest.java new file mode 100644 index 0000000000..85afcb9a69 --- /dev/null +++ b/jackson/src/test/java/com/baeldung/jackson/deserialization/enums/jsonvalue/EnumDeserializationUsingJsonValueUnitTest.java @@ -0,0 +1,19 @@ +package com.baeldung.jackson.deserialization.enums.jsonvalue; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.io.IOException; +import org.junit.Test; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class EnumDeserializationUsingJsonValueUnitTest { + + @Test + public void givenEnumWithJsonValue_whenDeserializingJson_thenCorrectRepresentation() throws JsonParseException, IOException { + String json = "{\"distance\": \"0.0254\"}"; + + City city = new ObjectMapper().readValue(json, City.class); + assertEquals(Distance.INCH, city.getDistance()); + } + +} diff --git a/jackson/src/test/java/com/baeldung/jackson/enums/JacksonEnumSerializationUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/enums/JacksonEnumSerializationUnitTest.java index 45c0ba1382..d4fb2401ed 100644 --- a/jackson/src/test/java/com/baeldung/jackson/enums/JacksonEnumSerializationUnitTest.java +++ b/jackson/src/test/java/com/baeldung/jackson/enums/JacksonEnumSerializationUnitTest.java @@ -2,11 +2,8 @@ package com.baeldung.jackson.enums; import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertThat; - import java.io.IOException; - import org.junit.Test; - import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -18,5 +15,5 @@ public class JacksonEnumSerializationUnitTest { assertThat(dtoAsString, containsString("1609.34")); } - + } diff --git a/java-blockchain/README.md b/java-blockchain/README.md index 600f4dd610..5afd0d356b 100644 --- a/java-blockchain/README.md +++ b/java-blockchain/README.md @@ -1,6 +1,7 @@ -========= +## Java Blockchain -## Basic Implementation of Blockchian in Java +This module contains articles about Blockchain in Java ### Relevant Articles: -- []() + +- [Implementing a Simple Blockchain in Java](https://www.baeldung.com/java-blockchain) diff --git a/java-blockchain/pom.xml b/java-blockchain/pom.xml index 2f9e011aa7..4c5d0f31d5 100644 --- a/java-blockchain/pom.xml +++ b/java-blockchain/pom.xml @@ -7,12 +7,14 @@ 0.1.0-SNAPSHOT java-blockchain jar + com.baeldung parent-java 0.0.1-SNAPSHOT ../parent-java + java-blockchain @@ -33,8 +35,10 @@ + 1.8 1.8 + \ No newline at end of file diff --git a/java-collections-conversions-2/README.md b/java-collections-conversions-2/README.md new file mode 100644 index 0000000000..761e56253e --- /dev/null +++ b/java-collections-conversions-2/README.md @@ -0,0 +1,7 @@ +## Java Collections Cookbooks and Examples + +This module contains articles about conversions among Collection types and arrays in Java. + +### Relevant Articles: +- [Array to String Conversions](https://www.baeldung.com/java-array-to-string) +- More articles: [[<-- prev]](../java-collections-conversions) \ No newline at end of file diff --git a/java-collections-conversions-2/pom.xml b/java-collections-conversions-2/pom.xml new file mode 100644 index 0000000000..72673527ac --- /dev/null +++ b/java-collections-conversions-2/pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + java-collections-conversions-2 + 0.1.0-SNAPSHOT + java-collections-conversions-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + + java-collections-conversions-2 + + + src/main/resources + true + + + + + + + diff --git a/java-collections-conversions/src/test/java/org/baeldung/convertarraytostring/ArrayToStringUnitTest.java b/java-collections-conversions-2/src/test/java/com/baeldung/convertarraytostring/ArrayToStringUnitTest.java similarity index 98% rename from java-collections-conversions/src/test/java/org/baeldung/convertarraytostring/ArrayToStringUnitTest.java rename to java-collections-conversions-2/src/test/java/com/baeldung/convertarraytostring/ArrayToStringUnitTest.java index b563475997..73cf9d6baa 100644 --- a/java-collections-conversions/src/test/java/org/baeldung/convertarraytostring/ArrayToStringUnitTest.java +++ b/java-collections-conversions-2/src/test/java/com/baeldung/convertarraytostring/ArrayToStringUnitTest.java @@ -1,15 +1,14 @@ -package org.baeldung.convertarraytostring; +package com.baeldung.convertarraytostring; + +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import org.apache.commons.lang3.StringUtils; -import org.junit.Test; - -import com.google.common.base.Joiner; -import com.google.common.base.Splitter; - import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; diff --git a/java-collections-conversions/README.md b/java-collections-conversions/README.md index 614f20f186..2d3aa41f2d 100644 --- a/java-collections-conversions/README.md +++ b/java-collections-conversions/README.md @@ -1,16 +1,16 @@ -========= - ## Java Collections Cookbooks and Examples +This module contains articles about conversions among Collection types and arrays in Java. + ### Relevant Articles: -- [Converting between an Array and a List in Java](http://www.baeldung.com/convert-array-to-list-and-list-to-array) -- [Converting between an Array and a Set in Java](http://www.baeldung.com/convert-array-to-set-and-set-to-array) -- [Converting between a List and a Set in Java](http://www.baeldung.com/convert-list-to-set-and-set-to-list) -- [Convert a Map to an Array, List or Set in Java](http://www.baeldung.com/convert-map-values-to-array-list-set) -- [Converting a List to String in Java](http://www.baeldung.com/java-list-to-string) -- [How to Convert List to Map in Java](http://www.baeldung.com/java-list-to-map) -- [Array to String Conversions](https://www.baeldung.com/java-array-to-string) +- [Converting between an Array and a List in Java](https://www.baeldung.com/convert-array-to-list-and-list-to-array) +- [Converting between an Array and a Set in Java](https://www.baeldung.com/convert-array-to-set-and-set-to-array) +- [Converting between a List and a Set in Java](https://www.baeldung.com/convert-list-to-set-and-set-to-list) +- [Convert a Map to an Array, List or Set in Java](https://www.baeldung.com/convert-map-values-to-array-list-set) +- [Converting a List to String in Java](https://www.baeldung.com/java-list-to-string) +- [How to Convert List to Map in Java](https://www.baeldung.com/java-list-to-map) - [Converting a Collection to ArrayList in Java](https://www.baeldung.com/java-convert-collection-arraylist) - [Java 8 Collectors toMap](https://www.baeldung.com/java-collectors-tomap) - [Converting Iterable to Collection in Java](https://www.baeldung.com/java-iterable-to-collection) - [Converting Iterator to List](https://www.baeldung.com/java-convert-iterator-to-list) +- More articles: [[next -->]](../java-collections-conversions-2) \ No newline at end of file diff --git a/java-collections-conversions/pom.xml b/java-collections-conversions/pom.xml index 24d918d105..b5ab4f841a 100644 --- a/java-collections-conversions/pom.xml +++ b/java-collections-conversions/pom.xml @@ -32,6 +32,16 @@ + + java-collections-conversions-2 + + + src/main/resources + true + + + + 4.1 3.6.1 diff --git a/java-collections-conversions/src/test/java/com/baeldung/convertcollectiontoarraylist/CollectionToArrayListUnitTest.java b/java-collections-conversions/src/test/java/com/baeldung/convertcollectiontoarraylist/CollectionToArrayListUnitTest.java new file mode 100644 index 0000000000..ad2ab2a756 --- /dev/null +++ b/java-collections-conversions/src/test/java/com/baeldung/convertcollectiontoarraylist/CollectionToArrayListUnitTest.java @@ -0,0 +1,145 @@ +package com.baeldung.convertcollectiontoarraylist; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashSet; +import java.util.Iterator; +import static java.util.stream.Collectors.toCollection; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author chris + */ +public class CollectionToArrayListUnitTest { + private static Collection srcCollection = new HashSet<>(); + + public CollectionToArrayListUnitTest() { + } + + @BeforeClass + public static void setUpClass() { + int i = 0; + Foo john = new Foo(i++, "John", null); + Foo mary = new Foo(i++, "Mary", null); + Foo sam = new Foo(i++, "Sam", john); + Foo alice = new Foo(i++, "Alice", john); + Foo buffy = new Foo(i++, "Buffy", sam); + srcCollection.add(john); + srcCollection.add(mary); + srcCollection.add(sam); + srcCollection.add(alice); + srcCollection.add(buffy); + } + + /** + * Section 3. Using the ArrayList Constructor + */ + @Test + public void whenUsingConstructor_thenVerifyShallowCopy() { + ArrayList newList = new ArrayList<>(srcCollection); + verifyShallowCopy(srcCollection, newList); + } + + /** + * Section 4. Using the Streams API + */ + @Test + public void whenUsingStream_thenVerifyShallowCopy() { + ArrayList newList = srcCollection.stream().collect(toCollection(ArrayList::new)); + + verifyShallowCopy(srcCollection, newList); + } + + /** + * Section 5. Deep Copy + */ + @Test + public void whenUsingDeepCopy_thenVerifyDeepCopy() { + ArrayList newList = srcCollection.stream() + .map(foo -> foo.deepCopy()) + .collect(toCollection(ArrayList::new)); + + verifyDeepCopy(srcCollection, newList); + } + + /** + * Section 6. Controlling the List Order + */ + @Test + public void whenUsingSortedStream_thenVerifySortOrder() { + ArrayList newList = srcCollection.stream() + .sorted(Comparator.comparing(Foo::getName)) + .collect(toCollection(ArrayList::new)); + + assertTrue("ArrayList is not sorted by name", isSorted(newList)); + } + + /** + * Verify that the contents of the two collections are the same + * @param a + * @param b + */ + private void verifyShallowCopy(Collection a, Collection b) { + assertEquals("Collections have different lengths", a.size(), b.size()); + Iterator iterA = a.iterator(); + Iterator iterB = b.iterator(); + while (iterA.hasNext()) { + // use '==' to test instance identity + assertTrue("Foo instances differ!", iterA.next() == iterB.next()); + } + } + + /** + * Verify that the contents of the two collections are the same + * @param a + * @param b + */ + private void verifyDeepCopy(Collection a, Collection b) { + assertEquals("Collections have different lengths", a.size(), b.size()); + Iterator iterA = a.iterator(); + Iterator iterB = b.iterator(); + while (iterA.hasNext()) { + Foo nextA = iterA.next(); + Foo nextB = iterB.next(); + // should not be same instance + assertFalse("Foo instances are the same!", nextA == nextB); + // but should have same content + assertFalse("Foo instances have different content!", fooDiff(nextA, nextB)); + } + } + + /** + * Return true if the contents of a and b differ. Test parent recursively + * @param a + * @param b + * @return False if the two items are the same + */ + private boolean fooDiff(Foo a, Foo b) { + if (a != null && b != null) { + return a.getId() != b.getId() + || !a.getName().equals(b.getName()) + || fooDiff(a.getParent(), b.getParent()); + } + return !(a == null && b == null); + } + + /** + * @param c collection of Foo + * @return true if the collection is sorted by name + */ + private static boolean isSorted(Collection c) { + String prevName = null; + for (Foo foo : c) { + if (prevName == null || foo.getName().compareTo(prevName) > 0) { + prevName = foo.getName(); + } else { + return false; + } + } + return true; + } +} diff --git a/java-collections-conversions/src/test/java/com/baeldung/convertcollectiontoarraylist/FooUnitTest.java b/java-collections-conversions/src/test/java/com/baeldung/convertcollectiontoarraylist/FooUnitTest.java deleted file mode 100644 index 1de600aebf..0000000000 --- a/java-collections-conversions/src/test/java/com/baeldung/convertcollectiontoarraylist/FooUnitTest.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.baeldung.convertcollectiontoarraylist; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Iterator; -import static java.util.stream.Collectors.toCollection; -import org.junit.BeforeClass; -import org.junit.Test; -import static org.junit.Assert.*; - -/** - * - * @author chris - */ -public class FooUnitTest { - private static Collection srcCollection = new HashSet<>(); - - public FooUnitTest() { - } - - @BeforeClass - public static void setUpClass() { - int i = 0; - Foo john = new Foo(i++, "John", null); - Foo mary = new Foo(i++, "Mary", null); - Foo sam = new Foo(i++, "Sam", john); - Foo alice = new Foo(i++, "Alice", john); - Foo buffy = new Foo(i++, "Buffy", sam); - srcCollection.add(john); - srcCollection.add(mary); - srcCollection.add(sam); - srcCollection.add(alice); - srcCollection.add(buffy); - } - - /** - * Section 3. Using the ArrayList Constructor - */ - @Test - public void whenUsingConstructor_thenVerifyShallowCopy() { - ArrayList newList = new ArrayList<>(srcCollection); - verifyShallowCopy(srcCollection, newList); - } - - /** - * Section 4. Using the Streams API - */ - @Test - public void whenUsingStream_thenVerifyShallowCopy() { - ArrayList newList = srcCollection.stream().collect(toCollection(ArrayList::new)); - - verifyShallowCopy(srcCollection, newList); - } - - /** - * Section 5. Deep Copy - */ - @Test - public void whenUsingDeepCopy_thenVerifyDeepCopy() { - ArrayList newList = srcCollection.stream() - .map(foo -> foo.deepCopy()) - .collect(toCollection(ArrayList::new)); - - verifyDeepCopy(srcCollection, newList); - } - - /** - * Section 6. Controlling the List Order - */ - @Test - public void whenUsingSortedStream_thenVerifySortOrder() { - ArrayList newList = srcCollection.stream() - .sorted(Comparator.comparing(Foo::getName)) - .collect(toCollection(ArrayList::new)); - - assertTrue("ArrayList is not sorted by name", isSorted(newList)); - } - - /** - * Verify that the contents of the two collections are the same - * @param a - * @param b - */ - private void verifyShallowCopy(Collection a, Collection b) { - assertEquals("Collections have different lengths", a.size(), b.size()); - Iterator iterA = a.iterator(); - Iterator iterB = b.iterator(); - while (iterA.hasNext()) { - // use '==' to test instance identity - assertTrue("Foo instances differ!", iterA.next() == iterB.next()); - } - } - - /** - * Verify that the contents of the two collections are the same - * @param a - * @param b - */ - private void verifyDeepCopy(Collection a, Collection b) { - assertEquals("Collections have different lengths", a.size(), b.size()); - Iterator iterA = a.iterator(); - Iterator iterB = b.iterator(); - while (iterA.hasNext()) { - Foo nextA = iterA.next(); - Foo nextB = iterB.next(); - // should not be same instance - assertFalse("Foo instances are the same!", nextA == nextB); - // but should have same content - assertFalse("Foo instances have different content!", fooDiff(nextA, nextB)); - } - } - - /** - * Return true if the contents of a and b differ. Test parent recursively - * @param a - * @param b - * @return False if the two items are the same - */ - private boolean fooDiff(Foo a, Foo b) { - if (a != null && b != null) { - return a.getId() != b.getId() - || !a.getName().equals(b.getName()) - || fooDiff(a.getParent(), b.getParent()); - } - return !(a == null && b == null); - } - - /** - * @param c collection of Foo - * @return true if the collection is sorted by name - */ - private static boolean isSorted(Collection c) { - String prevName = null; - for (Foo foo : c) { - if (prevName == null || foo.getName().compareTo(prevName) > 0) { - prevName = foo.getName(); - } else { - return false; - } - } - return true; - } -} diff --git a/java-collections-conversions/src/test/java/com/baeldung/convert/iteratortolist/ConvertIteratorToListServiceUnitTest.java b/java-collections-conversions/src/test/java/com/baeldung/convertiteratortolist/ConvertIteratorToListServiceUnitTest.java similarity index 98% rename from java-collections-conversions/src/test/java/com/baeldung/convert/iteratortolist/ConvertIteratorToListServiceUnitTest.java rename to java-collections-conversions/src/test/java/com/baeldung/convertiteratortolist/ConvertIteratorToListServiceUnitTest.java index ced2ddcfc0..4d6cba7d27 100644 --- a/java-collections-conversions/src/test/java/com/baeldung/convert/iteratortolist/ConvertIteratorToListServiceUnitTest.java +++ b/java-collections-conversions/src/test/java/com/baeldung/convertiteratortolist/ConvertIteratorToListServiceUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.convert.iteratortolist; +package com.baeldung.convertiteratortolist; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.collection.IsCollectionWithSize.hasSize; diff --git a/java-collections-conversions/src/test/java/com/baeldung/convertlisttomap/ConvertListWithDiplicatedIdToMapServiceUnitTest.java b/java-collections-conversions/src/test/java/com/baeldung/convertlisttomap/ConvertListWithDiplicatedIdToMapServiceUnitTest.java deleted file mode 100644 index 6e766433d1..0000000000 --- a/java-collections-conversions/src/test/java/com/baeldung/convertlisttomap/ConvertListWithDiplicatedIdToMapServiceUnitTest.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.baeldung.convertlisttomap; - -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.Matchers.hasSize; - -public class ConvertListWithDiplicatedIdToMapServiceUnitTest { - List duplicatedIdList; - - private ConvertListToMapService convertListService = new ConvertListToMapService(); - - @Before - public void init() { - - this.duplicatedIdList = new ArrayList<>(); - - Animal cat = new Animal(1, "Cat"); - duplicatedIdList.add(cat); - Animal dog = new Animal(2, "Dog"); - duplicatedIdList.add(dog); - Animal pig = new Animal(3, "Pig"); - duplicatedIdList.add(pig); - Animal cow = new Animal(4, "Cow"); - duplicatedIdList.add(cow); - Animal goat = new Animal(4, "Goat"); - duplicatedIdList.add(goat); - - } - - @Test - public void givenADupIdList_whenConvertBeforeJava8_thenReturnMapWithRewrittenElement() { - - Map map = convertListService.convertListBeforeJava8(duplicatedIdList); - - assertThat(map.values(), hasSize(4)); - assertThat(map.values(), hasItem(duplicatedIdList.get(4))); - } - - @Test - public void givenADupIdList_whenConvertWithApacheCommons_thenReturnMapWithRewrittenElement() { - - Map map = convertListService.convertListWithApacheCommons(duplicatedIdList); - - assertThat(map.values(), hasSize(4)); - assertThat(map.values(), hasItem(duplicatedIdList.get(4))); - } - - @Test(expected = IllegalStateException.class) - public void givenADupIdList_whenConvertAfterJava8_thenException() { - - convertListService.convertListAfterJava8(duplicatedIdList); - } - - @Test(expected = IllegalArgumentException.class) - public void givenADupIdList_whenConvertWithGuava_thenException() { - - convertListService.convertListWithGuava(duplicatedIdList); - - } - -} diff --git a/java-collections-conversions/src/test/java/com/baeldung/convertlisttomap/ConvertListWithDuplicatedIdToMapServiceUnitTest.java b/java-collections-conversions/src/test/java/com/baeldung/convertlisttomap/ConvertListWithDuplicatedIdToMapServiceUnitTest.java new file mode 100644 index 0000000000..5e6828a3d5 --- /dev/null +++ b/java-collections-conversions/src/test/java/com/baeldung/convertlisttomap/ConvertListWithDuplicatedIdToMapServiceUnitTest.java @@ -0,0 +1,68 @@ +package com.baeldung.convertlisttomap; + +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.hasSize; + +public class ConvertListWithDuplicatedIdToMapServiceUnitTest { + List duplicatedIdList; + + private ConvertListToMapService convertListService = new ConvertListToMapService(); + + @Before + public void init() { + + this.duplicatedIdList = new ArrayList<>(); + + Animal cat = new Animal(1, "Cat"); + duplicatedIdList.add(cat); + Animal dog = new Animal(2, "Dog"); + duplicatedIdList.add(dog); + Animal pig = new Animal(3, "Pig"); + duplicatedIdList.add(pig); + Animal cow = new Animal(4, "Cow"); + duplicatedIdList.add(cow); + Animal goat = new Animal(4, "Goat"); + duplicatedIdList.add(goat); + + } + + @Test + public void givenADupIdList_whenConvertBeforeJava8_thenReturnMapWithRewrittenElement() { + + Map map = convertListService.convertListBeforeJava8(duplicatedIdList); + + assertThat(map.values(), hasSize(4)); + assertThat(map.values(), hasItem(duplicatedIdList.get(4))); + } + + @Test + public void givenADupIdList_whenConvertWithApacheCommons_thenReturnMapWithRewrittenElement() { + + Map map = convertListService.convertListWithApacheCommons(duplicatedIdList); + + assertThat(map.values(), hasSize(4)); + assertThat(map.values(), hasItem(duplicatedIdList.get(4))); + } + + @Test(expected = IllegalStateException.class) + public void givenADupIdList_whenConvertAfterJava8_thenException() { + + convertListService.convertListAfterJava8(duplicatedIdList); + } + + @Test(expected = IllegalArgumentException.class) + public void givenADupIdList_whenConvertWithGuava_thenException() { + + convertListService.convertListWithGuava(duplicatedIdList); + + } + +} diff --git a/java-collections-conversions/src/test/java/org/baeldung/java/collections/JavaCollectionConversionUnitTest.java b/java-collections-conversions/src/test/java/com/baeldung/java/collections/JavaCollectionConversionUnitTest.java similarity index 99% rename from java-collections-conversions/src/test/java/org/baeldung/java/collections/JavaCollectionConversionUnitTest.java rename to java-collections-conversions/src/test/java/com/baeldung/java/collections/JavaCollectionConversionUnitTest.java index a5f684a141..4977c122e7 100644 --- a/java-collections-conversions/src/test/java/org/baeldung/java/collections/JavaCollectionConversionUnitTest.java +++ b/java-collections-conversions/src/test/java/com/baeldung/java/collections/JavaCollectionConversionUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.collections; +package com.baeldung.java.collections; import java.util.ArrayList; import java.util.Arrays; diff --git a/java-collections-conversions/src/test/java/com/baeldung/java/lists/ListToStringUnitTest.java b/java-collections-conversions/src/test/java/com/baeldung/java/lists/ListToStringUnitTest.java new file mode 100644 index 0000000000..0fdc096d14 --- /dev/null +++ b/java-collections-conversions/src/test/java/com/baeldung/java/lists/ListToStringUnitTest.java @@ -0,0 +1,31 @@ +package com.baeldung.java.lists; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +public class ListToStringUnitTest { + + @Test + public void whenListToString_thenPrintDefault() { + List intLIst = Arrays.asList(1, 2, 3); + System.out.println(intLIst); + } + + @Test + public void whenCollectorsJoining_thenPrintCustom() { + List intList = Arrays.asList(1, 2, 3); + System.out.println(intList.stream() + .map(n -> String.valueOf(n)) + .collect(Collectors.joining("-", "{", "}"))); + } + + @Test + public void whenStringUtilsJoin_thenPrintCustom() { + List intList = Arrays.asList(1, 2, 3); + System.out.println(StringUtils.join(intList, "|")); + } +} diff --git a/java-collections-conversions/src/test/java/org/baeldung/java/lists/ListToSTring.java b/java-collections-conversions/src/test/java/org/baeldung/java/lists/ListToSTring.java deleted file mode 100644 index 3fc26bcb51..0000000000 --- a/java-collections-conversions/src/test/java/org/baeldung/java/lists/ListToSTring.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.baeldung.java.lists; - -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.StringUtils; -import org.junit.Test; - -public class ListToSTring { - - @Test - public void whenListToString_thenPrintDefault() { - List intLIst = Arrays.asList(1, 2, 3); - System.out.println(intLIst); - } - - @Test - public void whenCollectorsJoining_thenPrintCustom() { - List intList = Arrays.asList(1, 2, 3); - System.out.println(intList.stream() - .map(n -> String.valueOf(n)) - .collect(Collectors.joining("-", "{", "}"))); - } - - @Test - public void whenStringUtilsJoin_thenPrintCustom() { - List intList = Arrays.asList(1, 2, 3); - System.out.println(StringUtils.join(intList, "|")); - } -} diff --git a/java-collections-maps-2/README.md b/java-collections-maps-2/README.md index ff84e93ce4..8b33276f56 100644 --- a/java-collections-maps-2/README.md +++ b/java-collections-maps-2/README.md @@ -1,3 +1,17 @@ -## Relevant Articles: +## Java Collections Cookbooks and Examples + +This module contains articles about Map data structures in Java. + +### Relevant Articles: - [Map of Primitives in Java](https://www.baeldung.com/java-map-primitives) - [Copying a HashMap in Java](https://www.baeldung.com/java-copy-hashmap) +- [A Guide to Java HashMap](https://www.baeldung.com/java-hashmap) +- [Guide to WeakHashMap in Java](https://www.baeldung.com/java-weakhashmap) +- [Map to String Conversion in Java](https://www.baeldung.com/java-map-to-string-conversion) +- [Iterate over a Map in Java](https://www.baeldung.com/java-iterate-map) +- [Merging Two Maps with Java 8](https://www.baeldung.com/java-merge-maps) +- [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort) +- [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max) +- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) +- [Java TreeMap vs HashMap](https://www.baeldung.com/java-treemap-vs-hashmap) +- More articles: [[<-- prev>]](/../java-collections-maps) diff --git a/java-collections-maps-2/pom.xml b/java-collections-maps-2/pom.xml index e242a8655e..a246559f61 100644 --- a/java-collections-maps-2/pom.xml +++ b/java-collections-maps-2/pom.xml @@ -41,6 +41,22 @@ commons-lang3 ${commons-lang3.version} + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + one.util + streamex + ${streamex.version} + + + com.jayway.awaitility + awaitility + ${avaitility.version} + test + org.assertj assertj-core @@ -50,6 +66,9 @@ + 0.6.5 + 4.1 + 1.7.0 8.2.0 3.0.2 8.1.0 diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/Product.java b/java-collections-maps-2/src/main/java/com/baeldung/map/Product.java new file mode 100644 index 0000000000..5559895730 --- /dev/null +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/Product.java @@ -0,0 +1,133 @@ +package com.baeldung.map; + +import java.util.*; + +public class Product { + + private String name; + private String description; + private List tags; + + public Product(String name, String description) { + this.name = name; + this.description = description; + this.tags = new ArrayList<>(); + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public List getTags() { + return tags; + } + + public Product addTagsOfOtherProdcut(Product product) { + this.tags.addAll(product.getTags()); + return this; + } + + @Override + public boolean equals(Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Product product = (Product) o; + return Objects.equals(name, product.name) && + Objects.equals(description, product.description); + } + + @Override + public int hashCode() { + return Objects.hash(name, description); + } + + public static void forEach() { + + HashMap productsByName = new HashMap<>(); + productsByName.forEach( (key, product) + -> System.out.println("Key: " + key + " Product:" + product.getDescription()) + //do something with the key and value + ); + + //Prior to Java 8: + for(Map.Entry entry : productsByName.entrySet()) { + Product product = entry.getValue(); + String key = entry.getKey(); + //do something with the key and value + } + } + + public static void getOrDefault() { + + HashMap productsByName = new HashMap<>(); + Product chocolate = new Product("chocolate", "something sweet"); + Product defaultProduct = productsByName.getOrDefault("horse carriage", chocolate); + Product bike = productsByName.getOrDefault("E-Bike", chocolate); + + //Prior to Java 8: + Product bike2 = productsByName.containsKey("E-Bike") + ? productsByName.get("E-Bike") + : chocolate; + Product defaultProduct2 = productsByName.containsKey("horse carriage") + ? productsByName.get("horse carriage") + : chocolate; + } + + public static void putIfAbsent() { + + HashMap productsByName = new HashMap<>(); + Product chocolate = new Product("chocolate", "something sweet"); + productsByName.putIfAbsent("E-Bike", chocolate); + + //Prior to Java 8: + if(productsByName.containsKey("E-Bike")) { + productsByName.put("E-Bike", chocolate); + } + } + + public static void merge() { + + HashMap productsByName = new HashMap<>(); + Product eBike2 = new Product("E-Bike", "A bike with a battery"); + eBike2.getTags().add("sport"); + productsByName.merge("E-Bike", eBike2, Product::addTagsOfOtherProdcut); + + //Prior to Java 8: + if(productsByName.containsKey("E-Bike")) { + productsByName.get("E-Bike").addTagsOfOtherProdcut(eBike2); + } else { + productsByName.put("E-Bike", eBike2); + } + } + + public static void compute() { + + HashMap productsByName = new HashMap<>(); + Product eBike2 = new Product("E-Bike", "A bike with a battery"); + + productsByName.compute("E-Bike", (k,v) -> { + if(v != null) { + return v.addTagsOfOtherProdcut(eBike2); + } else { + return eBike2; + } + }); + + //Prior to Java 8: + if(productsByName.containsKey("E-Bike")) { + productsByName.get("E-Bike").addTagsOfOtherProdcut(eBike2); + } else { + productsByName.put("E-Bike", eBike2); + } + } +} diff --git a/java-collections-maps/src/main/java/com/baeldung/convert/MapToString.java b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/MapToString.java similarity index 96% rename from java-collections-maps/src/main/java/com/baeldung/convert/MapToString.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/convert/MapToString.java index aca0d05ef1..d13be924ff 100644 --- a/java-collections-maps/src/main/java/com/baeldung/convert/MapToString.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/MapToString.java @@ -1,4 +1,4 @@ -package com.baeldung.convert; +package com.baeldung.map.convert; import com.google.common.base.Joiner; import org.apache.commons.lang3.StringUtils; diff --git a/java-collections-maps/src/main/java/com/baeldung/convert/StringToMap.java b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/StringToMap.java similarity index 94% rename from java-collections-maps/src/main/java/com/baeldung/convert/StringToMap.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/convert/StringToMap.java index caabca4a09..416ba4dd9a 100644 --- a/java-collections-maps/src/main/java/com/baeldung/convert/StringToMap.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/convert/StringToMap.java @@ -1,4 +1,4 @@ -package com.baeldung.convert; +package com.baeldung.map.convert; import com.google.common.base.Splitter; diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/CopyHashMap.java b/java-collections-maps-2/src/main/java/com/baeldung/map/copyhashmap/CopyHashMap.java similarity index 98% rename from java-collections-maps-2/src/main/java/com/baeldung/map/CopyHashMap.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/copyhashmap/CopyHashMap.java index 2ebc9413c8..cb18f3aa11 100644 --- a/java-collections-maps-2/src/main/java/com/baeldung/map/CopyHashMap.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/copyhashmap/CopyHashMap.java @@ -1,4 +1,6 @@ -package com.baeldung.map; +package com.baeldung.map.copyhashmap; + +import org.apache.commons.lang3.SerializationUtils; import java.util.HashMap; import java.util.Map; @@ -6,8 +8,6 @@ import java.util.Map.Entry; import java.util.Set; import java.util.stream.Collectors; -import org.apache.commons.lang3.SerializationUtils; - public class CopyHashMap { public static HashMap copyUsingConstructor(HashMap originalMap) { diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/initialize/MapInitializer.java b/java-collections-maps-2/src/main/java/com/baeldung/map/initialize/MapInitializer.java similarity index 98% rename from java-collections-maps/src/main/java/com/baeldung/java/map/initialize/MapInitializer.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/initialize/MapInitializer.java index 4dbaceac62..4d63abcfd0 100644 --- a/java-collections-maps/src/main/java/com/baeldung/java/map/initialize/MapInitializer.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/initialize/MapInitializer.java @@ -1,4 +1,4 @@ -package com.baeldung.java.map.initialize; +package com.baeldung.map.initialize; import java.util.AbstractMap; import java.util.Collections; diff --git a/java-collections-maps/src/main/java/com/baeldung/map/iteration/MapIteration.java b/java-collections-maps-2/src/main/java/com/baeldung/map/iteration/MapIteration.java similarity index 100% rename from java-collections-maps/src/main/java/com/baeldung/map/iteration/MapIteration.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/iteration/MapIteration.java diff --git a/java-collections-maps/src/main/java/com/baeldung/map/util/MapMax.java b/java-collections-maps-2/src/main/java/com/baeldung/map/mapmax/MapMax.java similarity index 94% rename from java-collections-maps/src/main/java/com/baeldung/map/util/MapMax.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/mapmax/MapMax.java index 93a98ba6fd..8c33c857ee 100644 --- a/java-collections-maps/src/main/java/com/baeldung/map/util/MapMax.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/mapmax/MapMax.java @@ -1,11 +1,7 @@ -package com.baeldung.map.util; +package com.baeldung.map.mapmax; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; -import java.util.Optional; public class MapMax { diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/Employee.java b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/Employee.java new file mode 100644 index 0000000000..d7fb0d1a1d --- /dev/null +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/Employee.java @@ -0,0 +1,60 @@ +package com.baeldung.map.mergemaps; + +public class Employee implements Comparable { + + private Long id; + private String name; + + public Employee(Long id, String name) { + this.name = name; + this.id = id; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Employee employee = (Employee) o; + + if (!id.equals(employee.id)) return false; + return name.equals(employee.name); + + } + + @Override + public int hashCode() { + int result = id.hashCode(); + result = 31 * result + name.hashCode(); + return result; + } + + @Override + public String toString() { + return "Employee{" + + "id=" + id + + ", name='" + name + '\'' + + '}'; + } + + @Override + public int compareTo(Employee employee) { + return (int)(this.id - employee.getId()); + } +} diff --git a/java-collections-maps/src/main/java/com/baeldung/map/java_8/MergeMaps.java b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/MergeMaps.java similarity index 97% rename from java-collections-maps/src/main/java/com/baeldung/map/java_8/MergeMaps.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/MergeMaps.java index 052cfb8bad..4f187bad90 100644 --- a/java-collections-maps/src/main/java/com/baeldung/map/java_8/MergeMaps.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/mergemaps/MergeMaps.java @@ -1,7 +1,7 @@ -package com.baeldung.map.java_8; +package com.baeldung.map.mergemaps; -import com.baeldung.sort.Employee; import one.util.streamex.EntryStream; + import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; diff --git a/java-collections-maps-2/src/main/java/com/baeldung/map/PrimitiveMaps.java b/java-collections-maps-2/src/main/java/com/baeldung/map/primitives/PrimitiveMaps.java similarity index 98% rename from java-collections-maps-2/src/main/java/com/baeldung/map/PrimitiveMaps.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/primitives/PrimitiveMaps.java index d835950c68..30bec12ccc 100644 --- a/java-collections-maps-2/src/main/java/com/baeldung/map/PrimitiveMaps.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/primitives/PrimitiveMaps.java @@ -1,4 +1,4 @@ -package com.baeldung.map; +package com.baeldung.map.primitives; import cern.colt.map.AbstractIntDoubleMap; import cern.colt.map.OpenIntDoubleHashMap; diff --git a/java-collections-maps/src/main/java/com/baeldung/sort/SortHashMap.java b/java-collections-maps-2/src/main/java/com/baeldung/map/sort/SortHashMap.java similarity index 97% rename from java-collections-maps/src/main/java/com/baeldung/sort/SortHashMap.java rename to java-collections-maps-2/src/main/java/com/baeldung/map/sort/SortHashMap.java index b8a2b32060..14610ffb00 100644 --- a/java-collections-maps/src/main/java/com/baeldung/sort/SortHashMap.java +++ b/java-collections-maps-2/src/main/java/com/baeldung/map/sort/SortHashMap.java @@ -1,8 +1,8 @@ -package com.baeldung.sort; +package com.baeldung.map.sort; +import com.baeldung.map.mergemaps.Employee; import com.google.common.base.Functions; import com.google.common.collect.ImmutableSortedMap; -import com.google.common.collect.Lists; import com.google.common.collect.Ordering; import java.util.*; diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/Employee.java b/java-collections-maps-2/src/test/java/com/baeldung/map/Employee.java deleted file mode 100644 index 7963fa811c..0000000000 --- a/java-collections-maps-2/src/test/java/com/baeldung/map/Employee.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.baeldung.map; - -import java.io.Serializable; - -public class Employee implements Serializable{ - - private String name; - - public Employee(String name) { - super(); - this.name = name; - } - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public String toString() { - return this.name; - } - -} - - diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java new file mode 100644 index 0000000000..2015909870 --- /dev/null +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/ProductUnitTest.java @@ -0,0 +1,124 @@ +package com.baeldung.map; + +import org.junit.jupiter.api.Test; + +import java.util.HashMap; + +import static org.junit.jupiter.api.Assertions.*; + +class ProductUnitTest { + + + @Test + public void getExistingValue() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + Product roadBike = new Product("Road bike", "A bike for competition"); + + productsByName.put(eBike.getName(), eBike); + productsByName.put(roadBike.getName(), roadBike); + + Product nextPurchase = productsByName.get("E-Bike"); + + assertEquals("A bike with a battery", nextPurchase.getDescription()); + } + + @Test + public void getNonExistingValue() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + Product roadBike = new Product("Road bike", "A bike for competition"); + + productsByName.put(eBike.getName(), eBike); + productsByName.put(roadBike.getName(), roadBike); + + Product nextPurchase = productsByName.get("Car"); + + assertNull(nextPurchase); + } + + @Test + public void getExistingValueAfterSameKeyInsertedTwice() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + Product roadBike = new Product("Road bike", "A bike for competition"); + Product newEBike = new Product("E-Bike", "A bike with a better battery"); + + productsByName.put(eBike.getName(), eBike); + productsByName.put(roadBike.getName(), roadBike); + productsByName.put(newEBike.getName(), newEBike); + + Product nextPurchase = productsByName.get("E-Bike"); + + assertEquals("A bike with a better battery", nextPurchase.getDescription()); + } + + @Test + public void getExistingValueWithNullKey() { + HashMap productsByName = new HashMap<>(); + + Product defaultProduct = new Product("Chocolate", "At least buy chocolate"); + + productsByName.put(null, defaultProduct); + productsByName.put(defaultProduct.getName(), defaultProduct); + + Product nextPurchase = productsByName.get(null); + assertEquals("At least buy chocolate", nextPurchase.getDescription()); + + nextPurchase = productsByName.get("Chocolate"); + assertEquals("At least buy chocolate", nextPurchase.getDescription()); + } + + @Test + public void insertSameObjectWithDifferentKey() { + HashMap productsByName = new HashMap<>(); + + Product defaultProduct = new Product("Chocolate", "At least buy chocolate"); + + productsByName.put(null, defaultProduct); + productsByName.put(defaultProduct.getName(), defaultProduct); + + assertSame(productsByName.get(null), productsByName.get("Chocolate")); + } + + @Test + public void checkIfKeyExists() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + + productsByName.put(eBike.getName(), eBike); + + assertTrue(productsByName.containsKey("E-Bike")); + } + + @Test + public void checkIfValueExists() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + + productsByName.put(eBike.getName(), eBike); + + assertTrue(productsByName.containsValue(eBike)); + } + + @Test + public void removeExistingKey() { + HashMap productsByName = new HashMap<>(); + + Product eBike = new Product("E-Bike", "A bike with a battery"); + Product roadBike = new Product("Road bike", "A bike for competition"); + + productsByName.put(eBike.getName(), eBike); + productsByName.put(roadBike.getName(), roadBike); + + productsByName.remove("E-Bike"); + + assertNull(productsByName.get("E-Bike")); + } + +} diff --git a/java-collections-maps/src/test/java/com/baeldung/convert/MapToStringUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/MapToStringUnitTest.java similarity index 97% rename from java-collections-maps/src/test/java/com/baeldung/convert/MapToStringUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/convert/MapToStringUnitTest.java index d9923e74a0..4517dea328 100644 --- a/java-collections-maps/src/test/java/com/baeldung/convert/MapToStringUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/MapToStringUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.convert; +package com.baeldung.map.convert; import org.apache.commons.collections4.MapUtils; import org.junit.Assert; diff --git a/java-collections-maps/src/test/java/com/baeldung/convert/StringToMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/StringToMapUnitTest.java similarity index 95% rename from java-collections-maps/src/test/java/com/baeldung/convert/StringToMapUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/convert/StringToMapUnitTest.java index 8fb906efd0..2f80b30871 100644 --- a/java-collections-maps/src/test/java/com/baeldung/convert/StringToMapUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/convert/StringToMapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.convert; +package com.baeldung.map.convert; import org.junit.Assert; import org.junit.jupiter.api.Test; diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/CopyHashMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/CopyHashMapUnitTest.java similarity index 98% rename from java-collections-maps-2/src/test/java/com/baeldung/map/CopyHashMapUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/CopyHashMapUnitTest.java index c400eea153..e2d5e327e1 100644 --- a/java-collections-maps-2/src/test/java/com/baeldung/map/CopyHashMapUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/CopyHashMapUnitTest.java @@ -1,13 +1,12 @@ -package com.baeldung.map; +package com.baeldung.map.copyhashmap; -import static org.assertj.core.api.Assertions.assertThat; +import com.google.common.collect.ImmutableMap; +import org.junit.Test; import java.util.HashMap; import java.util.Map; -import org.junit.Test; - -import com.google.common.collect.ImmutableMap; +import static org.assertj.core.api.Assertions.assertThat; public class CopyHashMapUnitTest { diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/Employee.java b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/Employee.java new file mode 100644 index 0000000000..5db55c26ea --- /dev/null +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/copyhashmap/Employee.java @@ -0,0 +1,28 @@ +package com.baeldung.map.copyhashmap; + +import java.io.Serializable; + +public class Employee implements Serializable{ + + private String name; + + public Employee(String name) { + super(); + this.name = name; + } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return this.name; + } + +} + + diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/initialize/MapInitializerUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/initialize/MapInitializerUnitTest.java similarity index 94% rename from java-collections-maps/src/test/java/com/baeldung/java/map/initialize/MapInitializerUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/initialize/MapInitializerUnitTest.java index 80a8983d6f..7c6dffe787 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/initialize/MapInitializerUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/initialize/MapInitializerUnitTest.java @@ -1,10 +1,10 @@ -package com.baeldung.java.map.initialize; +package com.baeldung.map.initialize; -import static org.junit.Assert.assertEquals; +import org.junit.Test; import java.util.Map; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class MapInitializerUnitTest { diff --git a/java-collections-maps/src/test/java/com/baeldung/map/util/MapMaxUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/mapmax/MapMaxUnitTest.java similarity index 97% rename from java-collections-maps/src/test/java/com/baeldung/map/util/MapMaxUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/mapmax/MapMaxUnitTest.java index 883265cc8b..30b945bfc8 100644 --- a/java-collections-maps/src/test/java/com/baeldung/map/util/MapMaxUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/mapmax/MapMaxUnitTest.java @@ -1,14 +1,13 @@ -package com.baeldung.map.util; +package com.baeldung.map.mapmax; - -import static org.junit.Assert.assertEquals; +import org.junit.Before; +import org.junit.Test; import java.util.HashMap; import java.util.Map; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertEquals; public class MapMaxUnitTest { diff --git a/java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java new file mode 100644 index 0000000000..1057e3b9f0 --- /dev/null +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/treemaphashmap/TreeMapVsHashMapUnitTest.java @@ -0,0 +1,58 @@ +package com.baeldung.map.treemaphashmap; + +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; + +public class TreeMapVsHashMapUnitTest { + + @Test + public void whenInsertObjectsTreeMap_thenNaturalOrder() { + Map treemap = new TreeMap<>(); + treemap.put(3, "TreeMap"); + treemap.put(2, "vs"); + treemap.put(1, "HashMap"); + Assert.assertThat(treemap.keySet(), Matchers.contains(1, 2, 3)); + } + + @Test(expected = NullPointerException.class) + public void whenInsertNullInTreeMap_thenException() { + Map treemap = new TreeMap<>(); + treemap.put(null, "NullPointerException"); + } + + @Test + public void whenInsertObjectsHashMap_thenRandomOrder() { + Map hashmap = new HashMap<>(); + hashmap.put(3, "TreeMap"); + hashmap.put(2, "vs"); + hashmap.put(1, "HashMap"); + Assert.assertThat(hashmap.keySet(), Matchers.containsInAnyOrder(1, 2, 3)); + } + + @Test + public void whenInsertNullInHashMap_thenInsertsNull() { + Map hashmap = new HashMap<>(); + hashmap.put(null, null); + Assert.assertNull(hashmap.get(null)); + } + + @Test + public void givenHashMapAndTreeMap_whenputDuplicates_thenOnlyUnique() { + Map treeMap = new HashMap<>(); + treeMap.put(1, "Baeldung"); + treeMap.put(1, "Baeldung"); + + Assert.assertTrue(treeMap.size() == 1); + + Map treeMap2 = new TreeMap<>(); + treeMap2.put(1, "Baeldung"); + treeMap2.put(1, "Baeldung"); + + Assert.assertTrue(treeMap2.size() == 1); + } +} \ No newline at end of file diff --git a/java-collections-maps/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java b/java-collections-maps-2/src/test/java/com/baeldung/map/weakhashmap/WeakHashMapUnitTest.java similarity index 98% rename from java-collections-maps/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java rename to java-collections-maps-2/src/test/java/com/baeldung/map/weakhashmap/WeakHashMapUnitTest.java index d7bcb31867..293f24c378 100644 --- a/java-collections-maps/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java +++ b/java-collections-maps-2/src/test/java/com/baeldung/map/weakhashmap/WeakHashMapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.weakhashmap; +package com.baeldung.map.weakhashmap; import org.junit.Test; diff --git a/java-collections-maps/README.md b/java-collections-maps/README.md index 2eeb2c8843..dfd0d47dbc 100644 --- a/java-collections-maps/README.md +++ b/java-collections-maps/README.md @@ -1,23 +1,17 @@ -========= - ## Java Collections Cookbooks and Examples +This module contains articles about Map data structures in Java. + ### Relevant Articles: -- [Guide to WeakHashMap in Java](http://www.baeldung.com/java-weakhashmap) -- [Guide to the Guava BiMap](http://www.baeldung.com/guava-bimap) -- [The Java HashMap Under the Hood](http://www.baeldung.com/java-hashmap) -- [A Guide to LinkedHashMap in Java](http://www.baeldung.com/java-linked-hashmap) -- [A Guide to TreeMap in Java](http://www.baeldung.com/java-treemap) -- [Iterate over a Map in Java](http://www.baeldung.com/java-iterate-map) -- [Java TreeMap vs HashMap](http://www.baeldung.com/java-treemap-vs-hashmap) -- [How to Store Duplicate Keys in a Map in Java?](http://www.baeldung.com/java-map-duplicate-keys) -- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) +- [Guide to the Guava BiMap](https://www.baeldung.com/guava-bimap) +- [A Guide to Java HashMap](https://www.baeldung.com/java-hashmap) +- [A Guide to LinkedHashMap in Java](https://www.baeldung.com/java-linked-hashmap) +- [A Guide to TreeMap in Java](https://www.baeldung.com/java-treemap) +- [How to Store Duplicate Keys in a Map in Java?](https://www.baeldung.com/java-map-duplicate-keys) - [Get the Key for a Value from a Java Map](https://www.baeldung.com/java-map-key-from-value) -- [Sort a HashMap in Java](https://www.baeldung.com/java-hashmap-sort) -- [Finding the Highest Value in a Java Map](https://www.baeldung.com/java-find-map-max) -- [Merging Two Maps with Java 8](https://www.baeldung.com/java-merge-maps) - [How to Check If a Key Exists in a Map](https://www.baeldung.com/java-map-key-exists) - [Comparing Two HashMaps in Java](https://www.baeldung.com/java-compare-hashmaps) - [Immutable Map Implementations in Java](https://www.baeldung.com/java-immutable-maps) -- [Map to String Conversion in Java](https://www.baeldung.com/java-map-to-string-conversion) - [Guide to Apache Commons MultiValuedMap](https://www.baeldung.com/apache-commons-multi-valued-map) +- [The Java HashMap Under the Hood](https://www.baeldung.com/java-hashmap-advanced) +- More articles: [[next -->]](/../java-collections-maps-2) diff --git a/java-collections-maps/pom.xml b/java-collections-maps/pom.xml index 83cc97a21e..b755582580 100644 --- a/java-collections-maps/pom.xml +++ b/java-collections-maps/pom.xml @@ -36,11 +36,6 @@ ${assertj.version} test - - one.util - streamex - ${streamex.version} - @@ -49,6 +44,5 @@ 1.7.0 3.6.1 7.1.0 - 0.6.5 diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/MapUtil.java b/java-collections-maps/src/main/java/com/baeldung/map/MapUtil.java similarity index 96% rename from java-collections-maps/src/main/java/com/baeldung/java/map/MapUtil.java rename to java-collections-maps/src/main/java/com/baeldung/map/MapUtil.java index 688c7592f3..91b7197a92 100644 --- a/java-collections-maps/src/main/java/com/baeldung/java/map/MapUtil.java +++ b/java-collections-maps/src/main/java/com/baeldung/map/MapUtil.java @@ -1,12 +1,12 @@ /** * */ -package com.baeldung.java.map; +package com.baeldung.map; import java.util.HashSet; import java.util.Map; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import java.util.stream.Stream; /** diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/MyKey.java b/java-collections-maps/src/main/java/com/baeldung/map/MyKey.java similarity index 97% rename from java-collections-maps/src/main/java/com/baeldung/java/map/MyKey.java rename to java-collections-maps/src/main/java/com/baeldung/map/MyKey.java index ae3c3edc39..9993d7862c 100644 --- a/java-collections-maps/src/main/java/com/baeldung/java/map/MyKey.java +++ b/java-collections-maps/src/main/java/com/baeldung/map/MyKey.java @@ -1,4 +1,4 @@ -package com.baeldung.java.map; +package com.baeldung.map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/java-collections-maps/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java b/java-collections-maps/src/main/java/com/baeldung/map/MyLinkedHashMap.java similarity index 94% rename from java-collections-maps/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java rename to java-collections-maps/src/main/java/com/baeldung/map/MyLinkedHashMap.java index 1e237580ec..b687e57d85 100644 --- a/java-collections-maps/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java +++ b/java-collections-maps/src/main/java/com/baeldung/map/MyLinkedHashMap.java @@ -1,4 +1,4 @@ -package com.baeldung.java.map; +package com.baeldung.map; import java.util.LinkedHashMap; import java.util.Map; diff --git a/java-collections-maps/src/main/java/com/baeldung/sort/Employee.java b/java-collections-maps/src/main/java/com/baeldung/sort/Employee.java deleted file mode 100644 index b5e56f6141..0000000000 --- a/java-collections-maps/src/main/java/com/baeldung/sort/Employee.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.baeldung.sort; - -public class Employee implements Comparable { - - private Long id; - private String name; - - public Employee(Long id, String name) { - this.name = name; - this.id = id; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Employee employee = (Employee) o; - - if (!id.equals(employee.id)) return false; - return name.equals(employee.name); - - } - - @Override - public int hashCode() { - int result = id.hashCode(); - result = 31 * result + name.hashCode(); - return result; - } - - @Override - public String toString() { - return "Employee{" + - "id=" + id + - ", name='" + name + '\'' + - '}'; - } - - @Override - public int compareTo(Employee employee) { - return (int)(this.id - employee.getId()); - } -} diff --git a/java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java b/java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java deleted file mode 100644 index f2dfc992c2..0000000000 --- a/java-collections-maps/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.baeldung.collection; - -import java.util.ConcurrentModificationException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.TreeMap; - -import org.hamcrest.Matchers; -import org.junit.Assert; -import org.junit.Test; - -public class WhenComparingTreeMapVsHashMap { - - @Test - public void whenInsertObjectsTreeMap_thenNaturalOrder() { - Map treemap = new TreeMap<>(); - treemap.put(3, "TreeMap"); - treemap.put(2, "vs"); - treemap.put(1, "HashMap"); - Assert.assertThat(treemap.keySet(), Matchers.contains(1, 2, 3)); - } - - @Test(expected = NullPointerException.class) - public void whenInsertNullInTreeMap_thenException() { - Map treemap = new TreeMap<>(); - treemap.put(null, "NullPointerException"); - } - - @Test - public void whenInsertObjectsHashMap_thenRandomOrder() { - Map hashmap = new HashMap<>(); - hashmap.put(3, "TreeMap"); - hashmap.put(2, "vs"); - hashmap.put(1, "HashMap"); - Assert.assertThat(hashmap.keySet(), Matchers.containsInAnyOrder(1, 2, 3)); - } - - @Test - public void whenInsertNullInHashMap_thenInsertsNull() { - Map hashmap = new HashMap<>(); - hashmap.put(null, null); - Assert.assertNull(hashmap.get(null)); - } - - @Test - public void givenHashMapAndTreeMap_whenputDuplicates_thenOnlyUnique() { - Map treeMap = new HashMap<>(); - treeMap.put(1, "Baeldung"); - treeMap.put(1, "Baeldung"); - - Assert.assertTrue(treeMap.size() == 1); - - Map treeMap2 = new TreeMap<>(); - treeMap2.put(1, "Baeldung"); - treeMap2.put(1, "Baeldung"); - - Assert.assertTrue(treeMap2.size() == 1); - } -} \ No newline at end of file diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/ImmutableMapUnitTest.java similarity index 92% rename from java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/ImmutableMapUnitTest.java index b239ae07d8..d308aac7eb 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/ImmutableMapUnitTest.java @@ -1,16 +1,13 @@ -package com.baeldung.java.map; +package com.baeldung.map; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import com.google.common.collect.ImmutableMap; +import org.junit.jupiter.api.Test; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.junit.jupiter.api.Test; - -import com.google.common.collect.ImmutableMap; +import static org.junit.jupiter.api.Assertions.*; public class ImmutableMapUnitTest { diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/KeyCheckUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/KeyCheckUnitTest.java similarity index 78% rename from java-collections-maps/src/test/java/com/baeldung/java/map/KeyCheckUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/KeyCheckUnitTest.java index 2c97a97690..dbad2e5b5e 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/KeyCheckUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/KeyCheckUnitTest.java @@ -1,13 +1,11 @@ -package com.baeldung.java.map; +package com.baeldung.map; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import org.junit.Test; import java.util.Collections; import java.util.Map; -import org.junit.Test; +import static org.junit.Assert.*; public class KeyCheckUnitTest { diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MapMultipleValuesUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MapMultipleValuesUnitTest.java similarity index 96% rename from java-collections-maps/src/test/java/com/baeldung/java/map/MapMultipleValuesUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/MapMultipleValuesUnitTest.java index 3a0affa6f3..721b48ea7b 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/MapMultipleValuesUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/MapMultipleValuesUnitTest.java @@ -1,13 +1,9 @@ -package com.baeldung.java.map; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +package com.baeldung.map; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Multimap; +import com.google.common.collect.TreeMultimap; import org.apache.commons.collections4.MultiMap; import org.apache.commons.collections4.MultiMapUtils; import org.apache.commons.collections4.MultiValuedMap; @@ -18,10 +14,9 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.LinkedHashMultimap; -import com.google.common.collect.Multimap; -import com.google.common.collect.TreeMultimap; +import java.util.*; + +import static org.assertj.core.api.Assertions.assertThat; public class MapMultipleValuesUnitTest { private static final Logger LOG = LoggerFactory.getLogger(MapMultipleValuesUnitTest.class); diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MapUnitTest.java similarity index 99% rename from java-collections-maps/src/test/java/com/baeldung/java/map/MapUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/MapUnitTest.java index 7582eb87fb..eaf68ccba5 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/MapUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.java.map; +package com.baeldung.map; import org.junit.Test; import org.slf4j.Logger; diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUtilUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MapUtilUnitTest.java similarity index 99% rename from java-collections-maps/src/test/java/com/baeldung/java/map/MapUtilUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/MapUtilUnitTest.java index e31385e972..f8e4c8fd8a 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/MapUtilUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/MapUtilUnitTest.java @@ -1,9 +1,12 @@ /** * */ -package com.baeldung.java.map; +package com.baeldung.map; -import static org.junit.Assert.assertEquals; +import com.google.common.collect.HashBiMap; +import org.apache.commons.collections4.BidiMap; +import org.apache.commons.collections4.bidimap.DualHashBidiMap; +import org.junit.Test; import java.util.Arrays; import java.util.HashMap; @@ -11,11 +14,7 @@ import java.util.HashSet; import java.util.Map; import java.util.stream.Collectors; -import org.apache.commons.collections4.BidiMap; -import org.apache.commons.collections4.bidimap.DualHashBidiMap; -import org.junit.Test; - -import com.google.common.collect.HashBiMap; +import static org.junit.Assert.assertEquals; /** * @author swpraman diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/MultiValuedMapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/MultiValuedMapUnitTest.java similarity index 99% rename from java-collections-maps/src/test/java/com/baeldung/java/map/MultiValuedMapUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/MultiValuedMapUnitTest.java index b3aaf8925f..686c1cef87 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/MultiValuedMapUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/MultiValuedMapUnitTest.java @@ -1,15 +1,4 @@ -package com.baeldung.java.map; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; +package com.baeldung.map; import org.apache.commons.collections4.MultiMapUtils; import org.apache.commons.collections4.MultiSet; @@ -18,6 +7,17 @@ import org.apache.commons.collections4.multimap.ArrayListValuedHashMap; import org.apache.commons.collections4.multimap.HashSetValuedHashMap; import org.junit.Test; +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + public class MultiValuedMapUnitTest { @Test diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/compare/HashMapComparisonUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/map/compare/HashMapComparisonUnitTest.java similarity index 97% rename from java-collections-maps/src/test/java/com/baeldung/java/map/compare/HashMapComparisonUnitTest.java rename to java-collections-maps/src/test/java/com/baeldung/map/compare/HashMapComparisonUnitTest.java index e8aa12d4bd..0edd0cd87b 100644 --- a/java-collections-maps/src/test/java/com/baeldung/java/map/compare/HashMapComparisonUnitTest.java +++ b/java-collections-maps/src/test/java/com/baeldung/map/compare/HashMapComparisonUnitTest.java @@ -1,24 +1,21 @@ -package com.baeldung.java.map.compare; +package com.baeldung.map.compare; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.collection.IsMapContaining.hasEntry; -import static org.hamcrest.collection.IsMapContaining.hasKey; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import com.google.common.base.Equivalence; +import com.google.common.collect.MapDifference; +import com.google.common.collect.MapDifference.ValueDifference; +import com.google.common.collect.Maps; +import org.junit.Before; +import org.junit.Test; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -import org.junit.Before; -import org.junit.Test; - -import com.google.common.base.Equivalence; -import com.google.common.collect.MapDifference; -import com.google.common.collect.MapDifference.ValueDifference; -import com.google.common.collect.Maps; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.collection.IsMapContaining.hasEntry; +import static org.hamcrest.collection.IsMapContaining.hasKey; +import static org.junit.Assert.*; public class HashMapComparisonUnitTest { diff --git a/java-dates-2/.gitignore b/java-dates-2/.gitignore deleted file mode 100644 index 6471aabbcf..0000000000 --- a/java-dates-2/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -*.class - -0.* - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* -.resourceCache - -# Packaged files # -*.jar -*.war -*.ear - -# Files generated by integration tests -*.txt -backup-pom.xml -/bin/ -/temp - -#IntelliJ specific -.idea/ -*.iml - -#jenv -.java-version \ No newline at end of file diff --git a/java-dates-2/README.md b/java-dates-2/README.md deleted file mode 100644 index b2f8319e58..0000000000 --- a/java-dates-2/README.md +++ /dev/null @@ -1,4 +0,0 @@ -## Relevant Articles: -- [Converting Between LocalDate and XMLGregorianCalendar](https://www.baeldung.com/java-localdate-to-xmlgregoriancalendar) -- [Convert Time to Milliseconds in Java](https://www.baeldung.com/java-time-milliseconds) -- [Check If a String Is a Valid Date in Java](https://www.baeldung.com/java-string-valid-date) diff --git a/java-dates-2/pom.xml b/java-dates-2/pom.xml deleted file mode 100644 index c1419514ef..0000000000 --- a/java-dates-2/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - 4.0.0 - com.baeldung - java-dates-2 - 0.1.0-SNAPSHOT - jar - java-dates-2 - - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../parent-java - - - - - joda-time - joda-time - ${joda-time.version} - - - - - commons-validator - commons-validator - ${commons-validator.version} - - - - - org.assertj - assertj-core - ${assertj.version} - test - - - - - java-dates-2 - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - - 3.6.1 - 2.10 - 1.6 - 1.9 - 1.9 - - diff --git a/java-dates-2/src/main/java/com/baeldung/date/conversion/ConvertToOffsetDateTime.java b/java-dates-2/src/main/java/com/baeldung/date/conversion/ConvertToOffsetDateTime.java new file mode 100644 index 0000000000..34914962f9 --- /dev/null +++ b/java-dates-2/src/main/java/com/baeldung/date/conversion/ConvertToOffsetDateTime.java @@ -0,0 +1,19 @@ +package com.baeldung.date.conversion; + +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Date; + +public class ConvertToOffsetDateTime { + + public static OffsetDateTime convert(Date date) { + return date.toInstant() + .atOffset(ZoneOffset.UTC); + } + + public static OffsetDateTime convert(Date date, int hour, int minute) { + return date.toInstant() + .atOffset(ZoneOffset.ofHoursMinutes(hour, minute)); + } + +} diff --git a/java-dates-2/src/test/java/com/baeldung/date/conversion/ConvertToOffsetDateTimeUnitTest.java b/java-dates-2/src/test/java/com/baeldung/date/conversion/ConvertToOffsetDateTimeUnitTest.java new file mode 100644 index 0000000000..c927da00c8 --- /dev/null +++ b/java-dates-2/src/test/java/com/baeldung/date/conversion/ConvertToOffsetDateTimeUnitTest.java @@ -0,0 +1,29 @@ +package com.baeldung.date.conversion; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.time.OffsetDateTime; +import java.util.Date; + +import org.junit.Test; + +public class ConvertToOffsetDateTimeUnitTest { + + @Test + public void whenDateIsNotNull_thenConvertToOffsetDateTime() { + Date date = new Date(); + assertTrue(ConvertToOffsetDateTime.convert(date) instanceof OffsetDateTime); + } + + @Test + public void givenDate_whenHasOffset_thenConvertWithOffset() { + Date date = new Date(); + date.setHours(6); + date.setMinutes(30); + OffsetDateTime odt = ConvertToOffsetDateTime.convert(date, 3, 30); + assertEquals(10, odt.getHour()); + assertEquals(0, odt.getMinute()); + } + +} diff --git a/java-dates/.gitignore b/java-dates/.gitignore deleted file mode 100644 index 3de4cc647e..0000000000 --- a/java-dates/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -*.class - -0.* - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* -.resourceCache - -# Packaged files # -*.jar -*.war -*.ear - -# Files generated by integration tests -*.txt -backup-pom.xml -/bin/ -/temp - -#IntelliJ specific -.idea/ -*.iml \ No newline at end of file diff --git a/java-dates/README.md b/java-dates/README.md deleted file mode 100644 index 7da309924d..0000000000 --- a/java-dates/README.md +++ /dev/null @@ -1,32 +0,0 @@ -========= - -## Java Dates Cookbooks and Examples - -### Relevant Articles: -- [TemporalAdjuster in Java](http://www.baeldung.com/java-temporal-adjuster) -- [Handling Daylight Savings Time in Java](http://www.baeldung.com/java-daylight-savings) -- [Period and Duration in Java](http://www.baeldung.com/java-period-duration) -- [Difference Between Two Dates in Java](http://www.baeldung.com/java-date-difference) -- [RegEx for matching Date Pattern in Java](http://www.baeldung.com/java-date-regular-expressions) -- [Migrating to the New Java 8 Date Time API](http://www.baeldung.com/migrating-to-java-8-date-time-api) -- [Introduction to the Java 8 Date/Time API](http://www.baeldung.com/java-8-date-time-intro) -- [Get the Current Date, Time and Timestamp in Java 8](http://www.baeldung.com/current-date-time-and-timestamp-in-java-8) -- [Get Date Without Time in Java](http://www.baeldung.com/java-date-without-time) -- [How to Get All Dates Between Two Dates?](http://www.baeldung.com/java-between-dates) -- [Convert Date to LocalDate or LocalDateTime and Back](http://www.baeldung.com/java-date-to-localdate-and-localdatetime) -- [Display All Time Zones With GMT And UTC in Java](http://www.baeldung.com/java-time-zones) -- [Extracting Year, Month and Day from Date in Java](http://www.baeldung.com/java-year-month-day) -- [Guide to java.util.GregorianCalendar](http://www.baeldung.com/java-gregorian-calendar) -- [Measure Elapsed Time in Java](http://www.baeldung.com/java-measure-elapsed-time) -- [How to Get the Start and the End of a Day using Java](http://www.baeldung.com/java-day-start-end) -- [Calculate Age in Java](http://www.baeldung.com/java-get-age) -- [Increment Date in Java](http://www.baeldung.com/java-increment-date) -- [Add Hours To a Date In Java](http://www.baeldung.com/java-add-hours-date) -- [Guide to DateTimeFormatter](https://www.baeldung.com/java-datetimeformatter) -- [Format ZonedDateTime to String](https://www.baeldung.com/java-format-zoned-datetime-string) -- [Convert Between java.time.Instant and java.sql.Timestamp](https://www.baeldung.com/java-time-instant-to-java-sql-timestamp) -- [Convert between String and Timestamp](https://www.baeldung.com/java-string-to-timestamp) -- [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) -- [ZoneOffset in Java](https://www.baeldung.com/java-zone-offset) -- [Differences Between ZonedDateTime and OffsetDateTime](https://www.baeldung.com/java-zoneddatetime-offsetdatetime) -- [Introduction to Joda-Time](http://www.baeldung.com/joda-time) diff --git a/java-dates/pom.xml b/java-dates/pom.xml deleted file mode 100644 index 3fddf3f0f8..0000000000 --- a/java-dates/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - 4.0.0 - com.baeldung - java-dates - 0.1.0-SNAPSHOT - java-dates - jar - - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../parent-java - - - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - log4j - log4j - ${log4j.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - - - - org.assertj - assertj-core - ${assertj.version} - test - - - joda-time - joda-time - ${joda-time.version} - - - com.darwinsys - hirondelle-date4j - RELEASE - test - - - - - java-dates - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - 2.10 - - 3.6.1 - 1.9 - 1.9 - - diff --git a/java-dates/src/main/java/com/baeldung/datetime/README.md b/java-dates/src/main/java/com/baeldung/datetime/README.md deleted file mode 100644 index 7d843af9ea..0000000000 --- a/java-dates/src/main/java/com/baeldung/datetime/README.md +++ /dev/null @@ -1 +0,0 @@ -### Relevant Articles: diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java b/java-dates/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java new file mode 100644 index 0000000000..13a2ba6a1a --- /dev/null +++ b/java-dates/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java @@ -0,0 +1,21 @@ +package com.baeldung.datetime; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.Locale; + +public class UseDateTimeFormatter { + public String formatAsIsoDate(LocalDateTime localDateTime) { + return localDateTime.format(DateTimeFormatter.ISO_DATE); + } + + public String formatCustom(LocalDateTime localDateTime, String pattern) { + return localDateTime.format(DateTimeFormatter.ofPattern(pattern)); + } + + public String formatWithStyleAndLocale(LocalDateTime localDateTime, FormatStyle formatStyle, Locale locale) { + return localDateTime.format(DateTimeFormatter.ofLocalizedDateTime(formatStyle) + .withLocale(locale)); + } +} diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseLocalDateTime.java b/java-dates/src/main/java/com/baeldung/datetime/UseLocalDateTime.java deleted file mode 100644 index b2ff11ba16..0000000000 --- a/java-dates/src/main/java/com/baeldung/datetime/UseLocalDateTime.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.datetime; - -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.temporal.ChronoField; - -public class UseLocalDateTime { - - public LocalDateTime getLocalDateTimeUsingParseMethod(String representation) { - return LocalDateTime.parse(representation); - } - - LocalDateTime getEndOfDayFromLocalDateTimeDirectly(LocalDateTime localDateTime) { - LocalDateTime endOfDate = localDateTime.with(ChronoField.NANO_OF_DAY, LocalTime.MAX.toNanoOfDay()); - return endOfDate; - } - - LocalDateTime getEndOfDayFromLocalDateTime(LocalDateTime localDateTime) { - LocalDateTime endOfDate = localDateTime.toLocalDate() - .atTime(LocalTime.MAX); - return endOfDate; - } - -} diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java b/java-dates/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java new file mode 100644 index 0000000000..ed8499d6e0 --- /dev/null +++ b/java-dates/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java @@ -0,0 +1,11 @@ +package com.baeldung.datetime; + +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +public class UseOffsetDateTime { + public OffsetDateTime offsetOfLocalDateTimeAndOffset(LocalDateTime localDateTime, ZoneOffset offset) { + return OffsetDateTime.of(localDateTime, offset); + } +} diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseZonedDateTime.java b/java-dates/src/main/java/com/baeldung/datetime/UseZonedDateTime.java deleted file mode 100644 index 505bfa741f..0000000000 --- a/java-dates/src/main/java/com/baeldung/datetime/UseZonedDateTime.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.baeldung.datetime; - -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.time.temporal.ChronoField; - -class UseZonedDateTime { - - ZonedDateTime getZonedDateTime(LocalDateTime localDateTime, ZoneId zoneId) { - return ZonedDateTime.of(localDateTime, zoneId); - } - - ZonedDateTime getStartOfDay(LocalDate localDate, ZoneId zone) { - ZonedDateTime startofDay = localDate.atStartOfDay() - .atZone(zone); - return startofDay; - } - - ZonedDateTime getStartOfDayShorthand(LocalDate localDate, ZoneId zone) { - ZonedDateTime startofDay = localDate.atStartOfDay(zone); - return startofDay; - } - - ZonedDateTime getStartOfDayFromZonedDateTime(ZonedDateTime zonedDateTime) { - ZonedDateTime startofDay = zonedDateTime.toLocalDateTime() - .toLocalDate() - .atStartOfDay(zonedDateTime.getZone()); - return startofDay; - } - - ZonedDateTime getStartOfDayAtMinTime(ZonedDateTime zonedDateTime) { - ZonedDateTime startofDay = zonedDateTime.with(ChronoField.HOUR_OF_DAY, 0); - return startofDay; - } - - ZonedDateTime getStartOfDayAtMidnightTime(ZonedDateTime zonedDateTime) { - ZonedDateTime startofDay = zonedDateTime.with(ChronoField.NANO_OF_DAY, 0); - return startofDay; - } -} diff --git a/java-dates/src/test/java/com/baeldung/dateapi/JavaDurationUnitTest.java b/java-dates/src/test/java/com/baeldung/dateapi/JavaDurationUnitTest.java deleted file mode 100644 index db6b353ba6..0000000000 --- a/java-dates/src/test/java/com/baeldung/dateapi/JavaDurationUnitTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.baeldung.dateapi; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; - -import java.time.Duration; -import java.time.Instant; -import java.time.temporal.ChronoUnit; - -import org.junit.Test; - -public class JavaDurationUnitTest { - - @Test - public void test2() { - Instant start = Instant.parse("2017-10-03T10:15:30.00Z"); - Instant end = Instant.parse("2017-10-03T10:16:30.00Z"); - - Duration duration = Duration.between(start, end); - - assertFalse(duration.isNegative()); - - assertEquals(60, duration.getSeconds()); - assertEquals(1, duration.toMinutes()); - - Duration fromDays = Duration.ofDays(1); - assertEquals(86400, fromDays.getSeconds()); - - Duration fromMinutes = Duration.ofMinutes(60); - assertEquals(1, fromMinutes.toHours()); - - assertEquals(120, duration.plusSeconds(60).getSeconds()); - assertEquals(30, duration.minusSeconds(30).getSeconds()); - - assertEquals(120, duration.plus(60, ChronoUnit.SECONDS).getSeconds()); - assertEquals(30, duration.minus(30, ChronoUnit.SECONDS).getSeconds()); - - Duration fromChar1 = Duration.parse("P1DT1H10M10.5S"); - Duration fromChar2 = Duration.parse("PT10M"); - } - -} diff --git a/java-dates/src/test/java/com/baeldung/dateapi/JavaPeriodUnitTest.java b/java-dates/src/test/java/com/baeldung/dateapi/JavaPeriodUnitTest.java deleted file mode 100644 index 81e9153a51..0000000000 --- a/java-dates/src/test/java/com/baeldung/dateapi/JavaPeriodUnitTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.baeldung.dateapi; - -import org.apache.log4j.Logger; -import org.junit.Test; - -import java.time.LocalDate; -import java.time.Period; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; - -public class JavaPeriodUnitTest { - - private static final Logger LOG = Logger.getLogger(JavaPeriodUnitTest.class); - - @Test - public void whenTestPeriod_thenOk() { - - LocalDate startDate = LocalDate.of(2015, 2, 15); - LocalDate endDate = LocalDate.of(2017, 1, 21); - - Period period = Period.between(startDate, endDate); - - LOG.info(String.format("Years:%d months:%d days:%d", period.getYears(), period.getMonths(), period.getDays())); - - assertFalse(period.isNegative()); - assertEquals(56, period.plusDays(50).getDays()); - assertEquals(9, period.minusMonths(2).getMonths()); - - Period fromUnits = Period.of(3, 10, 10); - Period fromDays = Period.ofDays(50); - Period fromMonths = Period.ofMonths(5); - Period fromYears = Period.ofYears(10); - Period fromWeeks = Period.ofWeeks(40); - - assertEquals(280, fromWeeks.getDays()); - - Period fromCharYears = Period.parse("P2Y"); - assertEquals(2, fromCharYears.getYears()); - Period fromCharUnits = Period.parse("P2Y3M5D"); - assertEquals(5, fromCharUnits.getDays()); - } - -} diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java b/java-dates/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java new file mode 100644 index 0000000000..797e0b954a --- /dev/null +++ b/java-dates/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java @@ -0,0 +1,36 @@ +package com.baeldung.datetime; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.time.LocalDateTime; +import java.time.Month; +import java.time.format.FormatStyle; +import java.util.Locale; + +import org.junit.Test; + +public class UseDateTimeFormatterUnitTest { + private final UseDateTimeFormatter subject = new UseDateTimeFormatter(); + private final LocalDateTime localDateTime = LocalDateTime.of(2015, Month.JANUARY, 25, 6, 30); + + @Test + public void givenALocalDate_whenFormattingAsIso_thenPass() { + String result = subject.formatAsIsoDate(localDateTime); + + assertThat(result).isEqualTo("2015-01-25"); + } + + @Test + public void givenALocalDate_whenFormattingWithPattern_thenPass() { + String result = subject.formatCustom(localDateTime, "yyyy/MM/dd"); + + assertThat(result).isEqualTo("2015/01/25"); + } + + @Test + public void givenALocalDate_whenFormattingWithStyleAndLocale_thenPass() { + String result = subject.formatWithStyleAndLocale(localDateTime, FormatStyle.MEDIUM, Locale.UK); + + assertThat(result).isEqualTo("25 Jan 2015, 06:30:00"); + } +} \ No newline at end of file diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java b/java-dates/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java deleted file mode 100644 index 5709fc7209..0000000000 --- a/java-dates/src/test/java/com/baeldung/datetime/UseLocalDateTimeUnitTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.baeldung.datetime; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; - -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.Month; - -import org.junit.Test; - -public class UseLocalDateTimeUnitTest { - - UseLocalDateTime useLocalDateTime = new UseLocalDateTime(); - - @Test - public void givenString_whenUsingParse_thenLocalDateTime() { - assertEquals(LocalDate.of(2016, Month.MAY, 10), useLocalDateTime.getLocalDateTimeUsingParseMethod("2016-05-10T06:30") - .toLocalDate()); - assertEquals(LocalTime.of(6, 30), useLocalDateTime.getLocalDateTimeUsingParseMethod("2016-05-10T06:30") - .toLocalTime()); - } - - @Test - public void givenLocalDateTime_whenSettingEndOfDay_thenReturnLastMomentOfDay() { - LocalDateTime givenTimed = LocalDateTime.parse("2018-06-23T05:55:55"); - - LocalDateTime endOfDayFromGivenDirectly = useLocalDateTime.getEndOfDayFromLocalDateTimeDirectly(givenTimed); - LocalDateTime endOfDayFromGiven = useLocalDateTime.getEndOfDayFromLocalDateTime(givenTimed); - - assertThat(endOfDayFromGivenDirectly).isEqualTo(endOfDayFromGiven); - assertThat(endOfDayFromGivenDirectly.toLocalTime()).isEqualTo(LocalTime.MAX); - assertThat(endOfDayFromGivenDirectly.toString()).isEqualTo("2018-06-23T23:59:59.999999999"); - } -} diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseLocalTimeUnitTest.java b/java-dates/src/test/java/com/baeldung/datetime/UseLocalTimeUnitTest.java deleted file mode 100644 index 996e200ae9..0000000000 --- a/java-dates/src/test/java/com/baeldung/datetime/UseLocalTimeUnitTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.baeldung.datetime; - -import java.time.LocalTime; - -import org.junit.Assert; -import org.junit.Test; - -public class UseLocalTimeUnitTest { - - UseLocalTime useLocalTime = new UseLocalTime(); - - @Test - public void givenValues_whenUsingFactoryOf_thenLocalTime() { - Assert.assertEquals("07:07:07", useLocalTime.getLocalTimeUsingFactoryOfMethod(7, 7, 7).toString()); - } - - @Test - public void givenString_whenUsingParse_thenLocalTime() { - Assert.assertEquals("06:30", useLocalTime.getLocalTimeUsingParseMethod("06:30").toString()); - } - - @Test - public void givenTime_whenAddHour_thenLocalTime() { - Assert.assertEquals("07:30", useLocalTime.addAnHour(LocalTime.of(6, 30)).toString()); - } - - @Test - public void getHourFromLocalTime() { - Assert.assertEquals(1, useLocalTime.getHourFromLocalTime(LocalTime.of(1, 1))); - } - - @Test - public void getLocalTimeWithMinuteSetToValue() { - Assert.assertEquals(LocalTime.of(10, 20), useLocalTime.getLocalTimeWithMinuteSetToValue(LocalTime.of(10, 10), 20)); - } -} diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java b/java-dates/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java new file mode 100644 index 0000000000..5b58dd3848 --- /dev/null +++ b/java-dates/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java @@ -0,0 +1,24 @@ +package com.baeldung.datetime; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.time.LocalDateTime; +import java.time.Month; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +import org.junit.Test; + +public class UseOffsetDateTimeUnitTest { + private final UseOffsetDateTime subject = new UseOffsetDateTime(); + + @Test + public void givenAZoneOffSetAndLocalDateTime_whenCombing_thenValidResult() { + ZoneOffset offset = ZoneOffset.of("+02:00"); + LocalDateTime localDateTime = LocalDateTime.of(2015, Month.FEBRUARY, 20, 6, 30); + + OffsetDateTime result = subject.offsetOfLocalDateTimeAndOffset(localDateTime, offset); + + assertThat(result.toString()).isEqualTo("2015-02-20T06:30+02:00"); + } +} \ No newline at end of file diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java b/java-dates/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java new file mode 100644 index 0000000000..78d9a647fe --- /dev/null +++ b/java-dates/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java @@ -0,0 +1,33 @@ +package com.baeldung.datetime; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.time.LocalDateTime; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; + +import org.junit.Test; + +public class UseToInstantUnitTest { + + private UseToInstant subject = new UseToInstant(); + + @Test + public void givenAGregorianCalenderDate_whenConvertingToLocalDate_thenAsExpected() { + GregorianCalendar givenCalender = new GregorianCalendar(2018, Calendar.JULY, 28); + + LocalDateTime localDateTime = subject.convertDateToLocalDate(givenCalender); + + assertThat(localDateTime).isEqualTo("2018-07-28T00:00:00"); + } + + @Test + public void givenADate_whenConvertingToLocalDate_thenAsExpected() { + Date givenDate = new Date(1465817690000L); + + LocalDateTime localDateTime = subject.convertDateToLocalDate(givenDate); + + assertThat(localDateTime).isEqualTo("2016-06-13T13:34:50"); + } +} \ No newline at end of file diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseZonedDateTimeUnitTest.java b/java-dates/src/test/java/com/baeldung/datetime/UseZonedDateTimeUnitTest.java deleted file mode 100644 index f9b4008888..0000000000 --- a/java-dates/src/test/java/com/baeldung/datetime/UseZonedDateTimeUnitTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.baeldung.datetime; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.ZoneId; -import java.time.ZonedDateTime; - -import org.junit.Assert; -import org.junit.Test; - -public class UseZonedDateTimeUnitTest { - - UseZonedDateTime zonedDateTime = new UseZonedDateTime(); - - @Test - public void givenZoneId_thenZonedDateTime() { - ZoneId zoneId = ZoneId.of("Europe/Paris"); - ZonedDateTime zonedDatetime = zonedDateTime.getZonedDateTime(LocalDateTime.parse("2016-05-20T06:30"), zoneId); - Assert.assertEquals(zoneId, ZoneId.from(zonedDatetime)); - } - - @Test - public void givenLocalDateOrZoned_whenSettingStartOfDay_thenReturnMidnightInAllCases() { - LocalDate given = LocalDate.parse("2018-06-23"); - ZoneId zone = ZoneId.of("Europe/Paris"); - ZonedDateTime zonedGiven = ZonedDateTime.of(given, LocalTime.NOON, zone); - - ZonedDateTime startOfOfDayWithMethod = zonedDateTime.getStartOfDay(given, zone); - ZonedDateTime startOfOfDayWithShorthandMethod = zonedDateTime.getStartOfDayShorthand(given, zone); - ZonedDateTime startOfOfDayFromZonedDateTime = zonedDateTime.getStartOfDayFromZonedDateTime(zonedGiven); - ZonedDateTime startOfOfDayAtMinTime = zonedDateTime.getStartOfDayAtMinTime(zonedGiven); - ZonedDateTime startOfOfDayAtMidnightTime = zonedDateTime.getStartOfDayAtMidnightTime(zonedGiven); - - assertThat(startOfOfDayWithMethod).isEqualTo(startOfOfDayWithShorthandMethod) - .isEqualTo(startOfOfDayFromZonedDateTime) - .isEqualTo(startOfOfDayAtMinTime) - .isEqualTo(startOfOfDayAtMidnightTime); - assertThat(startOfOfDayWithMethod.toLocalTime()).isEqualTo(LocalTime.MIDNIGHT); - assertThat(startOfOfDayWithMethod.toLocalTime() - .toString()).isEqualTo("00:00"); - } -} diff --git a/java-dates/src/test/resources/.gitignore b/java-dates/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/java-dates/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/java-ee-8-security-api/README.md b/java-ee-8-security-api/README.md index 1735419236..b01a073e35 100644 --- a/java-ee-8-security-api/README.md +++ b/java-ee-8-security-api/README.md @@ -1,3 +1,7 @@ +## Java EE 8 Security API + +This module contains articles about the Security API in Java EE 8. + ### Relevant articles - - [Java EE 8 Security API](http://www.baeldung.com/java-ee-8-security) + - [Java EE 8 Security API](https://www.baeldung.com/java-ee-8-security) diff --git a/java-ee-8-security-api/pom.xml b/java-ee-8-security-api/pom.xml index 4d4e2ba3b3..f43f3d7c5f 100644 --- a/java-ee-8-security-api/pom.xml +++ b/java-ee-8-security-api/pom.xml @@ -14,6 +14,13 @@ 1.0.0-SNAPSHOT + + app-auth-basic-store-db + app-auth-form-store-ldap + app-auth-custom-form-store-custom + app-auth-custom-no-store + + @@ -58,17 +65,9 @@ - - app-auth-basic-store-db - app-auth-form-store-ldap - app-auth-custom-form-store-custom - app-auth-custom-no-store - - 9080 9443 - 8.0 2.3 18.0.0.1 diff --git a/java-jdi/README.md b/java-jdi/README.md new file mode 100644 index 0000000000..110906e845 --- /dev/null +++ b/java-jdi/README.md @@ -0,0 +1,7 @@ +## Java JDI + +This module contains articles about JDI, the Java Debug Interface. + +### Relevant articles + +- [An Intro to the Java Debug Interface (JDI)](https://www.baeldung.com/java-debug-interface) diff --git a/java-lite/README.md b/java-lite/README.md index a4e2edd49f..96fb6f1a93 100644 --- a/java-lite/README.md +++ b/java-lite/README.md @@ -1,4 +1,8 @@ +## JavaLite + +This module contains articles about JavaLite. + ### Relevant Articles: -- [A Guide to JavaLite – Building a RESTful CRUD application](http://www.baeldung.com/javalite-rest) -- [Introduction to ActiveWeb](http://www.baeldung.com/activeweb) +- [A Guide to JavaLite – Building a RESTful CRUD application](https://www.baeldung.com/javalite-rest) +- [Introduction to ActiveWeb](https://www.baeldung.com/activeweb) diff --git a/java-math/README.md b/java-math/README.md index b0921e55ae..d80a07258a 100644 --- a/java-math/README.md +++ b/java-math/README.md @@ -1,4 +1,8 @@ -## Relevant articles: +## Java Math + +This module contains articles about math in Java. + +### Relevant articles: - [Calculate Factorial in Java](https://www.baeldung.com/java-calculate-factorial) - [Generate Combinations in Java](https://www.baeldung.com/java-combinations-algorithm) @@ -10,3 +14,5 @@ - [Convert Latitude and Longitude to a 2D Point in Java](https://www.baeldung.com/java-convert-latitude-longitude) - [Debugging with Eclipse](https://www.baeldung.com/eclipse-debugging) - [Matrix Multiplication in Java](https://www.baeldung.com/java-matrix-multiplication) +- [Calculating Logarithms in Java](https://www.baeldung.com/java-logarithms) +- [Finding Greatest Common Divisor in Java](https://www.baeldung.com/java-greatest-common-divisor) diff --git a/java-numbers-2/README.md b/java-numbers-2/README.md index 1d2919aa63..e200c4aa03 100644 --- a/java-numbers-2/README.md +++ b/java-numbers-2/README.md @@ -1,10 +1,18 @@ -## Relevant Articles +## Java Number Cookbooks and Examples + +This module contains articles about numbers in Java. + +### Relevant Articles - [Lossy Conversion in Java](https://www.baeldung.com/java-lossy-conversion) - [A Guide to the Java Math Class](https://www.baeldung.com/java-lang-math) - [Calculate the Area of a Circle in Java](https://www.baeldung.com/java-calculate-circle-area) -- [NaN in Java](http://www.baeldung.com/java-not-a-number) -- [Generating Prime Numbers in Java](http://www.baeldung.com/java-generate-prime-numbers) -- [Using Math.pow in Java](http://www.baeldung.com/java-math-pow) -- [Check If a Number Is Prime in Java](http://www.baeldung.com/java-prime-numbers) +- [NaN in Java](https://www.baeldung.com/java-not-a-number) +- [Generating Prime Numbers in Java](https://www.baeldung.com/java-generate-prime-numbers) +- [Using Math.pow in Java](https://www.baeldung.com/java-math-pow) +- [Check If a Number Is Prime in Java](https://www.baeldung.com/java-prime-numbers) - [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers) - [Finding the Least Common Multiple in Java](https://www.baeldung.com/java-least-common-multiple) +- [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers) +- [Generating Random Numbers in a Range in Java](https://www.baeldung.com/java-generating-random-numbers) +- [Listing Numbers Within a Range in Java](https://www.baeldung.com/java-listing-numbers-within-a-range) +- More articles: [[<-- prev]](/../java-numbers) diff --git a/java-numbers/README.md b/java-numbers/README.md index 7885232c46..eee6fceab1 100644 --- a/java-numbers/README.md +++ b/java-numbers/README.md @@ -1,7 +1,7 @@ -========= - ## Java Number Cookbooks and Examples +This module contains articles about numbers in Java. + ### Relevant Articles: - [Number of Digits in an Integer in Java](http://www.baeldung.com/java-number-of-digits-in-int) - [How to Round a Number to N Decimal Places in Java](http://www.baeldung.com/java-round-decimal-number) @@ -13,3 +13,4 @@ - [Calculating the nth Root in Java](https://www.baeldung.com/java-nth-root) - [Convert Double to String, Removing Decimal Places](https://www.baeldung.com/java-double-to-string) - [Changing the Order in a Sum Operation Can Produce Different Results?](https://www.baeldung.com/java-floating-point-sum-order) +- More articles: [[next -->]](/../java-numbers-2) diff --git a/java-numbers/src/main/java/com/baeldung/nth/root/calculator/NthRootCalculator.java b/java-numbers/src/main/java/com/baeldung/nth/root/calculator/NthRootCalculator.java index 217f1e06de..5e9f5bbcb4 100644 --- a/java-numbers/src/main/java/com/baeldung/nth/root/calculator/NthRootCalculator.java +++ b/java-numbers/src/main/java/com/baeldung/nth/root/calculator/NthRootCalculator.java @@ -1,8 +1,12 @@ package com.baeldung.nth.root.calculator; -public class NthRootCalculator -{ - public Double calculate(Double base, Double n) { - return Math.pow(Math.E, Math.log(base)/n); +public class NthRootCalculator { + + public double calculateWithRound(double base, double n) { + return Math.round(calculate(base, n)); + } + + public double calculate(double base, double n) { + return Math.pow(base, 1.0 / n); } } diff --git a/java-numbers/src/main/java/com/baeldung/nth/root/main/Main.java b/java-numbers/src/main/java/com/baeldung/nth/root/main/Main.java index 3fcd36812f..50190da38c 100644 --- a/java-numbers/src/main/java/com/baeldung/nth/root/main/Main.java +++ b/java-numbers/src/main/java/com/baeldung/nth/root/main/Main.java @@ -7,7 +7,7 @@ public class Main { NthRootCalculator calculator = new NthRootCalculator(); Double base = Double.parseDouble(args[0]); Double n = Double.parseDouble(args[1]); - Double result = calculator.calculate(base, n); + Double result = calculator.calculateWithRound(base, n); System.out.println("The " + n + " root of " + base + " equals to " + result + "."); } } diff --git a/java-numbers/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java b/java-numbers/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java index ab962fc150..35970536ed 100644 --- a/java-numbers/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java +++ b/java-numbers/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java @@ -1,19 +1,22 @@ package com.baeldung.nth.root.calculator; -import static org.junit.Assert.assertEquals; - import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.junit.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; public class NthRootCalculatorUnitTest { private NthRootCalculator nthRootCalculator = new NthRootCalculator(); @Test - public void whenBaseIs125AndNIs3_thenNthRootIs5() { - Double result = nthRootCalculator.calculate(125.0, 3.0); - assertEquals(result, (Double) 5.0d); + public void whenBaseIs125AndNIs3_thenNthIs5() { + double nth = nthRootCalculator.calculateWithRound(125,3); + assertEquals(5, nth, 0); + } + + @Test + public void whenBaseIs625AndNIs4_thenNthIs5() { + double nth = nthRootCalculator.calculate(625,4); + assertEquals(5, nth, 0.00001); } } diff --git a/java-numbers/src/test/java/com/baeldung/nth/root/main/MainUnitTest.java b/java-numbers/src/test/java/com/baeldung/nth/root/main/MainUnitTest.java deleted file mode 100644 index a2fd839ba4..0000000000 --- a/java-numbers/src/test/java/com/baeldung/nth/root/main/MainUnitTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.baeldung.nth.root.main; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import static org.junit.Assert.assertEquals; - -public class MainUnitTest { - @InjectMocks - private Main main; - - private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); - private final PrintStream originalOut = System.out; - - @Before - public void setUpStreams() { - System.setOut(new PrintStream(outContent)); - } - - @After - public void restoreStreams() { - System.setOut(originalOut); - } - - @Test - public void givenThatTheBaseIs125_andTheExpIs3_whenMainIsCalled_thenTheCorrectResultIsPrinted() { - main.main(new String[]{"125.0", "3.0"}); - assertEquals("The 3.0 root of 125.0 equals to 5.0.\n", outContent.toString().replaceAll("\r", "")); - } -} diff --git a/java-numbers/src/test/java/com/baeldung/random/JavaRandomUnitTest.java b/java-numbers/src/test/java/com/baeldung/random/JavaRandomUnitTest.java index 2273dfda13..de37b8d1e3 100644 --- a/java-numbers/src/test/java/com/baeldung/random/JavaRandomUnitTest.java +++ b/java-numbers/src/test/java/com/baeldung/random/JavaRandomUnitTest.java @@ -1,12 +1,10 @@ package com.baeldung.random; -import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.math3.random.RandomDataGenerator; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.nio.charset.Charset; import java.util.Random; public class JavaRandomUnitTest { @@ -155,63 +153,4 @@ public class JavaRandomUnitTest { LOG.debug("{}", generatedDouble); } - // tests - random String - - @Test - public void givenUsingPlainJava_whenGeneratingRandomStringUnbounded_thenCorrect() { - final byte[] array = new byte[7]; // length is bounded by 7 - new Random().nextBytes(array); - final String generatedString = new String(array, Charset.forName("UTF-8")); - - LOG.debug(generatedString); - } - - @Test - public void givenUsingPlainJava_whenGeneratingRandomStringBounded_thenCorrect() { - final int leftLimit = 97; // letter 'a' - final int rightLimit = 122; // letter 'z' - final int targetStringLength = 10; - final Random random = new Random(); - final StringBuilder buffer = new StringBuilder(targetStringLength); - - for (int i = 0; i < targetStringLength; i++) { - final int randomLimitedInt = leftLimit + (int) (random.nextFloat() * (rightLimit - leftLimit + 1)); - buffer.append((char) randomLimitedInt); - } - final String generatedString = buffer.toString(); - - LOG.debug(generatedString); - } - - @Test - public void givenUsingApache_whenGeneratingRandomString_thenCorrect() { - final String generatedString = RandomStringUtils.random(10); - - LOG.debug(generatedString); - } - - @Test - public void givenUsingApache_whenGeneratingRandomAlphabeticString_thenCorrect() { - final String generatedString = RandomStringUtils.randomAlphabetic(10); - - LOG.debug(generatedString); - } - - @Test - public void givenUsingApache_whenGeneratingRandomAlphanumericString_thenCorrect() { - final String generatedString = RandomStringUtils.randomAlphanumeric(10); - - LOG.debug(generatedString); - } - - @Test - public void givenUsingApache_whenGeneratingRandomStringBounded_thenCorrect() { - final int length = 10; - final boolean useLetters = true; - final boolean useNumbers = false; - final String generatedString = RandomStringUtils.random(length, useLetters, useNumbers); - - LOG.debug(generatedString); - } - } diff --git a/java-rmi/README.md b/java-rmi/README.md index 4d12060395..244f986639 100644 --- a/java-rmi/README.md +++ b/java-rmi/README.md @@ -1,3 +1,7 @@ +## Java RMI + +This module contains articles about RMI (Remote Method Invocation) in Java. + ### Relevant articles -- [Getting Started with Java RMI](http://www.baeldung.com/java-rmi) +- [Getting Started with Java RMI](https://www.baeldung.com/java-rmi) diff --git a/java-spi/README.md b/java-spi/README.md index d2658c42fe..2ccef98a10 100644 --- a/java-spi/README.md +++ b/java-spi/README.md @@ -1,4 +1,7 @@ +## Java SPI + +This module contains articles about the SPI (Service Provider Interface) in Java. ### Relevant Articles: -- [Java Service Provider Interface](http://www.baeldung.com/java-spi) +- [Java Service Provider Interface](https://www.baeldung.com/java-spi) diff --git a/java-streams-2/README.md b/java-streams-2/README.md deleted file mode 100644 index 851d3d71e2..0000000000 --- a/java-streams-2/README.md +++ /dev/null @@ -1,4 +0,0 @@ -### Relevant Articles: -- [Guide to Stream.reduce()](https://www.baeldung.com/java-stream-reduce) -- [How to Break from Java Stream forEach](https://www.baeldung.com/java-break-stream-foreach) -- [Java IntStream Conversions](https://www.baeldung.com/java-intstream-convert) diff --git a/java-streams-2/pom.xml b/java-streams-2/pom.xml deleted file mode 100644 index 4cebd44427..0000000000 --- a/java-streams-2/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - com.baeldung.javastreams2 - java-streams-2 - 1.0 - java-streams-2 - jar - - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../parent-java - - - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator.version} - - - junit - junit - ${junit.version} - test - jar - - - org.assertj - assertj-core - ${assertj.version} - test - - - - - UTF-8 - 1.9 - 1.9 - 3.11.1 - - \ No newline at end of file diff --git a/java-streams-2/src/main/java/com/baeldung/reduce/application/Application.java b/java-streams-2/src/main/java/com/baeldung/reduce/application/Application.java deleted file mode 100644 index 79c557524d..0000000000 --- a/java-streams-2/src/main/java/com/baeldung/reduce/application/Application.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.baeldung.reduce.application; - -import com.baeldung.reduce.entities.User; -import com.baeldung.reduce.utilities.NumberUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class Application { - - public static void main(String[] args) { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - int result1 = numbers.stream().reduce(0, (subtotal, element) -> subtotal + element); - System.out.println(result1); - - int result2 = numbers.stream().reduce(0, Integer::sum); - System.out.println(result2); - - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result3 = letters.stream().reduce("", (partialString, element) -> partialString + element); - System.out.println(result3); - - String result4 = letters.stream().reduce("", String::concat); - System.out.println(result4); - - String result5 = letters.stream().reduce("", (partialString, element) -> partialString.toUpperCase() + element.toUpperCase()); - System.out.println(result5); - - List users = Arrays.asList(new User("John", 30), new User("Julie", 35)); - int result6 = users.stream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - System.out.println(result6); - - String result7 = letters.parallelStream().reduce("", String::concat); - System.out.println(result7); - - int result8 = users.parallelStream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - System.out.println(result8); - } -} diff --git a/java-streams-2/src/main/java/com/baeldung/reduce/entities/User.java b/java-streams-2/src/main/java/com/baeldung/reduce/entities/User.java deleted file mode 100644 index a17c6a02b6..0000000000 --- a/java-streams-2/src/main/java/com/baeldung/reduce/entities/User.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.reduce.entities; - -public class User { - - private final String name; - private final int age; - - public User(String name, int age) { - this.name = name; - this.age = age; - } - - public String getName() { - return name; - } - - public int getAge() { - return age; - } - - @Override - public String toString() { - return "User{" + "name=" + name + ", age=" + age + '}'; - } -} diff --git a/java-streams-2/src/main/java/com/baeldung/reduce/utilities/NumberUtils.java b/java-streams-2/src/main/java/com/baeldung/reduce/utilities/NumberUtils.java deleted file mode 100644 index a7a4b8df29..0000000000 --- a/java-streams-2/src/main/java/com/baeldung/reduce/utilities/NumberUtils.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.baeldung.reduce.utilities; - -import java.util.List; -import java.util.function.BiFunction; -import java.util.logging.Level; -import java.util.logging.Logger; - -public abstract class NumberUtils { - - private static final Logger LOGGER = Logger.getLogger(NumberUtils.class.getName()); - - public static int divideListElements(List values, Integer divider) { - return values.stream() - .reduce(0, (a, b) -> { - try { - return a / divider + b / divider; - } catch (ArithmeticException e) { - LOGGER.log(Level.INFO, "Arithmetic Exception: Division by Zero"); - } - return 0; - }); - } - - public static int divideListElementsWithExtractedTryCatchBlock(List values, int divider) { - return values.stream().reduce(0, (a, b) -> divide(a, divider) + divide(b, divider)); - } - - public static int divideListElementsWithApplyFunctionMethod(List values, int divider) { - BiFunction division = (a, b) -> a / b; - return values.stream().reduce(0, (a, b) -> applyFunction(division, a, divider) + applyFunction(division, b, divider)); - } - - private static int divide(int value, int factor) { - int result = 0; - try { - result = value / factor; - } catch (ArithmeticException e) { - LOGGER.log(Level.INFO, "Arithmetic Exception: Division by Zero"); - } - return result; - } - - private static int applyFunction(BiFunction function, int a, int b) { - try { - return function.apply(a, b); - } - catch(Exception e) { - LOGGER.log(Level.INFO, "Exception thrown!"); - } - return 0; - } -} diff --git a/java-streams-2/src/test/java/com/baeldung/reduce/tests/StreamReduceUnitTest.java b/java-streams-2/src/test/java/com/baeldung/reduce/tests/StreamReduceUnitTest.java deleted file mode 100644 index 564d614017..0000000000 --- a/java-streams-2/src/test/java/com/baeldung/reduce/tests/StreamReduceUnitTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.baeldung.reduce.tests; - -import com.baeldung.reduce.entities.User; -import com.baeldung.reduce.utilities.NumberUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; - -public class StreamReduceUnitTest { - - @Test - public void givenIntegerList_whenReduceWithSumAccumulatorLambda_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - int result = numbers.stream().reduce(0, (subtotal, element) -> subtotal + element); - assertThat(result).isEqualTo(21); - } - - @Test - public void givenIntegerList_whenReduceWithSumAccumulatorMethodReference_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - int result = numbers.stream().reduce(0, Integer::sum); - assertThat(result).isEqualTo(21); - } - - @Test - public void givenStringList_whenReduceWithConcatenatorAccumulatorLambda_thenCorrect() { - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result = letters.stream().reduce("", (partialString, element) -> partialString + element); - assertThat(result).isEqualTo("abcde"); - } - - @Test - public void givenStringList_whenReduceWithConcatenatorAccumulatorMethodReference_thenCorrect() { - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result = letters.stream().reduce("", String::concat); - assertThat(result).isEqualTo("abcde"); - } - - @Test - public void givenStringList_whenReduceWithUppercaseConcatenatorAccumulator_thenCorrect() { - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result = letters.stream().reduce("", (partialString, element) -> partialString.toUpperCase() + element.toUpperCase()); - assertThat(result).isEqualTo("ABCDE"); - } - - @Test - public void givenUserList_whenReduceWithAgeAccumulatorAndSumCombiner_thenCorrect() { - List users = Arrays.asList(new User("John", 30), new User("Julie", 35)); - int result = users.stream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - assertThat(result).isEqualTo(65); - } - - @Test - public void givenStringList_whenReduceWithParallelStream_thenCorrect() { - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result = letters.parallelStream().reduce("", String::concat); - assertThat(result).isEqualTo("abcde"); - } - - @Test - public void givenNumberUtilsClass_whenCalledDivideListElements_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - assertThat(NumberUtils.divideListElements(numbers, 1)).isEqualTo(21); - } - - @Test - public void givenNumberUtilsClass_whenCalledDivideListElementsWithExtractedTryCatchBlock_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - assertThat(NumberUtils.divideListElementsWithExtractedTryCatchBlock(numbers, 1)).isEqualTo(21); - } - - @Test - public void givenStream_whneCalleddivideListElementsWithApplyFunctionMethod_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - assertThat(NumberUtils.divideListElementsWithApplyFunctionMethod(numbers, 1)).isEqualTo(21); - } -} diff --git a/java-streams/.gitignore b/java-streams/.gitignore deleted file mode 100644 index 3de4cc647e..0000000000 --- a/java-streams/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -*.class - -0.* - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* -.resourceCache - -# Packaged files # -*.jar -*.war -*.ear - -# Files generated by integration tests -*.txt -backup-pom.xml -/bin/ -/temp - -#IntelliJ specific -.idea/ -*.iml \ No newline at end of file diff --git a/java-streams/README.md b/java-streams/README.md deleted file mode 100644 index 0c9588c47e..0000000000 --- a/java-streams/README.md +++ /dev/null @@ -1,20 +0,0 @@ -========= - -## Java Streams Cookbooks and Examples - -### Relevant Articles: -- [The Java 8 Stream API Tutorial](http://www.baeldung.com/java-8-streams) -- [Introduction to Java 8 Streams](http://www.baeldung.com/java-8-streams-introduction) -- [Java 8 and Infinite Streams](http://www.baeldung.com/java-inifinite-streams) -- [Java 8 Stream findFirst() vs. findAny()](http://www.baeldung.com/java-stream-findfirst-vs-findany) -- [How to Get the Last Element of a Stream in Java?](http://www.baeldung.com/java-stream-last-element) -- [“Stream has already been operated upon or closed” Exception in Java](http://www.baeldung.com/java-stream-operated-upon-or-closed-exception) -- [Iterable to Stream in Java](http://www.baeldung.com/java-iterable-to-stream) -- [How to Iterate Over a Stream With Indices](http://www.baeldung.com/java-stream-indices) -- [Primitive Type Streams in Java 8](http://www.baeldung.com/java-8-primitive-streams) -- [Stream Ordering in Java](https://www.baeldung.com/java-stream-ordering) -- [Introduction to Protonpack](https://www.baeldung.com/java-protonpack) -- [Java Stream Filter with Lambda Expression](https://www.baeldung.com/java-stream-filter-lambda) -- [Counting Matches on a Stream Filter](https://www.baeldung.com/java-stream-filter-count) -- [Java 8 Streams peek() API](https://www.baeldung.com/java-streams-peek-api) -- [Working With Maps Using Streams](https://www.baeldung.com/java-maps-streams) diff --git a/java-streams/pom.xml b/java-streams/pom.xml deleted file mode 100644 index bd0123e01d..0000000000 --- a/java-streams/pom.xml +++ /dev/null @@ -1,121 +0,0 @@ - - 4.0.0 - java-streams - 0.1.0-SNAPSHOT - java-streams - jar - - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../parent-java - - - - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator.version} - provided - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - log4j - log4j - ${log4j.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - - - - org.assertj - assertj-core - ${assertj.version} - test - - - com.codepoetics - protonpack - ${protonpack.version} - - - io.vavr - vavr - ${vavr.version} - - - one.util - streamex - ${streamex.version} - - - org.aspectj - aspectjrt - ${asspectj.version} - - - org.aspectj - aspectjweaver - ${asspectj.version} - - - pl.touk - throwing-function - ${throwing-function.version} - - - - - java-streams - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${maven.compiler.source} - ${maven.compiler.target} - -parameters - - - - - - - - 0.9.0 - 1.15 - 0.6.5 - 2.10 - 1.3 - - 3.11.1 - 1.8.9 - 3.1 - 1.8 - 1.8 - - diff --git a/java-streams/src/main/java/com/baeldung/java_8_features/Detail.java b/java-streams/src/main/java/com/baeldung/java_8_features/Detail.java deleted file mode 100644 index 811937dba7..0000000000 --- a/java-streams/src/main/java/com/baeldung/java_8_features/Detail.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.java_8_features; - -import java.util.Arrays; -import java.util.List; - -public class Detail { - - private static final List PARTS = Arrays.asList("turbine", "pump"); - - public List getParts() { - return PARTS; - } -} diff --git a/java-streams/src/main/java/com/baeldung/reduce/application/Application.java b/java-streams/src/main/java/com/baeldung/reduce/application/Application.java deleted file mode 100644 index b101c86780..0000000000 --- a/java-streams/src/main/java/com/baeldung/reduce/application/Application.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.baeldung.reduce.application; - -import com.baeldung.reduce.entities.User; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.Warmup; - -public class Application { - - public static void main(String[] args) throws Exception { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - int result1 = numbers.stream().reduce(0, (subtotal, element) -> subtotal + element); - System.out.println(result1); - - int result2 = numbers.stream().reduce(0, Integer::sum); - System.out.println(result2); - - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result3 = letters.stream().reduce("", (partialString, element) -> partialString + element); - System.out.println(result3); - - String result4 = letters.stream().reduce("", String::concat); - System.out.println(result4); - - String result5 = letters.stream().reduce("", (partialString, element) -> partialString.toUpperCase() + element.toUpperCase()); - System.out.println(result5); - - List users = Arrays.asList(new User("John", 30), new User("Julie", 35)); - int result6 = users.stream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - System.out.println(result6); - - String result7 = letters.parallelStream().reduce("", String::concat); - System.out.println(result7); - - int result8 = users.parallelStream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - System.out.println(result8); - - org.openjdk.jmh.Main.main(args); - - } - - @Benchmark - @Fork(value = 1, warmups = 2) - @Warmup(iterations = 2) - @BenchmarkMode(Mode.AverageTime) - public void executeReduceOnParallelizedStream() { - List userList = new ArrayList<>(); - for (int i = 0; i <= 1000000; i++) { - userList.add(new User("John" + i, i)); - } - userList.parallelStream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - } - - @Benchmark - @Fork(value = 1, warmups = 2) - @Warmup(iterations = 2) - @BenchmarkMode(Mode.AverageTime) - public void executeReduceOnSequentialStream() { - List userList = new ArrayList<>(); - for (int i = 0; i <= 1000000; i++) { - userList.add(new User("John" + i, i)); - } - userList.stream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - } -} diff --git a/java-streams/src/main/java/com/baeldung/reduce/entities/User.java b/java-streams/src/main/java/com/baeldung/reduce/entities/User.java deleted file mode 100644 index a17c6a02b6..0000000000 --- a/java-streams/src/main/java/com/baeldung/reduce/entities/User.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.reduce.entities; - -public class User { - - private final String name; - private final int age; - - public User(String name, int age) { - this.name = name; - this.age = age; - } - - public String getName() { - return name; - } - - public int getAge() { - return age; - } - - @Override - public String toString() { - return "User{" + "name=" + name + ", age=" + age + '}'; - } -} diff --git a/java-streams/src/main/java/com/baeldung/reduce/utilities/NumberUtils.java b/java-streams/src/main/java/com/baeldung/reduce/utilities/NumberUtils.java deleted file mode 100644 index 8b4af2cbe2..0000000000 --- a/java-streams/src/main/java/com/baeldung/reduce/utilities/NumberUtils.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.baeldung.reduce.utilities; - -import java.util.List; -import java.util.function.BiFunction; -import java.util.logging.Level; -import java.util.logging.Logger; - -public abstract class NumberUtils { - - private static final Logger LOGGER = Logger.getLogger(NumberUtils.class.getName()); - - public static int divideListElements(List values, Integer divider) { - return values.stream() - .reduce(0, (a, b) -> { - try { - return a / divider + b / divider; - } catch (ArithmeticException e) { - LOGGER.log(Level.INFO, "Arithmetic Exception: Division by Zero"); - } - return 0; - }); - } - - public static int divideListElementsWithExtractedTryCatchBlock(List values, int divider) { - return values.stream().reduce(0, (a, b) -> divide(a, divider) + divide(b, divider)); - } - - public static int divideListElementsWithApplyFunctionMethod(List values, int divider) { - BiFunction division = (a, b) -> a / b; - return values.stream().reduce(0, (a, b) -> applyFunction(division, a, divider) + applyFunction(division, b, divider)); - } - - private static int divide(int value, int factor) { - int result = 0; - try { - result = value / factor; - } catch (ArithmeticException e) { - LOGGER.log(Level.INFO, "Arithmetic Exception: Division by Zero"); - } - return result; - } - - private static int applyFunction(BiFunction function, int a, int b) { - try { - return function.apply(a, b); - } - catch(Exception e) { - LOGGER.log(Level.INFO, "Exception occurred!"); - } - return 0; - } -} diff --git a/java-streams/src/main/java/com/baeldung/stream/Product.java b/java-streams/src/main/java/com/baeldung/stream/Product.java deleted file mode 100644 index e99a969b81..0000000000 --- a/java-streams/src/main/java/com/baeldung/stream/Product.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.baeldung.stream; - -import java.util.List; -import java.util.stream.Stream; - -/** - * Created by Alex Vengr - */ -public class Product { - - private int price; - - private String name; - - private boolean utilize; - - public Product(int price, String name) { - this(price); - this.name = name; - } - - public Product(int price) { - this.price = price; - } - - public Product() { - } - - public int getPrice() { - return price; - } - - public void setPrice(int price) { - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static Stream streamOf(List list) { - return (list == null || list.isEmpty()) ? Stream.empty() : list.stream(); - } -} diff --git a/java-streams/src/main/java/com/baeldung/stream/sum/Item.java b/java-streams/src/main/java/com/baeldung/stream/sum/Item.java deleted file mode 100644 index 2f162d6eda..0000000000 --- a/java-streams/src/main/java/com/baeldung/stream/sum/Item.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.baeldung.stream.sum; - -public class Item { - - private int id; - private Integer price; - - public Item(int id, Integer price) { - super(); - this.id = id; - this.price = price; - } - - // Standard getters and setters - public long getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public Integer getPrice() { - return price; - } - - public void setPrice(Integer price) { - this.price = price; - } - -} diff --git a/java-streams/src/test/java/com/baeldung/reduce/tests/StreamReduceUnitTest.java b/java-streams/src/test/java/com/baeldung/reduce/tests/StreamReduceUnitTest.java deleted file mode 100644 index 8e2ff7bf22..0000000000 --- a/java-streams/src/test/java/com/baeldung/reduce/tests/StreamReduceUnitTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.baeldung.reduce.tests; - -import com.baeldung.reduce.entities.User; -import com.baeldung.reduce.utilities.NumberUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; - -public class StreamReduceUnitTest { - - @Test - public void givenIntegerList_whenReduceWithSumAccumulatorLambda_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - int result = numbers.stream().reduce(0, (a, b) -> a + b); - assertThat(result).isEqualTo(21); - } - - @Test - public void givenIntegerList_whenReduceWithSumAccumulatorMethodReference_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - int result = numbers.stream().reduce(0, Integer::sum); - assertThat(result).isEqualTo(21); - } - - @Test - public void givenStringList_whenReduceWithConcatenatorAccumulatorLambda_thenCorrect() { - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result = letters.stream().reduce("", (a, b) -> a + b); - assertThat(result).isEqualTo("abcde"); - } - - @Test - public void givenStringList_whenReduceWithConcatenatorAccumulatorMethodReference_thenCorrect() { - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result = letters.stream().reduce("", String::concat); - assertThat(result).isEqualTo("abcde"); - } - - @Test - public void givenStringList_whenReduceWithUppercaseConcatenatorAccumulator_thenCorrect() { - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result = letters.stream().reduce("", (a, b) -> a.toUpperCase() + b.toUpperCase()); - assertThat(result).isEqualTo("ABCDE"); - } - - @Test - public void givenUserList_whenReduceWithAgeAccumulatorAndSumCombiner_thenCorrect() { - List users = Arrays.asList(new User("John", 30), new User("Julie", 35)); - int result = users.stream().reduce(0, (partialAgeResult, user) -> partialAgeResult + user.getAge(), Integer::sum); - assertThat(result).isEqualTo(65); - } - - @Test - public void givenStringList_whenReduceWithParallelStream_thenCorrect() { - List letters = Arrays.asList("a", "b", "c", "d", "e"); - String result = letters.parallelStream().reduce("", String::concat); - assertThat(result).isEqualTo("abcde"); - } - - @Test - public void givenNumberUtilsClass_whenCalledDivideListElements_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - assertThat(NumberUtils.divideListElements(numbers, 1)).isEqualTo(21); - } - - @Test - public void givenNumberUtilsClass_whenCalledDivideListElementsWithExtractedTryCatchBlock_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - assertThat(NumberUtils.divideListElementsWithExtractedTryCatchBlock(numbers, 1)).isEqualTo(21); - } - - @Test - public void givenStream_whneCalleddivideListElementsWithApplyFunctionMethod_thenCorrect() { - List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); - assertThat(NumberUtils.divideListElementsWithApplyFunctionMethod(numbers, 1)).isEqualTo(21); - } -} diff --git a/java-streams/src/test/resources/.gitignore b/java-streams/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/java-streams/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/java-strings-2/README.md b/java-strings-2/README.md deleted file mode 100644 index ad0a46fd96..0000000000 --- a/java-strings-2/README.md +++ /dev/null @@ -1,26 +0,0 @@ -## Relevant Articles: - -- [Java Localization – Formatting Messages](https://www.baeldung.com/java-localization-messages-formatting) -- [Check If a String Contains a Substring](https://www.baeldung.com/java-string-contains-substring) -- [Removing Stopwords from a String in Java](https://www.baeldung.com/java-string-remove-stopwords) -- [Java – Generate Random String](http://www.baeldung.com/java-random-string) -- [Image to Base64 String Conversion](http://www.baeldung.com/java-base64-image-string) -- [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) -- [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password) -- [Removing Repeated Characters from a String](https://www.baeldung.com/java-remove-repeated-char) -- [Join Array of Primitives with Separator in Java](https://www.baeldung.com/java-join-primitive-array) -- [Pad a String with Zeros or Spaces in Java](https://www.baeldung.com/java-pad-string) -- [Remove Emojis from a Java String](https://www.baeldung.com/java-string-remove-emojis) -- [Convert a Comma Separated String to a List in Java](https://www.baeldung.com/java-string-with-separator-to-list) -- [Guide to java.util.Formatter](http://www.baeldung.com/java-string-formatter) -- [Remove Leading and Trailing Characters from a String](https://www.baeldung.com/java-remove-trailing-characters) -- [Concatenating Strings In Java](https://www.baeldung.com/java-strings-concatenation) -- [Java String Interview Questions and Answers](https://www.baeldung.com/java-string-interview-questions) -- [Check if a String is a Pangram in Java](https://www.baeldung.com/java-string-pangram) -- [Check If a String Contains Multiple Keywords](https://www.baeldung.com/string-contains-multiple-words) -- [Checking for Empty or Blank Strings in Java](https://www.baeldung.com/java-blank-empty-strings) -- [String Initialization in Java](https://www.baeldung.com/java-string-initialization) -- [Java Multi-line String](https://www.baeldung.com/java-multiline-string) -- [Checking If a String Is a Repeated Substring](https://www.baeldung.com/java-repeated-substring) -- [How to Reverse a String in Java](https://www.baeldung.com/java-reverse-string) -- [String toLowerCase and toUpperCase Methods in Java](https://www.baeldung.com/java-string-convert-case) diff --git a/java-strings-2/pom.xml b/java-strings-2/pom.xml deleted file mode 100755 index be47b1ec89..0000000000 --- a/java-strings-2/pom.xml +++ /dev/null @@ -1,155 +0,0 @@ - - 4.0.0 - java-strings-2 - 0.1.0-SNAPSHOT - jar - java-strings-2 - - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../parent-java - - - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-core.version} - - - com.ibm.icu - icu4j - ${icu4j.version} - - - com.google.guava - guava - ${guava.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - commons-io - commons-io - ${commons-io.version} - - - commons-codec - commons-codec - ${commons-codec.version} - - - junit - junit - ${junit.version} - test - - - org.hamcrest - hamcrest-library - ${org.hamcrest.version} - test - - - org.assertj - assertj-core - ${assertj.version} - test - - - - - org.passay - passay - ${passay.version} - - - org.apache.commons - commons-text - ${commons-text.version} - - - com.vdurmont - emoji-java - ${emoji-java.version} - - - org.ahocorasick - ahocorasick - ${ahocorasick.version} - - - javax.validation - validation-api - ${validation-api.version} - - - org.hibernate.validator - hibernate-validator - ${hibernate-validator.version} - - - javax.el - javax.el-api - ${javax.el-api.version} - - - org.glassfish.web - javax.el - ${javax.el.version} - - - - - java-strings-2 - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - -parameters - - - - - - - 3.8.1 - 1.10 - 1.3.1 - - 3.6.1 - 4.0.0 - 0.4.0 - 61.1 - 28.0-jre - 1.4 - 2.0.0.Final - 6.0.2.Final - 3.0.0 - 2.2.6 - - - \ No newline at end of file diff --git a/java-strings-2/src/test/java/com/baeldung/base64encodinganddecoding/StringToByteArrayUnitTest.java b/java-strings-2/src/test/java/com/baeldung/base64encodinganddecoding/StringToByteArrayUnitTest.java deleted file mode 100644 index e2bb7bb64d..0000000000 --- a/java-strings-2/src/test/java/com/baeldung/base64encodinganddecoding/StringToByteArrayUnitTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.baeldung.base64encodinganddecoding; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.Base64; - -import javax.xml.bind.DatatypeConverter; - -import org.junit.Test; - -public class StringToByteArrayUnitTest { - - @Test - public void whenConvertStringToByteArrayUsingStringClass_thenOk() { - final String originalInput = "test input"; - byte[] result = originalInput.getBytes(); - System.out.println(Arrays.toString(result)); - - assertEquals(originalInput.length(), result.length); - } - - @Test - public void givenCharset_whenConvertStringToByteArrayUsingStringClass_thenOk() throws UnsupportedEncodingException { - final String originalInput = "test input"; - byte[] result = originalInput.getBytes(StandardCharsets.UTF_16); - System.out.println(Arrays.toString(result)); - - assertTrue(originalInput.length() < result.length); - } - - @Test - public void whenConvertStringToByteArrayUsingBase64Decoder_thenOk() { - final String originalInput = "dGVzdCBpbnB1dA=="; - byte[] result = Base64.getDecoder().decode(originalInput); - - assertEquals("test input", new String(result)); - } - - @Test - public void whenConvertStringToByteArrayUsingDatatypeConverter_thenOk() { - final String originalInput = "dGVzdCBpbnB1dA=="; - byte[] result = DatatypeConverter.parseBase64Binary(originalInput); - - assertEquals("test input", new String(result)); - } - - @Test - public void whenConvertStringToByteArray_thenOk(){ - String originalInput = "7465737420696E707574"; - byte[] result = DatatypeConverter.parseHexBinary(originalInput); - System.out.println(Arrays.toString(result)); - - assertEquals("test input", new String(result)); - } -} diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringJoinerUnitTest.java b/java-strings-2/src/test/java/com/baeldung/string/interview/StringJoinerUnitTest.java deleted file mode 100644 index d44c7478e4..0000000000 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringJoinerUnitTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.string.interview; - -import java.util.StringJoiner; -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class StringJoinerUnitTest { - @Test - public void whenUsingStringJoiner_thenStringsJoined() { - StringJoiner joiner = new StringJoiner(",", "[", "]"); - joiner.add("Red") - .add("Green") - .add("Blue"); - - assertEquals(joiner.toString(), "[Red,Green,Blue]"); - } -} diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringToByteArrayUnitTest.java b/java-strings-2/src/test/java/com/baeldung/string/interview/StringToByteArrayUnitTest.java deleted file mode 100644 index aee4eedcd6..0000000000 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringToByteArrayUnitTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.string.interview; - -import static org.junit.Assert.assertArrayEquals; - -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; - -import org.junit.Test; - -public class StringToByteArrayUnitTest { - @Test - public void whenGetBytes_thenCorrect() throws UnsupportedEncodingException { - byte[] byteArray1 = "abcd".getBytes(); - byte[] byteArray2 = "efgh".getBytes(StandardCharsets.US_ASCII); - byte[] byteArray3 = "ijkl".getBytes("UTF-8"); - byte[] expected1 = new byte[] { 97, 98, 99, 100 }; - byte[] expected2 = new byte[] { 101, 102, 103, 104 }; - byte[] expected3 = new byte[] { 105, 106, 107, 108 }; - - assertArrayEquals(expected1, byteArray1); - assertArrayEquals(expected2, byteArray2); - assertArrayEquals(expected3, byteArray3); - } -} diff --git a/java-strings-2/src/test/java/com/baeldung/string/interview/StringToCharArrayUnitTest.java b/java-strings-2/src/test/java/com/baeldung/string/interview/StringToCharArrayUnitTest.java deleted file mode 100644 index 1322d0fa82..0000000000 --- a/java-strings-2/src/test/java/com/baeldung/string/interview/StringToCharArrayUnitTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.string.interview; - -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; - -import org.junit.Test; - -public class StringToCharArrayUnitTest { - @Test - public void whenConvertingStringToCharArray_thenConversionSuccessful() { - String beforeConvStr = "hello"; - char[] afterConvCharArr = { 'h', 'e', 'l', 'l', 'o' }; - - assertEquals(Arrays.equals(beforeConvStr.toCharArray(), afterConvCharArr), true); - } -} diff --git a/java-strings-2/src/test/resources/.gitignore b/java-strings-2/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/java-strings-2/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/java-strings-3/README.md b/java-strings-3/README.md deleted file mode 100644 index 6c2339028f..0000000000 --- a/java-strings-3/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## Relevant Articles: - -- [Converting Java String to Double](https://www.baeldung.com/java-string-to-double) diff --git a/java-strings-3/pom.xml b/java-strings-3/pom.xml deleted file mode 100644 index 4589780c15..0000000000 --- a/java-strings-3/pom.xml +++ /dev/null @@ -1,161 +0,0 @@ - - 4.0.0 - java-strings-3 - 0.1.0-SNAPSHOT - jar - java-strings-3 - - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../parent-java - - - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-core.version} - - - com.ibm.icu - icu4j - ${icu4j.version} - - - com.google.guava - guava - ${guava.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - commons-io - commons-io - ${commons-io.version} - - - commons-codec - commons-codec - ${commons-codec.version} - - - junit - junit - ${junit.version} - test - - - org.hamcrest - hamcrest-library - ${org.hamcrest.version} - test - - - org.assertj - assertj-core - ${assertj.version} - test - - - org.bitbucket.cowwoc - diff-match-patch - 1.2 - test - - - - - org.passay - passay - ${passay.version} - - - org.apache.commons - commons-text - ${commons-text.version} - - - com.vdurmont - emoji-java - ${emoji-java.version} - - - org.ahocorasick - ahocorasick - ${ahocorasick.version} - - - javax.validation - validation-api - ${validation-api.version} - - - org.hibernate.validator - hibernate-validator - ${hibernate-validator.version} - - - javax.el - javax.el-api - ${javax.el-api.version} - - - org.glassfish.web - javax.el - ${javax.el.version} - - - - - java-strings-3 - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - -parameters - - - - - - - 3.8.1 - 1.10 - 1.3.1 - - 3.6.1 - 4.0.0 - 0.4.0 - 61.1 - 28.0-jre - 1.4 - 2.0.0.Final - 6.0.2.Final - 3.0.0 - 2.2.6 - - - \ No newline at end of file diff --git a/java-strings-3/src/main/resources/.gitignore b/java-strings-3/src/main/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/java-strings-3/src/main/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/java-strings-3/src/test/resources/.gitignore b/java-strings-3/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/java-strings-3/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/java-strings-ops/README.md b/java-strings-ops/README.md deleted file mode 100644 index d909f171a7..0000000000 --- a/java-strings-ops/README.md +++ /dev/null @@ -1,22 +0,0 @@ -========= - -## Java Strings Cookbooks and Examples - -### Relevant Articles: -- [Convert char to String in Java](http://www.baeldung.com/java-convert-char-to-string) -- [Convert String to int or Integer in Java](http://www.baeldung.com/java-convert-string-to-int-or-integer) -- [Java String Conversions](https://www.baeldung.com/java-string-conversions) -- [Check if a String is a Palindrome](http://www.baeldung.com/java-palindrome) -- [Comparing Strings in Java](http://www.baeldung.com/java-compare-strings) -- [Check If a String Is Numeric in Java](http://www.baeldung.com/java-check-string-number) -- [Get Substring from String in Java](https://www.baeldung.com/java-substring) -- [How to Remove the Last Character of a String?](http://www.baeldung.com/java-remove-last-character-of-string) -- [Add a Character to a String at a Given Position](https://www.baeldung.com/java-add-character-to-string) -- [Count Occurrences of a Char in a String](http://www.baeldung.com/java-count-chars) -- [Guide to Java String Pool](http://www.baeldung.com/java-string-pool) -- [Split a String in Java](http://www.baeldung.com/java-split-string) -- [Common String Operations in Java](https://www.baeldung.com/java-string-operations) -- [Convert String to Byte Array and Reverse in Java](https://www.baeldung.com/java-string-to-byte-array) -- [Java toString() Method](https://www.baeldung.com/java-tostring) -- [CharSequence vs. String in Java](http://www.baeldung.com/java-char-sequence-string) -- [StringBuilder and StringBuffer in Java](http://www.baeldung.com/java-string-builder-string-buffer) \ No newline at end of file diff --git a/java-strings-ops/pom.xml b/java-strings-ops/pom.xml deleted file mode 100644 index b6a7ea2728..0000000000 --- a/java-strings-ops/pom.xml +++ /dev/null @@ -1,99 +0,0 @@ - - 4.0.0 - com.baeldung - java-strings-ops - 0.1.0-SNAPSHOT - jar - java-strings-ops - - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../parent-java - - - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - log4j - log4j - ${log4j.version} - - - - org.assertj - assertj-core - ${assertj.version} - test - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator.version} - - - com.google.guava - guava - ${guava.version} - - - - org.junit.jupiter - junit-jupiter-api - ${junit-jupiter-api.version} - test - - - - org.hamcrest - hamcrest-library - ${org.hamcrest.version} - test - - - - - - java-strings-ops - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - -parameters - - - - - - - - 3.8.1 - - 3.6.1 - 27.0.1-jre - 5.3.1 - - - diff --git a/java-strings-ops/src/main/java/com/baeldung/datetime/UseLocalDateTime.java b/java-strings-ops/src/main/java/com/baeldung/datetime/UseLocalDateTime.java deleted file mode 100644 index 7f39ac2f91..0000000000 --- a/java-strings-ops/src/main/java/com/baeldung/datetime/UseLocalDateTime.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.baeldung.datetime; - -import java.time.LocalDateTime; - -public class UseLocalDateTime { - - public LocalDateTime getLocalDateTimeUsingParseMethod(String representation) { - return LocalDateTime.parse(representation); - } - -} diff --git a/java-strings-ops/src/main/java/com/baeldung/string/StringHelper.java b/java-strings-ops/src/main/java/com/baeldung/string/StringHelper.java deleted file mode 100644 index a9cc71d36a..0000000000 --- a/java-strings-ops/src/main/java/com/baeldung/string/StringHelper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.baeldung.string; - -import java.util.Optional; - -class StringHelper { - static String removeLastChar(String s) { - return (s == null || s.length() == 0) ? s : (s.substring(0, s.length() - 1)); - } - - static String removeLastCharRegex(String s) { - return (s == null) ? s : s.replaceAll(".$", ""); - } - - static String removeLastCharOptional(String s) { - return Optional.ofNullable(s).filter(str -> str.length() != 0).map(str -> str.substring(0, str.length() - 1)).orElse(s); - } - - static String removeLastCharRegexOptional(String s) { - return Optional.ofNullable(s).map(str -> str.replaceAll(".$", "")).orElse(s); - } -} diff --git a/java-strings-ops/src/main/java/com/baeldung/string/tostring/Customer.java b/java-strings-ops/src/main/java/com/baeldung/string/tostring/Customer.java deleted file mode 100644 index e914a83f0e..0000000000 --- a/java-strings-ops/src/main/java/com/baeldung/string/tostring/Customer.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.string.tostring; - -public class Customer { - private String firstName; - private String lastName; - - public String getFirstName() { - return firstName; - } - public void setFirstName(String firstName) { - this.firstName = firstName; - } - public String getLastName() { - return lastName; - } - public void setLastName(String lastName) { - this.lastName = lastName; - } -} diff --git a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerArrayToString.java b/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerArrayToString.java deleted file mode 100644 index 1736657276..0000000000 --- a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerArrayToString.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.string.tostring; - -import java.util.Arrays; - -public class CustomerArrayToString extends Customer { - private Order[] orders; - - public Order[] getOrders() { - return orders; - } - public void setOrders(Order[] orders) { - this.orders = orders; - } - @Override - public String toString() { - return "Customer [orders=" + Arrays.toString(orders) + ", getFirstName()=" + getFirstName() - + ", getLastName()=" + getLastName() + "]"; - } -} diff --git a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerComplexObjectToString.java b/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerComplexObjectToString.java deleted file mode 100644 index 9bede1b3fc..0000000000 --- a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerComplexObjectToString.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.string.tostring; - -public class CustomerComplexObjectToString extends Customer { - private Order order; - - public Order getOrder() { - return order; - } - - public void setOrder(Order order) { - this.order = order; - } - - @Override - public String toString() { - return "Customer [order=" + order + ", getFirstName()=" + getFirstName() - + ", getLastName()=" + getLastName() + "]"; - } -} \ No newline at end of file diff --git a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerPrimitiveToString.java b/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerPrimitiveToString.java deleted file mode 100644 index 86e08ca447..0000000000 --- a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerPrimitiveToString.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.string.tostring; - -public class CustomerPrimitiveToString extends Customer { - private long balance; - - public long getBalance() { - return balance; - } - - public void setBalance(long balance) { - this.balance = balance; - } - - @Override - public String toString() { - return "Customer [balance=" + balance + ", getFirstName()=" + getFirstName() - + ", getLastName()=" + getLastName() + "]"; - } -} diff --git a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerWrapperCollectionToString.java b/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerWrapperCollectionToString.java deleted file mode 100644 index 6c7b999045..0000000000 --- a/java-strings-ops/src/main/java/com/baeldung/string/tostring/CustomerWrapperCollectionToString.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.baeldung.string.tostring; - -import java.util.List; - -public class CustomerWrapperCollectionToString extends Customer { - private Integer score; - private List orders; - private StringBuffer fullname; - - public Integer getScore() { - return score; - } - - public void setScore(Integer score) { - this.score = score; - } - - public List getOrders() { - return orders; - } - - public void setOrders(List orders) { - this.orders = orders; - } - - public StringBuffer getFullname() { - return fullname; - } - - public void setFullname(StringBuffer fullname) { - this.fullname = fullname; - } - - @Override - public String toString() { - return "Customer [score=" + score + ", orders=" + orders + ", fullname=" + fullname - + ", getFirstName()=" + getFirstName() + ", getLastName()=" + getLastName() + "]"; - } -} diff --git a/java-strings-ops/src/main/java/com/baeldung/string/tostring/Order.java b/java-strings-ops/src/main/java/com/baeldung/string/tostring/Order.java deleted file mode 100644 index 017e2d9bc8..0000000000 --- a/java-strings-ops/src/main/java/com/baeldung/string/tostring/Order.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.baeldung.string.tostring; - -public class Order { - - private String orderId; - private String desc; - private long value; - private String status; - - public String getOrderId() { - return orderId; - } - - public void setOrderId(String orderId) { - this.orderId = orderId; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public long getValue() { - return value; - } - - public void setValue(long value) { - this.value = value; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - @Override - public String toString() { - return "Order [orderId=" + orderId + ", desc=" + desc + ", value=" + value + "]"; - } - -} diff --git a/java-strings-ops/src/test/java/com/baeldung/java/conversion/README.md b/java-strings-ops/src/test/java/com/baeldung/java/conversion/README.md deleted file mode 100644 index 7c81180249..0000000000 --- a/java-strings-ops/src/test/java/com/baeldung/java/conversion/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Relevant Articles: -- [Java String Conversions](http://www.baeldung.com/java-string-conversions) diff --git a/java-strings-ops/src/test/java/com/baeldung/string/SplitUnitTest.java b/java-strings-ops/src/test/java/com/baeldung/string/SplitUnitTest.java deleted file mode 100644 index 6157640a4a..0000000000 --- a/java-strings-ops/src/test/java/com/baeldung/string/SplitUnitTest.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.baeldung.string; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.Arrays; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.junit.jupiter.api.Test; - -import com.google.common.base.Splitter; - -public class SplitUnitTest { - - @Test - public void givenString_whenSplit_thenReturnsArray_through_JavaLangString() { - assertThat("peter,james,thomas".split(",")) - .containsExactly("peter", "james", "thomas"); - - assertThat("car jeep scooter".split(" ")) - .containsExactly("car", "jeep", "scooter"); - - assertThat("1-120-232323".split("-")) - .containsExactly("1", "120", "232323"); - - assertThat("192.168.1.178".split("\\.")) - .containsExactly("192", "168", "1", "178"); - - assertThat("b a, e, l.d u, n g".split("\\s+|,\\s*|\\.\\s*")) - .containsExactly("b", "a", "e", "l", "d", "u", "n", "g"); - } - - @Test - public void givenString_whenSplit_thenReturnsArray_through_StringUtils() { - StringUtils.split("car jeep scooter"); - - assertThat(StringUtils.split("car jeep scooter")) - .containsExactly("car", "jeep", "scooter"); - - assertThat(StringUtils.split("car jeep scooter")) - .containsExactly("car", "jeep", "scooter"); - - assertThat(StringUtils.split("car:jeep:scooter", ":")) - .containsExactly("car", "jeep", "scooter"); - - assertThat(StringUtils.split("car.jeep.scooter", ".")) - .containsExactly("car", "jeep", "scooter"); - } - - @Test - public void givenString_whenSplit_thenReturnsList_Splitter() { - //given - List resultList = Splitter.on(',').trimResults().omitEmptyStrings().splitToList("car,jeep,, scooter"); - - assertThat(resultList) - .containsExactly("car", "jeep", "scooter"); - } - - @Test - public void givenStringContainsSpaces_whenSplitAndTrim_thenReturnsArray_using_Regex() { - assertThat(" car , jeep, scooter ".trim() - .split("\\s*,\\s*")).containsExactly("car", "jeep", "scooter"); - - } - - @Test - public void givenStringContainsSpaces_whenSplitAndTrim_thenReturnsArray_using_java_8() { - assertThat(Arrays.stream(" car , jeep, scooter ".split(",")) - .map(String::trim) - .toArray(String[]::new)).containsExactly("car", "jeep", "scooter"); - } -} diff --git a/java-strings-ops/src/test/java/com/baeldung/string/StringBufferStringBuilder.java b/java-strings-ops/src/test/java/com/baeldung/string/StringBufferStringBuilder.java deleted file mode 100644 index 72af4a9aee..0000000000 --- a/java-strings-ops/src/test/java/com/baeldung/string/StringBufferStringBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.baeldung.string; - -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.State; -import org.openjdk.jmh.runner.Runner; -import org.openjdk.jmh.runner.RunnerException; -import org.openjdk.jmh.runner.options.Options; -import org.openjdk.jmh.runner.options.OptionsBuilder; - -public class StringBufferStringBuilder { - - public static void main(String[] args) throws RunnerException { - - Options opt = new OptionsBuilder() - .include(StringBufferStringBuilder.class.getSimpleName()) - .build(); - - new Runner(opt).run(); - } - - @State(Scope.Benchmark) - public static class MyState { - int iterations = 1000; - String initial = "abc"; - String suffix = "def"; - } - - @Benchmark - public StringBuffer benchmarkStringBuffer(MyState state) { - StringBuffer stringBuffer = new StringBuffer(state.initial); - for (int i = 0; i < state.iterations; i++) { - stringBuffer.append(state.suffix); - } - return stringBuffer; - } - - @Benchmark - public StringBuilder benchmarkStringBuilder(MyState state) { - StringBuilder stringBuilder = new StringBuilder(state.initial); - for (int i = 0; i < state.iterations; i++) { - stringBuilder.append(state.suffix); - } - return stringBuilder; - } -} \ No newline at end of file diff --git a/java-strings-ops/src/test/java/com/baeldung/string/StringHelperUnitTest.java b/java-strings-ops/src/test/java/com/baeldung/string/StringHelperUnitTest.java deleted file mode 100644 index 917ed1c937..0000000000 --- a/java-strings-ops/src/test/java/com/baeldung/string/StringHelperUnitTest.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.baeldung.string; - -import org.apache.commons.lang3.StringUtils; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; - -public class StringHelperUnitTest { - - public static final String TEST_STRING = "abcdef"; - public static final String NULL_STRING = null; - public static final String EMPTY_STRING = ""; - public static final String ONE_CHAR_STRING = "a"; - public static final String WHITE_SPACE_AT_THE_END_STRING = "abc "; - public static final String NEW_LINE_AT_THE_END_STRING = "abc\n"; - public static final String MULTIPLE_LINES_STRING = "abc\ndef"; - - @Test - public void givenTestString_whenSubstring_thenGetStingWithoutLastChar() { - assertEquals("abcde", StringHelper.removeLastChar(TEST_STRING)); - assertEquals("abcde", StringUtils.substring(TEST_STRING, 0, TEST_STRING.length() - 1)); - assertEquals("abcde", StringUtils.chop(TEST_STRING)); - assertEquals("abcde", TEST_STRING.replaceAll(".$", "")); - assertEquals("abcde", StringHelper.removeLastCharRegex(TEST_STRING)); - assertEquals("abcde", StringHelper.removeLastCharOptional(TEST_STRING)); - assertEquals("abcde", StringHelper.removeLastCharRegexOptional(TEST_STRING)); - } - - @Test - public void givenNullString_whenSubstring_thenGetNullString() { - assertEquals(NULL_STRING, StringHelper.removeLastChar(NULL_STRING)); - assertEquals(NULL_STRING, StringUtils.chop(NULL_STRING)); - assertEquals(NULL_STRING, StringHelper.removeLastCharRegex(NULL_STRING)); - assertEquals(NULL_STRING, StringHelper.removeLastCharOptional(NULL_STRING)); - assertEquals(NULL_STRING, StringHelper.removeLastCharRegexOptional(NULL_STRING)); - } - - @Test - public void givenEmptyString_whenSubstring_thenGetEmptyString() { - assertEquals(EMPTY_STRING, StringHelper.removeLastChar(EMPTY_STRING)); - assertEquals(EMPTY_STRING, StringUtils.substring(EMPTY_STRING, 0, EMPTY_STRING.length() - 1)); - assertEquals(EMPTY_STRING, StringUtils.chop(EMPTY_STRING)); - assertEquals(EMPTY_STRING, EMPTY_STRING.replaceAll(".$", "")); - assertEquals(EMPTY_STRING, StringHelper.removeLastCharRegex(EMPTY_STRING)); - assertEquals(EMPTY_STRING, StringHelper.removeLastCharOptional(EMPTY_STRING)); - assertEquals(EMPTY_STRING, StringHelper.removeLastCharRegexOptional(EMPTY_STRING)); - } - - @Test - public void givenOneCharString_whenSubstring_thenGetEmptyString() { - assertEquals(EMPTY_STRING, StringHelper.removeLastChar(ONE_CHAR_STRING)); - assertEquals(EMPTY_STRING, StringUtils.substring(ONE_CHAR_STRING, 0, ONE_CHAR_STRING.length() - 1)); - assertEquals(EMPTY_STRING, StringUtils.chop(ONE_CHAR_STRING)); - assertEquals(EMPTY_STRING, ONE_CHAR_STRING.replaceAll(".$", "")); - assertEquals(EMPTY_STRING, StringHelper.removeLastCharRegex(ONE_CHAR_STRING)); - assertEquals(EMPTY_STRING, StringHelper.removeLastCharOptional(ONE_CHAR_STRING)); - assertEquals(EMPTY_STRING, StringHelper.removeLastCharRegexOptional(ONE_CHAR_STRING)); - } - - @Test - public void givenStringWithWhiteSpaceAtTheEnd_whenSubstring_thenGetStringWithoutWhiteSpaceAtTheEnd() { - assertEquals("abc", StringHelper.removeLastChar(WHITE_SPACE_AT_THE_END_STRING)); - assertEquals("abc", StringUtils.substring(WHITE_SPACE_AT_THE_END_STRING, 0, WHITE_SPACE_AT_THE_END_STRING.length() - 1)); - assertEquals("abc", StringUtils.chop(WHITE_SPACE_AT_THE_END_STRING)); - assertEquals("abc", WHITE_SPACE_AT_THE_END_STRING.replaceAll(".$", "")); - assertEquals("abc", StringHelper.removeLastCharRegex(WHITE_SPACE_AT_THE_END_STRING)); - assertEquals("abc", StringHelper.removeLastCharOptional(WHITE_SPACE_AT_THE_END_STRING)); - assertEquals("abc", StringHelper.removeLastCharRegexOptional(WHITE_SPACE_AT_THE_END_STRING)); - } - - @Test - public void givenStringWithNewLineAtTheEnd_whenSubstring_thenGetStringWithoutNewLine() { - assertEquals("abc", StringHelper.removeLastChar(NEW_LINE_AT_THE_END_STRING)); - assertEquals("abc", StringUtils.substring(NEW_LINE_AT_THE_END_STRING, 0, NEW_LINE_AT_THE_END_STRING.length() - 1)); - assertEquals("abc", StringUtils.chop(NEW_LINE_AT_THE_END_STRING)); - assertNotEquals("abc", NEW_LINE_AT_THE_END_STRING.replaceAll(".$", "")); - assertNotEquals("abc", StringHelper.removeLastCharRegex(NEW_LINE_AT_THE_END_STRING)); - assertEquals("abc", StringHelper.removeLastCharOptional(NEW_LINE_AT_THE_END_STRING)); - assertNotEquals("abc", StringHelper.removeLastCharRegexOptional(NEW_LINE_AT_THE_END_STRING)); - } - - @Test - public void givenMultiLineString_whenSubstring_thenGetStringWithoutNewLine() { - assertEquals("abc\nde", StringHelper.removeLastChar(MULTIPLE_LINES_STRING)); - assertEquals("abc\nde", StringUtils.substring(MULTIPLE_LINES_STRING, 0, MULTIPLE_LINES_STRING.length() - 1)); - assertEquals("abc\nde", StringUtils.chop(MULTIPLE_LINES_STRING)); - assertEquals("abc\nde", MULTIPLE_LINES_STRING.replaceAll(".$", "")); - assertEquals("abc\nde", StringHelper.removeLastCharRegex(MULTIPLE_LINES_STRING)); - assertEquals("abc\nde", StringHelper.removeLastCharOptional(MULTIPLE_LINES_STRING)); - assertEquals("abc\nde", StringHelper.removeLastCharRegexOptional(MULTIPLE_LINES_STRING)); - } -} diff --git a/java-strings-ops/src/test/java/com/baeldung/string/conversion/StringToByteArrayUnitTest.java b/java-strings-ops/src/test/java/com/baeldung/string/conversion/StringToByteArrayUnitTest.java deleted file mode 100644 index 5377b4b28d..0000000000 --- a/java-strings-ops/src/test/java/com/baeldung/string/conversion/StringToByteArrayUnitTest.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.baeldung.string.conversion; - -import static org.junit.jupiter.api.Assertions.assertArrayEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import java.io.UnsupportedEncodingException; -import java.nio.CharBuffer; -import java.nio.charset.CharacterCodingException; -import java.nio.charset.Charset; -import java.nio.charset.CharsetEncoder; -import java.nio.charset.CodingErrorAction; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; - -import org.junit.Test; - -public class StringToByteArrayUnitTest { - - @Test - public void whenGetBytesWithDefaultCharset_thenOK() { - final String inputString = "Hello World!"; - final String defaultCharSet = Charset.defaultCharset() - .displayName(); - - byte[] byteArrray = inputString.getBytes(); - - System.out.printf( - "Using default charset:%s, Input String:%s, Output byte array:%s\n", - defaultCharSet, inputString, Arrays.toString(byteArrray)); - - assertNotNull(byteArrray); - assert (byteArrray.length >= inputString.length()); - } - - @Test - public void whenGetBytesWithNamedCharset_thenOK() - throws UnsupportedEncodingException { - final String inputString = "Hello World!"; - final String charsetName = "IBM01140"; - - byte[] byteArrray = inputString.getBytes("IBM01140"); - - System.out.printf( - "Using named charset:%s, Input String:%s, Output byte array:%s\n", - charsetName, inputString, Arrays.toString(byteArrray)); - - assertArrayEquals(new byte[] { -56, -123, -109, -109, -106, 64, -26, - -106, -103, -109, -124, 90 }, - byteArrray); - } - - @Test - public void whenGetBytesWithCharset_thenOK() { - final String inputString = "Hello ਸੰਸਾਰ!"; - final Charset charset = Charset.forName("ASCII"); - - byte[] byteArrray = inputString.getBytes(charset); - - System.out.printf( - "Using Charset:%s, Input String:%s, Output byte array:%s\n", - charset, inputString, Arrays.toString(byteArrray)); - - assertArrayEquals( - new byte[] { 72, 101, 108, 108, 111, 32, 63, 63, 63, 63, 63, 33 }, - byteArrray); - } - - @Test - public void whenGetBytesWithStandardCharset_thenOK() { - final String inputString = "Hello World!"; - final Charset charset = StandardCharsets.UTF_16; - - byte[] byteArrray = inputString.getBytes(charset); - - System.out.printf( - "Using Standard Charset:%s, Input String:%s, Output byte array:%s\n", - charset, inputString, Arrays.toString(byteArrray)); - - assertArrayEquals(new byte[] { -2, -1, 0, 72, 0, 101, 0, 108, 0, 108, 0, - 111, 0, 32, 0, 87, 0, 111, 0, 114, 0, 108, 0, 100, 0, 33 }, - byteArrray); - } - - @Test - public void whenEncodeWithCharset_thenOK() { - final String inputString = "Hello ਸੰਸਾਰ!"; - final Charset charset = StandardCharsets.US_ASCII; - - byte[] byteArrray = charset.encode(inputString) - .array(); - - System.out.printf( - "Using encode with Charset:%s, Input String:%s, Output byte array:%s\n", - charset, inputString, Arrays.toString(byteArrray)); - - assertArrayEquals( - new byte[] { 72, 101, 108, 108, 111, 32, 63, 63, 63, 63, 63, 33 }, - byteArrray); - } - - @Test - public void whenUsingCharsetEncoder_thenOK() - throws CharacterCodingException { - final String inputString = "Hello ਸੰਸਾਰ!"; - CharsetEncoder encoder = StandardCharsets.US_ASCII.newEncoder(); - encoder.onMalformedInput(CodingErrorAction.IGNORE) - .onUnmappableCharacter(CodingErrorAction.REPLACE) - .replaceWith(new byte[] { 0 }); - - byte[] byteArrray = encoder.encode(CharBuffer.wrap(inputString)) - .array(); - - System.out.printf( - "Using encode with CharsetEncoder:%s, Input String:%s, Output byte array:%s\n", - encoder, inputString, Arrays.toString(byteArrray)); - - assertArrayEquals( - new byte[] { 72, 101, 108, 108, 111, 32, 0, 0, 0, 0, 0, 33 }, - byteArrray); - } - -} diff --git a/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerArrayToStringUnitTest.java b/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerArrayToStringUnitTest.java deleted file mode 100644 index 9a88416179..0000000000 --- a/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerArrayToStringUnitTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.baeldung.string.tostring; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; - -public class CustomerArrayToStringUnitTest { - private static final String CUSTOMER_ARRAY_TO_STRING - = "Customer [orders=[Order [orderId=A1111, desc=Game, value=0]], getFirstName()=Rajesh, getLastName()=Bhojwani]"; - - @Test - public void givenArray_whenToString_thenCustomerDetails() { - CustomerArrayToString customer = new CustomerArrayToString(); - customer.setFirstName("Rajesh"); - customer.setLastName("Bhojwani"); - Order[] orders = new Order[1]; - orders[0] = new Order(); - orders[0].setOrderId("A1111"); - orders[0].setDesc("Game"); - orders[0].setStatus("In-Shiping"); - customer.setOrders(orders); - - assertEquals(CUSTOMER_ARRAY_TO_STRING, customer.toString()); - } - -} diff --git a/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerComplexObjectToStringUnitTest.java b/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerComplexObjectToStringUnitTest.java deleted file mode 100644 index 5ffb0d0e58..0000000000 --- a/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerComplexObjectToStringUnitTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.string.tostring; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; - -public class CustomerComplexObjectToStringUnitTest { - private static final String CUSTOMER_COMPLEX_TO_STRING - = "Customer [order=Order [orderId=A1111, desc=Game, value=0], getFirstName()=Rajesh, getLastName()=Bhojwani]"; - - @Test - public void givenComplex_whenToString_thenCustomerDetails() { - CustomerComplexObjectToString customer = new CustomerComplexObjectToString(); - customer.setFirstName("Rajesh"); - customer.setLastName("Bhojwani"); - Order order = new Order(); - order.setOrderId("A1111"); - order.setDesc("Game"); - order.setStatus("In-Shiping"); - customer.setOrder(order); - - assertEquals(CUSTOMER_COMPLEX_TO_STRING, customer.toString()); - } - -} diff --git a/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerPrimitiveToStringUnitTest.java b/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerPrimitiveToStringUnitTest.java deleted file mode 100644 index d43733bc60..0000000000 --- a/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerPrimitiveToStringUnitTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.baeldung.string.tostring; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; - -public class CustomerPrimitiveToStringUnitTest { - - private static final String CUSTOMER_PRIMITIVE_TO_STRING - = "Customer [balance=110, getFirstName()=Rajesh, getLastName()=Bhojwani]"; - - @Test - public void givenPrimitive_whenToString_thenCustomerDetails() { - CustomerPrimitiveToString customer = new CustomerPrimitiveToString(); - customer.setFirstName("Rajesh"); - customer.setLastName("Bhojwani"); - customer.setBalance(110); - - assertEquals(CUSTOMER_PRIMITIVE_TO_STRING, customer.toString()); - } -} - diff --git a/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerWrapperCollectionToStringUnitTest.java b/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerWrapperCollectionToStringUnitTest.java deleted file mode 100644 index e04512ff75..0000000000 --- a/java-strings-ops/src/test/java/com/baeldung/string/tostring/CustomerWrapperCollectionToStringUnitTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.baeldung.string.tostring; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.jupiter.api.Test; - -public class CustomerWrapperCollectionToStringUnitTest { - private static final String CUSTOMER_WRAPPER_COLLECTION_TO_STRING - = "Customer [score=8, orders=[Book, Pen], fullname=Bhojwani, Rajesh, getFirstName()=Rajesh, getLastName()=Bhojwani]"; - - @Test - public void givenWrapperCollectionStrBuffer_whenToString_thenCustomerDetails() { - CustomerWrapperCollectionToString customer = new CustomerWrapperCollectionToString(); - customer.setFirstName("Rajesh"); - customer.setLastName("Bhojwani"); - customer.setScore(8); - - List orders = new ArrayList(); - orders.add("Book"); - orders.add("Pen"); - customer.setOrders(orders); - - StringBuffer fullname = new StringBuffer(); - fullname.append(customer.getLastName()+", "+ customer.getFirstName()); - customer.setFullname(fullname); - - assertEquals(CUSTOMER_WRAPPER_COLLECTION_TO_STRING, customer.toString()); - } - -} diff --git a/java-strings-ops/src/test/resources/.gitignore b/java-strings-ops/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/java-strings-ops/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/java-strings/README.md b/java-strings/README.md deleted file mode 100644 index ef536b4099..0000000000 --- a/java-strings/README.md +++ /dev/null @@ -1,23 +0,0 @@ -========= - -## Java Strings Cookbooks and Examples - -### Relevant Articles: -- [String Operations with Java Streams](http://www.baeldung.com/java-stream-operations-on-strings) -- [Converting String to Stream of chars](http://www.baeldung.com/java-string-to-stream) -- [Java 8 StringJoiner](http://www.baeldung.com/java-string-joiner) -- [Converting Strings to Enums in Java](http://www.baeldung.com/java-string-to-enum) -- [Quick Guide to the Java StringTokenizer](http://www.baeldung.com/java-stringtokenizer) -- [Use char[] Array Over a String for Manipulating Passwords in Java?](http://www.baeldung.com/java-storing-passwords) -- [Convert a String to Title Case](http://www.baeldung.com/java-string-title-case) -- [Compact Strings in Java 9](http://www.baeldung.com/java-9-compact-string) -- [Java Check a String for Lowercase/Uppercase Letter, Special Character and Digit](https://www.baeldung.com/java-lowercase-uppercase-special-character-digit-regex) -- [Convert java.util.Date to String](https://www.baeldung.com/java-util-date-to-string) -- [Converting a Stack Trace to a String in Java](https://www.baeldung.com/java-stacktrace-to-string) -- [Sorting a String Alphabetically in Java](https://www.baeldung.com/java-sort-string-alphabetically) -- [String Not Empty Test Assertions in Java](https://www.baeldung.com/java-assert-string-not-empty) -- [String Performance Hints](https://www.baeldung.com/java-string-performance) -- [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences) -- [Adding a Newline Character to a String in Java](https://www.baeldung.com/java-string-newline) -- [Remove or Replace part of a String in Java](https://www.baeldung.com/java-remove-replace-string-part) -- [Replace a Character at a Specific Index in a String in Java](https://www.baeldung.com/java-replace-character-at-index) \ No newline at end of file diff --git a/java-strings/pom.xml b/java-strings/pom.xml deleted file mode 100755 index 42a57bfb42..0000000000 --- a/java-strings/pom.xml +++ /dev/null @@ -1,117 +0,0 @@ - - 4.0.0 - com.baeldung - java-strings - 0.1.0-SNAPSHOT - jar - java-strings - - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../parent-java - - - - - commons-io - commons-io - ${commons-io.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - log4j - log4j - ${log4j.version} - - - commons-codec - commons-codec - ${commons-codec.version} - - - - org.assertj - assertj-core - ${assertj.version} - test - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator.version} - - - com.ibm.icu - icu4j - ${icu4j.version} - - - com.google.guava - guava - ${guava.version} - - - - org.junit.jupiter - junit-jupiter-api - ${junit-jupiter-api.version} - test - - - - org.hamcrest - hamcrest-library - ${org.hamcrest.version} - test - - - - - - java-strings - - - src/main/resources - true - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - -parameters - - - - - - - - 3.8.1 - 1.10 - - 3.6.1 - 61.1 - 27.0.1-jre - 5.3.1 - 1.4 - - - diff --git a/java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumericDriver.java b/java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumericDriver.java deleted file mode 100644 index c0a6edae50..0000000000 --- a/java-strings/src/main/java/com/baeldung/stringisnumeric/IsNumericDriver.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.baeldung.stringisnumeric; - -import org.apache.log4j.Logger; - -public class IsNumericDriver { - private static IsNumeric isNumeric; - private static Logger LOG = Logger.getLogger(IsNumericDriver.class); - static { - isNumeric =new IsNumeric(); - - } - - public static void main(String[] args) { - LOG.info("Testing all methods..."); - - boolean res = isNumeric.usingCoreJava("1001"); - LOG.info("Using Core Java : " + res); - - res = isNumeric.usingRegularExpressions("1001"); - LOG.info("Using Regular Expressions : " + res); - - res =isNumeric.usingNumberUtils_isCreatable("1001"); - LOG.info("Using NumberUtils.isCreatable : " + res); - - res =isNumeric.usingNumberUtils_isParsable("1001"); - LOG.info("Using NumberUtils.isParsable : " + res); - - res =isNumeric.usingStringUtils_isNumeric("1001"); - LOG.info("Using StringUtils.isNumeric : " + res); - - res =isNumeric.usingStringUtils_isNumericSpace("1001"); - LOG.info("Using StringUtils.isNumericSpace : " + res); - } -} diff --git a/java-strings/src/main/resources/data.csv b/java-strings/src/main/resources/data.csv deleted file mode 100644 index ec4ac10443..0000000000 --- a/java-strings/src/main/resources/data.csv +++ /dev/null @@ -1,3 +0,0 @@ -1|IND|India -2|MY|Malaysia -3|AU|Australia diff --git a/java-strings/src/test/java/com/baeldung/CharArrayToStringUnitTest.java b/java-strings/src/test/java/com/baeldung/CharArrayToStringUnitTest.java deleted file mode 100644 index 3488f8b390..0000000000 --- a/java-strings/src/test/java/com/baeldung/CharArrayToStringUnitTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.baeldung; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class CharArrayToStringUnitTest { - - @Test - public void givenCharArray_whenCallingStringConstructor_shouldConvertToString() { - char[] charArray = { 'c', 'h', 'a', 'r', 'a', 'c', 't', 'e', 'r' }; - String result = new String(charArray); - String expectedValue = "character"; - - assertEquals(expectedValue, result); - } - - @Test - public void givenCharArray_whenCallingStringConstructorWithOffsetAndLength_shouldConvertToString() { - char[] charArray = { 'c', 'h', 'a', 'r', 'a', 'c', 't', 'e', 'r' }; - String result = new String(charArray, 4, 3); - String expectedValue = "act"; - - assertEquals(expectedValue, result); - } - - @Test - public void givenCharArray_whenCallingStringCopyValueOf_shouldConvertToString() { - char[] charArray = { 'c', 'h', 'a', 'r', 'a', 'c', 't', 'e', 'r' }; - String result = String.copyValueOf(charArray); - String expectedValue = "character"; - - assertEquals(expectedValue, result); - } - - @Test - public void givenCharArray_whenCallingStringCopyValueOfWithOffsetAndLength_shouldConvertToString() { - char[] charArray = { 'c', 'h', 'a', 'r', 'a', 'c', 't', 'e', 'r' }; - String result = String.copyValueOf(charArray, 0, 4); - String expectedValue = "char"; - - assertEquals(expectedValue, result); - } - - @Test - public void givenCharArray_whenCallingStringValueOf_shouldConvertToString() { - char[] charArray = { 'c', 'h', 'a', 'r', 'a', 'c', 't', 'e', 'r' }; - String result = String.valueOf(charArray); - String expectedValue = "character"; - - assertEquals(expectedValue, result); - } - - @Test - public void givenCharArray_whenCallingStringValueOfWithOffsetAndLength_shouldConvertToString() { - char[] charArray = { 'c', 'h', 'a', 'r', 'a', 'c', 't', 'e', 'r' }; - String result = String.valueOf(charArray, 3, 4); - String expectedValue = "ract"; - - assertEquals(expectedValue, result); - } -} diff --git a/java-strings/src/test/java/com/baeldung/StringToCharArrayUnitTest.java b/java-strings/src/test/java/com/baeldung/StringToCharArrayUnitTest.java deleted file mode 100644 index cd996e58e2..0000000000 --- a/java-strings/src/test/java/com/baeldung/StringToCharArrayUnitTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.baeldung; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class StringToCharArrayUnitTest { - - @Test - public void givenString_whenCallingStringToCharArray_shouldConvertToCharArray() { - String givenString = "characters"; - - char[] result = givenString.toCharArray(); - - char[] expectedCharArray = { 'c', 'h', 'a', 'r', 'a', 'c', 't', 'e', 'r', 's' }; - - assertArrayEquals(expectedCharArray, result); - } - -} diff --git a/java-strings/src/test/java/com/baeldung/enums/PizzaUnitTest.java b/java-strings/src/test/java/com/baeldung/enums/PizzaUnitTest.java deleted file mode 100644 index 3e52a89bad..0000000000 --- a/java-strings/src/test/java/com/baeldung/enums/PizzaUnitTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.baeldung.enums; - -import static junit.framework.TestCase.assertTrue; - -import org.junit.Test; - -public class PizzaUnitTest { - - @Test - public void whenConvertedIntoEnum_thenGetsConvertedCorrectly() { - String pizzaEnumValue = "READY"; - PizzaStatusEnum pizzaStatusEnum = PizzaStatusEnum.valueOf(pizzaEnumValue); - assertTrue(pizzaStatusEnum == PizzaStatusEnum.READY); - } - - @Test(expected = IllegalArgumentException.class) - public void whenConvertedIntoEnum_thenThrowsException() { - String pizzaEnumValue = "rEAdY"; - PizzaStatusEnum pizzaStatusEnum = PizzaStatusEnum.valueOf(pizzaEnumValue); - } - - @Test(expected = IllegalArgumentException.class) - public void givenInvalidEnumValueContentWiseAsString_whenConvertedIntoEnum_thenThrowsException() { - String pizzaEnumValue = "invalid"; - PizzaStatusEnum pizzaStatusEnum = PizzaStatusEnum.valueOf(pizzaEnumValue); - } -} \ No newline at end of file diff --git a/java-strings/src/test/java/com/baeldung/string/StringEmptyUnitTest.java b/java-strings/src/test/java/com/baeldung/string/StringEmptyUnitTest.java deleted file mode 100644 index 17b13f89de..0000000000 --- a/java-strings/src/test/java/com/baeldung/string/StringEmptyUnitTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.baeldung.string; - -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.text.IsEmptyString.isEmptyOrNullString; -import static org.hamcrest.text.IsEmptyString.isEmptyString; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - -import org.apache.commons.lang3.StringUtils; -import org.assertj.core.api.Assertions; -import org.junit.Test; - -import com.google.common.base.Strings; - -public class StringEmptyUnitTest { - - private String text = "baeldung"; - - @Test - public void givenAString_whenCheckedForEmptyUsingJunit_shouldAssertSuccessfully() { - assertTrue(!text.isEmpty()); - assertFalse(text.isEmpty()); - assertNotEquals("", text); - assertNotSame("", text); - } - - @Test - public void givenAString_whenCheckedForEmptyUsingHamcrest_shouldAssertSuccessfully() { - assertThat(text, not(isEmptyString())); - assertThat(text, not(isEmptyOrNullString())); - } - - @Test - public void givenAString_whenCheckedForEmptyUsingCommonsLang_shouldAssertSuccessfully() { - assertTrue(StringUtils.isNotBlank(text)); - } - - @Test - public void givenAString_whenCheckedForEmptyUsingAssertJ_shouldAssertSuccessfully() { - Assertions.assertThat(text).isNotEmpty(); - } - - @Test - public void givenAString_whenCheckedForEmptyUsingGuava_shouldAssertSuccessfully() { - assertFalse(Strings.isNullOrEmpty(text)); - } - -} diff --git a/java-strings/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java b/java-strings/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java deleted file mode 100644 index a72f811336..0000000000 --- a/java-strings/src/test/java/com/baeldung/stringjoiner/StringJoinerUnitTest.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.baeldung.stringjoiner; - -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.StringJoiner; -import java.util.stream.Collectors; - -import org.junit.Test; - -public class StringJoinerUnitTest { - private final String DELIMITER_COMMA = ","; - private final String DELIMITER_HYPHEN = "-"; - private final String PREFIX = "["; - private final String SUFFIX = "]"; - private final String EMPTY_JOINER = "empty"; - - @Test - public void whenJoinerWithoutPrefixSuffixWithoutEmptyValue_thenReturnDefault() { - StringJoiner commaSeparatedJoiner = new StringJoiner(DELIMITER_COMMA); - assertEquals(0, commaSeparatedJoiner.toString().length()); - } - - @Test - public void whenJoinerWithPrefixSuffixWithoutEmptyValue_thenReturnDefault() { - StringJoiner commaSeparatedPrefixSuffixJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); - assertEquals(commaSeparatedPrefixSuffixJoiner.toString(), PREFIX + SUFFIX); - } - - @Test - public void whenJoinerWithoutPrefixSuffixWithEmptyValue_thenReturnDefault() { - StringJoiner commaSeparatedJoiner = new StringJoiner(DELIMITER_COMMA); - commaSeparatedJoiner.setEmptyValue(EMPTY_JOINER); - - assertEquals(commaSeparatedJoiner.toString(), EMPTY_JOINER); - } - - @Test - public void whenJoinerWithPrefixSuffixWithEmptyValue_thenReturnDefault() { - StringJoiner commaSeparatedPrefixSuffixJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); - commaSeparatedPrefixSuffixJoiner.setEmptyValue(EMPTY_JOINER); - - assertEquals(commaSeparatedPrefixSuffixJoiner.toString(), EMPTY_JOINER); - } - - @Test - public void whenAddElements_thenJoinElements() { - StringJoiner rgbJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); - rgbJoiner.add("Red") - .add("Green") - .add("Blue"); - - assertEquals(rgbJoiner.toString(), "[Red,Green,Blue]"); - } - - @Test - public void whenAddListElements_thenJoinListElements() { - List rgbList = new ArrayList(); - rgbList.add("Red"); - rgbList.add("Green"); - rgbList.add("Blue"); - - StringJoiner rgbJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); - - for (String color : rgbList) { - rgbJoiner.add(color); - } - - assertEquals(rgbJoiner.toString(), "[Red,Green,Blue]"); - } - - @Test - public void whenMergeJoiners_thenReturnMerged() { - StringJoiner rgbJoiner = new StringJoiner(DELIMITER_COMMA, PREFIX, SUFFIX); - StringJoiner cmybJoiner = new StringJoiner(DELIMITER_HYPHEN, PREFIX, SUFFIX); - - rgbJoiner.add("Red") - .add("Green") - .add("Blue"); - cmybJoiner.add("Cyan") - .add("Magenta") - .add("Yellow") - .add("Black"); - - rgbJoiner.merge(cmybJoiner); - - assertEquals(rgbJoiner.toString(), "[Red,Green,Blue,Cyan-Magenta-Yellow-Black]"); - } - - @Test - public void whenUsedWithinCollectors_thenJoin() { - List rgbList = Arrays.asList("Red", "Green", "Blue"); - String commaSeparatedRGB = rgbList.stream() - .map(color -> color.toString()) - .collect(Collectors.joining(",")); - - assertEquals(commaSeparatedRGB, "Red,Green,Blue"); - } -} diff --git a/java-strings/src/test/resources/.gitignore b/java-strings/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/java-strings/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/java-vavr-stream/README.md b/java-vavr-stream/README.md index 64299cde11..4e8b5ccd66 100644 --- a/java-vavr-stream/README.md +++ b/java-vavr-stream/README.md @@ -1,5 +1,8 @@ +## Vavr Streams + +This module contains articles about streams in Vavr. ### Relevant Articles: -- [Java Streams vs Vavr Streams](http://www.baeldung.com/vavr-java-streams) +- [Java Streams vs Vavr Streams](https://www.baeldung.com/vavr-java-streams) diff --git a/java-websocket/README.md b/java-websocket/README.md index f9f0784043..f48b8c6804 100644 --- a/java-websocket/README.md +++ b/java-websocket/README.md @@ -1,3 +1,7 @@ +## Java WebSocket + +This module contains articles about WebSocket in Java. + ### Relevant articles -- [A Guide to the Java API for WebSocket](http://www.baeldung.com/java-websockets) +- [A Guide to the Java API for WebSocket](https://www.baeldung.com/java-websockets) diff --git a/javafx/README.md b/javafx/README.md index 66c81f17ad..80c4f49026 100644 --- a/javafx/README.md +++ b/javafx/README.md @@ -1,3 +1,7 @@ -### Relevant Articles: --[Introduction to JavaFX](http://www.baeldung.com/javafx) +## JavaFX + +This module contains articles about JavaFX. + +### Relevant Articles: +-[Introduction to JavaFX](https://www.baeldung.com/javafx) diff --git a/javax-servlets/README.md b/javax-servlets/README.md index 3c3b17996b..085cc04f87 100644 --- a/javax-servlets/README.md +++ b/javax-servlets/README.md @@ -1,9 +1,14 @@ +## Servlets + +This module contains articles about Servlets. + ### Relevant Articles: -- [Introduction to Java Servlets](http://www.baeldung.com/intro-to-servlets) -- [An MVC Example with Servlets and JSP](http://www.baeldung.com/mvc-servlet-jsp) -- [Handling Cookies and a Session in a Java Servlet](http://www.baeldung.com/java-servlet-cookies-session) -- [Uploading Files with Servlets and JSP](http://www.baeldung.com/upload-file-servlet) -- [Example of Downloading File in a Servlet](http://www.baeldung.com/servlet-download-file) -- [Returning a JSON Response from a Servlet](http://www.baeldung.com/servlet-json-response) -- [Java EE Servlet Exception Handling](http://www.baeldung.com/servlet-exceptions) -- [Context and Servlet Initialization Parameters](http://www.baeldung.com/context-servlet-initialization-param) +- [Introduction to Java Servlets](https://www.baeldung.com/intro-to-servlets) +- [An MVC Example with Servlets and JSP](https://www.baeldung.com/mvc-servlet-jsp) +- [Handling Cookies and a Session in a Java Servlet](https://www.baeldung.com/java-servlet-cookies-session) +- [Uploading Files with Servlets and JSP](https://www.baeldung.com/upload-file-servlet) +- [Example of Downloading File in a Servlet](https://www.baeldung.com/servlet-download-file) +- [Returning a JSON Response from a Servlet](https://www.baeldung.com/servlet-json-response) +- [Java EE Servlet Exception Handling](https://www.baeldung.com/servlet-exceptions) +- [Context and Servlet Initialization Parameters](https://www.baeldung.com/context-servlet-initialization-param) +- [The Difference between getRequestURI and getPathInfo in HttpServletRequest](https://www.baeldung.com/http-servlet-request-requesturi-pathinfo) diff --git a/javaxval/README.md b/javaxval/README.md index fadd174166..33ce4eae5b 100644 --- a/javaxval/README.md +++ b/javaxval/README.md @@ -1,9 +1,12 @@ -========= - ## Java Bean Validation Examples +This module contains articles about Bean Validation. + ### Relevant Articles: -- [Java Bean Validation Basics](http://www.baeldung.com/javax-validation) -- [Validating Container Elements with Bean Validation 2.0](http://www.baeldung.com/bean-validation-container-elements) -- [Method Constraints with Bean Validation 2.0](http://www.baeldung.com/javax-validation-method-constraints) +- [Java Bean Validation Basics](https://www.baeldung.com/javax-validation) +- [Validating Container Elements with Bean Validation 2.0](https://www.baeldung.com/bean-validation-container-elements) +- [Method Constraints with Bean Validation 2.0](https://www.baeldung.com/javax-validation-method-constraints) - [Difference Between @NotNull, @NotEmpty, and @NotBlank Constraints in Bean Validation](https://www.baeldung.com/java-bean-validation-not-null-empty-blank) +- [Javax BigDecimal Validation](https://www.baeldung.com/javax-bigdecimal-validation) +- [Grouping Javax Validation Constraints](https://www.baeldung.com/javax-validation-groups) +- [Validations for Enum Types](https://www.baeldung.com/javax-validations-enums) diff --git a/javaxval/src/main/java/org/baeldung/Customer.java b/javaxval/src/main/java/org/baeldung/Customer.java deleted file mode 100644 index a90fb419de..0000000000 --- a/javaxval/src/main/java/org/baeldung/Customer.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.baeldung; - -import java.util.List; -import java.util.Optional; -import java.util.OptionalInt; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.PositiveOrZero; - -public class Customer { - - @NotBlank(message="Name cannot be empty") - private String name; - - private List<@NotBlank(message="Address must not be blank") String> addresses; - - private Integer age; - - @PositiveOrZero - private OptionalInt numberOfOrders; - - //@NotBlank - private Profile profile; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getAddresses() { - return addresses; - } - - public void setAddresses(List addresses) { - this.addresses = addresses; - } - - public Optional<@Min(18) Integer> getAge() { - return Optional.ofNullable(age); - } - - public void setAge(Integer age) { - this.age = age; - } - - public OptionalInt getNumberOfOrders() { - return numberOfOrders; - } - - public void setNumberOfOrders(OptionalInt numberOfOrders) { - this.numberOfOrders = numberOfOrders; - } - - public Profile getProfile() { - return profile; - } - - public void setProfile(Profile profile) { - this.profile = profile; - } - -} diff --git a/javaxval/src/main/java/org/baeldung/CustomerMap.java b/javaxval/src/main/java/org/baeldung/CustomerMap.java deleted file mode 100644 index 37446cf86e..0000000000 --- a/javaxval/src/main/java/org/baeldung/CustomerMap.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.baeldung; - -import java.util.Map; - -import javax.validation.constraints.Email; -import javax.validation.constraints.NotNull; - -public class CustomerMap { - - private Map<@Email(message="Must be a valid email") String, @NotNull Customer> customers; - - public Map getCustomers() { - return customers; - } - - public void setCustomers(Map customers) { - this.customers = customers; - } -} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/appplication/Application.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/appplication/Application.java deleted file mode 100644 index c9f2ab6f98..0000000000 --- a/javaxval/src/main/java/org/baeldung/javabeanconstraints/appplication/Application.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.baeldung.javabeanconstraints.appplication; - -import javax.validation.Validation; -import javax.validation.Validator; -import org.baeldung.javabeanconstraints.entities.UserNotBlank; - -public class Application { - - public static void main(String[] args) throws Exception { - Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); - UserNotBlank user = new UserNotBlank(" "); - validator.validate(user).stream().forEach(violation -> System.out.println(violation.getMessage())); - } -} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/bigdecimal/Invoice.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/bigdecimal/Invoice.java deleted file mode 100644 index 6df1b79a60..0000000000 --- a/javaxval/src/main/java/org/baeldung/javabeanconstraints/bigdecimal/Invoice.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.baeldung.javabeanconstraints.bigdecimal; - -import java.math.BigDecimal; - -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.Digits; - -public class Invoice { - - @DecimalMin(value = "0.0", inclusive = false) - @Digits(integer=3, fraction=2) - private BigDecimal price; - private String description; - - public Invoice(BigDecimal price, String description) { - this.price = price; - this.description = description; - } -} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/AdvanceInfo.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/AdvanceInfo.java deleted file mode 100644 index 4d5df052c2..0000000000 --- a/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/AdvanceInfo.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.baeldung.javabeanconstraints.validationgroup; - -public interface AdvanceInfo { - -} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/BasicInfo.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/BasicInfo.java deleted file mode 100644 index 4564a7a702..0000000000 --- a/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/BasicInfo.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.baeldung.javabeanconstraints.validationgroup; - -public interface BasicInfo { - -} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/CompleteInfo.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/CompleteInfo.java deleted file mode 100644 index c989ea3a6f..0000000000 --- a/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/CompleteInfo.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.baeldung.javabeanconstraints.validationgroup; - -import javax.validation.GroupSequence; - -@GroupSequence({BasicInfo.class, AdvanceInfo.class}) -public interface CompleteInfo { - -} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationForm.java b/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationForm.java deleted file mode 100644 index ac8da5c26b..0000000000 --- a/javaxval/src/main/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationForm.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.baeldung.javabeanconstraints.validationgroup; - -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; - -public class RegistrationForm { - @NotBlank(groups = BasicInfo.class) - private String firstName; - @NotBlank(groups = BasicInfo.class) - private String lastName; - @Email(groups = BasicInfo.class) - private String email; - @NotBlank(groups = BasicInfo.class) - private String phone; - - @NotBlank(groups = { BasicInfo.class, AdvanceInfo.class }) - private String captcha; - - @NotBlank(groups = AdvanceInfo.class) - private String street; - @NotBlank(groups = AdvanceInfo.class) - private String houseNumber; - @NotBlank(groups = AdvanceInfo.class) - private String zipCode; - @NotBlank(groups = AdvanceInfo.class) - private String city; - @NotBlank(groups = AdvanceInfo.class) - private String contry; - - public String getStreet() { - return street; - } - - public void setStreet(String street) { - this.street = street; - } - - public String getHouseNumber() { - return houseNumber; - } - - public void setHouseNumber(String houseNumber) { - this.houseNumber = houseNumber; - } - - public String getZipCode() { - return zipCode; - } - - public void setZipCode(String zipCode) { - this.zipCode = zipCode; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getContry() { - return contry; - } - - public void setContry(String contry) { - this.contry = contry; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getCaptcha() { - return captcha; - } - - public void setCaptcha(String captcha) { - this.captcha = captcha; - } - -} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/beanvalidation/User.java b/javaxval/src/main/java/org/baeldung/javaxval/beanvalidation/User.java index cf80266c9d..8303edd033 100644 --- a/javaxval/src/main/java/org/baeldung/javaxval/beanvalidation/User.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/beanvalidation/User.java @@ -8,10 +8,10 @@ import javax.validation.constraints.AssertTrue; import javax.validation.constraints.Email; import javax.validation.constraints.Max; import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Past; import javax.validation.constraints.Size; -import javax.validation.constraints.NotBlank; public class User { @@ -30,9 +30,9 @@ public class User { @Email(message = "Email should be valid") private String email; - - List<@NotBlank String> preferences; - + + private List<@NotBlank String> preferences; + private LocalDate dateOfBirth; public int getAge() { @@ -90,5 +90,4 @@ public class User { public void setPreferences(List preferences) { this.preferences = preferences; } - } diff --git a/javaxval/src/main/java/org/baeldung/javaxval/bigdecimal/Invoice.java b/javaxval/src/main/java/org/baeldung/javaxval/bigdecimal/Invoice.java new file mode 100644 index 0000000000..087701f166 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/bigdecimal/Invoice.java @@ -0,0 +1,19 @@ +package org.baeldung.javaxval.bigdecimal; + +import java.math.BigDecimal; + +import javax.validation.constraints.DecimalMin; +import javax.validation.constraints.Digits; + +public class Invoice { + + @DecimalMin(value = "0.0", inclusive = false) + @Digits(integer = 3, fraction = 2) + private BigDecimal price; + private String description; + + public Invoice(BigDecimal price, String description) { + this.price = price; + this.description = description; + } +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/container/validation/Customer.java b/javaxval/src/main/java/org/baeldung/javaxval/container/validation/Customer.java new file mode 100644 index 0000000000..6ca5ba3ee1 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/container/validation/Customer.java @@ -0,0 +1,66 @@ +package org.baeldung.javaxval.container.validation; + +import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.PositiveOrZero; + +public class Customer { + + @NotBlank(message = "Name cannot be empty") + private String name; + + private List<@NotBlank(message = "Address must not be blank") String> addresses; + + private Integer age; + + @PositiveOrZero + private OptionalInt numberOfOrders; + + @NotBlank + private Profile profile; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getAddresses() { + return addresses; + } + + public void setAddresses(List addresses) { + this.addresses = addresses; + } + + public Optional<@Min(18) Integer> getAge() { + return Optional.ofNullable(age); + } + + public void setAge(Integer age) { + this.age = age; + } + + public OptionalInt getNumberOfOrders() { + return numberOfOrders; + } + + public void setNumberOfOrders(OptionalInt numberOfOrders) { + this.numberOfOrders = numberOfOrders; + } + + public Profile getProfile() { + return profile; + } + + public void setProfile(Profile profile) { + this.profile = profile; + } + +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/container/validation/CustomerMap.java b/javaxval/src/main/java/org/baeldung/javaxval/container/validation/CustomerMap.java new file mode 100644 index 0000000000..82cf0f2b0c --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/container/validation/CustomerMap.java @@ -0,0 +1,19 @@ +package org.baeldung.javaxval.container.validation; + +import java.util.Map; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotNull; + +public class CustomerMap { + + private Map<@Email(message = "Must be a valid email") String, @NotNull Customer> customers; + + public Map getCustomers() { + return customers; + } + + public void setCustomers(Map customers) { + this.customers = customers; + } +} diff --git a/javaxval/src/main/java/org/baeldung/Profile.java b/javaxval/src/main/java/org/baeldung/javaxval/container/validation/Profile.java similarity index 81% rename from javaxval/src/main/java/org/baeldung/Profile.java rename to javaxval/src/main/java/org/baeldung/javaxval/container/validation/Profile.java index ec73a5c62f..41260540fc 100644 --- a/javaxval/src/main/java/org/baeldung/Profile.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/container/validation/Profile.java @@ -1,4 +1,4 @@ -package org.baeldung; +package org.baeldung.javaxval.container.validation; public class Profile { private String companyName; diff --git a/javaxval/src/main/java/org/baeldung/valueextractors/ProfileValueExtractor.java b/javaxval/src/main/java/org/baeldung/javaxval/container/validation/valueextractors/ProfileValueExtractor.java similarity index 79% rename from javaxval/src/main/java/org/baeldung/valueextractors/ProfileValueExtractor.java rename to javaxval/src/main/java/org/baeldung/javaxval/container/validation/valueextractors/ProfileValueExtractor.java index f192034261..ebc618e80e 100644 --- a/javaxval/src/main/java/org/baeldung/valueextractors/ProfileValueExtractor.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/container/validation/valueextractors/ProfileValueExtractor.java @@ -1,10 +1,10 @@ -package org.baeldung.valueextractors; +package org.baeldung.javaxval.container.validation.valueextractors; import javax.validation.valueextraction.ExtractedValue; import javax.validation.valueextraction.UnwrapByDefault; import javax.validation.valueextraction.ValueExtractor; -import org.baeldung.Profile; +import org.baeldung.javaxval.container.validation.Profile; @UnwrapByDefault public class ProfileValueExtractor implements ValueExtractor<@ExtractedValue(type = String.class) Profile> { diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/CustomerTypeSubSetValidator.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/CustomerTypeSubSetValidator.java new file mode 100644 index 0000000000..c730cb937f --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/CustomerTypeSubSetValidator.java @@ -0,0 +1,24 @@ +package org.baeldung.javaxval.enums; + +import java.util.Arrays; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; + +import org.baeldung.javaxval.enums.constraints.CustomerTypeSubset; +import org.baeldung.javaxval.enums.demo.CustomerType; + +public class CustomerTypeSubSetValidator implements ConstraintValidator { + private CustomerType[] subset; + + @Override + public void initialize(CustomerTypeSubset constraint) { + this.subset = constraint.anyOf(); + } + + @Override + public boolean isValid(CustomerType value, ConstraintValidatorContext context) { + return value == null || Arrays.asList(subset) + .contains(value); + } +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/EnumNamePatternValidator.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/EnumNamePatternValidator.java new file mode 100644 index 0000000000..a279813461 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/EnumNamePatternValidator.java @@ -0,0 +1,33 @@ +package org.baeldung.javaxval.enums; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; + +import org.baeldung.javaxval.enums.constraints.EnumNamePattern; + +public class EnumNamePatternValidator implements ConstraintValidator> { + private Pattern pattern; + + @Override + public void initialize(EnumNamePattern constraintAnnotation) { + try { + pattern = Pattern.compile(constraintAnnotation.regexp()); + } catch (PatternSyntaxException e) { + throw new IllegalArgumentException("Given regex is invalid", e); + } + } + + @Override + public boolean isValid(Enum value, ConstraintValidatorContext context) { + if (value == null) { + return true; + } + + Matcher m = pattern.matcher(value.name()); + return m.matches(); + } +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/EnumSubSetValidator.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/EnumSubSetValidator.java new file mode 100644 index 0000000000..339b4fb03b --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/EnumSubSetValidator.java @@ -0,0 +1,25 @@ +package org.baeldung.javaxval.enums; + +import java.lang.annotation.Annotation; +import java.util.Arrays; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; + +public abstract class EnumSubSetValidator implements ConstraintValidator { + private U[] subset; + + protected void initialize(U[] subset) { + this.subset = subset; + } + + @Override + public boolean isValid(U value, ConstraintValidatorContext context) { + if (value == null) { + return true; + } + + return Arrays.asList(subset) + .contains(value); + } +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/InheritedCustomerTypeSubSetValidator.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/InheritedCustomerTypeSubSetValidator.java new file mode 100644 index 0000000000..1cd31c4187 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/InheritedCustomerTypeSubSetValidator.java @@ -0,0 +1,11 @@ +package org.baeldung.javaxval.enums; + +import org.baeldung.javaxval.enums.constraints.CustomerTypeSubset; +import org.baeldung.javaxval.enums.demo.CustomerType; + +public class InheritedCustomerTypeSubSetValidator extends EnumSubSetValidator { + @Override + public void initialize(CustomerTypeSubset constraint) { + super.initialize(constraint.anyOf()); + } +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/ValueOfEnumValidator.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/ValueOfEnumValidator.java new file mode 100644 index 0000000000..7184dae49b --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/ValueOfEnumValidator.java @@ -0,0 +1,31 @@ +package org.baeldung.javaxval.enums; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; + +import org.baeldung.javaxval.enums.constraints.ValueOfEnum; + +public class ValueOfEnumValidator implements ConstraintValidator { + private List acceptedValues; + + @Override + public void initialize(ValueOfEnum annotation) { + acceptedValues = Stream.of(annotation.enumClass() + .getEnumConstants()) + .map(Enum::name) + .collect(Collectors.toList()); + } + + @Override + public boolean isValid(CharSequence value, ConstraintValidatorContext context) { + if (value == null) { + return true; + } + + return acceptedValues.contains(value.toString()); + } +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/constraints/CustomerTypeSubset.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/constraints/CustomerTypeSubset.java new file mode 100644 index 0000000000..44009e6723 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/constraints/CustomerTypeSubset.java @@ -0,0 +1,45 @@ +package org.baeldung.javaxval.enums.constraints; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; +import static java.lang.annotation.ElementType.TYPE_USE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import javax.validation.Constraint; +import javax.validation.Payload; + +import org.baeldung.javaxval.enums.CustomerTypeSubSetValidator; +import org.baeldung.javaxval.enums.demo.CustomerType; + +@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE }) +@Retention(RUNTIME) +@Documented +@Constraint(validatedBy = CustomerTypeSubSetValidator.class) +public @interface CustomerTypeSubset { + /** + * @return subset of CustomerType enum + */ + CustomerType[] anyOf(); + + /** + * @return the error message template + */ + String message() default "must be any of {anyOf}"; + + /** + * @return the groups the constraint belongs to + */ + Class[] groups() default {}; + + /** + * @return the payload associated to the constraint + */ + Class[] payload() default {}; +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/constraints/EnumNamePattern.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/constraints/EnumNamePattern.java new file mode 100644 index 0000000000..403cdcd0b4 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/constraints/EnumNamePattern.java @@ -0,0 +1,45 @@ +package org.baeldung.javaxval.enums.constraints; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; +import static java.lang.annotation.ElementType.TYPE_USE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import javax.validation.Constraint; +import javax.validation.Payload; + +import org.baeldung.javaxval.enums.EnumNamePatternValidator; + +@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE }) +@Retention(RUNTIME) +@Documented +@Constraint(validatedBy = EnumNamePatternValidator.class) +public @interface EnumNamePattern { + + /** + * @return the regular expression to match + */ + String regexp(); + + /** + * @return the error message template + */ + String message() default "must match \"{regexp}\""; + + /** + * @return the groups the constraint belongs to + */ + Class[] groups() default {}; + + /** + * @return the payload associated to the constraint + */ + Class[] payload() default {}; +} \ No newline at end of file diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/constraints/ValueOfEnum.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/constraints/ValueOfEnum.java new file mode 100644 index 0000000000..0f9677d982 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/constraints/ValueOfEnum.java @@ -0,0 +1,44 @@ +package org.baeldung.javaxval.enums.constraints; + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; +import static java.lang.annotation.ElementType.TYPE_USE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import javax.validation.Constraint; +import javax.validation.Payload; + +import org.baeldung.javaxval.enums.ValueOfEnumValidator; + +@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE }) +@Retention(RUNTIME) +@Documented +@Constraint(validatedBy = ValueOfEnumValidator.class) +public @interface ValueOfEnum { + /** + * @return class containing enum values to which this String should match + */ + Class> enumClass(); + + /** + * @return the error message template + */ + String message() default "must be any of enum {enumClass}"; + + /** + * @return the groups the constraint belongs to + */ + Class[] groups() default {}; + + /** + * @return the payload associated to the constraint + */ + Class[] payload() default {}; +} \ No newline at end of file diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/demo/Customer.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/demo/Customer.java new file mode 100644 index 0000000000..db3486ab5f --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/demo/Customer.java @@ -0,0 +1,77 @@ +package org.baeldung.javaxval.enums.demo; + +import javax.validation.constraints.NotNull; + +import org.baeldung.javaxval.enums.constraints.CustomerTypeSubset; +import org.baeldung.javaxval.enums.constraints.EnumNamePattern; +import org.baeldung.javaxval.enums.constraints.ValueOfEnum; + +public class Customer { + @ValueOfEnum(enumClass = CustomerType.class) + private String customerTypeString; + + @NotNull + @CustomerTypeSubset(anyOf = { CustomerType.NEW, CustomerType.OLD }) + private CustomerType customerTypeOfSubset; + + @EnumNamePattern(regexp = "NEW|DEFAULT") + private CustomerType customerTypeMatchesPattern; + + public Customer() { + } + + public Customer(String customerTypeString, CustomerType customerTypeOfSubset, CustomerType customerTypeMatchesPattern) { + this.customerTypeString = customerTypeString; + this.customerTypeOfSubset = customerTypeOfSubset; + this.customerTypeMatchesPattern = customerTypeMatchesPattern; + } + + public String getCustomerTypeString() { + return customerTypeString; + } + + public void setCustomerTypeString(String customerTypeString) { + this.customerTypeString = customerTypeString; + } + + public CustomerType getCustomerTypeOfSubset() { + return customerTypeOfSubset; + } + + public void setCustomerTypeOfSubset(CustomerType customerTypeOfSubset) { + this.customerTypeOfSubset = customerTypeOfSubset; + } + + public CustomerType getCustomerTypeMatchesPattern() { + return customerTypeMatchesPattern; + } + + public void setCustomerTypeMatchesPattern(CustomerType customerTypeMatchesPattern) { + this.customerTypeMatchesPattern = customerTypeMatchesPattern; + } + + public static class Builder { + private String customerTypeString; + private CustomerType customerTypeOfSubset = CustomerType.NEW; + private CustomerType customerTypeMatchesPattern; + + public Builder withCustomerTypeString(String customerTypeString) { + this.customerTypeString = customerTypeString; + return this; + } + + public Builder withCustomerTypeOfSubset(CustomerType customerTypeOfSubset) { + this.customerTypeOfSubset = customerTypeOfSubset; + return this; + } + + public Builder withCustomerTypeMatchesPattern(CustomerType customerTypeMatchesPattern) { + this.customerTypeMatchesPattern = customerTypeMatchesPattern; + return this; + } + + public Customer build() { + return new Customer(customerTypeString, customerTypeOfSubset, customerTypeMatchesPattern); + } + } +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/enums/demo/CustomerType.java b/javaxval/src/main/java/org/baeldung/javaxval/enums/demo/CustomerType.java new file mode 100644 index 0000000000..937f3a3817 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/enums/demo/CustomerType.java @@ -0,0 +1,5 @@ +package org.baeldung.javaxval.enums.demo; + +public enum CustomerType { + NEW, OLD, DEFAULT +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/application/Application.java b/javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/application/Application.java new file mode 100644 index 0000000000..22095084c5 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/application/Application.java @@ -0,0 +1,18 @@ +package org.baeldung.javaxval.javabeanconstraints.application; + +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.javabeanconstraints.entities.UserNotBlank; + +public class Application { + + public static void main(String[] args) { + Validator validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + UserNotBlank user = new UserNotBlank(" "); + validator.validate(user) + .stream() + .forEach(violation -> System.out.println(violation.getMessage())); + } +} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotBlank.java b/javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/entities/UserNotBlank.java similarity index 81% rename from javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotBlank.java rename to javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/entities/UserNotBlank.java index 2ea6a3af56..d86b6a65d2 100644 --- a/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotBlank.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/entities/UserNotBlank.java @@ -1,22 +1,22 @@ -package org.baeldung.javabeanconstraints.entities; - -import javax.validation.constraints.NotBlank; - -public class UserNotBlank { - - @NotBlank(message = "Name is mandatory") - private final String name; - - public UserNotBlank(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - @Override - public String toString() { - return "User{" + "name=" + name + "}"; - } -} +package org.baeldung.javaxval.javabeanconstraints.entities; + +import javax.validation.constraints.NotBlank; + +public class UserNotBlank { + + @NotBlank(message = "Name is mandatory") + private final String name; + + public UserNotBlank(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + @Override + public String toString() { + return "User{" + "name=" + name + "}"; + } +} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotEmpty.java b/javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/entities/UserNotEmpty.java similarity index 80% rename from javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotEmpty.java rename to javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/entities/UserNotEmpty.java index 39e34b63d3..2082265145 100644 --- a/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotEmpty.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/entities/UserNotEmpty.java @@ -1,22 +1,22 @@ -package org.baeldung.javabeanconstraints.entities; - -import javax.validation.constraints.NotEmpty; - -public class UserNotEmpty { - - @NotEmpty(message = "Name is mandatory") - private final String name; - - public UserNotEmpty(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - @Override - public String toString() { - return "User{" + "name=" + name + "}"; - } -} +package org.baeldung.javaxval.javabeanconstraints.entities; + +import javax.validation.constraints.NotEmpty; + +public class UserNotEmpty { + + @NotEmpty(message = "Name is mandatory") + private final String name; + + public UserNotEmpty(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + @Override + public String toString() { + return "User{" + "name=" + name + "}"; + } +} diff --git a/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotNull.java b/javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/entities/UserNotNull.java similarity index 80% rename from javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotNull.java rename to javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/entities/UserNotNull.java index 598c9ba9f9..e2f9e7ec57 100644 --- a/javaxval/src/main/java/org/baeldung/javabeanconstraints/entities/UserNotNull.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/javabeanconstraints/entities/UserNotNull.java @@ -1,22 +1,22 @@ -package org.baeldung.javabeanconstraints.entities; - -import javax.validation.constraints.NotNull; - -public class UserNotNull { - - @NotNull(message = "Name is mandatory") - private final String name; - - public UserNotNull(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - @Override - public String toString() { - return "User{" + "name=" + name + "}"; - } -} +package org.baeldung.javaxval.javabeanconstraints.entities; + +import javax.validation.constraints.NotNull; + +public class UserNotNull { + + @NotNull(message = "Name is mandatory") + private final String name; + + public UserNotNull(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + @Override + public String toString() { + return "User{" + "name=" + name + "}"; + } +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/messageinterpolator/Person.java b/javaxval/src/main/java/org/baeldung/javaxval/messageinterpolator/Person.java new file mode 100644 index 0000000000..b9fcfdf4d4 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/messageinterpolator/Person.java @@ -0,0 +1,42 @@ +package org.baeldung.javaxval.messageinterpolator; + +import javax.validation.constraints.Email; +import javax.validation.constraints.Min; +import javax.validation.constraints.Size; + +public class Person { + + @Size(min = 10, max = 100, message = "Name should be between {min} and {max} characters") + private String name; + + @Min(value = 18, message = "Age should not be less than {value}") + private int age; + + @Email(message = "Email address should be in a correct format: ${validatedValue}") + private String email; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/MethodValidationConfig.java b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/MethodValidationConfig.java index 206a145337..817f2370ef 100644 --- a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/MethodValidationConfig.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/MethodValidationConfig.java @@ -1,5 +1,7 @@ package org.baeldung.javaxval.methodvalidation; +import java.time.LocalDate; + import org.baeldung.javaxval.methodvalidation.model.Customer; import org.baeldung.javaxval.methodvalidation.model.Reservation; import org.springframework.beans.factory.config.BeanDefinition; @@ -9,8 +11,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Scope; import org.springframework.validation.beanvalidation.MethodValidationPostProcessor; -import java.time.LocalDate; - @Configuration @ComponentScan({ "org.baeldung.javaxval.methodvalidation.model" }) public class MethodValidationConfig { diff --git a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ConsistentDateParameterValidator.java b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ConsistentDateParameterValidator.java index f1c97760d7..df09cfa906 100644 --- a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ConsistentDateParameterValidator.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ConsistentDateParameterValidator.java @@ -1,10 +1,11 @@ package org.baeldung.javaxval.methodvalidation.constraints; +import java.time.LocalDate; + import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import javax.validation.constraintvalidation.SupportedValidationTarget; import javax.validation.constraintvalidation.ValidationTarget; -import java.time.LocalDate; @SupportedValidationTarget(ValidationTarget.PARAMETERS) public class ConsistentDateParameterValidator implements ConstraintValidator { diff --git a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ConsistentDateParameters.java b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ConsistentDateParameters.java index 6b321f545c..bdfabe05ba 100644 --- a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ConsistentDateParameters.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ConsistentDateParameters.java @@ -1,13 +1,15 @@ package org.baeldung.javaxval.methodvalidation.constraints; -import javax.validation.Constraint; -import javax.validation.Payload; +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.*; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import javax.validation.Constraint; +import javax.validation.Payload; @Constraint(validatedBy = ConsistentDateParameterValidator.class) @Target({ METHOD, CONSTRUCTOR }) diff --git a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ValidReservation.java b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ValidReservation.java index f9cdea1483..842f9e0621 100644 --- a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ValidReservation.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ValidReservation.java @@ -1,15 +1,16 @@ package org.baeldung.javaxval.methodvalidation.constraints; -import javax.validation.Constraint; -import javax.validation.Payload; -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - import static java.lang.annotation.ElementType.CONSTRUCTOR; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import javax.validation.Constraint; +import javax.validation.Payload; + @Constraint(validatedBy = ValidReservationValidator.class) @Target({ METHOD, CONSTRUCTOR }) @Retention(RUNTIME) diff --git a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ValidReservationValidator.java b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ValidReservationValidator.java index 7b730480ed..c139d1affc 100644 --- a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ValidReservationValidator.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/constraints/ValidReservationValidator.java @@ -1,10 +1,11 @@ package org.baeldung.javaxval.methodvalidation.constraints; -import org.baeldung.javaxval.methodvalidation.model.Reservation; +import java.time.LocalDate; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; -import java.time.LocalDate; + +import org.baeldung.javaxval.methodvalidation.model.Reservation; public class ValidReservationValidator implements ConstraintValidator { diff --git a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/Customer.java b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/Customer.java index fe9ad7080e..99a32d6277 100644 --- a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/Customer.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/Customer.java @@ -1,10 +1,10 @@ package org.baeldung.javaxval.methodvalidation.model; -import org.springframework.validation.annotation.Validated; - import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; +import org.springframework.validation.annotation.Validated; + @Validated public class Customer { diff --git a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/Reservation.java b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/Reservation.java index a8c01d2be1..5775bdd66b 100644 --- a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/Reservation.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/Reservation.java @@ -1,13 +1,14 @@ package org.baeldung.javaxval.methodvalidation.model; +import java.time.LocalDate; + +import javax.validation.Valid; +import javax.validation.constraints.Positive; + import org.baeldung.javaxval.methodvalidation.constraints.ConsistentDateParameters; import org.baeldung.javaxval.methodvalidation.constraints.ValidReservation; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.Positive; -import java.time.LocalDate; - @Validated public class Reservation { diff --git a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/ReservationManagement.java b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/ReservationManagement.java index f6fec1a15d..e480e7912d 100644 --- a/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/ReservationManagement.java +++ b/javaxval/src/main/java/org/baeldung/javaxval/methodvalidation/model/ReservationManagement.java @@ -1,17 +1,20 @@ package org.baeldung.javaxval.methodvalidation.model; +import java.time.LocalDate; +import java.util.List; + +import javax.validation.Valid; +import javax.validation.constraints.Future; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + import org.baeldung.javaxval.methodvalidation.constraints.ConsistentDateParameters; -import org.baeldung.javaxval.methodvalidation.constraints.ValidReservation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.time.LocalDate; -import java.util.List; - @Controller @Validated public class ReservationManagement { diff --git a/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/AdvanceInfo.java b/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/AdvanceInfo.java new file mode 100644 index 0000000000..9a398e9e7e --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/AdvanceInfo.java @@ -0,0 +1,5 @@ +package org.baeldung.javaxval.validationgroup; + +public interface AdvanceInfo { + +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/BasicInfo.java b/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/BasicInfo.java new file mode 100644 index 0000000000..6959f52bfa --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/BasicInfo.java @@ -0,0 +1,5 @@ +package org.baeldung.javaxval.validationgroup; + +public interface BasicInfo { + +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/CompleteInfo.java b/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/CompleteInfo.java new file mode 100644 index 0000000000..e34f318b5f --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/CompleteInfo.java @@ -0,0 +1,8 @@ +package org.baeldung.javaxval.validationgroup; + +import javax.validation.GroupSequence; + +@GroupSequence({ BasicInfo.class, AdvanceInfo.class }) +public interface CompleteInfo { + +} diff --git a/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/RegistrationForm.java b/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/RegistrationForm.java new file mode 100644 index 0000000000..190a0c1280 --- /dev/null +++ b/javaxval/src/main/java/org/baeldung/javaxval/validationgroup/RegistrationForm.java @@ -0,0 +1,110 @@ +package org.baeldung.javaxval.validationgroup; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; + +public class RegistrationForm { + @NotBlank(groups = BasicInfo.class) + private String firstName; + @NotBlank(groups = BasicInfo.class) + private String lastName; + @Email(groups = BasicInfo.class) + private String email; + @NotBlank(groups = BasicInfo.class) + private String phone; + + @NotBlank(groups = { BasicInfo.class, AdvanceInfo.class }) + private String captcha; + + @NotBlank(groups = AdvanceInfo.class) + private String street; + @NotBlank(groups = AdvanceInfo.class) + private String houseNumber; + @NotBlank(groups = AdvanceInfo.class) + private String zipCode; + @NotBlank(groups = AdvanceInfo.class) + private String city; + @NotBlank(groups = AdvanceInfo.class) + private String country; + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } + + public String getHouseNumber() { + return houseNumber; + } + + public void setHouseNumber(String houseNumber) { + this.houseNumber = houseNumber; + } + + public String getZipCode() { + return zipCode; + } + + public void setZipCode(String zipCode) { + this.zipCode = zipCode; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getCaptcha() { + return captcha; + } + + public void setCaptcha(String captcha) { + this.captcha = captcha; + } + +} diff --git a/javaxval/src/main/resources/META-INF/services/javax.validation.valueextraction.ValueExtractor b/javaxval/src/main/resources/META-INF/services/javax.validation.valueextraction.ValueExtractor index e77a30cfe4..16bacf1097 100644 --- a/javaxval/src/main/resources/META-INF/services/javax.validation.valueextraction.ValueExtractor +++ b/javaxval/src/main/resources/META-INF/services/javax.validation.valueextraction.ValueExtractor @@ -1 +1 @@ -org.baeldung.valueextractors.ProfileValueExtractor \ No newline at end of file +org.baeldung.javaxval.container.validation.valueextractors.ProfileValueExtractor \ No newline at end of file diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/bigdecimal/InvoiceUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/bigdecimal/InvoiceUnitTest.java deleted file mode 100644 index 860177f4c9..0000000000 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/bigdecimal/InvoiceUnitTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.baeldung.javabeanconstraints.bigdecimal; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.math.BigDecimal; -import java.util.Set; - -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; - -import org.junit.BeforeClass; -import org.junit.Test; - -public class InvoiceUnitTest { - - private static Validator validator; - - @BeforeClass - public static void setupValidatorInstance() { - validator = Validation.buildDefaultValidatorFactory().getValidator(); - } - - @Test - public void whenPriceIntegerDigitLessThanThreeWithDecimalValue_thenShouldGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(10.21), "Book purchased"); - Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action-> assertThat(action.getMessage()) - .isEqualTo("numeric value out of bounds (<3 digits>.<2 digits> expected)")); - } - - @Test - public void whenPriceIntegerDigitLessThanThreeWithIntegerValue_thenShouldNotGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(10), "Book purchased"); - Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(0); - } - - @Test - public void whenPriceIntegerDigitGreaterThanThree_thenShouldGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(1021.21), "Book purchased"); - Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action-> assertThat(action.getMessage()) - .isEqualTo("numeric value out of bounds (<3 digits>.<2 digits> expected)")); - } - - @Test - public void whenPriceIsZero_thenShouldGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(000.00), "Book purchased"); - Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action-> assertThat(action.getMessage()) - .isEqualTo("must be greater than 0.0")); - } - - @Test - public void whenPriceIsGreaterThanZero_thenShouldNotGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(100.50), "Book purchased"); - Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(0); - } - -} diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationFormUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationFormUnitTest.java deleted file mode 100644 index bd7034476e..0000000000 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationFormUnitTest.java +++ /dev/null @@ -1,137 +0,0 @@ -package org.baeldung.javabeanconstraints.validationgroup; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.Set; - -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; - -import org.junit.BeforeClass; -import org.junit.Test; - -public class RegistrationFormUnitTest { - private static Validator validator; - - @BeforeClass - public static void setupValidatorInstance() { - validator = Validation.buildDefaultValidatorFactory().getValidator(); - } - - @Test - public void whenBasicInfoIsNotComplete_thenShouldGiveConstraintViolationsOnlyForBasicInfo() { - RegistrationForm form = buildRegistrationFormWithBasicInfo(); - form.setFirstName(""); - Set> violations = validator.validate(form, BasicInfo.class); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action -> { - assertThat(action.getMessage()).isEqualTo("must not be blank"); - assertThat(action.getPropertyPath().toString()).isEqualTo("firstName"); - }); - } - - @Test - public void whenAdvanceInfoIsNotComplete_thenShouldGiveConstraintViolationsOnlyForAdvanceInfo() { - RegistrationForm form = buildRegistrationFormWithAdvanceInfo(); - form.setZipCode(""); - Set> violations = validator.validate(form, AdvanceInfo.class); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action -> { - assertThat(action.getMessage()).isEqualTo("must not be blank"); - assertThat(action.getPropertyPath().toString()).isEqualTo("zipCode"); - }); - } - - @Test - public void whenCaptchaIsBlank_thenShouldGiveConstraintViolationsForBasicInfo() { - RegistrationForm form = buildRegistrationFormWithBasicInfo(); - form.setCaptcha(""); - Set> violations = validator.validate(form, BasicInfo.class); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action -> { - assertThat(action.getMessage()).isEqualTo("must not be blank"); - assertThat(action.getPropertyPath().toString()).isEqualTo("captcha"); - }); - } - - @Test - public void whenCaptchaIsBlank_thenShouldGiveConstraintViolationsForAdvanceInfo() { - RegistrationForm form = buildRegistrationFormWithAdvanceInfo(); - form.setCaptcha(""); - Set> violations = validator.validate(form, AdvanceInfo.class); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action -> { - assertThat(action.getMessage()).isEqualTo("must not be blank"); - assertThat(action.getPropertyPath().toString()).isEqualTo("captcha"); - }); - } - - @Test - public void whenBasicInfoIsNotComplete_thenShouldGiveConstraintViolationsForBasicInfoOnly() { - RegistrationForm form = buildRegistrationFormWithBasicInfo(); - form.setFirstName(""); - Set> violations = validator.validate(form, CompleteInfo.class); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action -> { - assertThat(action.getMessage()).isEqualTo("must not be blank"); - assertThat(action.getPropertyPath().toString()).isEqualTo("firstName"); - }); - } - - @Test - public void whenBasicInfoIsCompleteAndAdvanceInfoIsNotComplete_thenShouldGiveConstraintViolationsForAdvanceInfo() { - RegistrationForm form = buildRegistrationFormWithBasicAndAdvanceInfo(); - form.setZipCode(""); - Set> violations = validator.validate(form, CompleteInfo.class); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action -> { - assertThat(action.getMessage()).isEqualTo("must not be blank"); - assertThat(action.getPropertyPath().toString()).isEqualTo("zipCode"); - }); - } - - @Test - public void whenBasicAndAdvanceInfoIsComplete_thenShouldNotGiveConstraintViolationsWithCompleteInfoValidationGroup() { - RegistrationForm form = buildRegistrationFormWithBasicAndAdvanceInfo(); - Set> violations = validator.validate(form, CompleteInfo.class); - assertThat(violations.size()).isEqualTo(0); - } - - @Test - public void whenBasicAndAdvanceInfoIsComplete_thenShouldNotGiveConstraintViolations() { - RegistrationForm form = buildRegistrationFormWithBasicAndAdvanceInfo(); - Set> violations = validator.validate(form); - assertThat(violations.size()).isEqualTo(0); - } - - private RegistrationForm buildRegistrationFormWithBasicInfo() { - RegistrationForm form = new RegistrationForm(); - form.setFirstName("devender"); - form.setLastName("kumar"); - form.setEmail("anyemail@yopmail.com"); - form.setPhone("12345"); - form.setCaptcha("Y2HAhU5T"); - return form; - } - - private RegistrationForm buildRegistrationFormWithAdvanceInfo() { - RegistrationForm form = new RegistrationForm(); - return populateAdvanceInfo(form); - } - - private RegistrationForm populateAdvanceInfo(RegistrationForm form) { - form.setCity("Berlin"); - form.setContry("DE"); - form.setStreet("alexa str."); - form.setZipCode("19923"); - form.setHouseNumber("2a"); - form.setCaptcha("Y2HAhU5T"); - return form; - } - - private RegistrationForm buildRegistrationFormWithBasicAndAdvanceInfo() { - RegistrationForm form = buildRegistrationFormWithBasicInfo(); - return populateAdvanceInfo(form); - } -} diff --git a/javaxval/src/test/java/org/baeldung/javaxval/LocaleAwareUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/LocaleAwareUnitTest.java new file mode 100644 index 0000000000..5623b50a72 --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javaxval/LocaleAwareUnitTest.java @@ -0,0 +1,23 @@ +package org.baeldung.javaxval; + +import java.util.Locale; + +import org.junit.AfterClass; +import org.junit.BeforeClass; + +public abstract class LocaleAwareUnitTest { + private static Locale previousDefault; + + @BeforeClass + public static void setupLocale() { + previousDefault = Locale.getDefault(); + + Locale.setDefault(Locale.US); + } + + @AfterClass + public static void resetLocale() { + Locale.setDefault(previousDefault); + } + +} diff --git a/javaxval/src/test/java/org/baeldung/javaxval/beanvalidation/ValidationIntegrationTest.java b/javaxval/src/test/java/org/baeldung/javaxval/beanvalidation/ValidationIntegrationTest.java index 6639d60ac6..3d54955177 100644 --- a/javaxval/src/test/java/org/baeldung/javaxval/beanvalidation/ValidationIntegrationTest.java +++ b/javaxval/src/test/java/org/baeldung/javaxval/beanvalidation/ValidationIntegrationTest.java @@ -94,7 +94,7 @@ public class ValidationIntegrationTest { Set> violations = validator.validate(user); assertEquals(1, violations.size()); } - + @Test public void givenBlankPreference_thenValidationFails() { User user = createUser(); @@ -107,18 +107,18 @@ public class ValidationIntegrationTest { @Test public void givenEmptyOptional_thenValidationSucceeds() { User user = createUser(); - - Set> violations = validator.validate(user); - assertEquals(0, violations.size()); - } - - @Test - public void givenPastDateOfBirth_thenValidationSuccess() { - User user = createUser(); - user.setDateOfBirth(LocalDate.of(1980, 5, 20)); Set> violations = validator.validate(user); assertEquals(0, violations.size()); - + } + + @Test + public void givenPastDateOfBirth_thenValidationSuccess() { + User user = createUser(); + user.setDateOfBirth(LocalDate.of(1980, 5, 20)); + + Set> violations = validator.validate(user); + assertEquals(0, violations.size()); + } } diff --git a/javaxval/src/test/java/org/baeldung/javaxval/bigdecimal/InvoiceUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/bigdecimal/InvoiceUnitTest.java new file mode 100644 index 0000000000..6a53d67f30 --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javaxval/bigdecimal/InvoiceUnitTest.java @@ -0,0 +1,64 @@ +package org.baeldung.javaxval.bigdecimal; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.math.BigDecimal; +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.LocaleAwareUnitTest; +import org.junit.BeforeClass; +import org.junit.Test; + +public class InvoiceUnitTest extends LocaleAwareUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + } + + @Test + public void whenPriceIntegerDigitLessThanThreeWithDecimalValue_thenShouldGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal(10.21), "Book purchased"); + Set> violations = validator.validate(invoice); + assertThat(violations.size()).isEqualTo(1); + violations.forEach(action -> assertThat(action.getMessage()).isEqualTo("numeric value out of bounds (<3 digits>.<2 digits> expected)")); + } + + @Test + public void whenPriceIntegerDigitLessThanThreeWithIntegerValue_thenShouldNotGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal(10), "Book purchased"); + Set> violations = validator.validate(invoice); + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenPriceIntegerDigitGreaterThanThree_thenShouldGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal(1021.21), "Book purchased"); + Set> violations = validator.validate(invoice); + assertThat(violations.size()).isEqualTo(1); + violations.forEach(action -> assertThat(action.getMessage()).isEqualTo("numeric value out of bounds (<3 digits>.<2 digits> expected)")); + } + + @Test + public void whenPriceIsZero_thenShouldGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal(000.00), "Book purchased"); + Set> violations = validator.validate(invoice); + assertThat(violations.size()).isEqualTo(1); + violations.forEach(action -> assertThat(action.getMessage()).isEqualTo("must be greater than 0.0")); + } + + @Test + public void whenPriceIsGreaterThanZero_thenShouldNotGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal(100.50), "Book purchased"); + Set> violations = validator.validate(invoice); + assertThat(violations.size()).isEqualTo(0); + } + +} diff --git a/javaxval/src/test/java/org/baeldung/ContainerValidationIntegrationTest.java b/javaxval/src/test/java/org/baeldung/javaxval/container/validation/ContainerValidationIntegrationTest.java similarity index 91% rename from javaxval/src/test/java/org/baeldung/ContainerValidationIntegrationTest.java rename to javaxval/src/test/java/org/baeldung/javaxval/container/validation/ContainerValidationIntegrationTest.java index dff02ff13d..25c8111732 100644 --- a/javaxval/src/test/java/org/baeldung/ContainerValidationIntegrationTest.java +++ b/javaxval/src/test/java/org/baeldung/javaxval/container/validation/ContainerValidationIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung; +package org.baeldung.javaxval.container.validation; import static org.junit.Assert.assertEquals; @@ -10,8 +10,8 @@ import javax.validation.ConstraintViolation; import javax.validation.Validation; import javax.validation.Validator; import javax.validation.ValidatorFactory; -import org.baeldung.valueextractors.ProfileValueExtractor; +import org.baeldung.javaxval.container.validation.valueextractors.ProfileValueExtractor; import org.junit.Before; import org.junit.Test; @@ -20,8 +20,10 @@ public class ContainerValidationIntegrationTest { @Before public void setup() { - ValidatorFactory factory = Validation.byDefaultProvider().configure() - .addValueExtractor(new ProfileValueExtractor()).buildValidatorFactory(); + ValidatorFactory factory = Validation.byDefaultProvider() + .configure() + .addValueExtractor(new ProfileValueExtractor()) + .buildValidatorFactory(); validator = factory.getValidator(); } @@ -74,7 +76,7 @@ public class ContainerValidationIntegrationTest { assertEquals(0, violations.size()); } - //@Test + @Test public void whenProfileCompanyNameBlank_thenValidationFails() { Customer customer = new Customer(); customer.setName("John"); diff --git a/javaxval/src/test/java/org/baeldung/javaxval/enums/CustomerTypeSubSetValidatorUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/enums/CustomerTypeSubSetValidatorUnitTest.java new file mode 100644 index 0000000000..5aae504b23 --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javaxval/enums/CustomerTypeSubSetValidatorUnitTest.java @@ -0,0 +1,45 @@ +package org.baeldung.javaxval.enums; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.enums.demo.Customer; +import org.baeldung.javaxval.enums.demo.CustomerType; +import org.baeldung.javaxval.enums.demo.CustomerUnitTest; +import org.junit.BeforeClass; +import org.junit.Test; + +public class CustomerTypeSubSetValidatorUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + } + + @Test + public void whenEnumAnyOfSubset_thenShouldNotReportConstraintViolations() { + Customer customer = new Customer.Builder().withCustomerTypeOfSubset(CustomerType.NEW) + .build(); + Set> violations = validator.validate(customer); + assertThat(violations.isEmpty()).isTrue(); + } + + @Test + public void whenEnumNotAnyOfSubset_thenShouldGiveOccurrenceOfConstraintViolations() { + Customer customer = new Customer.Builder().withCustomerTypeOfSubset(CustomerType.DEFAULT) + .build(); + Set> violations = validator.validate(customer); + assertThat(violations.size()).isEqualTo(1); + + assertThat(violations).anyMatch(CustomerUnitTest.havingPropertyPath("customerTypeOfSubset") + .and(CustomerUnitTest.havingMessage("must be any of [NEW, OLD]"))); + } +} \ No newline at end of file diff --git a/javaxval/src/test/java/org/baeldung/javaxval/enums/EnumNamePatternValidatorUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/enums/EnumNamePatternValidatorUnitTest.java new file mode 100644 index 0000000000..48f7de2c34 --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javaxval/enums/EnumNamePatternValidatorUnitTest.java @@ -0,0 +1,54 @@ +package org.baeldung.javaxval.enums; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.baeldung.javaxval.enums.demo.CustomerType.DEFAULT; +import static org.baeldung.javaxval.enums.demo.CustomerType.OLD; + +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.enums.demo.Customer; +import org.baeldung.javaxval.enums.demo.CustomerUnitTest; +import org.junit.BeforeClass; +import org.junit.Test; + +public class EnumNamePatternValidatorUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + } + + @Test + public void whenEnumMatchesRegex_thenShouldNotReportConstraintViolations() { + Customer customer = new Customer.Builder().withCustomerTypeMatchesPattern(DEFAULT) + .build(); + Set> violations = validator.validate(customer); + assertThat(violations.isEmpty()).isTrue(); + } + + @Test + public void whenEnumNull_thenShouldNotReportConstraintViolations() { + Customer customer = new Customer.Builder().withCustomerTypeMatchesPattern(null) + .build(); + Set> violations = validator.validate(customer); + assertThat(violations.isEmpty()).isTrue(); + } + + @Test + public void whenEnumDoesNotMatchRegex_thenShouldGiveOccurrenceOfConstraintViolations() { + Customer customer = new Customer.Builder().withCustomerTypeMatchesPattern(OLD) + .build(); + Set> violations = validator.validate(customer); + assertThat(violations.size()).isEqualTo(1); + + assertThat(violations).anyMatch(CustomerUnitTest.havingPropertyPath("customerTypeMatchesPattern") + .and(CustomerUnitTest.havingMessage("must match \"NEW|DEFAULT\""))); + } +} \ No newline at end of file diff --git a/javaxval/src/test/java/org/baeldung/javaxval/enums/ValueOfEnumValidatorUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/enums/ValueOfEnumValidatorUnitTest.java new file mode 100644 index 0000000000..0784b58b77 --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javaxval/enums/ValueOfEnumValidatorUnitTest.java @@ -0,0 +1,52 @@ +package org.baeldung.javaxval.enums; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.enums.demo.Customer; +import org.baeldung.javaxval.enums.demo.CustomerUnitTest; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ValueOfEnumValidatorUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + } + + @Test + public void whenStringAnyOfEnum_thenShouldNotReportConstraintViolations() { + Customer customer = new Customer.Builder().withCustomerTypeString("DEFAULT") + .build(); + Set> violations = validator.validate(customer); + assertThat(violations.isEmpty()).isTrue(); + } + + @Test + public void whenStringNull_thenShouldNotReportConstraintViolations() { + Customer customer = new Customer.Builder().withCustomerTypeString(null) + .build(); + Set> violations = validator.validate(customer); + assertThat(violations.isEmpty()).isTrue(); + } + + @Test + public void whenStringNotAnyOfEnum_thenShouldGiveOccurrenceOfConstraintViolations() { + Customer customer = new Customer.Builder().withCustomerTypeString("test") + .build(); + Set> violations = validator.validate(customer); + assertThat(violations.size()).isEqualTo(1); + + assertThat(violations).anyMatch(CustomerUnitTest.havingPropertyPath("customerTypeString") + .and(CustomerUnitTest.havingMessage("must be any of enum class org.baeldung.javaxval.enums.demo.CustomerType"))); + } +} \ No newline at end of file diff --git a/javaxval/src/test/java/org/baeldung/javaxval/enums/demo/CustomerUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/enums/demo/CustomerUnitTest.java new file mode 100644 index 0000000000..6a064b640f --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javaxval/enums/demo/CustomerUnitTest.java @@ -0,0 +1,66 @@ +package org.baeldung.javaxval.enums.demo; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Set; +import java.util.function.Predicate; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.LocaleAwareUnitTest; +import org.junit.BeforeClass; +import org.junit.Test; + +public class CustomerUnitTest extends LocaleAwareUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + } + + @Test + public void whenAllAcceptable_thenShouldNotGiveConstraintViolations() { + Customer customer = new Customer(); + customer.setCustomerTypeOfSubset(CustomerType.NEW); + Set> violations = validator.validate(customer); + assertThat(violations).isEmpty(); + } + + @Test + public void whenAllNull_thenOnlyNotNullShouldGiveConstraintViolations() { + Customer customer = new Customer(); + Set> violations = validator.validate(customer); + assertThat(violations.size()).isEqualTo(1); + + assertThat(violations).anyMatch(havingPropertyPath("customerTypeOfSubset").and(havingMessage("must not be null"))); + } + + @Test + public void whenAllInvalid_thenViolationsShouldBeReported() { + Customer customer = new Customer(); + customer.setCustomerTypeString("invalid"); + customer.setCustomerTypeOfSubset(CustomerType.DEFAULT); + customer.setCustomerTypeMatchesPattern(CustomerType.OLD); + + Set> violations = validator.validate(customer); + assertThat(violations.size()).isEqualTo(3); + + assertThat(violations).anyMatch(havingPropertyPath("customerTypeString").and(havingMessage("must be any of enum class org.baeldung.javaxval.enums.demo.CustomerType"))); + assertThat(violations).anyMatch(havingPropertyPath("customerTypeOfSubset").and(havingMessage("must be any of [NEW, OLD]"))); + assertThat(violations).anyMatch(havingPropertyPath("customerTypeMatchesPattern").and(havingMessage("must match \"NEW|DEFAULT\""))); + } + + public static Predicate> havingMessage(String message) { + return l -> message.equals(l.getMessage()); + } + + public static Predicate> havingPropertyPath(String propertyPath) { + return l -> propertyPath.equals(l.getPropertyPath() + .toString()); + } +} \ No newline at end of file diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/javabeanconstraints/test/UserNotBlankUnitTest.java similarity index 82% rename from javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java rename to javaxval/src/test/java/org/baeldung/javaxval/javabeanconstraints/test/UserNotBlankUnitTest.java index 954833fef1..e3a51d4e27 100644 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotBlankUnitTest.java +++ b/javaxval/src/test/java/org/baeldung/javaxval/javabeanconstraints/test/UserNotBlankUnitTest.java @@ -1,63 +1,67 @@ -package org.baeldung.javabeanconstraints.test; - -import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; -import static org.assertj.core.api.Assertions.assertThat; -import org.baeldung.javabeanconstraints.entities.UserNotBlank; -import org.junit.BeforeClass; -import org.junit.Test; - -public class UserNotBlankUnitTest { - - private static Validator validator; - - @BeforeClass - public static void setupValidatorInstance() { - validator = Validation.buildDefaultValidatorFactory().getValidator(); - } - - @Test - public void whenNotBlankName_thenNoConstraintViolations() { - UserNotBlank user = new UserNotBlank("John"); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(0); - } - - @Test - public void whenBlankName_thenOneConstraintViolation() { - UserNotBlank user = new UserNotBlank(" "); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(1); - } - - @Test - public void whenEmptyName_thenOneConstraintViolation() { - UserNotBlank user = new UserNotBlank(""); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(1); - } - - @Test - public void whenNullName_thenOneConstraintViolation() { - UserNotBlank user = new UserNotBlank(null); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(1); - } - - @Test - public void whenToString_thenCorrect() { - UserNotBlank user = new UserNotBlank("John"); - - assertThat(user.toString()).isEqualTo("User{name=John}"); - } -} +package org.baeldung.javaxval.javabeanconstraints.test; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.javabeanconstraints.entities.UserNotBlank; +import org.junit.BeforeClass; +import org.junit.Test; + +public class UserNotBlankUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + } + + @Test + public void whenNotBlankName_thenNoConstraintViolations() { + UserNotBlank user = new UserNotBlank("John"); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenBlankName_thenOneConstraintViolation() { + UserNotBlank user = new UserNotBlank(" "); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenEmptyName_thenOneConstraintViolation() { + UserNotBlank user = new UserNotBlank(""); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenNullName_thenOneConstraintViolation() { + UserNotBlank user = new UserNotBlank(null); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenToString_thenCorrect() { + UserNotBlank user = new UserNotBlank("John"); + + assertThat(user.toString()).isEqualTo("User{name=John}"); + } +} diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/javabeanconstraints/test/UserNotEmptyUnitTest.java similarity index 80% rename from javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java rename to javaxval/src/test/java/org/baeldung/javaxval/javabeanconstraints/test/UserNotEmptyUnitTest.java index c2675ed8b6..22fbab6997 100644 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotEmptyUnitTest.java +++ b/javaxval/src/test/java/org/baeldung/javaxval/javabeanconstraints/test/UserNotEmptyUnitTest.java @@ -1,54 +1,58 @@ -package org.baeldung.javabeanconstraints.test; - -import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; -import static org.assertj.core.api.Assertions.assertThat; -import org.baeldung.javabeanconstraints.entities.UserNotEmpty; -import org.junit.BeforeClass; -import org.junit.Test; - -public class UserNotEmptyUnitTest { - - private static Validator validator; - - @BeforeClass - public static void setupValidatorInstance() { - validator = Validation.buildDefaultValidatorFactory().getValidator(); - } - - @Test - public void whenNotEmptyName_thenNoConstraintViolations() { - UserNotEmpty user = new UserNotEmpty("John"); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(0); - } - - @Test - public void whenEmptyName_thenOneConstraintViolation() { - UserNotEmpty user = new UserNotEmpty(""); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(1); - } - - @Test - public void whenNullName_thenOneConstraintViolation() { - UserNotEmpty user = new UserNotEmpty(null); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(1); - } - - @Test - public void whenToString_thenCorrect() { - UserNotEmpty user = new UserNotEmpty("John"); - - assertThat(user.toString()).isEqualTo("User{name=John}"); - } -} +package org.baeldung.javaxval.javabeanconstraints.test; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.javabeanconstraints.entities.UserNotEmpty; +import org.junit.BeforeClass; +import org.junit.Test; + +public class UserNotEmptyUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + } + + @Test + public void whenNotEmptyName_thenNoConstraintViolations() { + UserNotEmpty user = new UserNotEmpty("John"); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenEmptyName_thenOneConstraintViolation() { + UserNotEmpty user = new UserNotEmpty(""); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenNullName_thenOneConstraintViolation() { + UserNotEmpty user = new UserNotEmpty(null); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenToString_thenCorrect() { + UserNotEmpty user = new UserNotEmpty("John"); + + assertThat(user.toString()).isEqualTo("User{name=John}"); + } +} diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/javabeanconstraints/test/UserNotNullUnitTest.java similarity index 81% rename from javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java rename to javaxval/src/test/java/org/baeldung/javaxval/javabeanconstraints/test/UserNotNullUnitTest.java index 3dd1811947..a684668ae3 100644 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/test/UserNotNullUnitTest.java +++ b/javaxval/src/test/java/org/baeldung/javaxval/javabeanconstraints/test/UserNotNullUnitTest.java @@ -1,54 +1,58 @@ -package org.baeldung.javabeanconstraints.test; - -import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; -import static org.assertj.core.api.Assertions.assertThat; -import org.baeldung.javabeanconstraints.entities.UserNotNull; -import org.junit.BeforeClass; -import org.junit.Test; - -public class UserNotNullUnitTest { - - private static Validator validator; - - @BeforeClass - public static void setupValidatorInstance() { - validator = Validation.buildDefaultValidatorFactory().getValidator(); - } - - @Test - public void whenNotNullName_thenNoConstraintViolations() { - UserNotNull user = new UserNotNull("John"); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(0); - } - - @Test - public void whenNullName_thenOneConstraintViolation() { - UserNotNull user = new UserNotNull(null); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(1); - } - - @Test - public void whenEmptyName_thenNoConstraintViolations() { - UserNotNull user = new UserNotNull(""); - - Set> violations = validator.validate(user); - - assertThat(violations.size()).isEqualTo(0); - } - - @Test - public void whenToString_thenCorrect() { - UserNotNull user = new UserNotNull("John"); - - assertThat(user.toString()).isEqualTo("User{name=John}"); - } -} +package org.baeldung.javaxval.javabeanconstraints.test; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.javabeanconstraints.entities.UserNotNull; +import org.junit.BeforeClass; +import org.junit.Test; + +public class UserNotNullUnitTest { + + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + } + + @Test + public void whenNotNullName_thenNoConstraintViolations() { + UserNotNull user = new UserNotNull("John"); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenNullName_thenOneConstraintViolation() { + UserNotNull user = new UserNotNull(null); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(1); + } + + @Test + public void whenEmptyName_thenNoConstraintViolations() { + UserNotNull user = new UserNotNull(""); + + Set> violations = validator.validate(user); + + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenToString_thenCorrect() { + UserNotNull user = new UserNotNull("John"); + + assertThat(user.toString()).isEqualTo("User{name=John}"); + } +} diff --git a/javaxval/src/test/java/org/baeldung/javaxval/messageinterpolator/ParameterMessageInterpolaterIntegrationTest.java b/javaxval/src/test/java/org/baeldung/javaxval/messageinterpolator/ParameterMessageInterpolaterIntegrationTest.java new file mode 100644 index 0000000000..6ecb916ab4 --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javaxval/messageinterpolator/ParameterMessageInterpolaterIntegrationTest.java @@ -0,0 +1,70 @@ +package org.baeldung.javaxval.messageinterpolator; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import javax.validation.ValidatorFactory; + +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ParameterMessageInterpolaterIntegrationTest { + + private static Validator validator; + + @BeforeClass + public static void beforeClass() { + ValidatorFactory validatorFactory = Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory(); + + validator = validatorFactory.getValidator(); + } + + @Test + public void givenNameLengthLessThanMin_whenValidate_thenValidationFails() { + Person person = new Person(); + person.setName("John Doe"); + person.setAge(18); + + Set> violations = validator.validate(person); + assertEquals(1, violations.size()); + + ConstraintViolation violation = violations.iterator().next(); + assertEquals("Name should be between 10 and 100 characters", violation.getMessage()); + } + + @Test + public void givenAgeIsLessThanMin_whenValidate_thenValidationFails() { + Person person = new Person(); + person.setName("John Stephaner Doe"); + person.setAge(16); + + Set> violations = validator.validate(person); + assertEquals(1, violations.size()); + + ConstraintViolation violation = violations.iterator().next(); + assertEquals("Age should not be less than 18", violation.getMessage()); + } + + @Test + public void givenEmailIsMalformed_whenValidate_thenValidationFails() { + Person person = new Person(); + person.setName("John Stephaner Doe"); + person.setAge(18); + person.setEmail("johndoe.dev"); + + Set> violations = validator.validate(person); + assertEquals(1, violations.size()); + + ConstraintViolation violation = violations.iterator().next(); + assertEquals("Email address should be in a correct format: ${validatedValue}", violation.getMessage()); + } + +} diff --git a/javaxval/src/test/java/org/baeldung/javaxval/methodvalidation/ContainerValidationIntegrationTest.java b/javaxval/src/test/java/org/baeldung/javaxval/methodvalidation/ContainerValidationIntegrationTest.java index 2363bf8f5d..8febdca0ee 100644 --- a/javaxval/src/test/java/org/baeldung/javaxval/methodvalidation/ContainerValidationIntegrationTest.java +++ b/javaxval/src/test/java/org/baeldung/javaxval/methodvalidation/ContainerValidationIntegrationTest.java @@ -1,5 +1,10 @@ package org.baeldung.javaxval.methodvalidation; +import java.time.LocalDate; +import java.util.List; + +import javax.validation.ConstraintViolationException; + import org.baeldung.javaxval.methodvalidation.model.Customer; import org.baeldung.javaxval.methodvalidation.model.Reservation; import org.baeldung.javaxval.methodvalidation.model.ReservationManagement; @@ -12,10 +17,6 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; -import javax.validation.ConstraintViolationException; -import java.time.LocalDate; -import java.util.List; - @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { MethodValidationConfig.class }, loader = AnnotationConfigContextLoader.class) public class ContainerValidationIntegrationTest { diff --git a/javaxval/src/test/java/org/baeldung/javaxval/methodvalidation/ValidationIntegrationTest.java b/javaxval/src/test/java/org/baeldung/javaxval/methodvalidation/ValidationIntegrationTest.java index 6b53d3a107..9baeba7189 100644 --- a/javaxval/src/test/java/org/baeldung/javaxval/methodvalidation/ValidationIntegrationTest.java +++ b/javaxval/src/test/java/org/baeldung/javaxval/methodvalidation/ValidationIntegrationTest.java @@ -1,21 +1,23 @@ package org.baeldung.javaxval.methodvalidation; +import static org.junit.Assert.assertEquals; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.time.LocalDate; +import java.util.Collections; +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.ValidatorFactory; +import javax.validation.executable.ExecutableValidator; + import org.baeldung.javaxval.methodvalidation.model.Customer; import org.baeldung.javaxval.methodvalidation.model.Reservation; import org.baeldung.javaxval.methodvalidation.model.ReservationManagement; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.*; - -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.ValidatorFactory; -import javax.validation.executable.ExecutableValidator; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.time.LocalDate; -import java.util.Collections; -import java.util.Set; public class ValidationIntegrationTest { diff --git a/javaxval/src/test/java/org/baeldung/javaxval/validationgroup/RegistrationFormUnitTest.java b/javaxval/src/test/java/org/baeldung/javaxval/validationgroup/RegistrationFormUnitTest.java new file mode 100644 index 0000000000..df70ca0bce --- /dev/null +++ b/javaxval/src/test/java/org/baeldung/javaxval/validationgroup/RegistrationFormUnitTest.java @@ -0,0 +1,145 @@ +package org.baeldung.javaxval.validationgroup; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Set; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; + +import org.baeldung.javaxval.LocaleAwareUnitTest; +import org.junit.BeforeClass; +import org.junit.Test; + +public class RegistrationFormUnitTest extends LocaleAwareUnitTest { + private static Validator validator; + + @BeforeClass + public static void setupValidatorInstance() { + validator = Validation.buildDefaultValidatorFactory() + .getValidator(); + } + + @Test + public void whenBasicInfoIsNotComplete_thenShouldGiveConstraintViolationsOnlyForBasicInfo() { + RegistrationForm form = buildRegistrationFormWithBasicInfo(); + form.setFirstName(""); + Set> violations = validator.validate(form, BasicInfo.class); + assertThat(violations.size()).isEqualTo(1); + violations.forEach(action -> { + assertThat(action.getMessage()).isEqualTo("must not be blank"); + assertThat(action.getPropertyPath() + .toString()).isEqualTo("firstName"); + }); + } + + @Test + public void whenAdvanceInfoIsNotComplete_thenShouldGiveConstraintViolationsOnlyForAdvanceInfo() { + RegistrationForm form = buildRegistrationFormWithAdvanceInfo(); + form.setZipCode(""); + Set> violations = validator.validate(form, AdvanceInfo.class); + assertThat(violations.size()).isEqualTo(1); + violations.forEach(action -> { + assertThat(action.getMessage()).isEqualTo("must not be blank"); + assertThat(action.getPropertyPath() + .toString()).isEqualTo("zipCode"); + }); + } + + @Test + public void whenCaptchaIsBlank_thenShouldGiveConstraintViolationsForBasicInfo() { + RegistrationForm form = buildRegistrationFormWithBasicInfo(); + form.setCaptcha(""); + Set> violations = validator.validate(form, BasicInfo.class); + assertThat(violations.size()).isEqualTo(1); + violations.forEach(action -> { + assertThat(action.getMessage()).isEqualTo("must not be blank"); + assertThat(action.getPropertyPath() + .toString()).isEqualTo("captcha"); + }); + } + + @Test + public void whenCaptchaIsBlank_thenShouldGiveConstraintViolationsForAdvanceInfo() { + RegistrationForm form = buildRegistrationFormWithAdvanceInfo(); + form.setCaptcha(""); + Set> violations = validator.validate(form, AdvanceInfo.class); + assertThat(violations.size()).isEqualTo(1); + violations.forEach(action -> { + assertThat(action.getMessage()).isEqualTo("must not be blank"); + assertThat(action.getPropertyPath() + .toString()).isEqualTo("captcha"); + }); + } + + @Test + public void whenBasicInfoIsNotComplete_thenShouldGiveConstraintViolationsForBasicInfoOnly() { + RegistrationForm form = buildRegistrationFormWithBasicInfo(); + form.setFirstName(""); + Set> violations = validator.validate(form, CompleteInfo.class); + assertThat(violations.size()).isEqualTo(1); + violations.forEach(action -> { + assertThat(action.getMessage()).isEqualTo("must not be blank"); + assertThat(action.getPropertyPath() + .toString()).isEqualTo("firstName"); + }); + } + + @Test + public void whenBasicInfoIsCompleteAndAdvanceInfoIsNotComplete_thenShouldGiveConstraintViolationsForAdvanceInfo() { + RegistrationForm form = buildRegistrationFormWithBasicAndAdvanceInfo(); + form.setZipCode(""); + Set> violations = validator.validate(form, CompleteInfo.class); + assertThat(violations.size()).isEqualTo(1); + violations.forEach(action -> { + assertThat(action.getMessage()).isEqualTo("must not be blank"); + assertThat(action.getPropertyPath() + .toString()).isEqualTo("zipCode"); + }); + } + + @Test + public void whenBasicAndAdvanceInfoIsComplete_thenShouldNotGiveConstraintViolationsWithCompleteInfoValidationGroup() { + RegistrationForm form = buildRegistrationFormWithBasicAndAdvanceInfo(); + Set> violations = validator.validate(form, CompleteInfo.class); + assertThat(violations.size()).isEqualTo(0); + } + + @Test + public void whenBasicAndAdvanceInfoIsComplete_thenShouldNotGiveConstraintViolations() { + RegistrationForm form = buildRegistrationFormWithBasicAndAdvanceInfo(); + Set> violations = validator.validate(form); + assertThat(violations.size()).isEqualTo(0); + } + + private RegistrationForm buildRegistrationFormWithBasicInfo() { + RegistrationForm form = new RegistrationForm(); + form.setFirstName("devender"); + form.setLastName("kumar"); + form.setEmail("anyemail@yopmail.com"); + form.setPhone("12345"); + form.setCaptcha("Y2HAhU5T"); + return form; + } + + private RegistrationForm buildRegistrationFormWithAdvanceInfo() { + RegistrationForm form = new RegistrationForm(); + return populateAdvanceInfo(form); + } + + private RegistrationForm populateAdvanceInfo(RegistrationForm form) { + form.setCity("Berlin"); + form.setCountry("DE"); + form.setStreet("alexa str."); + form.setZipCode("19923"); + form.setHouseNumber("2a"); + form.setCaptcha("Y2HAhU5T"); + return form; + } + + private RegistrationForm buildRegistrationFormWithBasicAndAdvanceInfo() { + RegistrationForm form = buildRegistrationFormWithBasicInfo(); + return populateAdvanceInfo(form); + } +} diff --git a/jaxb/README.md b/jaxb/README.md index 4b603fca00..a471ccd39d 100644 --- a/jaxb/README.md +++ b/jaxb/README.md @@ -1,2 +1,7 @@ +## JAXB + +This module contains articles about JAXB. + ### Relevant Articles: -- [Guide to JAXB](http://www.baeldung.com/jaxb) +- [Guide to JAXB](https://www.baeldung.com/jaxb) +- [Unmarshalling Dates Using JAXB](https://www.baeldung.com/jaxb-unmarshalling-dates) diff --git a/jee-7-security/README.md b/jee-7-security/README.md index 314de6d957..ced2beec46 100644 --- a/jee-7-security/README.md +++ b/jee-7-security/README.md @@ -1,2 +1,6 @@ +## JEE 7 Security + +This module contains articles about security in JEE 7. + ### Relevant Articles: -- [Securing Java EE with Spring Security](http://www.baeldung.com/java-ee-spring-security) +- [Securing Java EE with Spring Security](https://www.baeldung.com/java-ee-spring-security) diff --git a/jee-7/README.md b/jee-7/README.md index c57863651d..2c45fe2c67 100644 --- a/jee-7/README.md +++ b/jee-7/README.md @@ -1,9 +1,13 @@ +## JEE 7 + +This module contains articles about JEE 7. + ### Relevant Articles: -- [Scheduling in Java EE](http://www.baeldung.com/scheduling-in-java-enterprise-edition) -- [JSON Processing in Java EE 7](http://www.baeldung.com/jee7-json) -- [Converters, Listeners and Validators in Java EE 7](http://www.baeldung.com/java-ee7-converter-listener-validator) -- [Introduction to JAX-WS](http://www.baeldung.com/jax-ws) -- [A Guide to Java EE Web-Related Annotations](http://www.baeldung.com/javaee-web-annotations) -- [Introduction to Testing with Arquillian](http://www.baeldung.com/arquillian) +- [Scheduling in Java EE](https://www.baeldung.com/scheduling-in-java-enterprise-edition) +- [JSON Processing in Java EE 7](https://www.baeldung.com/jee7-json) +- [Converters, Listeners and Validators in Java EE 7](https://www.baeldung.com/java-ee7-converter-listener-validator) +- [Introduction to JAX-WS](https://www.baeldung.com/jax-ws) +- [A Guide to Java EE Web-Related Annotations](https://www.baeldung.com/javaee-web-annotations) +- [Introduction to Testing with Arquillian](https://www.baeldung.com/arquillian) - [Java EE 7 Batch Processing](https://www.baeldung.com/java-ee-7-batch-processing) - [The Difference Between CDI and EJB Singleton](https://www.baeldung.com/jee-cdi-vs-ejb-singleton) diff --git a/jee-kotlin/README.md b/jee-kotlin/README.md index 43dcd992ca..aa3aa58b4e 100644 --- a/jee-kotlin/README.md +++ b/jee-kotlin/README.md @@ -1,2 +1,6 @@ +## JEE in Kotlin + +This module contains articles about Java EE with Kotlin. + ### Relevant Articles: - [Java EE Application with Kotlin](https://www.baeldung.com/java-ee-kotlin-app) diff --git a/jee-kotlin/pom.xml b/jee-kotlin/pom.xml index 17163ba23c..60765f6bc2 100644 --- a/jee-kotlin/pom.xml +++ b/jee-kotlin/pom.xml @@ -230,7 +230,7 @@ - wildfly-remote-arquillian + wildfly-remote-arquillian-disabled org.jboss.resteasy diff --git a/jee-kotlin/src/test/kotlin/com/baeldung/jeekotlin/StudentResourceIntegrationTest.java b/jee-kotlin/src/test/kotlin/com/baeldung/jeekotlin/StudentResourceIntegrationTest.java index b91b47cb1f..d48a3a96da 100644 --- a/jee-kotlin/src/test/kotlin/com/baeldung/jeekotlin/StudentResourceIntegrationTest.java +++ b/jee-kotlin/src/test/kotlin/com/baeldung/jeekotlin/StudentResourceIntegrationTest.java @@ -36,7 +36,7 @@ public class StudentResourceIntegrationTest { .withMavenCentralRepo(true) .withClassPathResolution(true) .loadPomFromFile("pom.xml") - .resolve("org.jetbrains.kotlin:kotlin-stdlib") + .resolve("org.jetbrains.kotlin:kotlin-stdlib:1.3.41") .withTransitivity() .as(JavaArchive.class); diff --git a/jenkins/README.md b/jenkins/README.md index 6b28b61277..ba3e13cc95 100644 --- a/jenkins/README.md +++ b/jenkins/README.md @@ -1,2 +1,3 @@ +## Jenkins This is an aggregator modules for Jenkins-related modules. diff --git a/jenkins/hello-world/README.md b/jenkins/hello-world/README.md deleted file mode 100644 index da60e556df..0000000000 --- a/jenkins/hello-world/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## Relevant articles: - -- [Writing a Jenkins Plugin](http://www.baeldung.com/jenkins-custom-plugin) diff --git a/jenkins/hello-world/pom.xml b/jenkins/hello-world/pom.xml deleted file mode 100644 index f00a551173..0000000000 --- a/jenkins/hello-world/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - 4.0.0 - hello-world - 1.0-SNAPSHOT - hello-world - hpi - A sample Jenkins Hello World plugin - - - org.jenkins-ci.plugins - plugin - 2.33 - - - - - - org.jenkins-ci.plugins - structs - ${structs.version} - - - org.jenkins-ci.plugins.workflow - workflow-step-api - ${workflow-step-api.version} - test - - - org.jenkins-ci.plugins.workflow - workflow-cps - ${workflow-cps.version} - test - - - org.jenkins-ci.plugins.workflow - workflow-job - ${workflow-job.version} - test - - - org.jenkins-ci.plugins.workflow - workflow-basic-steps - ${workflow-basic-steps.version} - test - - - org.jenkins-ci.plugins.workflow - workflow-durable-task-step - ${workflow-durable-task-step.version} - test - - - org.jenkins-ci.plugins.workflow - workflow-api - ${workflow-api.version} - test - - - org.jenkins-ci.plugins.workflow - workflow-support - ${workflow-support.version} - test - - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - - 2.7.3 - - 1.7 - 2.12 - 2.39 - 2.11.2 - 2.6 - 2.13 - 2.20 - 2.14 - - - diff --git a/jenkins/plugins/README.md b/jenkins/plugins/README.md new file mode 100644 index 0000000000..cf7aa3dba8 --- /dev/null +++ b/jenkins/plugins/README.md @@ -0,0 +1,7 @@ +## Jenkins plugins + +This module contains articles about various Jenkins plugins. + +### Relevant articles: + +- [Writing a Jenkins Plugin](https://www.baeldung.com/jenkins-custom-plugin) diff --git a/jenkins/plugins/pom.xml b/jenkins/plugins/pom.xml new file mode 100644 index 0000000000..1db7cec394 --- /dev/null +++ b/jenkins/plugins/pom.xml @@ -0,0 +1,96 @@ + + + 4.0.0 + plugins + 1.0-SNAPSHOT + plugins + hpi + A sample Jenkins Hello World plugin + + + org.jenkins-ci.plugins + plugin + 2.33 + + + + + + org.jenkins-ci.plugins + structs + ${structs.version} + + + org.jenkins-ci.plugins.workflow + workflow-step-api + ${workflow-step-api.version} + test + + + org.jenkins-ci.plugins.workflow + workflow-cps + ${workflow-cps.version} + test + + + org.jenkins-ci.plugins.workflow + workflow-job + ${workflow-job.version} + test + + + org.jenkins-ci.plugins.workflow + workflow-basic-steps + ${workflow-basic-steps.version} + test + + + org.jenkins-ci.plugins.workflow + workflow-durable-task-step + ${workflow-durable-task-step.version} + test + + + org.jenkins-ci.plugins.workflow + workflow-api + ${workflow-api.version} + test + + + org.jenkins-ci.plugins.workflow + workflow-support + ${workflow-support.version} + test + + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + + 2.7.3 + + 1.7 + 2.12 + 2.39 + 2.11.2 + 2.6 + 2.13 + 2.20 + 2.14 + + + diff --git a/jenkins/hello-world/src/main/java/com/baeldung/jenkins/helloworld/ProjectStats.java b/jenkins/plugins/src/main/java/com/baeldung/jenkins/plugins/ProjectStats.java similarity index 90% rename from jenkins/hello-world/src/main/java/com/baeldung/jenkins/helloworld/ProjectStats.java rename to jenkins/plugins/src/main/java/com/baeldung/jenkins/plugins/ProjectStats.java index 67af636bb4..46899c49d1 100644 --- a/jenkins/hello-world/src/main/java/com/baeldung/jenkins/helloworld/ProjectStats.java +++ b/jenkins/plugins/src/main/java/com/baeldung/jenkins/plugins/ProjectStats.java @@ -1,4 +1,4 @@ -package com.baeldung.jenkins.helloworld; +package com.baeldung.jenkins.plugins; public class ProjectStats { diff --git a/jenkins/hello-world/src/main/java/com/baeldung/jenkins/helloworld/ProjectStatsBuildWrapper.java b/jenkins/plugins/src/main/java/com/baeldung/jenkins/plugins/ProjectStatsBuildWrapper.java similarity index 99% rename from jenkins/hello-world/src/main/java/com/baeldung/jenkins/helloworld/ProjectStatsBuildWrapper.java rename to jenkins/plugins/src/main/java/com/baeldung/jenkins/plugins/ProjectStatsBuildWrapper.java index 9a7213c76f..39500a42cb 100644 --- a/jenkins/hello-world/src/main/java/com/baeldung/jenkins/helloworld/ProjectStatsBuildWrapper.java +++ b/jenkins/plugins/src/main/java/com/baeldung/jenkins/plugins/ProjectStatsBuildWrapper.java @@ -1,4 +1,4 @@ -package com.baeldung.jenkins.helloworld; +package com.baeldung.jenkins.plugins; import hudson.Extension; import hudson.FilePath; diff --git a/spring-boot-ops/src/main/resources/logback.xml b/jenkins/plugins/src/main/resources/logback.xml similarity index 100% rename from spring-boot-ops/src/main/resources/logback.xml rename to jenkins/plugins/src/main/resources/logback.xml diff --git a/jenkins/hello-world/src/main/resources/stats.html b/jenkins/plugins/src/main/resources/stats.html similarity index 100% rename from jenkins/hello-world/src/main/resources/stats.html rename to jenkins/plugins/src/main/resources/stats.html diff --git a/jersey/README.md b/jersey/README.md index 126dc542ba..366e7665f3 100644 --- a/jersey/README.md +++ b/jersey/README.md @@ -1,6 +1,12 @@ -- [Jersey Filters and Interceptors](http://www.baeldung.com/jersey-filters-interceptors) +## Jersey + +This module contains articles about Jersey. + +### Relevant Articles +- [Jersey Filters and Interceptors](https://www.baeldung.com/jersey-filters-interceptors) - [Jersey MVC Support](https://www.baeldung.com/jersey-mvc) - [Bean Validation in Jersey](https://www.baeldung.com/jersey-bean-validation) - [Set a Response Body in JAX-RS](https://www.baeldung.com/jax-rs-response) - [Exploring the Jersey Test Framework](https://www.baeldung.com/jersey-test) - [Explore Jersey Request Parameters](https://www.baeldung.com/jersey-request-parameters) +- [Add a Header to a Jersey SSE Client Request](https://www.baeldung.com/jersey-sse-client-request-headers) diff --git a/jgit/README.md b/jgit/README.md index 5c65f1101b..b48f3c7a87 100644 --- a/jgit/README.md +++ b/jgit/README.md @@ -1,3 +1,7 @@ -## Relevant articles: +## JGit -- [A Guide to JGit](http://www.baeldung.com/jgit) +This module contains articles about JGit. + +### Relevant articles: + +- [A Guide to JGit](https://www.baeldung.com/jgit) diff --git a/jgroups/README.md b/jgroups/README.md index 0921fa98a1..046ac89c1f 100644 --- a/jgroups/README.md +++ b/jgroups/README.md @@ -1,15 +1,12 @@ ## Reliable Messaging with JGroups Tutorial Project +This module contains articles about JGroups. + ### Relevant Article: -- [Reliable Messaging with JGroups](http://www.baeldung.com/jgroups) +- [Reliable Messaging with JGroups](https://www.baeldung.com/jgroups) ### Overview This Maven project contains the Java code for the article linked above. ### Package Organization Java classes for the intro tutorial are in the org.baeldung.jgroups package. - - -### Running the tests - -``` diff --git a/jhipster-5/README.md b/jhipster-5/README.md index 2731281b3e..e4a6b3c3a0 100644 --- a/jhipster-5/README.md +++ b/jhipster-5/README.md @@ -1,2 +1,6 @@ +## JHipster 5 -This is an aggregator module for JHipster 5 modules. +This module contains articles about JHipster 5. This is an aggregator module, articles are in the relevant submodules. + +### Relevant Articles: +- [JHipster Authentication with an External Service](https://www.baeldung.com/jhipster-authentication-external-service) diff --git a/jhipster-5/bookstore-monolith/README.md b/jhipster-5/bookstore-monolith/README.md index 0537f5b1a5..e4e69b83ac 100644 --- a/jhipster-5/bookstore-monolith/README.md +++ b/jhipster-5/bookstore-monolith/README.md @@ -1,3 +1,5 @@ ## Relevant articles: - [Creating New APIs and Views in JHipster](https://www.baeldung.com/jhipster-new-apis-and-views) +- [JHipster Authentication with an External Service](https://www.baeldung.com/jhipster-authentication-external-service) + diff --git a/jhipster/README.md b/jhipster/README.md new file mode 100644 index 0000000000..1bb31951f0 --- /dev/null +++ b/jhipster/README.md @@ -0,0 +1,9 @@ +## JHipster + +This module contains articles about JHipster. + +### Relevant articles: + +- [JHipster with a Microservice Architecture](https://www.baeldung.com/jhipster-microservices) +- [Intro to JHipster](https://www.baeldung.com/jhipster) +- [Building a Basic UAA-Secured JHipster Microservice](https://www.baeldung.com/jhipster-uaa-secured-micro-service) diff --git a/jhipster/jhipster-microservice/gateway-app/.gitignore b/jhipster/jhipster-microservice/gateway-app/.gitignore index 74b29e2042..6cf33be1d9 100644 --- a/jhipster/jhipster-microservice/gateway-app/.gitignore +++ b/jhipster/jhipster-microservice/gateway-app/.gitignore @@ -18,6 +18,11 @@ npm-debug.log.* ###################### .sass-cache/ +###################### +# Bower +###################### +bower_components + ###################### # Eclipse ###################### diff --git a/jhipster/jhipster-microservice/gateway-app/README.md b/jhipster/jhipster-microservice/gateway-app/README.md index 8b10a5934f..31f9a3e249 100644 --- a/jhipster/jhipster-microservice/gateway-app/README.md +++ b/jhipster/jhipster-microservice/gateway-app/README.md @@ -23,6 +23,10 @@ We use [Gulp][] as our build system. Install the Gulp command-line tool globally yarn global add gulp-cli +Besides that we should download our bower dependencies: + + bower instal + Run the following commands in two separate terminals to create a blissful development experience where your browser auto-refreshes when files change on your hard drive. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/.bower.json deleted file mode 100644 index 6fc255b3b3..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/.bower.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "angular-aria", - "version": "1.5.8", - "license": "MIT", - "main": "./angular-aria.js", - "ignore": [], - "dependencies": { - "angular": "1.5.8" - }, - "homepage": "https://github.com/angular/bower-angular-aria", - "_release": "1.5.8", - "_resolution": { - "type": "version", - "tag": "v1.5.8", - "commit": "91710f3ee26d4e2858af0c91ec462aa43360da47" - }, - "_source": "https://github.com/angular/bower-angular-aria.git", - "_target": "1.5.8", - "_originalSource": "angular-aria" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/LICENSE.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/LICENSE.md deleted file mode 100644 index 2c395eef1b..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Angular - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/README.md deleted file mode 100644 index 04c5a8f949..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# packaged angular-aria - -This repo is for distribution on `npm` and `bower`. The source for this module is in the -[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAria). -Please file issues and pull requests against that repo. - -## Install - -You can install this package either with `npm` or with `bower`. - -### npm - -```shell -npm install angular-aria -``` -Then add `ngAria` as a dependency for your app: - -```javascript -angular.module('myApp', [require('angular-aria')]); -``` - -### bower - -```shell -bower install angular-aria -``` - -Add a ` -``` - -Then add `ngAria` as a dependency for your app: - -```javascript -angular.module('myApp', ['ngAria']); -``` - -## Documentation - -Documentation is available on the -[AngularJS docs site](http://docs.angularjs.org/api/ngAria). - -## License - -The MIT License - -Copyright (c) 2010-2015 Google, Inc. http://angularjs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/angular-aria.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/angular-aria.js deleted file mode 100644 index e9048c638f..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/angular-aria.js +++ /dev/null @@ -1,405 +0,0 @@ -/** - * @license AngularJS v1.5.8 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -/** - * @ngdoc module - * @name ngAria - * @description - * - * The `ngAria` module provides support for common - * [ARIA](http://www.w3.org/TR/wai-aria/) - * attributes that convey state or semantic information about the application for users - * of assistive technologies, such as screen readers. - * - *
- * - * ## Usage - * - * For ngAria to do its magic, simply include the module `ngAria` as a dependency. The following - * directives are supported: - * `ngModel`, `ngChecked`, `ngReadonly`, `ngRequired`, `ngValue`, `ngDisabled`, `ngShow`, `ngHide`, `ngClick`, - * `ngDblClick`, and `ngMessages`. - * - * Below is a more detailed breakdown of the attributes handled by ngAria: - * - * | Directive | Supported Attributes | - * |---------------------------------------------|----------------------------------------------------------------------------------------| - * | {@link ng.directive:ngModel ngModel} | aria-checked, aria-valuemin, aria-valuemax, aria-valuenow, aria-invalid, aria-required, input roles | - * | {@link ng.directive:ngDisabled ngDisabled} | aria-disabled | - * | {@link ng.directive:ngRequired ngRequired} | aria-required - * | {@link ng.directive:ngChecked ngChecked} | aria-checked - * | {@link ng.directive:ngReadonly ngReadonly} | aria-readonly | - * | {@link ng.directive:ngValue ngValue} | aria-checked | - * | {@link ng.directive:ngShow ngShow} | aria-hidden | - * | {@link ng.directive:ngHide ngHide} | aria-hidden | - * | {@link ng.directive:ngDblclick ngDblclick} | tabindex | - * | {@link module:ngMessages ngMessages} | aria-live | - * | {@link ng.directive:ngClick ngClick} | tabindex, keypress event, button role | - * - * Find out more information about each directive by reading the - * {@link guide/accessibility ngAria Developer Guide}. - * - * ## Example - * Using ngDisabled with ngAria: - * ```html - * - * ``` - * Becomes: - * ```html - * - * ``` - * - * ## Disabling Attributes - * It's possible to disable individual attributes added by ngAria with the - * {@link ngAria.$ariaProvider#config config} method. For more details, see the - * {@link guide/accessibility Developer Guide}. - */ - /* global -ngAriaModule */ -var ngAriaModule = angular.module('ngAria', ['ng']). - provider('$aria', $AriaProvider); - -/** -* Internal Utilities -*/ -var nodeBlackList = ['BUTTON', 'A', 'INPUT', 'TEXTAREA', 'SELECT', 'DETAILS', 'SUMMARY']; - -var isNodeOneOf = function(elem, nodeTypeArray) { - if (nodeTypeArray.indexOf(elem[0].nodeName) !== -1) { - return true; - } -}; -/** - * @ngdoc provider - * @name $ariaProvider - * - * @description - * - * Used for configuring the ARIA attributes injected and managed by ngAria. - * - * ```js - * angular.module('myApp', ['ngAria'], function config($ariaProvider) { - * $ariaProvider.config({ - * ariaValue: true, - * tabindex: false - * }); - * }); - *``` - * - * ## Dependencies - * Requires the {@link ngAria} module to be installed. - * - */ -function $AriaProvider() { - var config = { - ariaHidden: true, - ariaChecked: true, - ariaReadonly: true, - ariaDisabled: true, - ariaRequired: true, - ariaInvalid: true, - ariaValue: true, - tabindex: true, - bindKeypress: true, - bindRoleForClick: true - }; - - /** - * @ngdoc method - * @name $ariaProvider#config - * - * @param {object} config object to enable/disable specific ARIA attributes - * - * - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags - * - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags - * - **ariaReadonly** – `{boolean}` – Enables/disables aria-readonly tags - * - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags - * - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags - * - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags - * - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and aria-valuenow tags - * - **tabindex** – `{boolean}` – Enables/disables tabindex tags - * - **bindKeypress** – `{boolean}` – Enables/disables keypress event binding on `div` and - * `li` elements with ng-click - * - **bindRoleForClick** – `{boolean}` – Adds role=button to non-interactive elements like `div` - * using ng-click, making them more accessible to users of assistive technologies - * - * @description - * Enables/disables various ARIA attributes - */ - this.config = function(newConfig) { - config = angular.extend(config, newConfig); - }; - - function watchExpr(attrName, ariaAttr, nodeBlackList, negate) { - return function(scope, elem, attr) { - var ariaCamelName = attr.$normalize(ariaAttr); - if (config[ariaCamelName] && !isNodeOneOf(elem, nodeBlackList) && !attr[ariaCamelName]) { - scope.$watch(attr[attrName], function(boolVal) { - // ensure boolean value - boolVal = negate ? !boolVal : !!boolVal; - elem.attr(ariaAttr, boolVal); - }); - } - }; - } - /** - * @ngdoc service - * @name $aria - * - * @description - * @priority 200 - * - * The $aria service contains helper methods for applying common - * [ARIA](http://www.w3.org/TR/wai-aria/) attributes to HTML directives. - * - * ngAria injects common accessibility attributes that tell assistive technologies when HTML - * elements are enabled, selected, hidden, and more. To see how this is performed with ngAria, - * let's review a code snippet from ngAria itself: - * - *```js - * ngAriaModule.directive('ngDisabled', ['$aria', function($aria) { - * return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nodeBlackList, false); - * }]) - *``` - * Shown above, the ngAria module creates a directive with the same signature as the - * traditional `ng-disabled` directive. But this ngAria version is dedicated to - * solely managing accessibility attributes on custom elements. The internal `$aria` service is - * used to watch the boolean attribute `ngDisabled`. If it has not been explicitly set by the - * developer, `aria-disabled` is injected as an attribute with its value synchronized to the - * value in `ngDisabled`. - * - * Because ngAria hooks into the `ng-disabled` directive, developers do not have to do - * anything to enable this feature. The `aria-disabled` attribute is automatically managed - * simply as a silent side-effect of using `ng-disabled` with the ngAria module. - * - * The full list of directives that interface with ngAria: - * * **ngModel** - * * **ngChecked** - * * **ngReadonly** - * * **ngRequired** - * * **ngDisabled** - * * **ngValue** - * * **ngShow** - * * **ngHide** - * * **ngClick** - * * **ngDblclick** - * * **ngMessages** - * - * Read the {@link guide/accessibility ngAria Developer Guide} for a thorough explanation of each - * directive. - * - * - * ## Dependencies - * Requires the {@link ngAria} module to be installed. - */ - this.$get = function() { - return { - config: function(key) { - return config[key]; - }, - $$watchExpr: watchExpr - }; - }; -} - - -ngAriaModule.directive('ngShow', ['$aria', function($aria) { - return $aria.$$watchExpr('ngShow', 'aria-hidden', [], true); -}]) -.directive('ngHide', ['$aria', function($aria) { - return $aria.$$watchExpr('ngHide', 'aria-hidden', [], false); -}]) -.directive('ngValue', ['$aria', function($aria) { - return $aria.$$watchExpr('ngValue', 'aria-checked', nodeBlackList, false); -}]) -.directive('ngChecked', ['$aria', function($aria) { - return $aria.$$watchExpr('ngChecked', 'aria-checked', nodeBlackList, false); -}]) -.directive('ngReadonly', ['$aria', function($aria) { - return $aria.$$watchExpr('ngReadonly', 'aria-readonly', nodeBlackList, false); -}]) -.directive('ngRequired', ['$aria', function($aria) { - return $aria.$$watchExpr('ngRequired', 'aria-required', nodeBlackList, false); -}]) -.directive('ngModel', ['$aria', function($aria) { - - function shouldAttachAttr(attr, normalizedAttr, elem, allowBlacklistEls) { - return $aria.config(normalizedAttr) && !elem.attr(attr) && (allowBlacklistEls || !isNodeOneOf(elem, nodeBlackList)); - } - - function shouldAttachRole(role, elem) { - // if element does not have role attribute - // AND element type is equal to role (if custom element has a type equaling shape) <-- remove? - // AND element is not INPUT - return !elem.attr('role') && (elem.attr('type') === role) && (elem[0].nodeName !== 'INPUT'); - } - - function getShape(attr, elem) { - var type = attr.type, - role = attr.role; - - return ((type || role) === 'checkbox' || role === 'menuitemcheckbox') ? 'checkbox' : - ((type || role) === 'radio' || role === 'menuitemradio') ? 'radio' : - (type === 'range' || role === 'progressbar' || role === 'slider') ? 'range' : ''; - } - - return { - restrict: 'A', - require: 'ngModel', - priority: 200, //Make sure watches are fired after any other directives that affect the ngModel value - compile: function(elem, attr) { - var shape = getShape(attr, elem); - - return { - pre: function(scope, elem, attr, ngModel) { - if (shape === 'checkbox') { - //Use the input[checkbox] $isEmpty implementation for elements with checkbox roles - ngModel.$isEmpty = function(value) { - return value === false; - }; - } - }, - post: function(scope, elem, attr, ngModel) { - var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem, false); - - function ngAriaWatchModelValue() { - return ngModel.$modelValue; - } - - function getRadioReaction(newVal) { - var boolVal = (attr.value == ngModel.$viewValue); - elem.attr('aria-checked', boolVal); - } - - function getCheckboxReaction() { - elem.attr('aria-checked', !ngModel.$isEmpty(ngModel.$viewValue)); - } - - switch (shape) { - case 'radio': - case 'checkbox': - if (shouldAttachRole(shape, elem)) { - elem.attr('role', shape); - } - if (shouldAttachAttr('aria-checked', 'ariaChecked', elem, false)) { - scope.$watch(ngAriaWatchModelValue, shape === 'radio' ? - getRadioReaction : getCheckboxReaction); - } - if (needsTabIndex) { - elem.attr('tabindex', 0); - } - break; - case 'range': - if (shouldAttachRole(shape, elem)) { - elem.attr('role', 'slider'); - } - if ($aria.config('ariaValue')) { - var needsAriaValuemin = !elem.attr('aria-valuemin') && - (attr.hasOwnProperty('min') || attr.hasOwnProperty('ngMin')); - var needsAriaValuemax = !elem.attr('aria-valuemax') && - (attr.hasOwnProperty('max') || attr.hasOwnProperty('ngMax')); - var needsAriaValuenow = !elem.attr('aria-valuenow'); - - if (needsAriaValuemin) { - attr.$observe('min', function ngAriaValueMinReaction(newVal) { - elem.attr('aria-valuemin', newVal); - }); - } - if (needsAriaValuemax) { - attr.$observe('max', function ngAriaValueMinReaction(newVal) { - elem.attr('aria-valuemax', newVal); - }); - } - if (needsAriaValuenow) { - scope.$watch(ngAriaWatchModelValue, function ngAriaValueNowReaction(newVal) { - elem.attr('aria-valuenow', newVal); - }); - } - } - if (needsTabIndex) { - elem.attr('tabindex', 0); - } - break; - } - - if (!attr.hasOwnProperty('ngRequired') && ngModel.$validators.required - && shouldAttachAttr('aria-required', 'ariaRequired', elem, false)) { - // ngModel.$error.required is undefined on custom controls - attr.$observe('required', function() { - elem.attr('aria-required', !!attr['required']); - }); - } - - if (shouldAttachAttr('aria-invalid', 'ariaInvalid', elem, true)) { - scope.$watch(function ngAriaInvalidWatch() { - return ngModel.$invalid; - }, function ngAriaInvalidReaction(newVal) { - elem.attr('aria-invalid', !!newVal); - }); - } - } - }; - } - }; -}]) -.directive('ngDisabled', ['$aria', function($aria) { - return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nodeBlackList, false); -}]) -.directive('ngMessages', function() { - return { - restrict: 'A', - require: '?ngMessages', - link: function(scope, elem, attr, ngMessages) { - if (!elem.attr('aria-live')) { - elem.attr('aria-live', 'assertive'); - } - } - }; -}) -.directive('ngClick',['$aria', '$parse', function($aria, $parse) { - return { - restrict: 'A', - compile: function(elem, attr) { - var fn = $parse(attr.ngClick, /* interceptorFn */ null, /* expensiveChecks */ true); - return function(scope, elem, attr) { - - if (!isNodeOneOf(elem, nodeBlackList)) { - - if ($aria.config('bindRoleForClick') && !elem.attr('role')) { - elem.attr('role', 'button'); - } - - if ($aria.config('tabindex') && !elem.attr('tabindex')) { - elem.attr('tabindex', 0); - } - - if ($aria.config('bindKeypress') && !attr.ngKeypress) { - elem.on('keypress', function(event) { - var keyCode = event.which || event.keyCode; - if (keyCode === 32 || keyCode === 13) { - scope.$apply(callback); - } - - function callback() { - fn(scope, { $event: event }); - } - }); - } - } - }; - } - }; -}]) -.directive('ngDblclick', ['$aria', function($aria) { - return function(scope, elem, attr) { - if ($aria.config('tabindex') && !elem.attr('tabindex') && !isNodeOneOf(elem, nodeBlackList)) { - elem.attr('tabindex', 0); - } - }; -}]); - - -})(window, window.angular); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/angular-aria.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/angular-aria.min.js deleted file mode 100644 index 94e202042f..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/angular-aria.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - AngularJS v1.5.8 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(t,p){'use strict';var b="BUTTON A INPUT TEXTAREA SELECT DETAILS SUMMARY".split(" "),l=function(a,c){if(-1!==c.indexOf(a[0].nodeName))return!0};p.module("ngAria",["ng"]).provider("$aria",function(){function a(a,b,m,h){return function(d,f,e){var q=e.$normalize(b);!c[q]||l(f,m)||e[q]||d.$watch(e[a],function(a){a=h?!a:!!a;f.attr(b,a)})}}var c={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeypress:!0,bindRoleForClick:!0}; -this.config=function(a){c=p.extend(c,a)};this.$get=function(){return{config:function(a){return c[a]},$$watchExpr:a}}}).directive("ngShow",["$aria",function(a){return a.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(a){return a.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(a){return a.$$watchExpr("ngValue","aria-checked",b,!1)}]).directive("ngChecked",["$aria",function(a){return a.$$watchExpr("ngChecked","aria-checked",b,!1)}]).directive("ngReadonly", -["$aria",function(a){return a.$$watchExpr("ngReadonly","aria-readonly",b,!1)}]).directive("ngRequired",["$aria",function(a){return a.$$watchExpr("ngRequired","aria-required",b,!1)}]).directive("ngModel",["$aria",function(a){function c(c,h,d,f){return a.config(h)&&!d.attr(c)&&(f||!l(d,b))}function g(a,c){return!c.attr("role")&&c.attr("type")===a&&"INPUT"!==c[0].nodeName}function k(a,c){var d=a.type,f=a.role;return"checkbox"===(d||f)||"menuitemcheckbox"===f?"checkbox":"radio"===(d||f)||"menuitemradio"=== -f?"radio":"range"===d||"progressbar"===f||"slider"===f?"range":""}return{restrict:"A",require:"ngModel",priority:200,compile:function(b,h){var d=k(h,b);return{pre:function(a,e,c,b){"checkbox"===d&&(b.$isEmpty=function(a){return!1===a})},post:function(f,e,b,n){function h(){return n.$modelValue}function k(a){e.attr("aria-checked",b.value==n.$viewValue)}function l(){e.attr("aria-checked",!n.$isEmpty(n.$viewValue))}var m=c("tabindex","tabindex",e,!1);switch(d){case "radio":case "checkbox":g(d,e)&&e.attr("role", -d);c("aria-checked","ariaChecked",e,!1)&&f.$watch(h,"radio"===d?k:l);m&&e.attr("tabindex",0);break;case "range":g(d,e)&&e.attr("role","slider");if(a.config("ariaValue")){var p=!e.attr("aria-valuemin")&&(b.hasOwnProperty("min")||b.hasOwnProperty("ngMin")),r=!e.attr("aria-valuemax")&&(b.hasOwnProperty("max")||b.hasOwnProperty("ngMax")),s=!e.attr("aria-valuenow");p&&b.$observe("min",function(a){e.attr("aria-valuemin",a)});r&&b.$observe("max",function(a){e.attr("aria-valuemax",a)});s&&f.$watch(h,function(a){e.attr("aria-valuenow", -a)})}m&&e.attr("tabindex",0)}!b.hasOwnProperty("ngRequired")&&n.$validators.required&&c("aria-required","ariaRequired",e,!1)&&b.$observe("required",function(){e.attr("aria-required",!!b.required)});c("aria-invalid","ariaInvalid",e,!0)&&f.$watch(function(){return n.$invalid},function(a){e.attr("aria-invalid",!!a)})}}}}}]).directive("ngDisabled",["$aria",function(a){return a.$$watchExpr("ngDisabled","aria-disabled",b,!1)}]).directive("ngMessages",function(){return{restrict:"A",require:"?ngMessages", -link:function(a,b,g,k){b.attr("aria-live")||b.attr("aria-live","assertive")}}}).directive("ngClick",["$aria","$parse",function(a,c){return{restrict:"A",compile:function(g,k){var m=c(k.ngClick,null,!0);return function(c,d,f){if(!l(d,b)&&(a.config("bindRoleForClick")&&!d.attr("role")&&d.attr("role","button"),a.config("tabindex")&&!d.attr("tabindex")&&d.attr("tabindex",0),a.config("bindKeypress")&&!f.ngKeypress))d.on("keypress",function(a){function b(){m(c,{$event:a})}var d=a.which||a.keyCode;32!==d&& -13!==d||c.$apply(b)})}}}}]).directive("ngDblclick",["$aria",function(a){return function(c,g,k){!a.config("tabindex")||g.attr("tabindex")||l(g,b)||g.attr("tabindex",0)}}])})(window,window.angular); -//# sourceMappingURL=angular-aria.min.js.map diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/angular-aria.min.js.map b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/angular-aria.min.js.map deleted file mode 100644 index 925779bac7..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/angular-aria.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular-aria.min.js", -"lineCount":13, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CA8D3B,IAAIC,EAAgB,gDAAA,MAAA,CAAA,GAAA,CAApB,CAEIC,EAAcA,QAAQ,CAACC,CAAD,CAAOC,CAAP,CAAsB,CAC9C,GAAiD,EAAjD,GAAIA,CAAAC,QAAA,CAAsBF,CAAA,CAAK,CAAL,CAAAG,SAAtB,CAAJ,CACE,MAAO,CAAA,CAFqC,CAR7BN,EAAAO,OAAA,CAAe,QAAf,CAAyB,CAAC,IAAD,CAAzB,CAAAC,SAAAC,CACc,OADdA,CAkCnBC,QAAsB,EAAG,CAwCvBC,QAASA,EAAS,CAACC,CAAD,CAAWC,CAAX,CAAqBZ,CAArB,CAAoCa,CAApC,CAA4C,CAC5D,MAAO,SAAQ,CAACC,CAAD,CAAQZ,CAAR,CAAca,CAAd,CAAoB,CACjC,IAAIC,EAAgBD,CAAAE,WAAA,CAAgBL,CAAhB,CAChB,EAAAM,CAAA,CAAOF,CAAP,CAAJ,EAA8Bf,CAAA,CAAYC,CAAZ,CAAkBF,CAAlB,CAA9B,EAAmEe,CAAA,CAAKC,CAAL,CAAnE,EACEF,CAAAK,OAAA,CAAaJ,CAAA,CAAKJ,CAAL,CAAb,CAA6B,QAAQ,CAACS,CAAD,CAAU,CAE7CA,CAAA,CAAUP,CAAA,CAAS,CAACO,CAAV,CAAoB,CAAEA,CAAAA,CAChClB,EAAAa,KAAA,CAAUH,CAAV,CAAoBQ,CAApB,CAH6C,CAA/C,CAH+B,CADyB,CAvC9D,IAAIF,EAAS,CACXG,WAAY,CAAA,CADD,CAEXC,YAAa,CAAA,CAFF,CAGXC,a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,EAAiChB,CAAAa,KAAA,CAAU,UAAV,CAAjC,EAA2Dd,CAAA,CAAYC,CAAZ,CAAkBF,CAAlB,CAA3D,EACEE,CAAAa,KAAA,CAAU,UAAV,CAAsB,CAAtB,CAF+B,CADc,CAA1B,CA3LzB,CA3M2B,CAA1B,CAAD,CA+YGjB,MA/YH,CA+YWA,MAAAC,QA/YX;", -"sources":["angular-aria.js"], -"names":["window","angular","nodeBlackList","isNodeOneOf","elem","nodeTypeArray","indexOf","nodeName","module","provider","ngAriaModule","$AriaProvider","watchExpr","attrName","ariaAttr","negate","scope","attr","ariaCamelName","$normalize","config","$watch","boolVal","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeypress","bindRoleForClick","this.config","newConfig","extend","$get","this.$get","key","$$watchExpr","directive","$aria","shouldAttachAttr","normalizedAttr","allowBlacklistEls","shouldAttachRole","role","getShape","type","restrict","require","priority","compile","shape","pre","ngModel","$isEmpty","ngModel.$isEmpty","value","post","ngAriaWatchModelValue","$modelValue","getRadioReaction","newVal","$viewValue","getCheckboxReaction","needsTabIndex","needsAriaValuemin","hasOwnProperty","needsAriaValuemax","needsAriaValuenow","$observe","ngAriaValueMinReaction","ngAriaValueNowReaction","$validators","required","ngAriaInvalidWatch","$invalid","ngAriaInvalidReaction","link","ngMessages","$parse","fn","ngClick","ngKeypress","on","event","callback","$event","keyCode","which","$apply"] -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/bower.json deleted file mode 100644 index b3414d55fb..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/bower.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "angular-aria", - "version": "1.5.8", - "license": "MIT", - "main": "./angular-aria.js", - "ignore": [], - "dependencies": { - "angular": "1.5.8" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/index.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/index.js deleted file mode 100644 index 0a8f0d9b05..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/index.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./angular-aria'); -module.exports = 'ngAria'; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/package.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/package.json deleted file mode 100644 index 476dda58ae..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-aria/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "angular-aria", - "version": "1.5.8", - "description": "AngularJS module for making accessibility easy", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/angular/angular.js.git" - }, - "keywords": [ - "angular", - "framework", - "browser", - "accessibility", - "a11y", - "client-side" - ], - "author": "Angular Core Team ", - "license": "MIT", - "bugs": { - "url": "https://github.com/angular/angular.js/issues" - }, - "homepage": "http://angularjs.org", - "jspm": { - "shim": { - "angular-aria": { - "deps": ["angular"] - } - } - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/.bower.json deleted file mode 100644 index 3573845cf6..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/.bower.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "author": { - "name": "https://github.com/angular-ui/bootstrap/graphs/contributors" - }, - "name": "angular-bootstrap", - "keywords": [ - "angular", - "angular-ui", - "bootstrap" - ], - "license": "MIT", - "ignore": [], - "description": "Native AngularJS (Angular) directives for Bootstrap.", - "version": "1.3.3", - "main": [ - "./ui-bootstrap-tpls.js" - ], - "dependencies": { - "angular": ">=1.4.0" - }, - "homepage": "https://github.com/angular-ui/bootstrap-bower", - "_release": "1.3.3", - "_resolution": { - "type": "version", - "tag": "1.3.3", - "commit": "d45246707f5bf9533e3824861a29abd36757db45" - }, - "_source": "https://github.com/angular-ui/bootstrap-bower.git", - "_target": "1.3.3", - "_originalSource": "angular-bootstrap" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/.gitignore b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/.gitignore deleted file mode 100644 index 496ee2ca6a..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.DS_Store \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/.npmignore b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/.npmignore deleted file mode 100644 index d62f9b6e0f..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/.npmignore +++ /dev/null @@ -1 +0,0 @@ -bower.json \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/README.md deleted file mode 100644 index 9607c65f68..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/README.md +++ /dev/null @@ -1,120 +0,0 @@ -### UI Bootstrap - [AngularJS](http://angularjs.org/) directives specific to [Bootstrap](http://getbootstrap.com) - -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular-ui/bootstrap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://secure.travis-ci.org/angular-ui/bootstrap.svg)](http://travis-ci.org/angular-ui/bootstrap) -[![devDependency Status](https://david-dm.org/angular-ui/bootstrap/dev-status.svg?branch=master)](https://david-dm.org/angular-ui/bootstrap#info=devDependencies) - -### Quick links -- [Demo](#demo) -- [Installation](#installation) - - [NPM](#install-with-npm) - - [Bower](#install-with-bower) - - [NuGet](#install-with-nuget) - - [Custom](#custom-build) - - [Manual](#manual-download) -- [Support](#support) - - [FAQ](#faq) - - [Supported browsers](#supported-browsers) - - [Need help?](#need-help) - - [Found a bug?](#found-a-bug) -- [Contributing to the project](#contributing-to-the-project) -- [Development, meeting minutes, roadmap and more.](#development-meeting-minutes-roadmap-and-more) - - -# Demo - -Do you want to see directives in action? Visit http://angular-ui.github.io/bootstrap/! - -# Installation - -Installation is easy as UI Bootstrap has minimal dependencies - only the AngularJS and Twitter Bootstrap's CSS are required. -Note: Since version 0.13.0, UI Bootstrap depends on [ngAnimate](https://docs.angularjs.org/api/ngAnimate) for transitions and animations, such as the accordion, carousel, etc. Include `ngAnimate` in the module dependencies for your app in order to enable animation. - -#### Install with NPM - -```sh -$ npm install angular-ui-bootstrap -``` - -This will install AngularJS and Bootstrap NPM packages. - -#### Install with Bower -```sh -$ bower install angular-bootstrap -``` - -Note: do not install 'angular-ui-bootstrap'. A separate repository - [bootstrap-bower](https://github.com/angular-ui/bootstrap-bower) - hosts the compiled javascript file and bower.json. - -#### Install with NuGet -To install AngularJS UI Bootstrap, run the following command in the Package Manager Console - -```sh -PM> Install-Package Angular.UI.Bootstrap -``` - -#### Custom build - -Head over to http://angular-ui.github.io/bootstrap/ and hit the *Custom build* button to create your own custom UI Bootstrap build, just the way you like it. - -#### Manual download - -After downloading dependencies (or better yet, referencing them from your favorite CDN) you need to download build version of this project. All the files and their purposes are described here: -https://github.com/angular-ui/bootstrap/tree/gh-pages#build-files -Don't worry, if you are not sure which file to take, opt for `ui-bootstrap-tpls-[version].min.js`. - -### Adding dependency to your project - -When you are done downloading all the dependencies and project files the only remaining part is to add dependencies on the `ui.bootstrap` AngularJS module: - -```js -angular.module('myModule', ['ui.bootstrap']); -``` - -If you're a Browserify or Webpack user, you can do: - -```js -var uibs = require('angular-ui-bootstrap'); - -angular.module('myModule', [uibs]); -``` - -# Support - -## FAQ - -https://github.com/angular-ui/bootstrap/wiki/FAQ - -## Supported browsers - -Directives from this repository are automatically tested with the following browsers: -* Chrome (stable and canary channel) -* Firefox -* IE 9 and 10 -* Opera -* Safari - -Modern mobile browsers should work without problems. - - -## Need help? -Need help using UI Bootstrap? - -* Live help in the IRC (`#angularjs` channel at the `freenode` network). Use this [webchat](https://webchat.freenode.net/) or your own IRC client. -* Ask a question in [StackOverflow](http://stackoverflow.com/) under the [angular-ui-bootstrap](http://stackoverflow.com/questions/tagged/angular-ui-bootstrap) tag. - -**Please do not create new issues in this repository to ask questions about using UI Bootstrap** - -## Found a bug? -Please take a look at [CONTRIBUTING.md](CONTRIBUTING.md#you-think-youve-found-a-bug) and submit your issue [here](https://github.com/angular-ui/bootstrap/issues/new). - - ----- - - -# Contributing to the project - -We are always looking for the quality contributions! Please check the [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution guidelines. - -# Development, meeting minutes, roadmap and more. - -Head over to the [Wiki](https://github.com/angular-ui/bootstrap/wiki) for notes on development for UI Bootstrap, meeting minutes from the UI Bootstrap team, roadmap plans, project philosophy and more. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/bower.json deleted file mode 100644 index 8ee7fd9f1c..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/bower.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "author": { - "name": "https://github.com/angular-ui/bootstrap/graphs/contributors" - }, - "name": "angular-bootstrap", - "keywords": [ - "angular", - "angular-ui", - "bootstrap" - ], - "license": "MIT", - "ignore": [], - "description": "Native AngularJS (Angular) directives for Bootstrap.", - "version": "1.3.3", - "main": ["./ui-bootstrap-tpls.js"], - "dependencies": { - "angular": ">=1.4.0" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/index.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/index.js deleted file mode 100644 index a174f26d42..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/index.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./ui-bootstrap-tpls'); -module.exports = 'ui.bootstrap'; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/package.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/package.json deleted file mode 100644 index 4efc7e8ff9..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "angular-ui-bootstrap", - "version": "1.3.3", - "description": "Bootstrap widgets for Angular", - "main": "index.js", - "homepage": "http://angular-ui.github.io/bootstrap/", - "repository": { - "type": "git", - "url": "https://github.com/angular-ui/bootstrap.git" - }, - "keywords": [ - "angular", - "bootstrap", - "angular-ui", - "components", - "client-side" - ], - "author": "https://github.com/angular-ui/bootstrap/graphs/contributors", - "peerDependencies": { - "angular": ">= 1.4.0-beta.0 || >= 1.5.0-beta.0" - }, - "license": "MIT" -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-csp.css b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-csp.css deleted file mode 100644 index 3b69cf6474..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-csp.css +++ /dev/null @@ -1,115 +0,0 @@ -/* Include this file in your html if you are using the CSP mode. */ - -.ng-animate.item:not(.left):not(.right) { - -webkit-transition: 0s ease-in-out left; - transition: 0s ease-in-out left -} -.uib-datepicker .uib-title { - width: 100%; -} - -.uib-day button, .uib-month button, .uib-year button { - min-width: 100%; -} - -.uib-left, .uib-right { - width: 100% -} - -.uib-position-measure { - display: block !important; - visibility: hidden !important; - position: absolute !important; - top: -9999px !important; - left: -9999px !important; -} - -.uib-position-scrollbar-measure { - position: absolute !important; - top: -9999px !important; - width: 50px !important; - height: 50px !important; - overflow: scroll !important; -} - -.uib-position-body-scrollbar-measure { - overflow: scroll !important; -} -.uib-datepicker-popup.dropdown-menu { - display: block; - float: none; - margin: 0; -} - -.uib-button-bar { - padding: 10px 9px 2px; -} - -[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow, -[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow, -[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow, -[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow, -[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow, -[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow, -[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow, -[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow, -[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow, -[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow, -[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow, -[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow, -[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow, -[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow, -[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow, -[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow, -[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow, -[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow, -[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow, -[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow, -[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow, -[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow, -[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow, -[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow, -[uib-popover-popup].popover.top-left > .arrow, -[uib-popover-popup].popover.top-right > .arrow, -[uib-popover-popup].popover.bottom-left > .arrow, -[uib-popover-popup].popover.bottom-right > .arrow, -[uib-popover-popup].popover.left-top > .arrow, -[uib-popover-popup].popover.left-bottom > .arrow, -[uib-popover-popup].popover.right-top > .arrow, -[uib-popover-popup].popover.right-bottom > .arrow, -[uib-popover-html-popup].popover.top-left > .arrow, -[uib-popover-html-popup].popover.top-right > .arrow, -[uib-popover-html-popup].popover.bottom-left > .arrow, -[uib-popover-html-popup].popover.bottom-right > .arrow, -[uib-popover-html-popup].popover.left-top > .arrow, -[uib-popover-html-popup].popover.left-bottom > .arrow, -[uib-popover-html-popup].popover.right-top > .arrow, -[uib-popover-html-popup].popover.right-bottom > .arrow, -[uib-popover-template-popup].popover.top-left > .arrow, -[uib-popover-template-popup].popover.top-right > .arrow, -[uib-popover-template-popup].popover.bottom-left > .arrow, -[uib-popover-template-popup].popover.bottom-right > .arrow, -[uib-popover-template-popup].popover.left-top > .arrow, -[uib-popover-template-popup].popover.left-bottom > .arrow, -[uib-popover-template-popup].popover.right-top > .arrow, -[uib-popover-template-popup].popover.right-bottom > .arrow { - top: auto; - bottom: auto; - left: auto; - right: auto; - margin: 0; -} - -[uib-popover-popup].popover, -[uib-popover-html-popup].popover, -[uib-popover-template-popup].popover { - display: block !important; -} - -.uib-time input { - width: 50px; -} - -[uib-typeahead-popup].dropdown-menu { - display: block; -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-tpls.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-tpls.js deleted file mode 100644 index 918ef43632..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-tpls.js +++ /dev/null @@ -1,7347 +0,0 @@ -/* - * angular-ui-bootstrap - * http://angular-ui.github.io/bootstrap/ - - * Version: 1.3.3 - 2016-05-22 - * License: MIT - */angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]); -angular.module("ui.bootstrap.tpls", ["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/datepickerPopup/popup.html","uib/template/modal/backdrop.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]); -angular.module('ui.bootstrap.collapse', []) - - .directive('uibCollapse', ['$animate', '$q', '$parse', '$injector', function($animate, $q, $parse, $injector) { - var $animateCss = $injector.has('$animateCss') ? $injector.get('$animateCss') : null; - return { - link: function(scope, element, attrs) { - var expandingExpr = $parse(attrs.expanding), - expandedExpr = $parse(attrs.expanded), - collapsingExpr = $parse(attrs.collapsing), - collapsedExpr = $parse(attrs.collapsed); - - if (!scope.$eval(attrs.uibCollapse)) { - element.addClass('in') - .addClass('collapse') - .attr('aria-expanded', true) - .attr('aria-hidden', false) - .css({height: 'auto'}); - } - - function expand() { - if (element.hasClass('collapse') && element.hasClass('in')) { - return; - } - - $q.resolve(expandingExpr(scope)) - .then(function() { - element.removeClass('collapse') - .addClass('collapsing') - .attr('aria-expanded', true) - .attr('aria-hidden', false); - - if ($animateCss) { - $animateCss(element, { - addClass: 'in', - easing: 'ease', - to: { height: element[0].scrollHeight + 'px' } - }).start()['finally'](expandDone); - } else { - $animate.addClass(element, 'in', { - to: { height: element[0].scrollHeight + 'px' } - }).then(expandDone); - } - }); - } - - function expandDone() { - element.removeClass('collapsing') - .addClass('collapse') - .css({height: 'auto'}); - expandedExpr(scope); - } - - function collapse() { - if (!element.hasClass('collapse') && !element.hasClass('in')) { - return collapseDone(); - } - - $q.resolve(collapsingExpr(scope)) - .then(function() { - element - // IMPORTANT: The height must be set before adding "collapsing" class. - // Otherwise, the browser attempts to animate from height 0 (in - // collapsing class) to the given height here. - .css({height: element[0].scrollHeight + 'px'}) - // initially all panel collapse have the collapse class, this removal - // prevents the animation from jumping to collapsed state - .removeClass('collapse') - .addClass('collapsing') - .attr('aria-expanded', false) - .attr('aria-hidden', true); - - if ($animateCss) { - $animateCss(element, { - removeClass: 'in', - to: {height: '0'} - }).start()['finally'](collapseDone); - } else { - $animate.removeClass(element, 'in', { - to: {height: '0'} - }).then(collapseDone); - } - }); - } - - function collapseDone() { - element.css({height: '0'}); // Required so that collapse works when animation is disabled - element.removeClass('collapsing') - .addClass('collapse'); - collapsedExpr(scope); - } - - scope.$watch(attrs.uibCollapse, function(shouldCollapse) { - if (shouldCollapse) { - collapse(); - } else { - expand(); - } - }); - } - }; - }]); - -angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse']) - -.constant('uibAccordionConfig', { - closeOthers: true -}) - -.controller('UibAccordionController', ['$scope', '$attrs', 'uibAccordionConfig', function($scope, $attrs, accordionConfig) { - // This array keeps track of the accordion groups - this.groups = []; - - // Ensure that all the groups in this accordion are closed, unless close-others explicitly says not to - this.closeOthers = function(openGroup) { - var closeOthers = angular.isDefined($attrs.closeOthers) ? - $scope.$eval($attrs.closeOthers) : accordionConfig.closeOthers; - if (closeOthers) { - angular.forEach(this.groups, function(group) { - if (group !== openGroup) { - group.isOpen = false; - } - }); - } - }; - - // This is called from the accordion-group directive to add itself to the accordion - this.addGroup = function(groupScope) { - var that = this; - this.groups.push(groupScope); - - groupScope.$on('$destroy', function(event) { - that.removeGroup(groupScope); - }); - }; - - // This is called from the accordion-group directive when to remove itself - this.removeGroup = function(group) { - var index = this.groups.indexOf(group); - if (index !== -1) { - this.groups.splice(index, 1); - } - }; -}]) - -// The accordion directive simply sets up the directive controller -// and adds an accordion CSS class to itself element. -.directive('uibAccordion', function() { - return { - controller: 'UibAccordionController', - controllerAs: 'accordion', - transclude: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/accordion/accordion.html'; - } - }; -}) - -// The accordion-group directive indicates a block of html that will expand and collapse in an accordion -.directive('uibAccordionGroup', function() { - return { - require: '^uibAccordion', // We need this directive to be inside an accordion - transclude: true, // It transcludes the contents of the directive into the template - replace: true, // The element containing the directive will be replaced with the template - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/accordion/accordion-group.html'; - }, - scope: { - heading: '@', // Interpolate the heading attribute onto this scope - panelClass: '@?', // Ditto with panelClass - isOpen: '=?', - isDisabled: '=?' - }, - controller: function() { - this.setHeading = function(element) { - this.heading = element; - }; - }, - link: function(scope, element, attrs, accordionCtrl) { - accordionCtrl.addGroup(scope); - - scope.openClass = attrs.openClass || 'panel-open'; - scope.panelClass = attrs.panelClass || 'panel-default'; - scope.$watch('isOpen', function(value) { - element.toggleClass(scope.openClass, !!value); - if (value) { - accordionCtrl.closeOthers(scope); - } - }); - - scope.toggleOpen = function($event) { - if (!scope.isDisabled) { - if (!$event || $event.which === 32) { - scope.isOpen = !scope.isOpen; - } - } - }; - - var id = 'accordiongroup-' + scope.$id + '-' + Math.floor(Math.random() * 10000); - scope.headingId = id + '-tab'; - scope.panelId = id + '-panel'; - } - }; -}) - -// Use accordion-heading below an accordion-group to provide a heading containing HTML -.directive('uibAccordionHeading', function() { - return { - transclude: true, // Grab the contents to be used as the heading - template: '', // In effect remove this element! - replace: true, - require: '^uibAccordionGroup', - link: function(scope, element, attrs, accordionGroupCtrl, transclude) { - // Pass the heading to the accordion-group controller - // so that it can be transcluded into the right place in the template - // [The second parameter to transclude causes the elements to be cloned so that they work in ng-repeat] - accordionGroupCtrl.setHeading(transclude(scope, angular.noop)); - } - }; -}) - -// Use in the accordion-group template to indicate where you want the heading to be transcluded -// You must provide the property on the accordion-group controller that will hold the transcluded element -.directive('uibAccordionTransclude', function() { - return { - require: '^uibAccordionGroup', - link: function(scope, element, attrs, controller) { - scope.$watch(function() { return controller[attrs.uibAccordionTransclude]; }, function(heading) { - if (heading) { - var elem = angular.element(element[0].querySelector(getHeaderSelectors())); - elem.html(''); - elem.append(heading); - } - }); - } - }; - - function getHeaderSelectors() { - return 'uib-accordion-header,' + - 'data-uib-accordion-header,' + - 'x-uib-accordion-header,' + - 'uib\\:accordion-header,' + - '[uib-accordion-header],' + - '[data-uib-accordion-header],' + - '[x-uib-accordion-header]'; - } -}); - -angular.module('ui.bootstrap.alert', []) - -.controller('UibAlertController', ['$scope', '$attrs', '$interpolate', '$timeout', function($scope, $attrs, $interpolate, $timeout) { - $scope.closeable = !!$attrs.close; - - var dismissOnTimeout = angular.isDefined($attrs.dismissOnTimeout) ? - $interpolate($attrs.dismissOnTimeout)($scope.$parent) : null; - - if (dismissOnTimeout) { - $timeout(function() { - $scope.close(); - }, parseInt(dismissOnTimeout, 10)); - } -}]) - -.directive('uibAlert', function() { - return { - controller: 'UibAlertController', - controllerAs: 'alert', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/alert/alert.html'; - }, - transclude: true, - replace: true, - scope: { - type: '@', - close: '&' - } - }; -}); - -angular.module('ui.bootstrap.buttons', []) - -.constant('uibButtonConfig', { - activeClass: 'active', - toggleEvent: 'click' -}) - -.controller('UibButtonsController', ['uibButtonConfig', function(buttonConfig) { - this.activeClass = buttonConfig.activeClass || 'active'; - this.toggleEvent = buttonConfig.toggleEvent || 'click'; -}]) - -.directive('uibBtnRadio', ['$parse', function($parse) { - return { - require: ['uibBtnRadio', 'ngModel'], - controller: 'UibButtonsController', - controllerAs: 'buttons', - link: function(scope, element, attrs, ctrls) { - var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - var uncheckableExpr = $parse(attrs.uibUncheckable); - - element.find('input').css({display: 'none'}); - - //model -> UI - ngModelCtrl.$render = function() { - element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, scope.$eval(attrs.uibBtnRadio))); - }; - - //ui->model - element.on(buttonsCtrl.toggleEvent, function() { - if (attrs.disabled) { - return; - } - - var isActive = element.hasClass(buttonsCtrl.activeClass); - - if (!isActive || angular.isDefined(attrs.uncheckable)) { - scope.$apply(function() { - ngModelCtrl.$setViewValue(isActive ? null : scope.$eval(attrs.uibBtnRadio)); - ngModelCtrl.$render(); - }); - } - }); - - if (attrs.uibUncheckable) { - scope.$watch(uncheckableExpr, function(uncheckable) { - attrs.$set('uncheckable', uncheckable ? '' : undefined); - }); - } - } - }; -}]) - -.directive('uibBtnCheckbox', function() { - return { - require: ['uibBtnCheckbox', 'ngModel'], - controller: 'UibButtonsController', - controllerAs: 'button', - link: function(scope, element, attrs, ctrls) { - var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - element.find('input').css({display: 'none'}); - - function getTrueValue() { - return getCheckboxValue(attrs.btnCheckboxTrue, true); - } - - function getFalseValue() { - return getCheckboxValue(attrs.btnCheckboxFalse, false); - } - - function getCheckboxValue(attribute, defaultValue) { - return angular.isDefined(attribute) ? scope.$eval(attribute) : defaultValue; - } - - //model -> UI - ngModelCtrl.$render = function() { - element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue())); - }; - - //ui->model - element.on(buttonsCtrl.toggleEvent, function() { - if (attrs.disabled) { - return; - } - - scope.$apply(function() { - ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass) ? getFalseValue() : getTrueValue()); - ngModelCtrl.$render(); - }); - }); - } - }; -}); - -angular.module('ui.bootstrap.carousel', []) - -.controller('UibCarouselController', ['$scope', '$element', '$interval', '$timeout', '$animate', function($scope, $element, $interval, $timeout, $animate) { - var self = this, - slides = self.slides = $scope.slides = [], - SLIDE_DIRECTION = 'uib-slideDirection', - currentIndex = $scope.active, - currentInterval, isPlaying, bufferedTransitions = []; - - var destroyed = false; - - self.addSlide = function(slide, element) { - slides.push({ - slide: slide, - element: element - }); - slides.sort(function(a, b) { - return +a.slide.index - +b.slide.index; - }); - //if this is the first slide or the slide is set to active, select it - if (slide.index === $scope.active || slides.length === 1 && !angular.isNumber($scope.active)) { - if ($scope.$currentTransition) { - $scope.$currentTransition = null; - } - - currentIndex = slide.index; - $scope.active = slide.index; - setActive(currentIndex); - self.select(slides[findSlideIndex(slide)]); - if (slides.length === 1) { - $scope.play(); - } - } - }; - - self.getCurrentIndex = function() { - for (var i = 0; i < slides.length; i++) { - if (slides[i].slide.index === currentIndex) { - return i; - } - } - }; - - self.next = $scope.next = function() { - var newIndex = (self.getCurrentIndex() + 1) % slides.length; - - if (newIndex === 0 && $scope.noWrap()) { - $scope.pause(); - return; - } - - return self.select(slides[newIndex], 'next'); - }; - - self.prev = $scope.prev = function() { - var newIndex = self.getCurrentIndex() - 1 < 0 ? slides.length - 1 : self.getCurrentIndex() - 1; - - if ($scope.noWrap() && newIndex === slides.length - 1) { - $scope.pause(); - return; - } - - return self.select(slides[newIndex], 'prev'); - }; - - self.removeSlide = function(slide) { - var index = findSlideIndex(slide); - - var bufferedIndex = bufferedTransitions.indexOf(slides[index]); - if (bufferedIndex !== -1) { - bufferedTransitions.splice(bufferedIndex, 1); - } - - //get the index of the slide inside the carousel - slides.splice(index, 1); - if (slides.length > 0 && currentIndex === index) { - if (index >= slides.length) { - currentIndex = slides.length - 1; - $scope.active = currentIndex; - setActive(currentIndex); - self.select(slides[slides.length - 1]); - } else { - currentIndex = index; - $scope.active = currentIndex; - setActive(currentIndex); - self.select(slides[index]); - } - } else if (currentIndex > index) { - currentIndex--; - $scope.active = currentIndex; - } - - //clean the active value when no more slide - if (slides.length === 0) { - currentIndex = null; - $scope.active = null; - clearBufferedTransitions(); - } - }; - - /* direction: "prev" or "next" */ - self.select = $scope.select = function(nextSlide, direction) { - var nextIndex = findSlideIndex(nextSlide.slide); - //Decide direction if it's not given - if (direction === undefined) { - direction = nextIndex > self.getCurrentIndex() ? 'next' : 'prev'; - } - //Prevent this user-triggered transition from occurring if there is already one in progress - if (nextSlide.slide.index !== currentIndex && - !$scope.$currentTransition) { - goNext(nextSlide.slide, nextIndex, direction); - } else if (nextSlide && nextSlide.slide.index !== currentIndex && $scope.$currentTransition) { - bufferedTransitions.push(slides[nextIndex]); - } - }; - - /* Allow outside people to call indexOf on slides array */ - $scope.indexOfSlide = function(slide) { - return +slide.slide.index; - }; - - $scope.isActive = function(slide) { - return $scope.active === slide.slide.index; - }; - - $scope.isPrevDisabled = function() { - return $scope.active === 0 && $scope.noWrap(); - }; - - $scope.isNextDisabled = function() { - return $scope.active === slides.length - 1 && $scope.noWrap(); - }; - - $scope.pause = function() { - if (!$scope.noPause) { - isPlaying = false; - resetTimer(); - } - }; - - $scope.play = function() { - if (!isPlaying) { - isPlaying = true; - restartTimer(); - } - }; - - $scope.$on('$destroy', function() { - destroyed = true; - resetTimer(); - }); - - $scope.$watch('noTransition', function(noTransition) { - $animate.enabled($element, !noTransition); - }); - - $scope.$watch('interval', restartTimer); - - $scope.$watchCollection('slides', resetTransition); - - $scope.$watch('active', function(index) { - if (angular.isNumber(index) && currentIndex !== index) { - for (var i = 0; i < slides.length; i++) { - if (slides[i].slide.index === index) { - index = i; - break; - } - } - - var slide = slides[index]; - if (slide) { - setActive(index); - self.select(slides[index]); - currentIndex = index; - } - } - }); - - function clearBufferedTransitions() { - while (bufferedTransitions.length) { - bufferedTransitions.shift(); - } - } - - function getSlideByIndex(index) { - for (var i = 0, l = slides.length; i < l; ++i) { - if (slides[i].index === index) { - return slides[i]; - } - } - } - - function setActive(index) { - for (var i = 0; i < slides.length; i++) { - slides[i].slide.active = i === index; - } - } - - function goNext(slide, index, direction) { - if (destroyed) { - return; - } - - angular.extend(slide, {direction: direction}); - angular.extend(slides[currentIndex].slide || {}, {direction: direction}); - if ($animate.enabled($element) && !$scope.$currentTransition && - slides[index].element && self.slides.length > 1) { - slides[index].element.data(SLIDE_DIRECTION, slide.direction); - var currentIdx = self.getCurrentIndex(); - - if (angular.isNumber(currentIdx) && slides[currentIdx].element) { - slides[currentIdx].element.data(SLIDE_DIRECTION, slide.direction); - } - - $scope.$currentTransition = true; - $animate.on('addClass', slides[index].element, function(element, phase) { - if (phase === 'close') { - $scope.$currentTransition = null; - $animate.off('addClass', element); - if (bufferedTransitions.length) { - var nextSlide = bufferedTransitions.pop().slide; - var nextIndex = nextSlide.index; - var nextDirection = nextIndex > self.getCurrentIndex() ? 'next' : 'prev'; - clearBufferedTransitions(); - - goNext(nextSlide, nextIndex, nextDirection); - } - } - }); - } - - $scope.active = slide.index; - currentIndex = slide.index; - setActive(index); - - //every time you change slides, reset the timer - restartTimer(); - } - - function findSlideIndex(slide) { - for (var i = 0; i < slides.length; i++) { - if (slides[i].slide === slide) { - return i; - } - } - } - - function resetTimer() { - if (currentInterval) { - $interval.cancel(currentInterval); - currentInterval = null; - } - } - - function resetTransition(slides) { - if (!slides.length) { - $scope.$currentTransition = null; - clearBufferedTransitions(); - } - } - - function restartTimer() { - resetTimer(); - var interval = +$scope.interval; - if (!isNaN(interval) && interval > 0) { - currentInterval = $interval(timerFn, interval); - } - } - - function timerFn() { - var interval = +$scope.interval; - if (isPlaying && !isNaN(interval) && interval > 0 && slides.length) { - $scope.next(); - } else { - $scope.pause(); - } - } -}]) - -.directive('uibCarousel', function() { - return { - transclude: true, - replace: true, - controller: 'UibCarouselController', - controllerAs: 'carousel', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/carousel/carousel.html'; - }, - scope: { - active: '=', - interval: '=', - noTransition: '=', - noPause: '=', - noWrap: '&' - } - }; -}) - -.directive('uibSlide', function() { - return { - require: '^uibCarousel', - transclude: true, - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/carousel/slide.html'; - }, - scope: { - actual: '=?', - index: '=?' - }, - link: function (scope, element, attrs, carouselCtrl) { - carouselCtrl.addSlide(scope, element); - //when the scope is destroyed then remove the slide from the current slides array - scope.$on('$destroy', function() { - carouselCtrl.removeSlide(scope); - }); - } - }; -}) - -.animation('.item', ['$animateCss', -function($animateCss) { - var SLIDE_DIRECTION = 'uib-slideDirection'; - - function removeClass(element, className, callback) { - element.removeClass(className); - if (callback) { - callback(); - } - } - - return { - beforeAddClass: function(element, className, done) { - if (className === 'active') { - var stopped = false; - var direction = element.data(SLIDE_DIRECTION); - var directionClass = direction === 'next' ? 'left' : 'right'; - var removeClassFn = removeClass.bind(this, element, - directionClass + ' ' + direction, done); - element.addClass(direction); - - $animateCss(element, {addClass: directionClass}) - .start() - .done(removeClassFn); - - return function() { - stopped = true; - }; - } - done(); - }, - beforeRemoveClass: function (element, className, done) { - if (className === 'active') { - var stopped = false; - var direction = element.data(SLIDE_DIRECTION); - var directionClass = direction === 'next' ? 'left' : 'right'; - var removeClassFn = removeClass.bind(this, element, directionClass, done); - - $animateCss(element, {addClass: directionClass}) - .start() - .done(removeClassFn); - - return function() { - stopped = true; - }; - } - done(); - } - }; -}]); - -angular.module('ui.bootstrap.dateparser', []) - -.service('uibDateParser', ['$log', '$locale', 'dateFilter', 'orderByFilter', function($log, $locale, dateFilter, orderByFilter) { - // Pulled from https://github.com/mbostock/d3/blob/master/src/format/requote.js - var SPECIAL_CHARACTERS_REGEXP = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; - - var localeId; - var formatCodeToRegex; - - this.init = function() { - localeId = $locale.id; - - this.parsers = {}; - this.formatters = {}; - - formatCodeToRegex = [ - { - key: 'yyyy', - regex: '\\d{4}', - apply: function(value) { this.year = +value; }, - formatter: function(date) { - var _date = new Date(); - _date.setFullYear(Math.abs(date.getFullYear())); - return dateFilter(_date, 'yyyy'); - } - }, - { - key: 'yy', - regex: '\\d{2}', - apply: function(value) { value = +value; this.year = value < 69 ? value + 2000 : value + 1900; }, - formatter: function(date) { - var _date = new Date(); - _date.setFullYear(Math.abs(date.getFullYear())); - return dateFilter(_date, 'yy'); - } - }, - { - key: 'y', - regex: '\\d{1,4}', - apply: function(value) { this.year = +value; }, - formatter: function(date) { - var _date = new Date(); - _date.setFullYear(Math.abs(date.getFullYear())); - return dateFilter(_date, 'y'); - } - }, - { - key: 'M!', - regex: '0?[1-9]|1[0-2]', - apply: function(value) { this.month = value - 1; }, - formatter: function(date) { - var value = date.getMonth(); - if (/^[0-9]$/.test(value)) { - return dateFilter(date, 'MM'); - } - - return dateFilter(date, 'M'); - } - }, - { - key: 'MMMM', - regex: $locale.DATETIME_FORMATS.MONTH.join('|'), - apply: function(value) { this.month = $locale.DATETIME_FORMATS.MONTH.indexOf(value); }, - formatter: function(date) { return dateFilter(date, 'MMMM'); } - }, - { - key: 'MMM', - regex: $locale.DATETIME_FORMATS.SHORTMONTH.join('|'), - apply: function(value) { this.month = $locale.DATETIME_FORMATS.SHORTMONTH.indexOf(value); }, - formatter: function(date) { return dateFilter(date, 'MMM'); } - }, - { - key: 'MM', - regex: '0[1-9]|1[0-2]', - apply: function(value) { this.month = value - 1; }, - formatter: function(date) { return dateFilter(date, 'MM'); } - }, - { - key: 'M', - regex: '[1-9]|1[0-2]', - apply: function(value) { this.month = value - 1; }, - formatter: function(date) { return dateFilter(date, 'M'); } - }, - { - key: 'd!', - regex: '[0-2]?[0-9]{1}|3[0-1]{1}', - apply: function(value) { this.date = +value; }, - formatter: function(date) { - var value = date.getDate(); - if (/^[1-9]$/.test(value)) { - return dateFilter(date, 'dd'); - } - - return dateFilter(date, 'd'); - } - }, - { - key: 'dd', - regex: '[0-2][0-9]{1}|3[0-1]{1}', - apply: function(value) { this.date = +value; }, - formatter: function(date) { return dateFilter(date, 'dd'); } - }, - { - key: 'd', - regex: '[1-2]?[0-9]{1}|3[0-1]{1}', - apply: function(value) { this.date = +value; }, - formatter: function(date) { return dateFilter(date, 'd'); } - }, - { - key: 'EEEE', - regex: $locale.DATETIME_FORMATS.DAY.join('|'), - formatter: function(date) { return dateFilter(date, 'EEEE'); } - }, - { - key: 'EEE', - regex: $locale.DATETIME_FORMATS.SHORTDAY.join('|'), - formatter: function(date) { return dateFilter(date, 'EEE'); } - }, - { - key: 'HH', - regex: '(?:0|1)[0-9]|2[0-3]', - apply: function(value) { this.hours = +value; }, - formatter: function(date) { return dateFilter(date, 'HH'); } - }, - { - key: 'hh', - regex: '0[0-9]|1[0-2]', - apply: function(value) { this.hours = +value; }, - formatter: function(date) { return dateFilter(date, 'hh'); } - }, - { - key: 'H', - regex: '1?[0-9]|2[0-3]', - apply: function(value) { this.hours = +value; }, - formatter: function(date) { return dateFilter(date, 'H'); } - }, - { - key: 'h', - regex: '[0-9]|1[0-2]', - apply: function(value) { this.hours = +value; }, - formatter: function(date) { return dateFilter(date, 'h'); } - }, - { - key: 'mm', - regex: '[0-5][0-9]', - apply: function(value) { this.minutes = +value; }, - formatter: function(date) { return dateFilter(date, 'mm'); } - }, - { - key: 'm', - regex: '[0-9]|[1-5][0-9]', - apply: function(value) { this.minutes = +value; }, - formatter: function(date) { return dateFilter(date, 'm'); } - }, - { - key: 'sss', - regex: '[0-9][0-9][0-9]', - apply: function(value) { this.milliseconds = +value; }, - formatter: function(date) { return dateFilter(date, 'sss'); } - }, - { - key: 'ss', - regex: '[0-5][0-9]', - apply: function(value) { this.seconds = +value; }, - formatter: function(date) { return dateFilter(date, 'ss'); } - }, - { - key: 's', - regex: '[0-9]|[1-5][0-9]', - apply: function(value) { this.seconds = +value; }, - formatter: function(date) { return dateFilter(date, 's'); } - }, - { - key: 'a', - regex: $locale.DATETIME_FORMATS.AMPMS.join('|'), - apply: function(value) { - if (this.hours === 12) { - this.hours = 0; - } - - if (value === 'PM') { - this.hours += 12; - } - }, - formatter: function(date) { return dateFilter(date, 'a'); } - }, - { - key: 'Z', - regex: '[+-]\\d{4}', - apply: function(value) { - var matches = value.match(/([+-])(\d{2})(\d{2})/), - sign = matches[1], - hours = matches[2], - minutes = matches[3]; - this.hours += toInt(sign + hours); - this.minutes += toInt(sign + minutes); - }, - formatter: function(date) { - return dateFilter(date, 'Z'); - } - }, - { - key: 'ww', - regex: '[0-4][0-9]|5[0-3]', - formatter: function(date) { return dateFilter(date, 'ww'); } - }, - { - key: 'w', - regex: '[0-9]|[1-4][0-9]|5[0-3]', - formatter: function(date) { return dateFilter(date, 'w'); } - }, - { - key: 'GGGG', - regex: $locale.DATETIME_FORMATS.ERANAMES.join('|').replace(/\s/g, '\\s'), - formatter: function(date) { return dateFilter(date, 'GGGG'); } - }, - { - key: 'GGG', - regex: $locale.DATETIME_FORMATS.ERAS.join('|'), - formatter: function(date) { return dateFilter(date, 'GGG'); } - }, - { - key: 'GG', - regex: $locale.DATETIME_FORMATS.ERAS.join('|'), - formatter: function(date) { return dateFilter(date, 'GG'); } - }, - { - key: 'G', - regex: $locale.DATETIME_FORMATS.ERAS.join('|'), - formatter: function(date) { return dateFilter(date, 'G'); } - } - ]; - }; - - this.init(); - - function createParser(format, func) { - var map = [], regex = format.split(''); - - // check for literal values - var quoteIndex = format.indexOf('\''); - if (quoteIndex > -1) { - var inLiteral = false; - format = format.split(''); - for (var i = quoteIndex; i < format.length; i++) { - if (inLiteral) { - if (format[i] === '\'') { - if (i + 1 < format.length && format[i+1] === '\'') { // escaped single quote - format[i+1] = '$'; - regex[i+1] = ''; - } else { // end of literal - regex[i] = ''; - inLiteral = false; - } - } - format[i] = '$'; - } else { - if (format[i] === '\'') { // start of literal - format[i] = '$'; - regex[i] = ''; - inLiteral = true; - } - } - } - - format = format.join(''); - } - - angular.forEach(formatCodeToRegex, function(data) { - var index = format.indexOf(data.key); - - if (index > -1) { - format = format.split(''); - - regex[index] = '(' + data.regex + ')'; - format[index] = '$'; // Custom symbol to define consumed part of format - for (var i = index + 1, n = index + data.key.length; i < n; i++) { - regex[i] = ''; - format[i] = '$'; - } - format = format.join(''); - - map.push({ - index: index, - key: data.key, - apply: data[func], - matcher: data.regex - }); - } - }); - - return { - regex: new RegExp('^' + regex.join('') + '$'), - map: orderByFilter(map, 'index') - }; - } - - this.filter = function(date, format) { - if (!angular.isDate(date) || isNaN(date) || !format) { - return ''; - } - - format = $locale.DATETIME_FORMATS[format] || format; - - if ($locale.id !== localeId) { - this.init(); - } - - if (!this.formatters[format]) { - this.formatters[format] = createParser(format, 'formatter'); - } - - var parser = this.formatters[format], - map = parser.map; - - var _format = format; - - return map.reduce(function(str, mapper, i) { - var match = _format.match(new RegExp('(.*)' + mapper.key)); - if (match && angular.isString(match[1])) { - str += match[1]; - _format = _format.replace(match[1] + mapper.key, ''); - } - - var endStr = i === map.length - 1 ? _format : ''; - - if (mapper.apply) { - return str + mapper.apply.call(null, date) + endStr; - } - - return str + endStr; - }, ''); - }; - - this.parse = function(input, format, baseDate) { - if (!angular.isString(input) || !format) { - return input; - } - - format = $locale.DATETIME_FORMATS[format] || format; - format = format.replace(SPECIAL_CHARACTERS_REGEXP, '\\$&'); - - if ($locale.id !== localeId) { - this.init(); - } - - if (!this.parsers[format]) { - this.parsers[format] = createParser(format, 'apply'); - } - - var parser = this.parsers[format], - regex = parser.regex, - map = parser.map, - results = input.match(regex), - tzOffset = false; - if (results && results.length) { - var fields, dt; - if (angular.isDate(baseDate) && !isNaN(baseDate.getTime())) { - fields = { - year: baseDate.getFullYear(), - month: baseDate.getMonth(), - date: baseDate.getDate(), - hours: baseDate.getHours(), - minutes: baseDate.getMinutes(), - seconds: baseDate.getSeconds(), - milliseconds: baseDate.getMilliseconds() - }; - } else { - if (baseDate) { - $log.warn('dateparser:', 'baseDate is not a valid date'); - } - fields = { year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 }; - } - - for (var i = 1, n = results.length; i < n; i++) { - var mapper = map[i - 1]; - if (mapper.matcher === 'Z') { - tzOffset = true; - } - - if (mapper.apply) { - mapper.apply.call(fields, results[i]); - } - } - - var datesetter = tzOffset ? Date.prototype.setUTCFullYear : - Date.prototype.setFullYear; - var timesetter = tzOffset ? Date.prototype.setUTCHours : - Date.prototype.setHours; - - if (isValid(fields.year, fields.month, fields.date)) { - if (angular.isDate(baseDate) && !isNaN(baseDate.getTime()) && !tzOffset) { - dt = new Date(baseDate); - datesetter.call(dt, fields.year, fields.month, fields.date); - timesetter.call(dt, fields.hours, fields.minutes, - fields.seconds, fields.milliseconds); - } else { - dt = new Date(0); - datesetter.call(dt, fields.year, fields.month, fields.date); - timesetter.call(dt, fields.hours || 0, fields.minutes || 0, - fields.seconds || 0, fields.milliseconds || 0); - } - } - - return dt; - } - }; - - // Check if date is valid for specific month (and year for February). - // Month: 0 = Jan, 1 = Feb, etc - function isValid(year, month, date) { - if (date < 1) { - return false; - } - - if (month === 1 && date > 28) { - return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0); - } - - if (month === 3 || month === 5 || month === 8 || month === 10) { - return date < 31; - } - - return true; - } - - function toInt(str) { - return parseInt(str, 10); - } - - this.toTimezone = toTimezone; - this.fromTimezone = fromTimezone; - this.timezoneToOffset = timezoneToOffset; - this.addDateMinutes = addDateMinutes; - this.convertTimezoneToLocal = convertTimezoneToLocal; - - function toTimezone(date, timezone) { - return date && timezone ? convertTimezoneToLocal(date, timezone) : date; - } - - function fromTimezone(date, timezone) { - return date && timezone ? convertTimezoneToLocal(date, timezone, true) : date; - } - - //https://github.com/angular/angular.js/blob/622c42169699ec07fc6daaa19fe6d224e5d2f70e/src/Angular.js#L1207 - function timezoneToOffset(timezone, fallback) { - timezone = timezone.replace(/:/g, ''); - var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000; - return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset; - } - - function addDateMinutes(date, minutes) { - date = new Date(date.getTime()); - date.setMinutes(date.getMinutes() + minutes); - return date; - } - - function convertTimezoneToLocal(date, timezone, reverse) { - reverse = reverse ? -1 : 1; - var dateTimezoneOffset = date.getTimezoneOffset(); - var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); - return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset)); - } -}]); - -// Avoiding use of ng-class as it creates a lot of watchers when a class is to be applied to -// at most one element. -angular.module('ui.bootstrap.isClass', []) -.directive('uibIsClass', [ - '$animate', -function ($animate) { - // 11111111 22222222 - var ON_REGEXP = /^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/; - // 11111111 22222222 - var IS_REGEXP = /^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/; - - var dataPerTracked = {}; - - return { - restrict: 'A', - compile: function(tElement, tAttrs) { - var linkedScopes = []; - var instances = []; - var expToData = {}; - var lastActivated = null; - var onExpMatches = tAttrs.uibIsClass.match(ON_REGEXP); - var onExp = onExpMatches[2]; - var expsStr = onExpMatches[1]; - var exps = expsStr.split(','); - - return linkFn; - - function linkFn(scope, element, attrs) { - linkedScopes.push(scope); - instances.push({ - scope: scope, - element: element - }); - - exps.forEach(function(exp, k) { - addForExp(exp, scope); - }); - - scope.$on('$destroy', removeScope); - } - - function addForExp(exp, scope) { - var matches = exp.match(IS_REGEXP); - var clazz = scope.$eval(matches[1]); - var compareWithExp = matches[2]; - var data = expToData[exp]; - if (!data) { - var watchFn = function(compareWithVal) { - var newActivated = null; - instances.some(function(instance) { - var thisVal = instance.scope.$eval(onExp); - if (thisVal === compareWithVal) { - newActivated = instance; - return true; - } - }); - if (data.lastActivated !== newActivated) { - if (data.lastActivated) { - $animate.removeClass(data.lastActivated.element, clazz); - } - if (newActivated) { - $animate.addClass(newActivated.element, clazz); - } - data.lastActivated = newActivated; - } - }; - expToData[exp] = data = { - lastActivated: null, - scope: scope, - watchFn: watchFn, - compareWithExp: compareWithExp, - watcher: scope.$watch(compareWithExp, watchFn) - }; - } - data.watchFn(scope.$eval(compareWithExp)); - } - - function removeScope(e) { - var removedScope = e.targetScope; - var index = linkedScopes.indexOf(removedScope); - linkedScopes.splice(index, 1); - instances.splice(index, 1); - if (linkedScopes.length) { - var newWatchScope = linkedScopes[0]; - angular.forEach(expToData, function(data) { - if (data.scope === removedScope) { - data.watcher = newWatchScope.$watch(data.compareWithExp, data.watchFn); - data.scope = newWatchScope; - } - }); - } else { - expToData = {}; - } - } - } - }; -}]); -angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.isClass']) - -.value('$datepickerSuppressError', false) - -.value('$datepickerLiteralWarning', true) - -.constant('uibDatepickerConfig', { - datepickerMode: 'day', - formatDay: 'dd', - formatMonth: 'MMMM', - formatYear: 'yyyy', - formatDayHeader: 'EEE', - formatDayTitle: 'MMMM yyyy', - formatMonthTitle: 'yyyy', - maxDate: null, - maxMode: 'year', - minDate: null, - minMode: 'day', - ngModelOptions: {}, - shortcutPropagation: false, - showWeeks: true, - yearColumns: 5, - yearRows: 4 -}) - -.controller('UibDatepickerController', ['$scope', '$attrs', '$parse', '$interpolate', '$locale', '$log', 'dateFilter', 'uibDatepickerConfig', '$datepickerLiteralWarning', '$datepickerSuppressError', 'uibDateParser', - function($scope, $attrs, $parse, $interpolate, $locale, $log, dateFilter, datepickerConfig, $datepickerLiteralWarning, $datepickerSuppressError, dateParser) { - var self = this, - ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl; - ngModelOptions = {}, - watchListeners = [], - optionsUsed = !!$attrs.datepickerOptions; - - if (!$scope.datepickerOptions) { - $scope.datepickerOptions = {}; - } - - // Modes chain - this.modes = ['day', 'month', 'year']; - - [ - 'customClass', - 'dateDisabled', - 'datepickerMode', - 'formatDay', - 'formatDayHeader', - 'formatDayTitle', - 'formatMonth', - 'formatMonthTitle', - 'formatYear', - 'maxDate', - 'maxMode', - 'minDate', - 'minMode', - 'showWeeks', - 'shortcutPropagation', - 'startingDay', - 'yearColumns', - 'yearRows' - ].forEach(function(key) { - switch (key) { - case 'customClass': - case 'dateDisabled': - $scope[key] = $scope.datepickerOptions[key] || angular.noop; - break; - case 'datepickerMode': - $scope.datepickerMode = angular.isDefined($scope.datepickerOptions.datepickerMode) ? - $scope.datepickerOptions.datepickerMode : datepickerConfig.datepickerMode; - break; - case 'formatDay': - case 'formatDayHeader': - case 'formatDayTitle': - case 'formatMonth': - case 'formatMonthTitle': - case 'formatYear': - self[key] = angular.isDefined($scope.datepickerOptions[key]) ? - $interpolate($scope.datepickerOptions[key])($scope.$parent) : - datepickerConfig[key]; - break; - case 'showWeeks': - case 'shortcutPropagation': - case 'yearColumns': - case 'yearRows': - self[key] = angular.isDefined($scope.datepickerOptions[key]) ? - $scope.datepickerOptions[key] : datepickerConfig[key]; - break; - case 'startingDay': - if (angular.isDefined($scope.datepickerOptions.startingDay)) { - self.startingDay = $scope.datepickerOptions.startingDay; - } else if (angular.isNumber(datepickerConfig.startingDay)) { - self.startingDay = datepickerConfig.startingDay; - } else { - self.startingDay = ($locale.DATETIME_FORMATS.FIRSTDAYOFWEEK + 8) % 7; - } - - break; - case 'maxDate': - case 'minDate': - $scope.$watch('datepickerOptions.' + key, function(value) { - if (value) { - if (angular.isDate(value)) { - self[key] = dateParser.fromTimezone(new Date(value), ngModelOptions.timezone); - } else { - if ($datepickerLiteralWarning) { - $log.warn('Literal date support has been deprecated, please switch to date object usage'); - } - - self[key] = new Date(dateFilter(value, 'medium')); - } - } else { - self[key] = datepickerConfig[key] ? - dateParser.fromTimezone(new Date(datepickerConfig[key]), ngModelOptions.timezone) : - null; - } - - self.refreshView(); - }); - - break; - case 'maxMode': - case 'minMode': - if ($scope.datepickerOptions[key]) { - $scope.$watch(function() { return $scope.datepickerOptions[key]; }, function(value) { - self[key] = $scope[key] = angular.isDefined(value) ? value : datepickerOptions[key]; - if (key === 'minMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) < self.modes.indexOf(self[key]) || - key === 'maxMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) > self.modes.indexOf(self[key])) { - $scope.datepickerMode = self[key]; - $scope.datepickerOptions.datepickerMode = self[key]; - } - }); - } else { - self[key] = $scope[key] = datepickerConfig[key] || null; - } - - break; - } - }); - - $scope.uniqueId = 'datepicker-' + $scope.$id + '-' + Math.floor(Math.random() * 10000); - - $scope.disabled = angular.isDefined($attrs.disabled) || false; - if (angular.isDefined($attrs.ngDisabled)) { - watchListeners.push($scope.$parent.$watch($attrs.ngDisabled, function(disabled) { - $scope.disabled = disabled; - self.refreshView(); - })); - } - - $scope.isActive = function(dateObject) { - if (self.compare(dateObject.date, self.activeDate) === 0) { - $scope.activeDateId = dateObject.uid; - return true; - } - return false; - }; - - this.init = function(ngModelCtrl_) { - ngModelCtrl = ngModelCtrl_; - ngModelOptions = ngModelCtrl_.$options || datepickerConfig.ngModelOptions; - if ($scope.datepickerOptions.initDate) { - self.activeDate = dateParser.fromTimezone($scope.datepickerOptions.initDate, ngModelOptions.timezone) || new Date(); - $scope.$watch('datepickerOptions.initDate', function(initDate) { - if (initDate && (ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue) || ngModelCtrl.$invalid)) { - self.activeDate = dateParser.fromTimezone(initDate, ngModelOptions.timezone); - self.refreshView(); - } - }); - } else { - self.activeDate = new Date(); - } - - var date = ngModelCtrl.$modelValue ? new Date(ngModelCtrl.$modelValue) : new Date(); - this.activeDate = !isNaN(date) ? - dateParser.fromTimezone(date, ngModelOptions.timezone) : - dateParser.fromTimezone(new Date(), ngModelOptions.timezone); - - ngModelCtrl.$render = function() { - self.render(); - }; - }; - - this.render = function() { - if (ngModelCtrl.$viewValue) { - var date = new Date(ngModelCtrl.$viewValue), - isValid = !isNaN(date); - - if (isValid) { - this.activeDate = dateParser.fromTimezone(date, ngModelOptions.timezone); - } else if (!$datepickerSuppressError) { - $log.error('Datepicker directive: "ng-model" value must be a Date object'); - } - } - this.refreshView(); - }; - - this.refreshView = function() { - if (this.element) { - $scope.selectedDt = null; - this._refreshView(); - if ($scope.activeDt) { - $scope.activeDateId = $scope.activeDt.uid; - } - - var date = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null; - date = dateParser.fromTimezone(date, ngModelOptions.timezone); - ngModelCtrl.$setValidity('dateDisabled', !date || - this.element && !this.isDisabled(date)); - } - }; - - this.createDateObject = function(date, format) { - var model = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null; - model = dateParser.fromTimezone(model, ngModelOptions.timezone); - var today = new Date(); - today = dateParser.fromTimezone(today, ngModelOptions.timezone); - var time = this.compare(date, today); - var dt = { - date: date, - label: dateParser.filter(date, format), - selected: model && this.compare(date, model) === 0, - disabled: this.isDisabled(date), - past: time < 0, - current: time === 0, - future: time > 0, - customClass: this.customClass(date) || null - }; - - if (model && this.compare(date, model) === 0) { - $scope.selectedDt = dt; - } - - if (self.activeDate && this.compare(dt.date, self.activeDate) === 0) { - $scope.activeDt = dt; - } - - return dt; - }; - - this.isDisabled = function(date) { - return $scope.disabled || - this.minDate && this.compare(date, this.minDate) < 0 || - this.maxDate && this.compare(date, this.maxDate) > 0 || - $scope.dateDisabled && $scope.dateDisabled({date: date, mode: $scope.datepickerMode}); - }; - - this.customClass = function(date) { - return $scope.customClass({date: date, mode: $scope.datepickerMode}); - }; - - // Split array into smaller arrays - this.split = function(arr, size) { - var arrays = []; - while (arr.length > 0) { - arrays.push(arr.splice(0, size)); - } - return arrays; - }; - - $scope.select = function(date) { - if ($scope.datepickerMode === self.minMode) { - var dt = ngModelCtrl.$viewValue ? dateParser.fromTimezone(new Date(ngModelCtrl.$viewValue), ngModelOptions.timezone) : new Date(0, 0, 0, 0, 0, 0, 0); - dt.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); - dt = dateParser.toTimezone(dt, ngModelOptions.timezone); - ngModelCtrl.$setViewValue(dt); - ngModelCtrl.$render(); - } else { - self.activeDate = date; - setMode(self.modes[self.modes.indexOf($scope.datepickerMode) - 1]); - - $scope.$emit('uib:datepicker.mode'); - } - - $scope.$broadcast('uib:datepicker.focus'); - }; - - $scope.move = function(direction) { - var year = self.activeDate.getFullYear() + direction * (self.step.years || 0), - month = self.activeDate.getMonth() + direction * (self.step.months || 0); - self.activeDate.setFullYear(year, month, 1); - self.refreshView(); - }; - - $scope.toggleMode = function(direction) { - direction = direction || 1; - - if ($scope.datepickerMode === self.maxMode && direction === 1 || - $scope.datepickerMode === self.minMode && direction === -1) { - return; - } - - setMode(self.modes[self.modes.indexOf($scope.datepickerMode) + direction]); - - $scope.$emit('uib:datepicker.mode'); - }; - - // Key event mapper - $scope.keys = { 13: 'enter', 32: 'space', 33: 'pageup', 34: 'pagedown', 35: 'end', 36: 'home', 37: 'left', 38: 'up', 39: 'right', 40: 'down' }; - - var focusElement = function() { - self.element[0].focus(); - }; - - // Listen for focus requests from popup directive - $scope.$on('uib:datepicker.focus', focusElement); - - $scope.keydown = function(evt) { - var key = $scope.keys[evt.which]; - - if (!key || evt.shiftKey || evt.altKey || $scope.disabled) { - return; - } - - evt.preventDefault(); - if (!self.shortcutPropagation) { - evt.stopPropagation(); - } - - if (key === 'enter' || key === 'space') { - if (self.isDisabled(self.activeDate)) { - return; // do nothing - } - $scope.select(self.activeDate); - } else if (evt.ctrlKey && (key === 'up' || key === 'down')) { - $scope.toggleMode(key === 'up' ? 1 : -1); - } else { - self.handleKeyDown(key, evt); - self.refreshView(); - } - }; - - $scope.$on('$destroy', function() { - //Clear all watch listeners on destroy - while (watchListeners.length) { - watchListeners.shift()(); - } - }); - - function setMode(mode) { - $scope.datepickerMode = mode; - $scope.datepickerOptions.datepickerMode = mode; - } -}]) - -.controller('UibDaypickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) { - var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - - this.step = { months: 1 }; - this.element = $element; - function getDaysInMonth(year, month) { - return month === 1 && year % 4 === 0 && - (year % 100 !== 0 || year % 400 === 0) ? 29 : DAYS_IN_MONTH[month]; - } - - this.init = function(ctrl) { - angular.extend(ctrl, this); - scope.showWeeks = ctrl.showWeeks; - ctrl.refreshView(); - }; - - this.getDates = function(startDate, n) { - var dates = new Array(n), current = new Date(startDate), i = 0, date; - while (i < n) { - date = new Date(current); - dates[i++] = date; - current.setDate(current.getDate() + 1); - } - return dates; - }; - - this._refreshView = function() { - var year = this.activeDate.getFullYear(), - month = this.activeDate.getMonth(), - firstDayOfMonth = new Date(this.activeDate); - - firstDayOfMonth.setFullYear(year, month, 1); - - var difference = this.startingDay - firstDayOfMonth.getDay(), - numDisplayedFromPreviousMonth = difference > 0 ? - 7 - difference : - difference, - firstDate = new Date(firstDayOfMonth); - - if (numDisplayedFromPreviousMonth > 0) { - firstDate.setDate(-numDisplayedFromPreviousMonth + 1); - } - - // 42 is the number of days on a six-week calendar - var days = this.getDates(firstDate, 42); - for (var i = 0; i < 42; i ++) { - days[i] = angular.extend(this.createDateObject(days[i], this.formatDay), { - secondary: days[i].getMonth() !== month, - uid: scope.uniqueId + '-' + i - }); - } - - scope.labels = new Array(7); - for (var j = 0; j < 7; j++) { - scope.labels[j] = { - abbr: dateFilter(days[j].date, this.formatDayHeader), - full: dateFilter(days[j].date, 'EEEE') - }; - } - - scope.title = dateFilter(this.activeDate, this.formatDayTitle); - scope.rows = this.split(days, 7); - - if (scope.showWeeks) { - scope.weekNumbers = []; - var thursdayIndex = (4 + 7 - this.startingDay) % 7, - numWeeks = scope.rows.length; - for (var curWeek = 0; curWeek < numWeeks; curWeek++) { - scope.weekNumbers.push( - getISO8601WeekNumber(scope.rows[curWeek][thursdayIndex].date)); - } - } - }; - - this.compare = function(date1, date2) { - var _date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()); - var _date2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()); - _date1.setFullYear(date1.getFullYear()); - _date2.setFullYear(date2.getFullYear()); - return _date1 - _date2; - }; - - function getISO8601WeekNumber(date) { - var checkDate = new Date(date); - checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); // Thursday - var time = checkDate.getTime(); - checkDate.setMonth(0); // Compare with Jan 1 - checkDate.setDate(1); - return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; - } - - this.handleKeyDown = function(key, evt) { - var date = this.activeDate.getDate(); - - if (key === 'left') { - date = date - 1; - } else if (key === 'up') { - date = date - 7; - } else if (key === 'right') { - date = date + 1; - } else if (key === 'down') { - date = date + 7; - } else if (key === 'pageup' || key === 'pagedown') { - var month = this.activeDate.getMonth() + (key === 'pageup' ? - 1 : 1); - this.activeDate.setMonth(month, 1); - date = Math.min(getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth()), date); - } else if (key === 'home') { - date = 1; - } else if (key === 'end') { - date = getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth()); - } - this.activeDate.setDate(date); - }; -}]) - -.controller('UibMonthpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) { - this.step = { years: 1 }; - this.element = $element; - - this.init = function(ctrl) { - angular.extend(ctrl, this); - ctrl.refreshView(); - }; - - this._refreshView = function() { - var months = new Array(12), - year = this.activeDate.getFullYear(), - date; - - for (var i = 0; i < 12; i++) { - date = new Date(this.activeDate); - date.setFullYear(year, i, 1); - months[i] = angular.extend(this.createDateObject(date, this.formatMonth), { - uid: scope.uniqueId + '-' + i - }); - } - - scope.title = dateFilter(this.activeDate, this.formatMonthTitle); - scope.rows = this.split(months, 3); - }; - - this.compare = function(date1, date2) { - var _date1 = new Date(date1.getFullYear(), date1.getMonth()); - var _date2 = new Date(date2.getFullYear(), date2.getMonth()); - _date1.setFullYear(date1.getFullYear()); - _date2.setFullYear(date2.getFullYear()); - return _date1 - _date2; - }; - - this.handleKeyDown = function(key, evt) { - var date = this.activeDate.getMonth(); - - if (key === 'left') { - date = date - 1; - } else if (key === 'up') { - date = date - 3; - } else if (key === 'right') { - date = date + 1; - } else if (key === 'down') { - date = date + 3; - } else if (key === 'pageup' || key === 'pagedown') { - var year = this.activeDate.getFullYear() + (key === 'pageup' ? - 1 : 1); - this.activeDate.setFullYear(year); - } else if (key === 'home') { - date = 0; - } else if (key === 'end') { - date = 11; - } - this.activeDate.setMonth(date); - }; -}]) - -.controller('UibYearpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) { - var columns, range; - this.element = $element; - - function getStartingYear(year) { - return parseInt((year - 1) / range, 10) * range + 1; - } - - this.yearpickerInit = function() { - columns = this.yearColumns; - range = this.yearRows * columns; - this.step = { years: range }; - }; - - this._refreshView = function() { - var years = new Array(range), date; - - for (var i = 0, start = getStartingYear(this.activeDate.getFullYear()); i < range; i++) { - date = new Date(this.activeDate); - date.setFullYear(start + i, 0, 1); - years[i] = angular.extend(this.createDateObject(date, this.formatYear), { - uid: scope.uniqueId + '-' + i - }); - } - - scope.title = [years[0].label, years[range - 1].label].join(' - '); - scope.rows = this.split(years, columns); - scope.columns = columns; - }; - - this.compare = function(date1, date2) { - return date1.getFullYear() - date2.getFullYear(); - }; - - this.handleKeyDown = function(key, evt) { - var date = this.activeDate.getFullYear(); - - if (key === 'left') { - date = date - 1; - } else if (key === 'up') { - date = date - columns; - } else if (key === 'right') { - date = date + 1; - } else if (key === 'down') { - date = date + columns; - } else if (key === 'pageup' || key === 'pagedown') { - date += (key === 'pageup' ? - 1 : 1) * range; - } else if (key === 'home') { - date = getStartingYear(this.activeDate.getFullYear()); - } else if (key === 'end') { - date = getStartingYear(this.activeDate.getFullYear()) + range - 1; - } - this.activeDate.setFullYear(date); - }; -}]) - -.directive('uibDatepicker', function() { - return { - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepicker/datepicker.html'; - }, - scope: { - datepickerOptions: '=?' - }, - require: ['uibDatepicker', '^ngModel'], - controller: 'UibDatepickerController', - controllerAs: 'datepicker', - link: function(scope, element, attrs, ctrls) { - var datepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - datepickerCtrl.init(ngModelCtrl); - } - }; -}) - -.directive('uibDaypicker', function() { - return { - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepicker/day.html'; - }, - require: ['^uibDatepicker', 'uibDaypicker'], - controller: 'UibDaypickerController', - link: function(scope, element, attrs, ctrls) { - var datepickerCtrl = ctrls[0], - daypickerCtrl = ctrls[1]; - - daypickerCtrl.init(datepickerCtrl); - } - }; -}) - -.directive('uibMonthpicker', function() { - return { - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepicker/month.html'; - }, - require: ['^uibDatepicker', 'uibMonthpicker'], - controller: 'UibMonthpickerController', - link: function(scope, element, attrs, ctrls) { - var datepickerCtrl = ctrls[0], - monthpickerCtrl = ctrls[1]; - - monthpickerCtrl.init(datepickerCtrl); - } - }; -}) - -.directive('uibYearpicker', function() { - return { - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepicker/year.html'; - }, - require: ['^uibDatepicker', 'uibYearpicker'], - controller: 'UibYearpickerController', - link: function(scope, element, attrs, ctrls) { - var ctrl = ctrls[0]; - angular.extend(ctrl, ctrls[1]); - ctrl.yearpickerInit(); - - ctrl.refreshView(); - } - }; -}); - -angular.module('ui.bootstrap.position', []) - -/** - * A set of utility methods for working with the DOM. - * It is meant to be used where we need to absolute-position elements in - * relation to another element (this is the case for tooltips, popovers, - * typeahead suggestions etc.). - */ - .factory('$uibPosition', ['$document', '$window', function($document, $window) { - /** - * Used by scrollbarWidth() function to cache scrollbar's width. - * Do not access this variable directly, use scrollbarWidth() instead. - */ - var SCROLLBAR_WIDTH; - /** - * scrollbar on body and html element in IE and Edge overlay - * content and should be considered 0 width. - */ - var BODY_SCROLLBAR_WIDTH; - var OVERFLOW_REGEX = { - normal: /(auto|scroll)/, - hidden: /(auto|scroll|hidden)/ - }; - var PLACEMENT_REGEX = { - auto: /\s?auto?\s?/i, - primary: /^(top|bottom|left|right)$/, - secondary: /^(top|bottom|left|right|center)$/, - vertical: /^(top|bottom)$/ - }; - var BODY_REGEX = /(HTML|BODY)/; - - return { - - /** - * Provides a raw DOM element from a jQuery/jQLite element. - * - * @param {element} elem - The element to convert. - * - * @returns {element} A HTML element. - */ - getRawNode: function(elem) { - return elem.nodeName ? elem : elem[0] || elem; - }, - - /** - * Provides a parsed number for a style property. Strips - * units and casts invalid numbers to 0. - * - * @param {string} value - The style value to parse. - * - * @returns {number} A valid number. - */ - parseStyle: function(value) { - value = parseFloat(value); - return isFinite(value) ? value : 0; - }, - - /** - * Provides the closest positioned ancestor. - * - * @param {element} element - The element to get the offest parent for. - * - * @returns {element} The closest positioned ancestor. - */ - offsetParent: function(elem) { - elem = this.getRawNode(elem); - - var offsetParent = elem.offsetParent || $document[0].documentElement; - - function isStaticPositioned(el) { - return ($window.getComputedStyle(el).position || 'static') === 'static'; - } - - while (offsetParent && offsetParent !== $document[0].documentElement && isStaticPositioned(offsetParent)) { - offsetParent = offsetParent.offsetParent; - } - - return offsetParent || $document[0].documentElement; - }, - - /** - * Provides the scrollbar width, concept from TWBS measureScrollbar() - * function in https://github.com/twbs/bootstrap/blob/master/js/modal.js - * In IE and Edge, scollbar on body and html element overlay and should - * return a width of 0. - * - * @returns {number} The width of the browser scollbar. - */ - scrollbarWidth: function(isBody) { - if (isBody) { - if (angular.isUndefined(BODY_SCROLLBAR_WIDTH)) { - var bodyElem = $document.find('body'); - bodyElem.addClass('uib-position-body-scrollbar-measure'); - BODY_SCROLLBAR_WIDTH = $window.innerWidth - bodyElem[0].clientWidth; - BODY_SCROLLBAR_WIDTH = isFinite(BODY_SCROLLBAR_WIDTH) ? BODY_SCROLLBAR_WIDTH : 0; - bodyElem.removeClass('uib-position-body-scrollbar-measure'); - } - return BODY_SCROLLBAR_WIDTH; - } - - if (angular.isUndefined(SCROLLBAR_WIDTH)) { - var scrollElem = angular.element('
'); - $document.find('body').append(scrollElem); - SCROLLBAR_WIDTH = scrollElem[0].offsetWidth - scrollElem[0].clientWidth; - SCROLLBAR_WIDTH = isFinite(SCROLLBAR_WIDTH) ? SCROLLBAR_WIDTH : 0; - scrollElem.remove(); - } - - return SCROLLBAR_WIDTH; - }, - - /** - * Provides the padding required on an element to replace the scrollbar. - * - * @returns {object} An object with the following properties: - *
    - *
  • **scrollbarWidth**: the width of the scrollbar
  • - *
  • **widthOverflow**: whether the the width is overflowing
  • - *
  • **right**: the amount of right padding on the element needed to replace the scrollbar
  • - *
  • **rightOriginal**: the amount of right padding currently on the element
  • - *
  • **heightOverflow**: whether the the height is overflowing
  • - *
  • **bottom**: the amount of bottom padding on the element needed to replace the scrollbar
  • - *
  • **bottomOriginal**: the amount of bottom padding currently on the element
  • - *
- */ - scrollbarPadding: function(elem) { - elem = this.getRawNode(elem); - - var elemStyle = $window.getComputedStyle(elem); - var paddingRight = this.parseStyle(elemStyle.paddingRight); - var paddingBottom = this.parseStyle(elemStyle.paddingBottom); - var scrollParent = this.scrollParent(elem, false, true); - var scrollbarWidth = this.scrollbarWidth(scrollParent, BODY_REGEX.test(scrollParent.tagName)); - - return { - scrollbarWidth: scrollbarWidth, - widthOverflow: scrollParent.scrollWidth > scrollParent.clientWidth, - right: paddingRight + scrollbarWidth, - originalRight: paddingRight, - heightOverflow: scrollParent.scrollHeight > scrollParent.clientHeight, - bottom: paddingBottom + scrollbarWidth, - originalBottom: paddingBottom - }; - }, - - /** - * Checks to see if the element is scrollable. - * - * @param {element} elem - The element to check. - * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered, - * default is false. - * - * @returns {boolean} Whether the element is scrollable. - */ - isScrollable: function(elem, includeHidden) { - elem = this.getRawNode(elem); - - var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal; - var elemStyle = $window.getComputedStyle(elem); - return overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX); - }, - - /** - * Provides the closest scrollable ancestor. - * A port of the jQuery UI scrollParent method: - * https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js - * - * @param {element} elem - The element to find the scroll parent of. - * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered, - * default is false. - * @param {boolean=} [includeSelf=false] - Should the element being passed be - * included in the scrollable llokup. - * - * @returns {element} A HTML element. - */ - scrollParent: function(elem, includeHidden, includeSelf) { - elem = this.getRawNode(elem); - - var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal; - var documentEl = $document[0].documentElement; - var elemStyle = $window.getComputedStyle(elem); - if (includeSelf && overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX)) { - return elem; - } - var excludeStatic = elemStyle.position === 'absolute'; - var scrollParent = elem.parentElement || documentEl; - - if (scrollParent === documentEl || elemStyle.position === 'fixed') { - return documentEl; - } - - while (scrollParent.parentElement && scrollParent !== documentEl) { - var spStyle = $window.getComputedStyle(scrollParent); - if (excludeStatic && spStyle.position !== 'static') { - excludeStatic = false; - } - - if (!excludeStatic && overflowRegex.test(spStyle.overflow + spStyle.overflowY + spStyle.overflowX)) { - break; - } - scrollParent = scrollParent.parentElement; - } - - return scrollParent; - }, - - /** - * Provides read-only equivalent of jQuery's position function: - * http://api.jquery.com/position/ - distance to closest positioned - * ancestor. Does not account for margins by default like jQuery position. - * - * @param {element} elem - The element to caclulate the position on. - * @param {boolean=} [includeMargins=false] - Should margins be accounted - * for, default is false. - * - * @returns {object} An object with the following properties: - *
    - *
  • **width**: the width of the element
  • - *
  • **height**: the height of the element
  • - *
  • **top**: distance to top edge of offset parent
  • - *
  • **left**: distance to left edge of offset parent
  • - *
- */ - position: function(elem, includeMagins) { - elem = this.getRawNode(elem); - - var elemOffset = this.offset(elem); - if (includeMagins) { - var elemStyle = $window.getComputedStyle(elem); - elemOffset.top -= this.parseStyle(elemStyle.marginTop); - elemOffset.left -= this.parseStyle(elemStyle.marginLeft); - } - var parent = this.offsetParent(elem); - var parentOffset = {top: 0, left: 0}; - - if (parent !== $document[0].documentElement) { - parentOffset = this.offset(parent); - parentOffset.top += parent.clientTop - parent.scrollTop; - parentOffset.left += parent.clientLeft - parent.scrollLeft; - } - - return { - width: Math.round(angular.isNumber(elemOffset.width) ? elemOffset.width : elem.offsetWidth), - height: Math.round(angular.isNumber(elemOffset.height) ? elemOffset.height : elem.offsetHeight), - top: Math.round(elemOffset.top - parentOffset.top), - left: Math.round(elemOffset.left - parentOffset.left) - }; - }, - - /** - * Provides read-only equivalent of jQuery's offset function: - * http://api.jquery.com/offset/ - distance to viewport. Does - * not account for borders, margins, or padding on the body - * element. - * - * @param {element} elem - The element to calculate the offset on. - * - * @returns {object} An object with the following properties: - *
    - *
  • **width**: the width of the element
  • - *
  • **height**: the height of the element
  • - *
  • **top**: distance to top edge of viewport
  • - *
  • **right**: distance to bottom edge of viewport
  • - *
- */ - offset: function(elem) { - elem = this.getRawNode(elem); - - var elemBCR = elem.getBoundingClientRect(); - return { - width: Math.round(angular.isNumber(elemBCR.width) ? elemBCR.width : elem.offsetWidth), - height: Math.round(angular.isNumber(elemBCR.height) ? elemBCR.height : elem.offsetHeight), - top: Math.round(elemBCR.top + ($window.pageYOffset || $document[0].documentElement.scrollTop)), - left: Math.round(elemBCR.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft)) - }; - }, - - /** - * Provides offset distance to the closest scrollable ancestor - * or viewport. Accounts for border and scrollbar width. - * - * Right and bottom dimensions represent the distance to the - * respective edge of the viewport element. If the element - * edge extends beyond the viewport, a negative value will be - * reported. - * - * @param {element} elem - The element to get the viewport offset for. - * @param {boolean=} [useDocument=false] - Should the viewport be the document element instead - * of the first scrollable element, default is false. - * @param {boolean=} [includePadding=true] - Should the padding on the offset parent element - * be accounted for, default is true. - * - * @returns {object} An object with the following properties: - *
    - *
  • **top**: distance to the top content edge of viewport element
  • - *
  • **bottom**: distance to the bottom content edge of viewport element
  • - *
  • **left**: distance to the left content edge of viewport element
  • - *
  • **right**: distance to the right content edge of viewport element
  • - *
- */ - viewportOffset: function(elem, useDocument, includePadding) { - elem = this.getRawNode(elem); - includePadding = includePadding !== false ? true : false; - - var elemBCR = elem.getBoundingClientRect(); - var offsetBCR = {top: 0, left: 0, bottom: 0, right: 0}; - - var offsetParent = useDocument ? $document[0].documentElement : this.scrollParent(elem); - var offsetParentBCR = offsetParent.getBoundingClientRect(); - - offsetBCR.top = offsetParentBCR.top + offsetParent.clientTop; - offsetBCR.left = offsetParentBCR.left + offsetParent.clientLeft; - if (offsetParent === $document[0].documentElement) { - offsetBCR.top += $window.pageYOffset; - offsetBCR.left += $window.pageXOffset; - } - offsetBCR.bottom = offsetBCR.top + offsetParent.clientHeight; - offsetBCR.right = offsetBCR.left + offsetParent.clientWidth; - - if (includePadding) { - var offsetParentStyle = $window.getComputedStyle(offsetParent); - offsetBCR.top += this.parseStyle(offsetParentStyle.paddingTop); - offsetBCR.bottom -= this.parseStyle(offsetParentStyle.paddingBottom); - offsetBCR.left += this.parseStyle(offsetParentStyle.paddingLeft); - offsetBCR.right -= this.parseStyle(offsetParentStyle.paddingRight); - } - - return { - top: Math.round(elemBCR.top - offsetBCR.top), - bottom: Math.round(offsetBCR.bottom - elemBCR.bottom), - left: Math.round(elemBCR.left - offsetBCR.left), - right: Math.round(offsetBCR.right - elemBCR.right) - }; - }, - - /** - * Provides an array of placement values parsed from a placement string. - * Along with the 'auto' indicator, supported placement strings are: - *
    - *
  • top: element on top, horizontally centered on host element.
  • - *
  • top-left: element on top, left edge aligned with host element left edge.
  • - *
  • top-right: element on top, lerightft edge aligned with host element right edge.
  • - *
  • bottom: element on bottom, horizontally centered on host element.
  • - *
  • bottom-left: element on bottom, left edge aligned with host element left edge.
  • - *
  • bottom-right: element on bottom, right edge aligned with host element right edge.
  • - *
  • left: element on left, vertically centered on host element.
  • - *
  • left-top: element on left, top edge aligned with host element top edge.
  • - *
  • left-bottom: element on left, bottom edge aligned with host element bottom edge.
  • - *
  • right: element on right, vertically centered on host element.
  • - *
  • right-top: element on right, top edge aligned with host element top edge.
  • - *
  • right-bottom: element on right, bottom edge aligned with host element bottom edge.
  • - *
- * A placement string with an 'auto' indicator is expected to be - * space separated from the placement, i.e: 'auto bottom-left' If - * the primary and secondary placement values do not match 'top, - * bottom, left, right' then 'top' will be the primary placement and - * 'center' will be the secondary placement. If 'auto' is passed, true - * will be returned as the 3rd value of the array. - * - * @param {string} placement - The placement string to parse. - * - * @returns {array} An array with the following values - *
    - *
  • **[0]**: The primary placement.
  • - *
  • **[1]**: The secondary placement.
  • - *
  • **[2]**: If auto is passed: true, else undefined.
  • - *
- */ - parsePlacement: function(placement) { - var autoPlace = PLACEMENT_REGEX.auto.test(placement); - if (autoPlace) { - placement = placement.replace(PLACEMENT_REGEX.auto, ''); - } - - placement = placement.split('-'); - - placement[0] = placement[0] || 'top'; - if (!PLACEMENT_REGEX.primary.test(placement[0])) { - placement[0] = 'top'; - } - - placement[1] = placement[1] || 'center'; - if (!PLACEMENT_REGEX.secondary.test(placement[1])) { - placement[1] = 'center'; - } - - if (autoPlace) { - placement[2] = true; - } else { - placement[2] = false; - } - - return placement; - }, - - /** - * Provides coordinates for an element to be positioned relative to - * another element. Passing 'auto' as part of the placement parameter - * will enable smart placement - where the element fits. i.e: - * 'auto left-top' will check to see if there is enough space to the left - * of the hostElem to fit the targetElem, if not place right (same for secondary - * top placement). Available space is calculated using the viewportOffset - * function. - * - * @param {element} hostElem - The element to position against. - * @param {element} targetElem - The element to position. - * @param {string=} [placement=top] - The placement for the targetElem, - * default is 'top'. 'center' is assumed as secondary placement for - * 'top', 'left', 'right', and 'bottom' placements. Available placements are: - *
    - *
  • top
  • - *
  • top-right
  • - *
  • top-left
  • - *
  • bottom
  • - *
  • bottom-left
  • - *
  • bottom-right
  • - *
  • left
  • - *
  • left-top
  • - *
  • left-bottom
  • - *
  • right
  • - *
  • right-top
  • - *
  • right-bottom
  • - *
- * @param {boolean=} [appendToBody=false] - Should the top and left values returned - * be calculated from the body element, default is false. - * - * @returns {object} An object with the following properties: - *
    - *
  • **top**: Value for targetElem top.
  • - *
  • **left**: Value for targetElem left.
  • - *
  • **placement**: The resolved placement.
  • - *
- */ - positionElements: function(hostElem, targetElem, placement, appendToBody) { - hostElem = this.getRawNode(hostElem); - targetElem = this.getRawNode(targetElem); - - // need to read from prop to support tests. - var targetWidth = angular.isDefined(targetElem.offsetWidth) ? targetElem.offsetWidth : targetElem.prop('offsetWidth'); - var targetHeight = angular.isDefined(targetElem.offsetHeight) ? targetElem.offsetHeight : targetElem.prop('offsetHeight'); - - placement = this.parsePlacement(placement); - - var hostElemPos = appendToBody ? this.offset(hostElem) : this.position(hostElem); - var targetElemPos = {top: 0, left: 0, placement: ''}; - - if (placement[2]) { - var viewportOffset = this.viewportOffset(hostElem, appendToBody); - - var targetElemStyle = $window.getComputedStyle(targetElem); - var adjustedSize = { - width: targetWidth + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginLeft) + this.parseStyle(targetElemStyle.marginRight))), - height: targetHeight + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginTop) + this.parseStyle(targetElemStyle.marginBottom))) - }; - - placement[0] = placement[0] === 'top' && adjustedSize.height > viewportOffset.top && adjustedSize.height <= viewportOffset.bottom ? 'bottom' : - placement[0] === 'bottom' && adjustedSize.height > viewportOffset.bottom && adjustedSize.height <= viewportOffset.top ? 'top' : - placement[0] === 'left' && adjustedSize.width > viewportOffset.left && adjustedSize.width <= viewportOffset.right ? 'right' : - placement[0] === 'right' && adjustedSize.width > viewportOffset.right && adjustedSize.width <= viewportOffset.left ? 'left' : - placement[0]; - - placement[1] = placement[1] === 'top' && adjustedSize.height - hostElemPos.height > viewportOffset.bottom && adjustedSize.height - hostElemPos.height <= viewportOffset.top ? 'bottom' : - placement[1] === 'bottom' && adjustedSize.height - hostElemPos.height > viewportOffset.top && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom ? 'top' : - placement[1] === 'left' && adjustedSize.width - hostElemPos.width > viewportOffset.right && adjustedSize.width - hostElemPos.width <= viewportOffset.left ? 'right' : - placement[1] === 'right' && adjustedSize.width - hostElemPos.width > viewportOffset.left && adjustedSize.width - hostElemPos.width <= viewportOffset.right ? 'left' : - placement[1]; - - if (placement[1] === 'center') { - if (PLACEMENT_REGEX.vertical.test(placement[0])) { - var xOverflow = hostElemPos.width / 2 - targetWidth / 2; - if (viewportOffset.left + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.right) { - placement[1] = 'left'; - } else if (viewportOffset.right + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.left) { - placement[1] = 'right'; - } - } else { - var yOverflow = hostElemPos.height / 2 - adjustedSize.height / 2; - if (viewportOffset.top + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom) { - placement[1] = 'top'; - } else if (viewportOffset.bottom + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.top) { - placement[1] = 'bottom'; - } - } - } - } - - switch (placement[0]) { - case 'top': - targetElemPos.top = hostElemPos.top - targetHeight; - break; - case 'bottom': - targetElemPos.top = hostElemPos.top + hostElemPos.height; - break; - case 'left': - targetElemPos.left = hostElemPos.left - targetWidth; - break; - case 'right': - targetElemPos.left = hostElemPos.left + hostElemPos.width; - break; - } - - switch (placement[1]) { - case 'top': - targetElemPos.top = hostElemPos.top; - break; - case 'bottom': - targetElemPos.top = hostElemPos.top + hostElemPos.height - targetHeight; - break; - case 'left': - targetElemPos.left = hostElemPos.left; - break; - case 'right': - targetElemPos.left = hostElemPos.left + hostElemPos.width - targetWidth; - break; - case 'center': - if (PLACEMENT_REGEX.vertical.test(placement[0])) { - targetElemPos.left = hostElemPos.left + hostElemPos.width / 2 - targetWidth / 2; - } else { - targetElemPos.top = hostElemPos.top + hostElemPos.height / 2 - targetHeight / 2; - } - break; - } - - targetElemPos.top = Math.round(targetElemPos.top); - targetElemPos.left = Math.round(targetElemPos.left); - targetElemPos.placement = placement[1] === 'center' ? placement[0] : placement[0] + '-' + placement[1]; - - return targetElemPos; - }, - - /** - * Provides a way for positioning tooltip & dropdown - * arrows when using placement options beyond the standard - * left, right, top, or bottom. - * - * @param {element} elem - The tooltip/dropdown element. - * @param {string} placement - The placement for the elem. - */ - positionArrow: function(elem, placement) { - elem = this.getRawNode(elem); - - var innerElem = elem.querySelector('.tooltip-inner, .popover-inner'); - if (!innerElem) { - return; - } - - var isTooltip = angular.element(innerElem).hasClass('tooltip-inner'); - - var arrowElem = isTooltip ? elem.querySelector('.tooltip-arrow') : elem.querySelector('.arrow'); - if (!arrowElem) { - return; - } - - var arrowCss = { - top: '', - bottom: '', - left: '', - right: '' - }; - - placement = this.parsePlacement(placement); - if (placement[1] === 'center') { - // no adjustment necessary - just reset styles - angular.element(arrowElem).css(arrowCss); - return; - } - - var borderProp = 'border-' + placement[0] + '-width'; - var borderWidth = $window.getComputedStyle(arrowElem)[borderProp]; - - var borderRadiusProp = 'border-'; - if (PLACEMENT_REGEX.vertical.test(placement[0])) { - borderRadiusProp += placement[0] + '-' + placement[1]; - } else { - borderRadiusProp += placement[1] + '-' + placement[0]; - } - borderRadiusProp += '-radius'; - var borderRadius = $window.getComputedStyle(isTooltip ? innerElem : elem)[borderRadiusProp]; - - switch (placement[0]) { - case 'top': - arrowCss.bottom = isTooltip ? '0' : '-' + borderWidth; - break; - case 'bottom': - arrowCss.top = isTooltip ? '0' : '-' + borderWidth; - break; - case 'left': - arrowCss.right = isTooltip ? '0' : '-' + borderWidth; - break; - case 'right': - arrowCss.left = isTooltip ? '0' : '-' + borderWidth; - break; - } - - arrowCss[placement[1]] = borderRadius; - - angular.element(arrowElem).css(arrowCss); - } - }; - }]); - -angular.module('ui.bootstrap.datepickerPopup', ['ui.bootstrap.datepicker', 'ui.bootstrap.position']) - -.value('$datepickerPopupLiteralWarning', true) - -.constant('uibDatepickerPopupConfig', { - altInputFormats: [], - appendToBody: false, - clearText: 'Clear', - closeOnDateSelection: true, - closeText: 'Done', - currentText: 'Today', - datepickerPopup: 'yyyy-MM-dd', - datepickerPopupTemplateUrl: 'uib/template/datepickerPopup/popup.html', - datepickerTemplateUrl: 'uib/template/datepicker/datepicker.html', - html5Types: { - date: 'yyyy-MM-dd', - 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss', - 'month': 'yyyy-MM' - }, - onOpenFocus: true, - showButtonBar: true, - placement: 'auto bottom-left' -}) - -.controller('UibDatepickerPopupController', ['$scope', '$element', '$attrs', '$compile', '$log', '$parse', '$window', '$document', '$rootScope', '$uibPosition', 'dateFilter', 'uibDateParser', 'uibDatepickerPopupConfig', '$timeout', 'uibDatepickerConfig', '$datepickerPopupLiteralWarning', -function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $rootScope, $position, dateFilter, dateParser, datepickerPopupConfig, $timeout, datepickerConfig, $datepickerPopupLiteralWarning) { - var cache = {}, - isHtml5DateInput = false; - var dateFormat, closeOnDateSelection, appendToBody, onOpenFocus, - datepickerPopupTemplateUrl, datepickerTemplateUrl, popupEl, datepickerEl, scrollParentEl, - ngModel, ngModelOptions, $popup, altInputFormats, watchListeners = [], - timezone; - - this.init = function(_ngModel_) { - ngModel = _ngModel_; - ngModelOptions = _ngModel_.$options; - closeOnDateSelection = angular.isDefined($attrs.closeOnDateSelection) ? - $scope.$parent.$eval($attrs.closeOnDateSelection) : - datepickerPopupConfig.closeOnDateSelection; - appendToBody = angular.isDefined($attrs.datepickerAppendToBody) ? - $scope.$parent.$eval($attrs.datepickerAppendToBody) : - datepickerPopupConfig.appendToBody; - onOpenFocus = angular.isDefined($attrs.onOpenFocus) ? - $scope.$parent.$eval($attrs.onOpenFocus) : datepickerPopupConfig.onOpenFocus; - datepickerPopupTemplateUrl = angular.isDefined($attrs.datepickerPopupTemplateUrl) ? - $attrs.datepickerPopupTemplateUrl : - datepickerPopupConfig.datepickerPopupTemplateUrl; - datepickerTemplateUrl = angular.isDefined($attrs.datepickerTemplateUrl) ? - $attrs.datepickerTemplateUrl : datepickerPopupConfig.datepickerTemplateUrl; - altInputFormats = angular.isDefined($attrs.altInputFormats) ? - $scope.$parent.$eval($attrs.altInputFormats) : - datepickerPopupConfig.altInputFormats; - - $scope.showButtonBar = angular.isDefined($attrs.showButtonBar) ? - $scope.$parent.$eval($attrs.showButtonBar) : - datepickerPopupConfig.showButtonBar; - - if (datepickerPopupConfig.html5Types[$attrs.type]) { - dateFormat = datepickerPopupConfig.html5Types[$attrs.type]; - isHtml5DateInput = true; - } else { - dateFormat = $attrs.uibDatepickerPopup || datepickerPopupConfig.datepickerPopup; - $attrs.$observe('uibDatepickerPopup', function(value, oldValue) { - var newDateFormat = value || datepickerPopupConfig.datepickerPopup; - // Invalidate the $modelValue to ensure that formatters re-run - // FIXME: Refactor when PR is merged: https://github.com/angular/angular.js/pull/10764 - if (newDateFormat !== dateFormat) { - dateFormat = newDateFormat; - ngModel.$modelValue = null; - - if (!dateFormat) { - throw new Error('uibDatepickerPopup must have a date format specified.'); - } - } - }); - } - - if (!dateFormat) { - throw new Error('uibDatepickerPopup must have a date format specified.'); - } - - if (isHtml5DateInput && $attrs.uibDatepickerPopup) { - throw new Error('HTML5 date input types do not support custom formats.'); - } - - // popup element used to display calendar - popupEl = angular.element('
'); - if (ngModelOptions) { - timezone = ngModelOptions.timezone; - $scope.ngModelOptions = angular.copy(ngModelOptions); - $scope.ngModelOptions.timezone = null; - if ($scope.ngModelOptions.updateOnDefault === true) { - $scope.ngModelOptions.updateOn = $scope.ngModelOptions.updateOn ? - $scope.ngModelOptions.updateOn + ' default' : 'default'; - } - - popupEl.attr('ng-model-options', 'ngModelOptions'); - } else { - timezone = null; - } - - popupEl.attr({ - 'ng-model': 'date', - 'ng-change': 'dateSelection(date)', - 'template-url': datepickerPopupTemplateUrl - }); - - // datepicker element - datepickerEl = angular.element(popupEl.children()[0]); - datepickerEl.attr('template-url', datepickerTemplateUrl); - - if (!$scope.datepickerOptions) { - $scope.datepickerOptions = {}; - } - - if (isHtml5DateInput) { - if ($attrs.type === 'month') { - $scope.datepickerOptions.datepickerMode = 'month'; - $scope.datepickerOptions.minMode = 'month'; - } - } - - datepickerEl.attr('datepicker-options', 'datepickerOptions'); - - if (!isHtml5DateInput) { - // Internal API to maintain the correct ng-invalid-[key] class - ngModel.$$parserName = 'date'; - ngModel.$validators.date = validator; - ngModel.$parsers.unshift(parseDate); - ngModel.$formatters.push(function(value) { - if (ngModel.$isEmpty(value)) { - $scope.date = value; - return value; - } - - if (angular.isNumber(value)) { - value = new Date(value); - } - - $scope.date = dateParser.fromTimezone(value, timezone); - - return dateParser.filter($scope.date, dateFormat); - }); - } else { - ngModel.$formatters.push(function(value) { - $scope.date = dateParser.fromTimezone(value, timezone); - return value; - }); - } - - // Detect changes in the view from the text box - ngModel.$viewChangeListeners.push(function() { - $scope.date = parseDateString(ngModel.$viewValue); - }); - - $element.on('keydown', inputKeydownBind); - - $popup = $compile(popupEl)($scope); - // Prevent jQuery cache memory leak (template is now redundant after linking) - popupEl.remove(); - - if (appendToBody) { - $document.find('body').append($popup); - } else { - $element.after($popup); - } - - $scope.$on('$destroy', function() { - if ($scope.isOpen === true) { - if (!$rootScope.$$phase) { - $scope.$apply(function() { - $scope.isOpen = false; - }); - } - } - - $popup.remove(); - $element.off('keydown', inputKeydownBind); - $document.off('click', documentClickBind); - if (scrollParentEl) { - scrollParentEl.off('scroll', positionPopup); - } - angular.element($window).off('resize', positionPopup); - - //Clear all watch listeners on destroy - while (watchListeners.length) { - watchListeners.shift()(); - } - }); - }; - - $scope.getText = function(key) { - return $scope[key + 'Text'] || datepickerPopupConfig[key + 'Text']; - }; - - $scope.isDisabled = function(date) { - if (date === 'today') { - date = dateParser.fromTimezone(new Date(), timezone); - } - - var dates = {}; - angular.forEach(['minDate', 'maxDate'], function(key) { - if (!$scope.datepickerOptions[key]) { - dates[key] = null; - } else if (angular.isDate($scope.datepickerOptions[key])) { - dates[key] = dateParser.fromTimezone(new Date($scope.datepickerOptions[key]), timezone); - } else { - if ($datepickerPopupLiteralWarning) { - $log.warn('Literal date support has been deprecated, please switch to date object usage'); - } - - dates[key] = new Date(dateFilter($scope.datepickerOptions[key], 'medium')); - } - }); - - return $scope.datepickerOptions && - dates.minDate && $scope.compare(date, dates.minDate) < 0 || - dates.maxDate && $scope.compare(date, dates.maxDate) > 0; - }; - - $scope.compare = function(date1, date2) { - return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()); - }; - - // Inner change - $scope.dateSelection = function(dt) { - if (angular.isDefined(dt)) { - $scope.date = dt; - } - var date = $scope.date ? dateParser.filter($scope.date, dateFormat) : null; // Setting to NULL is necessary for form validators to function - $element.val(date); - ngModel.$setViewValue(date); - - if (closeOnDateSelection) { - $scope.isOpen = false; - $element[0].focus(); - } - }; - - $scope.keydown = function(evt) { - if (evt.which === 27) { - evt.stopPropagation(); - $scope.isOpen = false; - $element[0].focus(); - } - }; - - $scope.select = function(date, evt) { - evt.stopPropagation(); - - if (date === 'today') { - var today = new Date(); - if (angular.isDate($scope.date)) { - date = new Date($scope.date); - date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate()); - } else { - date = new Date(today.setHours(0, 0, 0, 0)); - } - } - $scope.dateSelection(date); - }; - - $scope.close = function(evt) { - evt.stopPropagation(); - - $scope.isOpen = false; - $element[0].focus(); - }; - - $scope.disabled = angular.isDefined($attrs.disabled) || false; - if ($attrs.ngDisabled) { - watchListeners.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(disabled) { - $scope.disabled = disabled; - })); - } - - $scope.$watch('isOpen', function(value) { - if (value) { - if (!$scope.disabled) { - $timeout(function() { - positionPopup(); - - if (onOpenFocus) { - $scope.$broadcast('uib:datepicker.focus'); - } - - $document.on('click', documentClickBind); - - var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement; - if (appendToBody || $position.parsePlacement(placement)[2]) { - scrollParentEl = scrollParentEl || angular.element($position.scrollParent($element)); - if (scrollParentEl) { - scrollParentEl.on('scroll', positionPopup); - } - } else { - scrollParentEl = null; - } - - angular.element($window).on('resize', positionPopup); - }, 0, false); - } else { - $scope.isOpen = false; - } - } else { - $document.off('click', documentClickBind); - if (scrollParentEl) { - scrollParentEl.off('scroll', positionPopup); - } - angular.element($window).off('resize', positionPopup); - } - }); - - function cameltoDash(string) { - return string.replace(/([A-Z])/g, function($1) { return '-' + $1.toLowerCase(); }); - } - - function parseDateString(viewValue) { - var date = dateParser.parse(viewValue, dateFormat, $scope.date); - if (isNaN(date)) { - for (var i = 0; i < altInputFormats.length; i++) { - date = dateParser.parse(viewValue, altInputFormats[i], $scope.date); - if (!isNaN(date)) { - return date; - } - } - } - return date; - } - - function parseDate(viewValue) { - if (angular.isNumber(viewValue)) { - // presumably timestamp to date object - viewValue = new Date(viewValue); - } - - if (!viewValue) { - return null; - } - - if (angular.isDate(viewValue) && !isNaN(viewValue)) { - return viewValue; - } - - if (angular.isString(viewValue)) { - var date = parseDateString(viewValue); - if (!isNaN(date)) { - return dateParser.toTimezone(date, timezone); - } - } - - return ngModel.$options && ngModel.$options.allowInvalid ? viewValue : undefined; - } - - function validator(modelValue, viewValue) { - var value = modelValue || viewValue; - - if (!$attrs.ngRequired && !value) { - return true; - } - - if (angular.isNumber(value)) { - value = new Date(value); - } - - if (!value) { - return true; - } - - if (angular.isDate(value) && !isNaN(value)) { - return true; - } - - if (angular.isString(value)) { - return !isNaN(parseDateString(viewValue)); - } - - return false; - } - - function documentClickBind(event) { - if (!$scope.isOpen && $scope.disabled) { - return; - } - - var popup = $popup[0]; - var dpContainsTarget = $element[0].contains(event.target); - // The popup node may not be an element node - // In some browsers (IE) only element nodes have the 'contains' function - var popupContainsTarget = popup.contains !== undefined && popup.contains(event.target); - if ($scope.isOpen && !(dpContainsTarget || popupContainsTarget)) { - $scope.$apply(function() { - $scope.isOpen = false; - }); - } - } - - function inputKeydownBind(evt) { - if (evt.which === 27 && $scope.isOpen) { - evt.preventDefault(); - evt.stopPropagation(); - $scope.$apply(function() { - $scope.isOpen = false; - }); - $element[0].focus(); - } else if (evt.which === 40 && !$scope.isOpen) { - evt.preventDefault(); - evt.stopPropagation(); - $scope.$apply(function() { - $scope.isOpen = true; - }); - } - } - - function positionPopup() { - if ($scope.isOpen) { - var dpElement = angular.element($popup[0].querySelector('.uib-datepicker-popup')); - var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement; - var position = $position.positionElements($element, dpElement, placement, appendToBody); - dpElement.css({top: position.top + 'px', left: position.left + 'px'}); - if (dpElement.hasClass('uib-position-measure')) { - dpElement.removeClass('uib-position-measure'); - } - } - } - - $scope.$on('uib:datepicker.mode', function() { - $timeout(positionPopup, 0, false); - }); -}]) - -.directive('uibDatepickerPopup', function() { - return { - require: ['ngModel', 'uibDatepickerPopup'], - controller: 'UibDatepickerPopupController', - scope: { - datepickerOptions: '=?', - isOpen: '=?', - currentText: '@', - clearText: '@', - closeText: '@' - }, - link: function(scope, element, attrs, ctrls) { - var ngModel = ctrls[0], - ctrl = ctrls[1]; - - ctrl.init(ngModel); - } - }; -}) - -.directive('uibDatepickerPopupWrap', function() { - return { - replace: true, - transclude: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepickerPopup/popup.html'; - } - }; -}); - -angular.module('ui.bootstrap.debounce', []) -/** - * A helper, internal service that debounces a function - */ - .factory('$$debounce', ['$timeout', function($timeout) { - return function(callback, debounceTime) { - var timeoutPromise; - - return function() { - var self = this; - var args = Array.prototype.slice.call(arguments); - if (timeoutPromise) { - $timeout.cancel(timeoutPromise); - } - - timeoutPromise = $timeout(function() { - callback.apply(self, args); - }, debounceTime); - }; - }; - }]); - -angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) - -.constant('uibDropdownConfig', { - appendToOpenClass: 'uib-dropdown-open', - openClass: 'open' -}) - -.service('uibDropdownService', ['$document', '$rootScope', function($document, $rootScope) { - var openScope = null; - - this.open = function(dropdownScope, element) { - if (!openScope) { - $document.on('click', closeDropdown); - element.on('keydown', keybindFilter); - } - - if (openScope && openScope !== dropdownScope) { - openScope.isOpen = false; - } - - openScope = dropdownScope; - }; - - this.close = function(dropdownScope, element) { - if (openScope === dropdownScope) { - openScope = null; - $document.off('click', closeDropdown); - element.off('keydown', keybindFilter); - } - }; - - var closeDropdown = function(evt) { - // This method may still be called during the same mouse event that - // unbound this event handler. So check openScope before proceeding. - if (!openScope) { return; } - - if (evt && openScope.getAutoClose() === 'disabled') { return; } - - if (evt && evt.which === 3) { return; } - - var toggleElement = openScope.getToggleElement(); - if (evt && toggleElement && toggleElement[0].contains(evt.target)) { - return; - } - - var dropdownElement = openScope.getDropdownElement(); - if (evt && openScope.getAutoClose() === 'outsideClick' && - dropdownElement && dropdownElement[0].contains(evt.target)) { - return; - } - - openScope.isOpen = false; - - if (!$rootScope.$$phase) { - openScope.$apply(); - } - }; - - var keybindFilter = function(evt) { - if (evt.which === 27) { - evt.stopPropagation(); - openScope.focusToggleElement(); - closeDropdown(); - } else if (openScope.isKeynavEnabled() && [38, 40].indexOf(evt.which) !== -1 && openScope.isOpen) { - evt.preventDefault(); - evt.stopPropagation(); - openScope.focusDropdownEntry(evt.which); - } - }; -}]) - -.controller('UibDropdownController', ['$scope', '$element', '$attrs', '$parse', 'uibDropdownConfig', 'uibDropdownService', '$animate', '$uibPosition', '$document', '$compile', '$templateRequest', function($scope, $element, $attrs, $parse, dropdownConfig, uibDropdownService, $animate, $position, $document, $compile, $templateRequest) { - var self = this, - scope = $scope.$new(), // create a child scope so we are not polluting original one - templateScope, - appendToOpenClass = dropdownConfig.appendToOpenClass, - openClass = dropdownConfig.openClass, - getIsOpen, - setIsOpen = angular.noop, - toggleInvoker = $attrs.onToggle ? $parse($attrs.onToggle) : angular.noop, - appendToBody = false, - appendTo = null, - keynavEnabled = false, - selectedOption = null, - body = $document.find('body'); - - $element.addClass('dropdown'); - - this.init = function() { - if ($attrs.isOpen) { - getIsOpen = $parse($attrs.isOpen); - setIsOpen = getIsOpen.assign; - - $scope.$watch(getIsOpen, function(value) { - scope.isOpen = !!value; - }); - } - - if (angular.isDefined($attrs.dropdownAppendTo)) { - var appendToEl = $parse($attrs.dropdownAppendTo)(scope); - if (appendToEl) { - appendTo = angular.element(appendToEl); - } - } - - appendToBody = angular.isDefined($attrs.dropdownAppendToBody); - keynavEnabled = angular.isDefined($attrs.keyboardNav); - - if (appendToBody && !appendTo) { - appendTo = body; - } - - if (appendTo && self.dropdownMenu) { - appendTo.append(self.dropdownMenu); - $element.on('$destroy', function handleDestroyEvent() { - self.dropdownMenu.remove(); - }); - } - }; - - this.toggle = function(open) { - scope.isOpen = arguments.length ? !!open : !scope.isOpen; - if (angular.isFunction(setIsOpen)) { - setIsOpen(scope, scope.isOpen); - } - - return scope.isOpen; - }; - - // Allow other directives to watch status - this.isOpen = function() { - return scope.isOpen; - }; - - scope.getToggleElement = function() { - return self.toggleElement; - }; - - scope.getAutoClose = function() { - return $attrs.autoClose || 'always'; //or 'outsideClick' or 'disabled' - }; - - scope.getElement = function() { - return $element; - }; - - scope.isKeynavEnabled = function() { - return keynavEnabled; - }; - - scope.focusDropdownEntry = function(keyCode) { - var elems = self.dropdownMenu ? //If append to body is used. - angular.element(self.dropdownMenu).find('a') : - $element.find('ul').eq(0).find('a'); - - switch (keyCode) { - case 40: { - if (!angular.isNumber(self.selectedOption)) { - self.selectedOption = 0; - } else { - self.selectedOption = self.selectedOption === elems.length - 1 ? - self.selectedOption : - self.selectedOption + 1; - } - break; - } - case 38: { - if (!angular.isNumber(self.selectedOption)) { - self.selectedOption = elems.length - 1; - } else { - self.selectedOption = self.selectedOption === 0 ? - 0 : self.selectedOption - 1; - } - break; - } - } - elems[self.selectedOption].focus(); - }; - - scope.getDropdownElement = function() { - return self.dropdownMenu; - }; - - scope.focusToggleElement = function() { - if (self.toggleElement) { - self.toggleElement[0].focus(); - } - }; - - scope.$watch('isOpen', function(isOpen, wasOpen) { - if (appendTo && self.dropdownMenu) { - var pos = $position.positionElements($element, self.dropdownMenu, 'bottom-left', true), - css, - rightalign, - scrollbarWidth; - - css = { - top: pos.top + 'px', - display: isOpen ? 'block' : 'none' - }; - - rightalign = self.dropdownMenu.hasClass('dropdown-menu-right'); - if (!rightalign) { - css.left = pos.left + 'px'; - css.right = 'auto'; - } else { - css.left = 'auto'; - scrollbarWidth = $position.scrollbarWidth(true); - css.right = window.innerWidth - scrollbarWidth - - (pos.left + $element.prop('offsetWidth')) + 'px'; - } - - // Need to adjust our positioning to be relative to the appendTo container - // if it's not the body element - if (!appendToBody) { - var appendOffset = $position.offset(appendTo); - - css.top = pos.top - appendOffset.top + 'px'; - - if (!rightalign) { - css.left = pos.left - appendOffset.left + 'px'; - } else { - css.right = window.innerWidth - - (pos.left - appendOffset.left + $element.prop('offsetWidth')) + 'px'; - } - } - - self.dropdownMenu.css(css); - } - - var openContainer = appendTo ? appendTo : $element; - var hasOpenClass = openContainer.hasClass(appendTo ? appendToOpenClass : openClass); - - if (hasOpenClass === !isOpen) { - $animate[isOpen ? 'addClass' : 'removeClass'](openContainer, appendTo ? appendToOpenClass : openClass).then(function() { - if (angular.isDefined(isOpen) && isOpen !== wasOpen) { - toggleInvoker($scope, { open: !!isOpen }); - } - }); - } - - if (isOpen) { - if (self.dropdownMenuTemplateUrl) { - $templateRequest(self.dropdownMenuTemplateUrl).then(function(tplContent) { - templateScope = scope.$new(); - $compile(tplContent.trim())(templateScope, function(dropdownElement) { - var newEl = dropdownElement; - self.dropdownMenu.replaceWith(newEl); - self.dropdownMenu = newEl; - }); - }); - } - - scope.focusToggleElement(); - uibDropdownService.open(scope, $element); - } else { - if (self.dropdownMenuTemplateUrl) { - if (templateScope) { - templateScope.$destroy(); - } - var newEl = angular.element(''); - self.dropdownMenu.replaceWith(newEl); - self.dropdownMenu = newEl; - } - - uibDropdownService.close(scope, $element); - self.selectedOption = null; - } - - if (angular.isFunction(setIsOpen)) { - setIsOpen($scope, isOpen); - } - }); -}]) - -.directive('uibDropdown', function() { - return { - controller: 'UibDropdownController', - link: function(scope, element, attrs, dropdownCtrl) { - dropdownCtrl.init(); - } - }; -}) - -.directive('uibDropdownMenu', function() { - return { - restrict: 'A', - require: '?^uibDropdown', - link: function(scope, element, attrs, dropdownCtrl) { - if (!dropdownCtrl || angular.isDefined(attrs.dropdownNested)) { - return; - } - - element.addClass('dropdown-menu'); - - var tplUrl = attrs.templateUrl; - if (tplUrl) { - dropdownCtrl.dropdownMenuTemplateUrl = tplUrl; - } - - if (!dropdownCtrl.dropdownMenu) { - dropdownCtrl.dropdownMenu = element; - } - } - }; -}) - -.directive('uibDropdownToggle', function() { - return { - require: '?^uibDropdown', - link: function(scope, element, attrs, dropdownCtrl) { - if (!dropdownCtrl) { - return; - } - - element.addClass('dropdown-toggle'); - - dropdownCtrl.toggleElement = element; - - var toggleDropdown = function(event) { - event.preventDefault(); - - if (!element.hasClass('disabled') && !attrs.disabled) { - scope.$apply(function() { - dropdownCtrl.toggle(); - }); - } - }; - - element.bind('click', toggleDropdown); - - // WAI-ARIA - element.attr({ 'aria-haspopup': true, 'aria-expanded': false }); - scope.$watch(dropdownCtrl.isOpen, function(isOpen) { - element.attr('aria-expanded', !!isOpen); - }); - - scope.$on('$destroy', function() { - element.unbind('click', toggleDropdown); - }); - } - }; -}); - -angular.module('ui.bootstrap.stackedMap', []) -/** - * A helper, internal data structure that acts as a map but also allows getting / removing - * elements in the LIFO order - */ - .factory('$$stackedMap', function() { - return { - createNew: function() { - var stack = []; - - return { - add: function(key, value) { - stack.push({ - key: key, - value: value - }); - }, - get: function(key) { - for (var i = 0; i < stack.length; i++) { - if (key === stack[i].key) { - return stack[i]; - } - } - }, - keys: function() { - var keys = []; - for (var i = 0; i < stack.length; i++) { - keys.push(stack[i].key); - } - return keys; - }, - top: function() { - return stack[stack.length - 1]; - }, - remove: function(key) { - var idx = -1; - for (var i = 0; i < stack.length; i++) { - if (key === stack[i].key) { - idx = i; - break; - } - } - return stack.splice(idx, 1)[0]; - }, - removeTop: function() { - return stack.splice(stack.length - 1, 1)[0]; - }, - length: function() { - return stack.length; - } - }; - } - }; - }); -angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.position']) -/** - * A helper, internal data structure that stores all references attached to key - */ - .factory('$$multiMap', function() { - return { - createNew: function() { - var map = {}; - - return { - entries: function() { - return Object.keys(map).map(function(key) { - return { - key: key, - value: map[key] - }; - }); - }, - get: function(key) { - return map[key]; - }, - hasKey: function(key) { - return !!map[key]; - }, - keys: function() { - return Object.keys(map); - }, - put: function(key, value) { - if (!map[key]) { - map[key] = []; - } - - map[key].push(value); - }, - remove: function(key, value) { - var values = map[key]; - - if (!values) { - return; - } - - var idx = values.indexOf(value); - - if (idx !== -1) { - values.splice(idx, 1); - } - - if (!values.length) { - delete map[key]; - } - } - }; - } - }; - }) - -/** - * Pluggable resolve mechanism for the modal resolve resolution - * Supports UI Router's $resolve service - */ - .provider('$uibResolve', function() { - var resolve = this; - this.resolver = null; - - this.setResolver = function(resolver) { - this.resolver = resolver; - }; - - this.$get = ['$injector', '$q', function($injector, $q) { - var resolver = resolve.resolver ? $injector.get(resolve.resolver) : null; - return { - resolve: function(invocables, locals, parent, self) { - if (resolver) { - return resolver.resolve(invocables, locals, parent, self); - } - - var promises = []; - - angular.forEach(invocables, function(value) { - if (angular.isFunction(value) || angular.isArray(value)) { - promises.push($q.resolve($injector.invoke(value))); - } else if (angular.isString(value)) { - promises.push($q.resolve($injector.get(value))); - } else { - promises.push($q.resolve(value)); - } - }); - - return $q.all(promises).then(function(resolves) { - var resolveObj = {}; - var resolveIter = 0; - angular.forEach(invocables, function(value, key) { - resolveObj[key] = resolves[resolveIter++]; - }); - - return resolveObj; - }); - } - }; - }]; - }) - -/** - * A helper directive for the $modal service. It creates a backdrop element. - */ - .directive('uibModalBackdrop', ['$animate', '$injector', '$uibModalStack', - function($animate, $injector, $modalStack) { - return { - replace: true, - templateUrl: 'uib/template/modal/backdrop.html', - compile: function(tElement, tAttrs) { - tElement.addClass(tAttrs.backdropClass); - return linkFn; - } - }; - - function linkFn(scope, element, attrs) { - if (attrs.modalInClass) { - $animate.addClass(element, attrs.modalInClass); - - scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) { - var done = setIsAsync(); - if (scope.modalOptions.animation) { - $animate.removeClass(element, attrs.modalInClass).then(done); - } else { - done(); - } - }); - } - } - }]) - - .directive('uibModalWindow', ['$uibModalStack', '$q', '$animateCss', '$document', - function($modalStack, $q, $animateCss, $document) { - return { - scope: { - index: '@' - }, - replace: true, - transclude: true, - templateUrl: function(tElement, tAttrs) { - return tAttrs.templateUrl || 'uib/template/modal/window.html'; - }, - link: function(scope, element, attrs) { - element.addClass(attrs.windowClass || ''); - element.addClass(attrs.windowTopClass || ''); - scope.size = attrs.size; - - scope.close = function(evt) { - var modal = $modalStack.getTop(); - if (modal && modal.value.backdrop && - modal.value.backdrop !== 'static' && - evt.target === evt.currentTarget) { - evt.preventDefault(); - evt.stopPropagation(); - $modalStack.dismiss(modal.key, 'backdrop click'); - } - }; - - // moved from template to fix issue #2280 - element.on('click', scope.close); - - // This property is only added to the scope for the purpose of detecting when this directive is rendered. - // We can detect that by using this property in the template associated with this directive and then use - // {@link Attribute#$observe} on it. For more details please see {@link TableColumnResize}. - scope.$isRendered = true; - - // Deferred object that will be resolved when this modal is render. - var modalRenderDeferObj = $q.defer(); - // Observe function will be called on next digest cycle after compilation, ensuring that the DOM is ready. - // In order to use this way of finding whether DOM is ready, we need to observe a scope property used in modal's template. - attrs.$observe('modalRender', function(value) { - if (value === 'true') { - modalRenderDeferObj.resolve(); - } - }); - - modalRenderDeferObj.promise.then(function() { - var animationPromise = null; - - if (attrs.modalInClass) { - animationPromise = $animateCss(element, { - addClass: attrs.modalInClass - }).start(); - - scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) { - var done = setIsAsync(); - $animateCss(element, { - removeClass: attrs.modalInClass - }).start().then(done); - }); - } - - - $q.when(animationPromise).then(function() { - // Notify {@link $modalStack} that modal is rendered. - var modal = $modalStack.getTop(); - if (modal) { - $modalStack.modalRendered(modal.key); - } - - /** - * If something within the freshly-opened modal already has focus (perhaps via a - * directive that causes focus). then no need to try and focus anything. - */ - if (!($document[0].activeElement && element[0].contains($document[0].activeElement))) { - var inputWithAutofocus = element[0].querySelector('[autofocus]'); - /** - * Auto-focusing of a freshly-opened modal element causes any child elements - * with the autofocus attribute to lose focus. This is an issue on touch - * based devices which will show and then hide the onscreen keyboard. - * Attempts to refocus the autofocus element via JavaScript will not reopen - * the onscreen keyboard. Fixed by updated the focusing logic to only autofocus - * the modal element if the modal does not contain an autofocus element. - */ - if (inputWithAutofocus) { - inputWithAutofocus.focus(); - } else { - element[0].focus(); - } - } - }); - }); - } - }; - }]) - - .directive('uibModalAnimationClass', function() { - return { - compile: function(tElement, tAttrs) { - if (tAttrs.modalAnimation) { - tElement.addClass(tAttrs.uibModalAnimationClass); - } - } - }; - }) - - .directive('uibModalTransclude', function() { - return { - link: function(scope, element, attrs, controller, transclude) { - transclude(scope.$parent, function(clone) { - element.empty(); - element.append(clone); - }); - } - }; - }) - - .factory('$uibModalStack', ['$animate', '$animateCss', '$document', - '$compile', '$rootScope', '$q', '$$multiMap', '$$stackedMap', '$uibPosition', - function($animate, $animateCss, $document, $compile, $rootScope, $q, $$multiMap, $$stackedMap, $uibPosition) { - var OPENED_MODAL_CLASS = 'modal-open'; - - var backdropDomEl, backdropScope; - var openedWindows = $$stackedMap.createNew(); - var openedClasses = $$multiMap.createNew(); - var $modalStack = { - NOW_CLOSING_EVENT: 'modal.stack.now-closing' - }; - var topModalIndex = 0; - var previousTopOpenedModal = null; - - //Modal focus behavior - var tabableSelector = 'a[href], area[href], input:not([disabled]), ' + - 'button:not([disabled]),select:not([disabled]), textarea:not([disabled]), ' + - 'iframe, object, embed, *[tabindex], *[contenteditable=true]'; - var scrollbarPadding; - - function isVisible(element) { - return !!(element.offsetWidth || - element.offsetHeight || - element.getClientRects().length); - } - - function backdropIndex() { - var topBackdropIndex = -1; - var opened = openedWindows.keys(); - for (var i = 0; i < opened.length; i++) { - if (openedWindows.get(opened[i]).value.backdrop) { - topBackdropIndex = i; - } - } - - // If any backdrop exist, ensure that it's index is always - // right below the top modal - if (topBackdropIndex > -1 && topBackdropIndex < topModalIndex) { - topBackdropIndex = topModalIndex; - } - return topBackdropIndex; - } - - $rootScope.$watch(backdropIndex, function(newBackdropIndex) { - if (backdropScope) { - backdropScope.index = newBackdropIndex; - } - }); - - function removeModalWindow(modalInstance, elementToReceiveFocus) { - var modalWindow = openedWindows.get(modalInstance).value; - var appendToElement = modalWindow.appendTo; - - //clean up the stack - openedWindows.remove(modalInstance); - previousTopOpenedModal = openedWindows.top(); - if (previousTopOpenedModal) { - topModalIndex = parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10); - } - - removeAfterAnimate(modalWindow.modalDomEl, modalWindow.modalScope, function() { - var modalBodyClass = modalWindow.openedClass || OPENED_MODAL_CLASS; - openedClasses.remove(modalBodyClass, modalInstance); - var areAnyOpen = openedClasses.hasKey(modalBodyClass); - appendToElement.toggleClass(modalBodyClass, areAnyOpen); - if (!areAnyOpen && scrollbarPadding && scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) { - if (scrollbarPadding.originalRight) { - appendToElement.css({paddingRight: scrollbarPadding.originalRight + 'px'}); - } else { - appendToElement.css({paddingRight: ''}); - } - scrollbarPadding = null; - } - toggleTopWindowClass(true); - }, modalWindow.closedDeferred); - checkRemoveBackdrop(); - - //move focus to specified element if available, or else to body - if (elementToReceiveFocus && elementToReceiveFocus.focus) { - elementToReceiveFocus.focus(); - } else if (appendToElement.focus) { - appendToElement.focus(); - } - } - - // Add or remove "windowTopClass" from the top window in the stack - function toggleTopWindowClass(toggleSwitch) { - var modalWindow; - - if (openedWindows.length() > 0) { - modalWindow = openedWindows.top().value; - modalWindow.modalDomEl.toggleClass(modalWindow.windowTopClass || '', toggleSwitch); - } - } - - function checkRemoveBackdrop() { - //remove backdrop if no longer needed - if (backdropDomEl && backdropIndex() === -1) { - var backdropScopeRef = backdropScope; - removeAfterAnimate(backdropDomEl, backdropScope, function() { - backdropScopeRef = null; - }); - backdropDomEl = undefined; - backdropScope = undefined; - } - } - - function removeAfterAnimate(domEl, scope, done, closedDeferred) { - var asyncDeferred; - var asyncPromise = null; - var setIsAsync = function() { - if (!asyncDeferred) { - asyncDeferred = $q.defer(); - asyncPromise = asyncDeferred.promise; - } - - return function asyncDone() { - asyncDeferred.resolve(); - }; - }; - scope.$broadcast($modalStack.NOW_CLOSING_EVENT, setIsAsync); - - // Note that it's intentional that asyncPromise might be null. - // That's when setIsAsync has not been called during the - // NOW_CLOSING_EVENT broadcast. - return $q.when(asyncPromise).then(afterAnimating); - - function afterAnimating() { - if (afterAnimating.done) { - return; - } - afterAnimating.done = true; - - $animate.leave(domEl).then(function() { - domEl.remove(); - if (closedDeferred) { - closedDeferred.resolve(); - } - }); - - scope.$destroy(); - if (done) { - done(); - } - } - } - - $document.on('keydown', keydownListener); - - $rootScope.$on('$destroy', function() { - $document.off('keydown', keydownListener); - }); - - function keydownListener(evt) { - if (evt.isDefaultPrevented()) { - return evt; - } - - var modal = openedWindows.top(); - if (modal) { - switch (evt.which) { - case 27: { - if (modal.value.keyboard) { - evt.preventDefault(); - $rootScope.$apply(function() { - $modalStack.dismiss(modal.key, 'escape key press'); - }); - } - break; - } - case 9: { - var list = $modalStack.loadFocusElementList(modal); - var focusChanged = false; - if (evt.shiftKey) { - if ($modalStack.isFocusInFirstItem(evt, list) || $modalStack.isModalFocused(evt, modal)) { - focusChanged = $modalStack.focusLastFocusableElement(list); - } - } else { - if ($modalStack.isFocusInLastItem(evt, list)) { - focusChanged = $modalStack.focusFirstFocusableElement(list); - } - } - - if (focusChanged) { - evt.preventDefault(); - evt.stopPropagation(); - } - - break; - } - } - } - } - - $modalStack.open = function(modalInstance, modal) { - var modalOpener = $document[0].activeElement, - modalBodyClass = modal.openedClass || OPENED_MODAL_CLASS; - - toggleTopWindowClass(false); - - // Store the current top first, to determine what index we ought to use - // for the current top modal - previousTopOpenedModal = openedWindows.top(); - - openedWindows.add(modalInstance, { - deferred: modal.deferred, - renderDeferred: modal.renderDeferred, - closedDeferred: modal.closedDeferred, - modalScope: modal.scope, - backdrop: modal.backdrop, - keyboard: modal.keyboard, - openedClass: modal.openedClass, - windowTopClass: modal.windowTopClass, - animation: modal.animation, - appendTo: modal.appendTo - }); - - openedClasses.put(modalBodyClass, modalInstance); - - var appendToElement = modal.appendTo, - currBackdropIndex = backdropIndex(); - - if (!appendToElement.length) { - throw new Error('appendTo element not found. Make sure that the element passed is in DOM.'); - } - - if (currBackdropIndex >= 0 && !backdropDomEl) { - backdropScope = $rootScope.$new(true); - backdropScope.modalOptions = modal; - backdropScope.index = currBackdropIndex; - backdropDomEl = angular.element('
'); - backdropDomEl.attr('backdrop-class', modal.backdropClass); - if (modal.animation) { - backdropDomEl.attr('modal-animation', 'true'); - } - $compile(backdropDomEl)(backdropScope); - $animate.enter(backdropDomEl, appendToElement); - scrollbarPadding = $uibPosition.scrollbarPadding(appendToElement); - if (scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) { - appendToElement.css({paddingRight: scrollbarPadding.right + 'px'}); - } - } - - // Set the top modal index based on the index of the previous top modal - topModalIndex = previousTopOpenedModal ? parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10) + 1 : 0; - var angularDomEl = angular.element('
'); - angularDomEl.attr({ - 'template-url': modal.windowTemplateUrl, - 'window-class': modal.windowClass, - 'window-top-class': modal.windowTopClass, - 'size': modal.size, - 'index': topModalIndex, - 'animate': 'animate' - }).html(modal.content); - if (modal.animation) { - angularDomEl.attr('modal-animation', 'true'); - } - - appendToElement.addClass(modalBodyClass); - $animate.enter($compile(angularDomEl)(modal.scope), appendToElement); - - openedWindows.top().value.modalDomEl = angularDomEl; - openedWindows.top().value.modalOpener = modalOpener; - }; - - function broadcastClosing(modalWindow, resultOrReason, closing) { - return !modalWindow.value.modalScope.$broadcast('modal.closing', resultOrReason, closing).defaultPrevented; - } - - $modalStack.close = function(modalInstance, result) { - var modalWindow = openedWindows.get(modalInstance); - if (modalWindow && broadcastClosing(modalWindow, result, true)) { - modalWindow.value.modalScope.$$uibDestructionScheduled = true; - modalWindow.value.deferred.resolve(result); - removeModalWindow(modalInstance, modalWindow.value.modalOpener); - return true; - } - return !modalWindow; - }; - - $modalStack.dismiss = function(modalInstance, reason) { - var modalWindow = openedWindows.get(modalInstance); - if (modalWindow && broadcastClosing(modalWindow, reason, false)) { - modalWindow.value.modalScope.$$uibDestructionScheduled = true; - modalWindow.value.deferred.reject(reason); - removeModalWindow(modalInstance, modalWindow.value.modalOpener); - return true; - } - return !modalWindow; - }; - - $modalStack.dismissAll = function(reason) { - var topModal = this.getTop(); - while (topModal && this.dismiss(topModal.key, reason)) { - topModal = this.getTop(); - } - }; - - $modalStack.getTop = function() { - return openedWindows.top(); - }; - - $modalStack.modalRendered = function(modalInstance) { - var modalWindow = openedWindows.get(modalInstance); - if (modalWindow) { - modalWindow.value.renderDeferred.resolve(); - } - }; - - $modalStack.focusFirstFocusableElement = function(list) { - if (list.length > 0) { - list[0].focus(); - return true; - } - return false; - }; - - $modalStack.focusLastFocusableElement = function(list) { - if (list.length > 0) { - list[list.length - 1].focus(); - return true; - } - return false; - }; - - $modalStack.isModalFocused = function(evt, modalWindow) { - if (evt && modalWindow) { - var modalDomEl = modalWindow.value.modalDomEl; - if (modalDomEl && modalDomEl.length) { - return (evt.target || evt.srcElement) === modalDomEl[0]; - } - } - return false; - }; - - $modalStack.isFocusInFirstItem = function(evt, list) { - if (list.length > 0) { - return (evt.target || evt.srcElement) === list[0]; - } - return false; - }; - - $modalStack.isFocusInLastItem = function(evt, list) { - if (list.length > 0) { - return (evt.target || evt.srcElement) === list[list.length - 1]; - } - return false; - }; - - $modalStack.loadFocusElementList = function(modalWindow) { - if (modalWindow) { - var modalDomE1 = modalWindow.value.modalDomEl; - if (modalDomE1 && modalDomE1.length) { - var elements = modalDomE1[0].querySelectorAll(tabableSelector); - return elements ? - Array.prototype.filter.call(elements, function(element) { - return isVisible(element); - }) : elements; - } - } - }; - - return $modalStack; - }]) - - .provider('$uibModal', function() { - var $modalProvider = { - options: { - animation: true, - backdrop: true, //can also be false or 'static' - keyboard: true - }, - $get: ['$rootScope', '$q', '$document', '$templateRequest', '$controller', '$uibResolve', '$uibModalStack', - function ($rootScope, $q, $document, $templateRequest, $controller, $uibResolve, $modalStack) { - var $modal = {}; - - function getTemplatePromise(options) { - return options.template ? $q.when(options.template) : - $templateRequest(angular.isFunction(options.templateUrl) ? - options.templateUrl() : options.templateUrl); - } - - var promiseChain = null; - $modal.getPromiseChain = function() { - return promiseChain; - }; - - $modal.open = function(modalOptions) { - var modalResultDeferred = $q.defer(); - var modalOpenedDeferred = $q.defer(); - var modalClosedDeferred = $q.defer(); - var modalRenderDeferred = $q.defer(); - - //prepare an instance of a modal to be injected into controllers and returned to a caller - var modalInstance = { - result: modalResultDeferred.promise, - opened: modalOpenedDeferred.promise, - closed: modalClosedDeferred.promise, - rendered: modalRenderDeferred.promise, - close: function (result) { - return $modalStack.close(modalInstance, result); - }, - dismiss: function (reason) { - return $modalStack.dismiss(modalInstance, reason); - } - }; - - //merge and clean up options - modalOptions = angular.extend({}, $modalProvider.options, modalOptions); - modalOptions.resolve = modalOptions.resolve || {}; - modalOptions.appendTo = modalOptions.appendTo || $document.find('body').eq(0); - - //verify options - if (!modalOptions.template && !modalOptions.templateUrl) { - throw new Error('One of template or templateUrl options is required.'); - } - - var templateAndResolvePromise = - $q.all([getTemplatePromise(modalOptions), $uibResolve.resolve(modalOptions.resolve, {}, null, null)]); - - function resolveWithTemplate() { - return templateAndResolvePromise; - } - - // Wait for the resolution of the existing promise chain. - // Then switch to our own combined promise dependency (regardless of how the previous modal fared). - // Then add to $modalStack and resolve opened. - // Finally clean up the chain variable if no subsequent modal has overwritten it. - var samePromise; - samePromise = promiseChain = $q.all([promiseChain]) - .then(resolveWithTemplate, resolveWithTemplate) - .then(function resolveSuccess(tplAndVars) { - var providedScope = modalOptions.scope || $rootScope; - - var modalScope = providedScope.$new(); - modalScope.$close = modalInstance.close; - modalScope.$dismiss = modalInstance.dismiss; - - modalScope.$on('$destroy', function() { - if (!modalScope.$$uibDestructionScheduled) { - modalScope.$dismiss('$uibUnscheduledDestruction'); - } - }); - - var ctrlInstance, ctrlInstantiate, ctrlLocals = {}; - - //controllers - if (modalOptions.controller) { - ctrlLocals.$scope = modalScope; - ctrlLocals.$scope.$resolve = {}; - ctrlLocals.$uibModalInstance = modalInstance; - angular.forEach(tplAndVars[1], function(value, key) { - ctrlLocals[key] = value; - ctrlLocals.$scope.$resolve[key] = value; - }); - - // the third param will make the controller instantiate later,private api - // @see https://github.com/angular/angular.js/blob/master/src/ng/controller.js#L126 - ctrlInstantiate = $controller(modalOptions.controller, ctrlLocals, true, modalOptions.controllerAs); - if (modalOptions.controllerAs && modalOptions.bindToController) { - ctrlInstance = ctrlInstantiate.instance; - ctrlInstance.$close = modalScope.$close; - ctrlInstance.$dismiss = modalScope.$dismiss; - angular.extend(ctrlInstance, { - $resolve: ctrlLocals.$scope.$resolve - }, providedScope); - } - - ctrlInstance = ctrlInstantiate(); - - if (angular.isFunction(ctrlInstance.$onInit)) { - ctrlInstance.$onInit(); - } - } - - $modalStack.open(modalInstance, { - scope: modalScope, - deferred: modalResultDeferred, - renderDeferred: modalRenderDeferred, - closedDeferred: modalClosedDeferred, - content: tplAndVars[0], - animation: modalOptions.animation, - backdrop: modalOptions.backdrop, - keyboard: modalOptions.keyboard, - backdropClass: modalOptions.backdropClass, - windowTopClass: modalOptions.windowTopClass, - windowClass: modalOptions.windowClass, - windowTemplateUrl: modalOptions.windowTemplateUrl, - size: modalOptions.size, - openedClass: modalOptions.openedClass, - appendTo: modalOptions.appendTo - }); - modalOpenedDeferred.resolve(true); - - }, function resolveError(reason) { - modalOpenedDeferred.reject(reason); - modalResultDeferred.reject(reason); - })['finally'](function() { - if (promiseChain === samePromise) { - promiseChain = null; - } - }); - - return modalInstance; - }; - - return $modal; - } - ] - }; - - return $modalProvider; - }); - -angular.module('ui.bootstrap.paging', []) -/** - * Helper internal service for generating common controller code between the - * pager and pagination components - */ -.factory('uibPaging', ['$parse', function($parse) { - return { - create: function(ctrl, $scope, $attrs) { - ctrl.setNumPages = $attrs.numPages ? $parse($attrs.numPages).assign : angular.noop; - ctrl.ngModelCtrl = { $setViewValue: angular.noop }; // nullModelCtrl - ctrl._watchers = []; - - ctrl.init = function(ngModelCtrl, config) { - ctrl.ngModelCtrl = ngModelCtrl; - ctrl.config = config; - - ngModelCtrl.$render = function() { - ctrl.render(); - }; - - if ($attrs.itemsPerPage) { - ctrl._watchers.push($scope.$parent.$watch($attrs.itemsPerPage, function(value) { - ctrl.itemsPerPage = parseInt(value, 10); - $scope.totalPages = ctrl.calculateTotalPages(); - ctrl.updatePage(); - })); - } else { - ctrl.itemsPerPage = config.itemsPerPage; - } - - $scope.$watch('totalItems', function(newTotal, oldTotal) { - if (angular.isDefined(newTotal) || newTotal !== oldTotal) { - $scope.totalPages = ctrl.calculateTotalPages(); - ctrl.updatePage(); - } - }); - }; - - ctrl.calculateTotalPages = function() { - var totalPages = ctrl.itemsPerPage < 1 ? 1 : Math.ceil($scope.totalItems / ctrl.itemsPerPage); - return Math.max(totalPages || 0, 1); - }; - - ctrl.render = function() { - $scope.page = parseInt(ctrl.ngModelCtrl.$viewValue, 10) || 1; - }; - - $scope.selectPage = function(page, evt) { - if (evt) { - evt.preventDefault(); - } - - var clickAllowed = !$scope.ngDisabled || !evt; - if (clickAllowed && $scope.page !== page && page > 0 && page <= $scope.totalPages) { - if (evt && evt.target) { - evt.target.blur(); - } - ctrl.ngModelCtrl.$setViewValue(page); - ctrl.ngModelCtrl.$render(); - } - }; - - $scope.getText = function(key) { - return $scope[key + 'Text'] || ctrl.config[key + 'Text']; - }; - - $scope.noPrevious = function() { - return $scope.page === 1; - }; - - $scope.noNext = function() { - return $scope.page === $scope.totalPages; - }; - - ctrl.updatePage = function() { - ctrl.setNumPages($scope.$parent, $scope.totalPages); // Readonly variable - - if ($scope.page > $scope.totalPages) { - $scope.selectPage($scope.totalPages); - } else { - ctrl.ngModelCtrl.$render(); - } - }; - - $scope.$on('$destroy', function() { - while (ctrl._watchers.length) { - ctrl._watchers.shift()(); - } - }); - } - }; -}]); - -angular.module('ui.bootstrap.pager', ['ui.bootstrap.paging']) - -.controller('UibPagerController', ['$scope', '$attrs', 'uibPaging', 'uibPagerConfig', function($scope, $attrs, uibPaging, uibPagerConfig) { - $scope.align = angular.isDefined($attrs.align) ? $scope.$parent.$eval($attrs.align) : uibPagerConfig.align; - - uibPaging.create(this, $scope, $attrs); -}]) - -.constant('uibPagerConfig', { - itemsPerPage: 10, - previousText: '« Previous', - nextText: 'Next »', - align: true -}) - -.directive('uibPager', ['uibPagerConfig', function(uibPagerConfig) { - return { - scope: { - totalItems: '=', - previousText: '@', - nextText: '@', - ngDisabled: '=' - }, - require: ['uibPager', '?ngModel'], - controller: 'UibPagerController', - controllerAs: 'pager', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/pager/pager.html'; - }, - replace: true, - link: function(scope, element, attrs, ctrls) { - var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - if (!ngModelCtrl) { - return; // do nothing if no ng-model - } - - paginationCtrl.init(ngModelCtrl, uibPagerConfig); - } - }; -}]); - -angular.module('ui.bootstrap.pagination', ['ui.bootstrap.paging']) -.controller('UibPaginationController', ['$scope', '$attrs', '$parse', 'uibPaging', 'uibPaginationConfig', function($scope, $attrs, $parse, uibPaging, uibPaginationConfig) { - var ctrl = this; - // Setup configuration parameters - var maxSize = angular.isDefined($attrs.maxSize) ? $scope.$parent.$eval($attrs.maxSize) : uibPaginationConfig.maxSize, - rotate = angular.isDefined($attrs.rotate) ? $scope.$parent.$eval($attrs.rotate) : uibPaginationConfig.rotate, - forceEllipses = angular.isDefined($attrs.forceEllipses) ? $scope.$parent.$eval($attrs.forceEllipses) : uibPaginationConfig.forceEllipses, - boundaryLinkNumbers = angular.isDefined($attrs.boundaryLinkNumbers) ? $scope.$parent.$eval($attrs.boundaryLinkNumbers) : uibPaginationConfig.boundaryLinkNumbers, - pageLabel = angular.isDefined($attrs.pageLabel) ? function(idx) { return $scope.$parent.$eval($attrs.pageLabel, {$page: idx}); } : angular.identity; - $scope.boundaryLinks = angular.isDefined($attrs.boundaryLinks) ? $scope.$parent.$eval($attrs.boundaryLinks) : uibPaginationConfig.boundaryLinks; - $scope.directionLinks = angular.isDefined($attrs.directionLinks) ? $scope.$parent.$eval($attrs.directionLinks) : uibPaginationConfig.directionLinks; - - uibPaging.create(this, $scope, $attrs); - - if ($attrs.maxSize) { - ctrl._watchers.push($scope.$parent.$watch($parse($attrs.maxSize), function(value) { - maxSize = parseInt(value, 10); - ctrl.render(); - })); - } - - // Create page object used in template - function makePage(number, text, isActive) { - return { - number: number, - text: text, - active: isActive - }; - } - - function getPages(currentPage, totalPages) { - var pages = []; - - // Default page limits - var startPage = 1, endPage = totalPages; - var isMaxSized = angular.isDefined(maxSize) && maxSize < totalPages; - - // recompute if maxSize - if (isMaxSized) { - if (rotate) { - // Current page is displayed in the middle of the visible ones - startPage = Math.max(currentPage - Math.floor(maxSize / 2), 1); - endPage = startPage + maxSize - 1; - - // Adjust if limit is exceeded - if (endPage > totalPages) { - endPage = totalPages; - startPage = endPage - maxSize + 1; - } - } else { - // Visible pages are paginated with maxSize - startPage = (Math.ceil(currentPage / maxSize) - 1) * maxSize + 1; - - // Adjust last page if limit is exceeded - endPage = Math.min(startPage + maxSize - 1, totalPages); - } - } - - // Add page number links - for (var number = startPage; number <= endPage; number++) { - var page = makePage(number, pageLabel(number), number === currentPage); - pages.push(page); - } - - // Add links to move between page sets - if (isMaxSized && maxSize > 0 && (!rotate || forceEllipses || boundaryLinkNumbers)) { - if (startPage > 1) { - if (!boundaryLinkNumbers || startPage > 3) { //need ellipsis for all options unless range is too close to beginning - var previousPageSet = makePage(startPage - 1, '...', false); - pages.unshift(previousPageSet); - } - if (boundaryLinkNumbers) { - if (startPage === 3) { //need to replace ellipsis when the buttons would be sequential - var secondPageLink = makePage(2, '2', false); - pages.unshift(secondPageLink); - } - //add the first page - var firstPageLink = makePage(1, '1', false); - pages.unshift(firstPageLink); - } - } - - if (endPage < totalPages) { - if (!boundaryLinkNumbers || endPage < totalPages - 2) { //need ellipsis for all options unless range is too close to end - var nextPageSet = makePage(endPage + 1, '...', false); - pages.push(nextPageSet); - } - if (boundaryLinkNumbers) { - if (endPage === totalPages - 2) { //need to replace ellipsis when the buttons would be sequential - var secondToLastPageLink = makePage(totalPages - 1, totalPages - 1, false); - pages.push(secondToLastPageLink); - } - //add the last page - var lastPageLink = makePage(totalPages, totalPages, false); - pages.push(lastPageLink); - } - } - } - return pages; - } - - var originalRender = this.render; - this.render = function() { - originalRender(); - if ($scope.page > 0 && $scope.page <= $scope.totalPages) { - $scope.pages = getPages($scope.page, $scope.totalPages); - } - }; -}]) - -.constant('uibPaginationConfig', { - itemsPerPage: 10, - boundaryLinks: false, - boundaryLinkNumbers: false, - directionLinks: true, - firstText: 'First', - previousText: 'Previous', - nextText: 'Next', - lastText: 'Last', - rotate: true, - forceEllipses: false -}) - -.directive('uibPagination', ['$parse', 'uibPaginationConfig', function($parse, uibPaginationConfig) { - return { - scope: { - totalItems: '=', - firstText: '@', - previousText: '@', - nextText: '@', - lastText: '@', - ngDisabled:'=' - }, - require: ['uibPagination', '?ngModel'], - controller: 'UibPaginationController', - controllerAs: 'pagination', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/pagination/pagination.html'; - }, - replace: true, - link: function(scope, element, attrs, ctrls) { - var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - if (!ngModelCtrl) { - return; // do nothing if no ng-model - } - - paginationCtrl.init(ngModelCtrl, uibPaginationConfig); - } - }; -}]); - -/** - * The following features are still outstanding: animation as a - * function, placement as a function, inside, support for more triggers than - * just mouse enter/leave, html tooltips, and selector delegation. - */ -angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.stackedMap']) - -/** - * The $tooltip service creates tooltip- and popover-like directives as well as - * houses global options for them. - */ -.provider('$uibTooltip', function() { - // The default options tooltip and popover. - var defaultOptions = { - placement: 'top', - placementClassPrefix: '', - animation: true, - popupDelay: 0, - popupCloseDelay: 0, - useContentExp: false - }; - - // Default hide triggers for each show trigger - var triggerMap = { - 'mouseenter': 'mouseleave', - 'click': 'click', - 'outsideClick': 'outsideClick', - 'focus': 'blur', - 'none': '' - }; - - // The options specified to the provider globally. - var globalOptions = {}; - - /** - * `options({})` allows global configuration of all tooltips in the - * application. - * - * var app = angular.module( 'App', ['ui.bootstrap.tooltip'], function( $tooltipProvider ) { - * // place tooltips left instead of top by default - * $tooltipProvider.options( { placement: 'left' } ); - * }); - */ - this.options = function(value) { - angular.extend(globalOptions, value); - }; - - /** - * This allows you to extend the set of trigger mappings available. E.g.: - * - * $tooltipProvider.setTriggers( { 'openTrigger': 'closeTrigger' } ); - */ - this.setTriggers = function setTriggers(triggers) { - angular.extend(triggerMap, triggers); - }; - - /** - * This is a helper function for translating camel-case to snake_case. - */ - function snake_case(name) { - var regexp = /[A-Z]/g; - var separator = '-'; - return name.replace(regexp, function(letter, pos) { - return (pos ? separator : '') + letter.toLowerCase(); - }); - } - - /** - * Returns the actual instance of the $tooltip service. - * TODO support multiple triggers - */ - this.$get = ['$window', '$compile', '$timeout', '$document', '$uibPosition', '$interpolate', '$rootScope', '$parse', '$$stackedMap', function($window, $compile, $timeout, $document, $position, $interpolate, $rootScope, $parse, $$stackedMap) { - var openedTooltips = $$stackedMap.createNew(); - $document.on('keypress', keypressListener); - - $rootScope.$on('$destroy', function() { - $document.off('keypress', keypressListener); - }); - - function keypressListener(e) { - if (e.which === 27) { - var last = openedTooltips.top(); - if (last) { - last.value.close(); - openedTooltips.removeTop(); - last = null; - } - } - } - - return function $tooltip(ttType, prefix, defaultTriggerShow, options) { - options = angular.extend({}, defaultOptions, globalOptions, options); - - /** - * Returns an object of show and hide triggers. - * - * If a trigger is supplied, - * it is used to show the tooltip; otherwise, it will use the `trigger` - * option passed to the `$tooltipProvider.options` method; else it will - * default to the trigger supplied to this directive factory. - * - * The hide trigger is based on the show trigger. If the `trigger` option - * was passed to the `$tooltipProvider.options` method, it will use the - * mapped trigger from `triggerMap` or the passed trigger if the map is - * undefined; otherwise, it uses the `triggerMap` value of the show - * trigger; else it will just use the show trigger. - */ - function getTriggers(trigger) { - var show = (trigger || options.trigger || defaultTriggerShow).split(' '); - var hide = show.map(function(trigger) { - return triggerMap[trigger] || trigger; - }); - return { - show: show, - hide: hide - }; - } - - var directiveName = snake_case(ttType); - - var startSym = $interpolate.startSymbol(); - var endSym = $interpolate.endSymbol(); - var template = - '
' + - '
'; - - return { - compile: function(tElem, tAttrs) { - var tooltipLinker = $compile(template); - - return function link(scope, element, attrs, tooltipCtrl) { - var tooltip; - var tooltipLinkedScope; - var transitionTimeout; - var showTimeout; - var hideTimeout; - var positionTimeout; - var appendToBody = angular.isDefined(options.appendToBody) ? options.appendToBody : false; - var triggers = getTriggers(undefined); - var hasEnableExp = angular.isDefined(attrs[prefix + 'Enable']); - var ttScope = scope.$new(true); - var repositionScheduled = false; - var isOpenParse = angular.isDefined(attrs[prefix + 'IsOpen']) ? $parse(attrs[prefix + 'IsOpen']) : false; - var contentParse = options.useContentExp ? $parse(attrs[ttType]) : false; - var observers = []; - var lastPlacement; - - var positionTooltip = function() { - // check if tooltip exists and is not empty - if (!tooltip || !tooltip.html()) { return; } - - if (!positionTimeout) { - positionTimeout = $timeout(function() { - var ttPosition = $position.positionElements(element, tooltip, ttScope.placement, appendToBody); - tooltip.css({ top: ttPosition.top + 'px', left: ttPosition.left + 'px' }); - - if (!tooltip.hasClass(ttPosition.placement.split('-')[0])) { - tooltip.removeClass(lastPlacement.split('-')[0]); - tooltip.addClass(ttPosition.placement.split('-')[0]); - } - - if (!tooltip.hasClass(options.placementClassPrefix + ttPosition.placement)) { - tooltip.removeClass(options.placementClassPrefix + lastPlacement); - tooltip.addClass(options.placementClassPrefix + ttPosition.placement); - } - - // first time through tt element will have the - // uib-position-measure class or if the placement - // has changed we need to position the arrow. - if (tooltip.hasClass('uib-position-measure')) { - $position.positionArrow(tooltip, ttPosition.placement); - tooltip.removeClass('uib-position-measure'); - } else if (lastPlacement !== ttPosition.placement) { - $position.positionArrow(tooltip, ttPosition.placement); - } - lastPlacement = ttPosition.placement; - - positionTimeout = null; - }, 0, false); - } - }; - - // Set up the correct scope to allow transclusion later - ttScope.origScope = scope; - - // By default, the tooltip is not open. - // TODO add ability to start tooltip opened - ttScope.isOpen = false; - openedTooltips.add(ttScope, { - close: hide - }); - - function toggleTooltipBind() { - if (!ttScope.isOpen) { - showTooltipBind(); - } else { - hideTooltipBind(); - } - } - - // Show the tooltip with delay if specified, otherwise show it immediately - function showTooltipBind() { - if (hasEnableExp && !scope.$eval(attrs[prefix + 'Enable'])) { - return; - } - - cancelHide(); - prepareTooltip(); - - if (ttScope.popupDelay) { - // Do nothing if the tooltip was already scheduled to pop-up. - // This happens if show is triggered multiple times before any hide is triggered. - if (!showTimeout) { - showTimeout = $timeout(show, ttScope.popupDelay, false); - } - } else { - show(); - } - } - - function hideTooltipBind() { - cancelShow(); - - if (ttScope.popupCloseDelay) { - if (!hideTimeout) { - hideTimeout = $timeout(hide, ttScope.popupCloseDelay, false); - } - } else { - hide(); - } - } - - // Show the tooltip popup element. - function show() { - cancelShow(); - cancelHide(); - - // Don't show empty tooltips. - if (!ttScope.content) { - return angular.noop; - } - - createTooltip(); - - // And show the tooltip. - ttScope.$evalAsync(function() { - ttScope.isOpen = true; - assignIsOpen(true); - positionTooltip(); - }); - } - - function cancelShow() { - if (showTimeout) { - $timeout.cancel(showTimeout); - showTimeout = null; - } - - if (positionTimeout) { - $timeout.cancel(positionTimeout); - positionTimeout = null; - } - } - - // Hide the tooltip popup element. - function hide() { - if (!ttScope) { - return; - } - - // First things first: we don't show it anymore. - ttScope.$evalAsync(function() { - if (ttScope) { - ttScope.isOpen = false; - assignIsOpen(false); - // And now we remove it from the DOM. However, if we have animation, we - // need to wait for it to expire beforehand. - // FIXME: this is a placeholder for a port of the transitions library. - // The fade transition in TWBS is 150ms. - if (ttScope.animation) { - if (!transitionTimeout) { - transitionTimeout = $timeout(removeTooltip, 150, false); - } - } else { - removeTooltip(); - } - } - }); - } - - function cancelHide() { - if (hideTimeout) { - $timeout.cancel(hideTimeout); - hideTimeout = null; - } - - if (transitionTimeout) { - $timeout.cancel(transitionTimeout); - transitionTimeout = null; - } - } - - function createTooltip() { - // There can only be one tooltip element per directive shown at once. - if (tooltip) { - return; - } - - tooltipLinkedScope = ttScope.$new(); - tooltip = tooltipLinker(tooltipLinkedScope, function(tooltip) { - if (appendToBody) { - $document.find('body').append(tooltip); - } else { - element.after(tooltip); - } - }); - - prepObservers(); - } - - function removeTooltip() { - cancelShow(); - cancelHide(); - unregisterObservers(); - - if (tooltip) { - tooltip.remove(); - tooltip = null; - } - if (tooltipLinkedScope) { - tooltipLinkedScope.$destroy(); - tooltipLinkedScope = null; - } - } - - /** - * Set the initial scope values. Once - * the tooltip is created, the observers - * will be added to keep things in sync. - */ - function prepareTooltip() { - ttScope.title = attrs[prefix + 'Title']; - if (contentParse) { - ttScope.content = contentParse(scope); - } else { - ttScope.content = attrs[ttType]; - } - - ttScope.popupClass = attrs[prefix + 'Class']; - ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement; - var placement = $position.parsePlacement(ttScope.placement); - lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0]; - - var delay = parseInt(attrs[prefix + 'PopupDelay'], 10); - var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10); - ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay; - ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay; - } - - function assignIsOpen(isOpen) { - if (isOpenParse && angular.isFunction(isOpenParse.assign)) { - isOpenParse.assign(scope, isOpen); - } - } - - ttScope.contentExp = function() { - return ttScope.content; - }; - - /** - * Observe the relevant attributes. - */ - attrs.$observe('disabled', function(val) { - if (val) { - cancelShow(); - } - - if (val && ttScope.isOpen) { - hide(); - } - }); - - if (isOpenParse) { - scope.$watch(isOpenParse, function(val) { - if (ttScope && !val === ttScope.isOpen) { - toggleTooltipBind(); - } - }); - } - - function prepObservers() { - observers.length = 0; - - if (contentParse) { - observers.push( - scope.$watch(contentParse, function(val) { - ttScope.content = val; - if (!val && ttScope.isOpen) { - hide(); - } - }) - ); - - observers.push( - tooltipLinkedScope.$watch(function() { - if (!repositionScheduled) { - repositionScheduled = true; - tooltipLinkedScope.$$postDigest(function() { - repositionScheduled = false; - if (ttScope && ttScope.isOpen) { - positionTooltip(); - } - }); - } - }) - ); - } else { - observers.push( - attrs.$observe(ttType, function(val) { - ttScope.content = val; - if (!val && ttScope.isOpen) { - hide(); - } else { - positionTooltip(); - } - }) - ); - } - - observers.push( - attrs.$observe(prefix + 'Title', function(val) { - ttScope.title = val; - if (ttScope.isOpen) { - positionTooltip(); - } - }) - ); - - observers.push( - attrs.$observe(prefix + 'Placement', function(val) { - ttScope.placement = val ? val : options.placement; - if (ttScope.isOpen) { - positionTooltip(); - } - }) - ); - } - - function unregisterObservers() { - if (observers.length) { - angular.forEach(observers, function(observer) { - observer(); - }); - observers.length = 0; - } - } - - // hide tooltips/popovers for outsideClick trigger - function bodyHideTooltipBind(e) { - if (!ttScope || !ttScope.isOpen || !tooltip) { - return; - } - // make sure the tooltip/popover link or tool tooltip/popover itself were not clicked - if (!element[0].contains(e.target) && !tooltip[0].contains(e.target)) { - hideTooltipBind(); - } - } - - var unregisterTriggers = function() { - triggers.show.forEach(function(trigger) { - if (trigger === 'outsideClick') { - element.off('click', toggleTooltipBind); - } else { - element.off(trigger, showTooltipBind); - element.off(trigger, toggleTooltipBind); - } - }); - triggers.hide.forEach(function(trigger) { - if (trigger === 'outsideClick') { - $document.off('click', bodyHideTooltipBind); - } else { - element.off(trigger, hideTooltipBind); - } - }); - }; - - function prepTriggers() { - var val = attrs[prefix + 'Trigger']; - unregisterTriggers(); - - triggers = getTriggers(val); - - if (triggers.show !== 'none') { - triggers.show.forEach(function(trigger, idx) { - if (trigger === 'outsideClick') { - element.on('click', toggleTooltipBind); - $document.on('click', bodyHideTooltipBind); - } else if (trigger === triggers.hide[idx]) { - element.on(trigger, toggleTooltipBind); - } else if (trigger) { - element.on(trigger, showTooltipBind); - element.on(triggers.hide[idx], hideTooltipBind); - } - - element.on('keypress', function(e) { - if (e.which === 27) { - hideTooltipBind(); - } - }); - }); - } - } - - prepTriggers(); - - var animation = scope.$eval(attrs[prefix + 'Animation']); - ttScope.animation = angular.isDefined(animation) ? !!animation : options.animation; - - var appendToBodyVal; - var appendKey = prefix + 'AppendToBody'; - if (appendKey in attrs && attrs[appendKey] === undefined) { - appendToBodyVal = true; - } else { - appendToBodyVal = scope.$eval(attrs[appendKey]); - } - - appendToBody = angular.isDefined(appendToBodyVal) ? appendToBodyVal : appendToBody; - - // Make sure tooltip is destroyed and removed. - scope.$on('$destroy', function onDestroyTooltip() { - unregisterTriggers(); - removeTooltip(); - openedTooltips.remove(ttScope); - ttScope = null; - }); - }; - } - }; - }; - }]; -}) - -// This is mostly ngInclude code but with a custom scope -.directive('uibTooltipTemplateTransclude', [ - '$animate', '$sce', '$compile', '$templateRequest', -function ($animate, $sce, $compile, $templateRequest) { - return { - link: function(scope, elem, attrs) { - var origScope = scope.$eval(attrs.tooltipTemplateTranscludeScope); - - var changeCounter = 0, - currentScope, - previousElement, - currentElement; - - var cleanupLastIncludeContent = function() { - if (previousElement) { - previousElement.remove(); - previousElement = null; - } - - if (currentScope) { - currentScope.$destroy(); - currentScope = null; - } - - if (currentElement) { - $animate.leave(currentElement).then(function() { - previousElement = null; - }); - previousElement = currentElement; - currentElement = null; - } - }; - - scope.$watch($sce.parseAsResourceUrl(attrs.uibTooltipTemplateTransclude), function(src) { - var thisChangeId = ++changeCounter; - - if (src) { - //set the 2nd param to true to ignore the template request error so that the inner - //contents and scope can be cleaned up. - $templateRequest(src, true).then(function(response) { - if (thisChangeId !== changeCounter) { return; } - var newScope = origScope.$new(); - var template = response; - - var clone = $compile(template)(newScope, function(clone) { - cleanupLastIncludeContent(); - $animate.enter(clone, elem); - }); - - currentScope = newScope; - currentElement = clone; - - currentScope.$emit('$includeContentLoaded', src); - }, function() { - if (thisChangeId === changeCounter) { - cleanupLastIncludeContent(); - scope.$emit('$includeContentError', src); - } - }); - scope.$emit('$includeContentRequested', src); - } else { - cleanupLastIncludeContent(); - } - }); - - scope.$on('$destroy', cleanupLastIncludeContent); - } - }; -}]) - -/** - * Note that it's intentional that these classes are *not* applied through $animate. - * They must not be animated as they're expected to be present on the tooltip on - * initialization. - */ -.directive('uibTooltipClasses', ['$uibPosition', function($uibPosition) { - return { - restrict: 'A', - link: function(scope, element, attrs) { - // need to set the primary position so the - // arrow has space during position measure. - // tooltip.positionTooltip() - if (scope.placement) { - // // There are no top-left etc... classes - // // in TWBS, so we need the primary position. - var position = $uibPosition.parsePlacement(scope.placement); - element.addClass(position[0]); - } - - if (scope.popupClass) { - element.addClass(scope.popupClass); - } - - if (scope.animation()) { - element.addClass(attrs.tooltipAnimationClass); - } - } - }; -}]) - -.directive('uibTooltipPopup', function() { - return { - replace: true, - scope: { content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' }, - templateUrl: 'uib/template/tooltip/tooltip-popup.html' - }; -}) - -.directive('uibTooltip', [ '$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibTooltip', 'tooltip', 'mouseenter'); -}]) - -.directive('uibTooltipTemplatePopup', function() { - return { - replace: true, - scope: { contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&', - originScope: '&' }, - templateUrl: 'uib/template/tooltip/tooltip-template-popup.html' - }; -}) - -.directive('uibTooltipTemplate', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibTooltipTemplate', 'tooltip', 'mouseenter', { - useContentExp: true - }); -}]) - -.directive('uibTooltipHtmlPopup', function() { - return { - replace: true, - scope: { contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&' }, - templateUrl: 'uib/template/tooltip/tooltip-html-popup.html' - }; -}) - -.directive('uibTooltipHtml', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibTooltipHtml', 'tooltip', 'mouseenter', { - useContentExp: true - }); -}]); - -/** - * The following features are still outstanding: popup delay, animation as a - * function, placement as a function, inside, support for more triggers than - * just mouse enter/leave, and selector delegatation. - */ -angular.module('ui.bootstrap.popover', ['ui.bootstrap.tooltip']) - -.directive('uibPopoverTemplatePopup', function() { - return { - replace: true, - scope: { uibTitle: '@', contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&', - originScope: '&' }, - templateUrl: 'uib/template/popover/popover-template.html' - }; -}) - -.directive('uibPopoverTemplate', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibPopoverTemplate', 'popover', 'click', { - useContentExp: true - }); -}]) - -.directive('uibPopoverHtmlPopup', function() { - return { - replace: true, - scope: { contentExp: '&', uibTitle: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' }, - templateUrl: 'uib/template/popover/popover-html.html' - }; -}) - -.directive('uibPopoverHtml', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibPopoverHtml', 'popover', 'click', { - useContentExp: true - }); -}]) - -.directive('uibPopoverPopup', function() { - return { - replace: true, - scope: { uibTitle: '@', content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' }, - templateUrl: 'uib/template/popover/popover.html' - }; -}) - -.directive('uibPopover', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibPopover', 'popover', 'click'); -}]); - -angular.module('ui.bootstrap.progressbar', []) - -.constant('uibProgressConfig', { - animate: true, - max: 100 -}) - -.controller('UibProgressController', ['$scope', '$attrs', 'uibProgressConfig', function($scope, $attrs, progressConfig) { - var self = this, - animate = angular.isDefined($attrs.animate) ? $scope.$parent.$eval($attrs.animate) : progressConfig.animate; - - this.bars = []; - $scope.max = getMaxOrDefault(); - - this.addBar = function(bar, element, attrs) { - if (!animate) { - element.css({'transition': 'none'}); - } - - this.bars.push(bar); - - bar.max = getMaxOrDefault(); - bar.title = attrs && angular.isDefined(attrs.title) ? attrs.title : 'progressbar'; - - bar.$watch('value', function(value) { - bar.recalculatePercentage(); - }); - - bar.recalculatePercentage = function() { - var totalPercentage = self.bars.reduce(function(total, bar) { - bar.percent = +(100 * bar.value / bar.max).toFixed(2); - return total + bar.percent; - }, 0); - - if (totalPercentage > 100) { - bar.percent -= totalPercentage - 100; - } - }; - - bar.$on('$destroy', function() { - element = null; - self.removeBar(bar); - }); - }; - - this.removeBar = function(bar) { - this.bars.splice(this.bars.indexOf(bar), 1); - this.bars.forEach(function (bar) { - bar.recalculatePercentage(); - }); - }; - - //$attrs.$observe('maxParam', function(maxParam) { - $scope.$watch('maxParam', function(maxParam) { - self.bars.forEach(function(bar) { - bar.max = getMaxOrDefault(); - bar.recalculatePercentage(); - }); - }); - - function getMaxOrDefault () { - return angular.isDefined($scope.maxParam) ? $scope.maxParam : progressConfig.max; - } -}]) - -.directive('uibProgress', function() { - return { - replace: true, - transclude: true, - controller: 'UibProgressController', - require: 'uibProgress', - scope: { - maxParam: '=?max' - }, - templateUrl: 'uib/template/progressbar/progress.html' - }; -}) - -.directive('uibBar', function() { - return { - replace: true, - transclude: true, - require: '^uibProgress', - scope: { - value: '=', - type: '@' - }, - templateUrl: 'uib/template/progressbar/bar.html', - link: function(scope, element, attrs, progressCtrl) { - progressCtrl.addBar(scope, element, attrs); - } - }; -}) - -.directive('uibProgressbar', function() { - return { - replace: true, - transclude: true, - controller: 'UibProgressController', - scope: { - value: '=', - maxParam: '=?max', - type: '@' - }, - templateUrl: 'uib/template/progressbar/progressbar.html', - link: function(scope, element, attrs, progressCtrl) { - progressCtrl.addBar(scope, angular.element(element.children()[0]), {title: attrs.title}); - } - }; -}); - -angular.module('ui.bootstrap.rating', []) - -.constant('uibRatingConfig', { - max: 5, - stateOn: null, - stateOff: null, - enableReset: true, - titles : ['one', 'two', 'three', 'four', 'five'] -}) - -.controller('UibRatingController', ['$scope', '$attrs', 'uibRatingConfig', function($scope, $attrs, ratingConfig) { - var ngModelCtrl = { $setViewValue: angular.noop }, - self = this; - - this.init = function(ngModelCtrl_) { - ngModelCtrl = ngModelCtrl_; - ngModelCtrl.$render = this.render; - - ngModelCtrl.$formatters.push(function(value) { - if (angular.isNumber(value) && value << 0 !== value) { - value = Math.round(value); - } - - return value; - }); - - this.stateOn = angular.isDefined($attrs.stateOn) ? $scope.$parent.$eval($attrs.stateOn) : ratingConfig.stateOn; - this.stateOff = angular.isDefined($attrs.stateOff) ? $scope.$parent.$eval($attrs.stateOff) : ratingConfig.stateOff; - this.enableReset = angular.isDefined($attrs.enableReset) ? - $scope.$parent.$eval($attrs.enableReset) : ratingConfig.enableReset; - var tmpTitles = angular.isDefined($attrs.titles) ? $scope.$parent.$eval($attrs.titles) : ratingConfig.titles; - this.titles = angular.isArray(tmpTitles) && tmpTitles.length > 0 ? - tmpTitles : ratingConfig.titles; - - var ratingStates = angular.isDefined($attrs.ratingStates) ? - $scope.$parent.$eval($attrs.ratingStates) : - new Array(angular.isDefined($attrs.max) ? $scope.$parent.$eval($attrs.max) : ratingConfig.max); - $scope.range = this.buildTemplateObjects(ratingStates); - }; - - this.buildTemplateObjects = function(states) { - for (var i = 0, n = states.length; i < n; i++) { - states[i] = angular.extend({ index: i }, { stateOn: this.stateOn, stateOff: this.stateOff, title: this.getTitle(i) }, states[i]); - } - return states; - }; - - this.getTitle = function(index) { - if (index >= this.titles.length) { - return index + 1; - } - - return this.titles[index]; - }; - - $scope.rate = function(value) { - if (!$scope.readonly && value >= 0 && value <= $scope.range.length) { - var newViewValue = self.enableReset && ngModelCtrl.$viewValue === value ? 0 : value; - ngModelCtrl.$setViewValue(newViewValue); - ngModelCtrl.$render(); - } - }; - - $scope.enter = function(value) { - if (!$scope.readonly) { - $scope.value = value; - } - $scope.onHover({value: value}); - }; - - $scope.reset = function() { - $scope.value = ngModelCtrl.$viewValue; - $scope.onLeave(); - }; - - $scope.onKeydown = function(evt) { - if (/(37|38|39|40)/.test(evt.which)) { - evt.preventDefault(); - evt.stopPropagation(); - $scope.rate($scope.value + (evt.which === 38 || evt.which === 39 ? 1 : -1)); - } - }; - - this.render = function() { - $scope.value = ngModelCtrl.$viewValue; - $scope.title = self.getTitle($scope.value - 1); - }; -}]) - -.directive('uibRating', function() { - return { - require: ['uibRating', 'ngModel'], - scope: { - readonly: '=?readOnly', - onHover: '&', - onLeave: '&' - }, - controller: 'UibRatingController', - templateUrl: 'uib/template/rating/rating.html', - replace: true, - link: function(scope, element, attrs, ctrls) { - var ratingCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - ratingCtrl.init(ngModelCtrl); - } - }; -}); - -angular.module('ui.bootstrap.tabs', []) - -.controller('UibTabsetController', ['$scope', function ($scope) { - var ctrl = this, - oldIndex; - ctrl.tabs = []; - - ctrl.select = function(index, evt) { - if (!destroyed) { - var previousIndex = findTabIndex(oldIndex); - var previousSelected = ctrl.tabs[previousIndex]; - if (previousSelected) { - previousSelected.tab.onDeselect({ - $event: evt, - $selectedIndex: index - }); - if (evt && evt.isDefaultPrevented()) { - return; - } - previousSelected.tab.active = false; - } - - var selected = ctrl.tabs[index]; - if (selected) { - selected.tab.onSelect({ - $event: evt - }); - selected.tab.active = true; - ctrl.active = selected.index; - oldIndex = selected.index; - } else if (!selected && angular.isDefined(oldIndex)) { - ctrl.active = null; - oldIndex = null; - } - } - }; - - ctrl.addTab = function addTab(tab) { - ctrl.tabs.push({ - tab: tab, - index: tab.index - }); - ctrl.tabs.sort(function(t1, t2) { - if (t1.index > t2.index) { - return 1; - } - - if (t1.index < t2.index) { - return -1; - } - - return 0; - }); - - if (tab.index === ctrl.active || !angular.isDefined(ctrl.active) && ctrl.tabs.length === 1) { - var newActiveIndex = findTabIndex(tab.index); - ctrl.select(newActiveIndex); - } - }; - - ctrl.removeTab = function removeTab(tab) { - var index; - for (var i = 0; i < ctrl.tabs.length; i++) { - if (ctrl.tabs[i].tab === tab) { - index = i; - break; - } - } - - if (ctrl.tabs[index].index === ctrl.active) { - var newActiveTabIndex = index === ctrl.tabs.length - 1 ? - index - 1 : index + 1 % ctrl.tabs.length; - ctrl.select(newActiveTabIndex); - } - - ctrl.tabs.splice(index, 1); - }; - - $scope.$watch('tabset.active', function(val) { - if (angular.isDefined(val) && val !== oldIndex) { - ctrl.select(findTabIndex(val)); - } - }); - - var destroyed; - $scope.$on('$destroy', function() { - destroyed = true; - }); - - function findTabIndex(index) { - for (var i = 0; i < ctrl.tabs.length; i++) { - if (ctrl.tabs[i].index === index) { - return i; - } - } - } -}]) - -.directive('uibTabset', function() { - return { - transclude: true, - replace: true, - scope: {}, - bindToController: { - active: '=?', - type: '@' - }, - controller: 'UibTabsetController', - controllerAs: 'tabset', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/tabs/tabset.html'; - }, - link: function(scope, element, attrs) { - scope.vertical = angular.isDefined(attrs.vertical) ? - scope.$parent.$eval(attrs.vertical) : false; - scope.justified = angular.isDefined(attrs.justified) ? - scope.$parent.$eval(attrs.justified) : false; - } - }; -}) - -.directive('uibTab', ['$parse', function($parse) { - return { - require: '^uibTabset', - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/tabs/tab.html'; - }, - transclude: true, - scope: { - heading: '@', - index: '=?', - classes: '@?', - onSelect: '&select', //This callback is called in contentHeadingTransclude - //once it inserts the tab's content into the dom - onDeselect: '&deselect' - }, - controller: function() { - //Empty controller so other directives can require being 'under' a tab - }, - controllerAs: 'tab', - link: function(scope, elm, attrs, tabsetCtrl, transclude) { - scope.disabled = false; - if (attrs.disable) { - scope.$parent.$watch($parse(attrs.disable), function(value) { - scope.disabled = !! value; - }); - } - - if (angular.isUndefined(attrs.index)) { - if (tabsetCtrl.tabs && tabsetCtrl.tabs.length) { - scope.index = Math.max.apply(null, tabsetCtrl.tabs.map(function(t) { return t.index; })) + 1; - } else { - scope.index = 0; - } - } - - if (angular.isUndefined(attrs.classes)) { - scope.classes = ''; - } - - scope.select = function(evt) { - if (!scope.disabled) { - var index; - for (var i = 0; i < tabsetCtrl.tabs.length; i++) { - if (tabsetCtrl.tabs[i].tab === scope) { - index = i; - break; - } - } - - tabsetCtrl.select(index, evt); - } - }; - - tabsetCtrl.addTab(scope); - scope.$on('$destroy', function() { - tabsetCtrl.removeTab(scope); - }); - - //We need to transclude later, once the content container is ready. - //when this link happens, we're inside a tab heading. - scope.$transcludeFn = transclude; - } - }; -}]) - -.directive('uibTabHeadingTransclude', function() { - return { - restrict: 'A', - require: '^uibTab', - link: function(scope, elm) { - scope.$watch('headingElement', function updateHeadingElement(heading) { - if (heading) { - elm.html(''); - elm.append(heading); - } - }); - } - }; -}) - -.directive('uibTabContentTransclude', function() { - return { - restrict: 'A', - require: '^uibTabset', - link: function(scope, elm, attrs) { - var tab = scope.$eval(attrs.uibTabContentTransclude).tab; - - //Now our tab is ready to be transcluded: both the tab heading area - //and the tab content area are loaded. Transclude 'em both. - tab.$transcludeFn(tab.$parent, function(contents) { - angular.forEach(contents, function(node) { - if (isTabHeading(node)) { - //Let tabHeadingTransclude know. - tab.headingElement = node; - } else { - elm.append(node); - } - }); - }); - } - }; - - function isTabHeading(node) { - return node.tagName && ( - node.hasAttribute('uib-tab-heading') || - node.hasAttribute('data-uib-tab-heading') || - node.hasAttribute('x-uib-tab-heading') || - node.tagName.toLowerCase() === 'uib-tab-heading' || - node.tagName.toLowerCase() === 'data-uib-tab-heading' || - node.tagName.toLowerCase() === 'x-uib-tab-heading' || - node.tagName.toLowerCase() === 'uib:tab-heading' - ); - } -}); - -angular.module('ui.bootstrap.timepicker', []) - -.constant('uibTimepickerConfig', { - hourStep: 1, - minuteStep: 1, - secondStep: 1, - showMeridian: true, - showSeconds: false, - meridians: null, - readonlyInput: false, - mousewheel: true, - arrowkeys: true, - showSpinners: true, - templateUrl: 'uib/template/timepicker/timepicker.html' -}) - -.controller('UibTimepickerController', ['$scope', '$element', '$attrs', '$parse', '$log', '$locale', 'uibTimepickerConfig', function($scope, $element, $attrs, $parse, $log, $locale, timepickerConfig) { - var selected = new Date(), - watchers = [], - ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl - meridians = angular.isDefined($attrs.meridians) ? $scope.$parent.$eval($attrs.meridians) : timepickerConfig.meridians || $locale.DATETIME_FORMATS.AMPMS, - padHours = angular.isDefined($attrs.padHours) ? $scope.$parent.$eval($attrs.padHours) : true; - - $scope.tabindex = angular.isDefined($attrs.tabindex) ? $attrs.tabindex : 0; - $element.removeAttr('tabindex'); - - this.init = function(ngModelCtrl_, inputs) { - ngModelCtrl = ngModelCtrl_; - ngModelCtrl.$render = this.render; - - ngModelCtrl.$formatters.unshift(function(modelValue) { - return modelValue ? new Date(modelValue) : null; - }); - - var hoursInputEl = inputs.eq(0), - minutesInputEl = inputs.eq(1), - secondsInputEl = inputs.eq(2); - - var mousewheel = angular.isDefined($attrs.mousewheel) ? $scope.$parent.$eval($attrs.mousewheel) : timepickerConfig.mousewheel; - - if (mousewheel) { - this.setupMousewheelEvents(hoursInputEl, minutesInputEl, secondsInputEl); - } - - var arrowkeys = angular.isDefined($attrs.arrowkeys) ? $scope.$parent.$eval($attrs.arrowkeys) : timepickerConfig.arrowkeys; - if (arrowkeys) { - this.setupArrowkeyEvents(hoursInputEl, minutesInputEl, secondsInputEl); - } - - $scope.readonlyInput = angular.isDefined($attrs.readonlyInput) ? $scope.$parent.$eval($attrs.readonlyInput) : timepickerConfig.readonlyInput; - this.setupInputEvents(hoursInputEl, minutesInputEl, secondsInputEl); - }; - - var hourStep = timepickerConfig.hourStep; - if ($attrs.hourStep) { - watchers.push($scope.$parent.$watch($parse($attrs.hourStep), function(value) { - hourStep = +value; - })); - } - - var minuteStep = timepickerConfig.minuteStep; - if ($attrs.minuteStep) { - watchers.push($scope.$parent.$watch($parse($attrs.minuteStep), function(value) { - minuteStep = +value; - })); - } - - var min; - watchers.push($scope.$parent.$watch($parse($attrs.min), function(value) { - var dt = new Date(value); - min = isNaN(dt) ? undefined : dt; - })); - - var max; - watchers.push($scope.$parent.$watch($parse($attrs.max), function(value) { - var dt = new Date(value); - max = isNaN(dt) ? undefined : dt; - })); - - var disabled = false; - if ($attrs.ngDisabled) { - watchers.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(value) { - disabled = value; - })); - } - - $scope.noIncrementHours = function() { - var incrementedSelected = addMinutes(selected, hourStep * 60); - return disabled || incrementedSelected > max || - incrementedSelected < selected && incrementedSelected < min; - }; - - $scope.noDecrementHours = function() { - var decrementedSelected = addMinutes(selected, -hourStep * 60); - return disabled || decrementedSelected < min || - decrementedSelected > selected && decrementedSelected > max; - }; - - $scope.noIncrementMinutes = function() { - var incrementedSelected = addMinutes(selected, minuteStep); - return disabled || incrementedSelected > max || - incrementedSelected < selected && incrementedSelected < min; - }; - - $scope.noDecrementMinutes = function() { - var decrementedSelected = addMinutes(selected, -minuteStep); - return disabled || decrementedSelected < min || - decrementedSelected > selected && decrementedSelected > max; - }; - - $scope.noIncrementSeconds = function() { - var incrementedSelected = addSeconds(selected, secondStep); - return disabled || incrementedSelected > max || - incrementedSelected < selected && incrementedSelected < min; - }; - - $scope.noDecrementSeconds = function() { - var decrementedSelected = addSeconds(selected, -secondStep); - return disabled || decrementedSelected < min || - decrementedSelected > selected && decrementedSelected > max; - }; - - $scope.noToggleMeridian = function() { - if (selected.getHours() < 12) { - return disabled || addMinutes(selected, 12 * 60) > max; - } - - return disabled || addMinutes(selected, -12 * 60) < min; - }; - - var secondStep = timepickerConfig.secondStep; - if ($attrs.secondStep) { - watchers.push($scope.$parent.$watch($parse($attrs.secondStep), function(value) { - secondStep = +value; - })); - } - - $scope.showSeconds = timepickerConfig.showSeconds; - if ($attrs.showSeconds) { - watchers.push($scope.$parent.$watch($parse($attrs.showSeconds), function(value) { - $scope.showSeconds = !!value; - })); - } - - // 12H / 24H mode - $scope.showMeridian = timepickerConfig.showMeridian; - if ($attrs.showMeridian) { - watchers.push($scope.$parent.$watch($parse($attrs.showMeridian), function(value) { - $scope.showMeridian = !!value; - - if (ngModelCtrl.$error.time) { - // Evaluate from template - var hours = getHoursFromTemplate(), minutes = getMinutesFromTemplate(); - if (angular.isDefined(hours) && angular.isDefined(minutes)) { - selected.setHours(hours); - refresh(); - } - } else { - updateTemplate(); - } - })); - } - - // Get $scope.hours in 24H mode if valid - function getHoursFromTemplate() { - var hours = +$scope.hours; - var valid = $scope.showMeridian ? hours > 0 && hours < 13 : - hours >= 0 && hours < 24; - if (!valid || $scope.hours === '') { - return undefined; - } - - if ($scope.showMeridian) { - if (hours === 12) { - hours = 0; - } - if ($scope.meridian === meridians[1]) { - hours = hours + 12; - } - } - return hours; - } - - function getMinutesFromTemplate() { - var minutes = +$scope.minutes; - var valid = minutes >= 0 && minutes < 60; - if (!valid || $scope.minutes === '') { - return undefined; - } - return minutes; - } - - function getSecondsFromTemplate() { - var seconds = +$scope.seconds; - return seconds >= 0 && seconds < 60 ? seconds : undefined; - } - - function pad(value, noPad) { - if (value === null) { - return ''; - } - - return angular.isDefined(value) && value.toString().length < 2 && !noPad ? - '0' + value : value.toString(); - } - - // Respond on mousewheel spin - this.setupMousewheelEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) { - var isScrollingUp = function(e) { - if (e.originalEvent) { - e = e.originalEvent; - } - //pick correct delta variable depending on event - var delta = e.wheelDelta ? e.wheelDelta : -e.deltaY; - return e.detail || delta > 0; - }; - - hoursInputEl.bind('mousewheel wheel', function(e) { - if (!disabled) { - $scope.$apply(isScrollingUp(e) ? $scope.incrementHours() : $scope.decrementHours()); - } - e.preventDefault(); - }); - - minutesInputEl.bind('mousewheel wheel', function(e) { - if (!disabled) { - $scope.$apply(isScrollingUp(e) ? $scope.incrementMinutes() : $scope.decrementMinutes()); - } - e.preventDefault(); - }); - - secondsInputEl.bind('mousewheel wheel', function(e) { - if (!disabled) { - $scope.$apply(isScrollingUp(e) ? $scope.incrementSeconds() : $scope.decrementSeconds()); - } - e.preventDefault(); - }); - }; - - // Respond on up/down arrowkeys - this.setupArrowkeyEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) { - hoursInputEl.bind('keydown', function(e) { - if (!disabled) { - if (e.which === 38) { // up - e.preventDefault(); - $scope.incrementHours(); - $scope.$apply(); - } else if (e.which === 40) { // down - e.preventDefault(); - $scope.decrementHours(); - $scope.$apply(); - } - } - }); - - minutesInputEl.bind('keydown', function(e) { - if (!disabled) { - if (e.which === 38) { // up - e.preventDefault(); - $scope.incrementMinutes(); - $scope.$apply(); - } else if (e.which === 40) { // down - e.preventDefault(); - $scope.decrementMinutes(); - $scope.$apply(); - } - } - }); - - secondsInputEl.bind('keydown', function(e) { - if (!disabled) { - if (e.which === 38) { // up - e.preventDefault(); - $scope.incrementSeconds(); - $scope.$apply(); - } else if (e.which === 40) { // down - e.preventDefault(); - $scope.decrementSeconds(); - $scope.$apply(); - } - } - }); - }; - - this.setupInputEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) { - if ($scope.readonlyInput) { - $scope.updateHours = angular.noop; - $scope.updateMinutes = angular.noop; - $scope.updateSeconds = angular.noop; - return; - } - - var invalidate = function(invalidHours, invalidMinutes, invalidSeconds) { - ngModelCtrl.$setViewValue(null); - ngModelCtrl.$setValidity('time', false); - if (angular.isDefined(invalidHours)) { - $scope.invalidHours = invalidHours; - } - - if (angular.isDefined(invalidMinutes)) { - $scope.invalidMinutes = invalidMinutes; - } - - if (angular.isDefined(invalidSeconds)) { - $scope.invalidSeconds = invalidSeconds; - } - }; - - $scope.updateHours = function() { - var hours = getHoursFromTemplate(), - minutes = getMinutesFromTemplate(); - - ngModelCtrl.$setDirty(); - - if (angular.isDefined(hours) && angular.isDefined(minutes)) { - selected.setHours(hours); - selected.setMinutes(minutes); - if (selected < min || selected > max) { - invalidate(true); - } else { - refresh('h'); - } - } else { - invalidate(true); - } - }; - - hoursInputEl.bind('blur', function(e) { - ngModelCtrl.$setTouched(); - if (modelIsEmpty()) { - makeValid(); - } else if ($scope.hours === null || $scope.hours === '') { - invalidate(true); - } else if (!$scope.invalidHours && $scope.hours < 10) { - $scope.$apply(function() { - $scope.hours = pad($scope.hours, !padHours); - }); - } - }); - - $scope.updateMinutes = function() { - var minutes = getMinutesFromTemplate(), - hours = getHoursFromTemplate(); - - ngModelCtrl.$setDirty(); - - if (angular.isDefined(minutes) && angular.isDefined(hours)) { - selected.setHours(hours); - selected.setMinutes(minutes); - if (selected < min || selected > max) { - invalidate(undefined, true); - } else { - refresh('m'); - } - } else { - invalidate(undefined, true); - } - }; - - minutesInputEl.bind('blur', function(e) { - ngModelCtrl.$setTouched(); - if (modelIsEmpty()) { - makeValid(); - } else if ($scope.minutes === null) { - invalidate(undefined, true); - } else if (!$scope.invalidMinutes && $scope.minutes < 10) { - $scope.$apply(function() { - $scope.minutes = pad($scope.minutes); - }); - } - }); - - $scope.updateSeconds = function() { - var seconds = getSecondsFromTemplate(); - - ngModelCtrl.$setDirty(); - - if (angular.isDefined(seconds)) { - selected.setSeconds(seconds); - refresh('s'); - } else { - invalidate(undefined, undefined, true); - } - }; - - secondsInputEl.bind('blur', function(e) { - if (modelIsEmpty()) { - makeValid(); - } else if (!$scope.invalidSeconds && $scope.seconds < 10) { - $scope.$apply( function() { - $scope.seconds = pad($scope.seconds); - }); - } - }); - - }; - - this.render = function() { - var date = ngModelCtrl.$viewValue; - - if (isNaN(date)) { - ngModelCtrl.$setValidity('time', false); - $log.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'); - } else { - if (date) { - selected = date; - } - - if (selected < min || selected > max) { - ngModelCtrl.$setValidity('time', false); - $scope.invalidHours = true; - $scope.invalidMinutes = true; - } else { - makeValid(); - } - updateTemplate(); - } - }; - - // Call internally when we know that model is valid. - function refresh(keyboardChange) { - makeValid(); - ngModelCtrl.$setViewValue(new Date(selected)); - updateTemplate(keyboardChange); - } - - function makeValid() { - ngModelCtrl.$setValidity('time', true); - $scope.invalidHours = false; - $scope.invalidMinutes = false; - $scope.invalidSeconds = false; - } - - function updateTemplate(keyboardChange) { - if (!ngModelCtrl.$modelValue) { - $scope.hours = null; - $scope.minutes = null; - $scope.seconds = null; - $scope.meridian = meridians[0]; - } else { - var hours = selected.getHours(), - minutes = selected.getMinutes(), - seconds = selected.getSeconds(); - - if ($scope.showMeridian) { - hours = hours === 0 || hours === 12 ? 12 : hours % 12; // Convert 24 to 12 hour system - } - - $scope.hours = keyboardChange === 'h' ? hours : pad(hours, !padHours); - if (keyboardChange !== 'm') { - $scope.minutes = pad(minutes); - } - $scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1]; - - if (keyboardChange !== 's') { - $scope.seconds = pad(seconds); - } - $scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1]; - } - } - - function addSecondsToSelected(seconds) { - selected = addSeconds(selected, seconds); - refresh(); - } - - function addMinutes(selected, minutes) { - return addSeconds(selected, minutes*60); - } - - function addSeconds(date, seconds) { - var dt = new Date(date.getTime() + seconds * 1000); - var newDate = new Date(date); - newDate.setHours(dt.getHours(), dt.getMinutes(), dt.getSeconds()); - return newDate; - } - - function modelIsEmpty() { - return ($scope.hours === null || $scope.hours === '') && - ($scope.minutes === null || $scope.minutes === '') && - (!$scope.showSeconds || $scope.showSeconds && ($scope.seconds === null || $scope.seconds === '')); - } - - $scope.showSpinners = angular.isDefined($attrs.showSpinners) ? - $scope.$parent.$eval($attrs.showSpinners) : timepickerConfig.showSpinners; - - $scope.incrementHours = function() { - if (!$scope.noIncrementHours()) { - addSecondsToSelected(hourStep * 60 * 60); - } - }; - - $scope.decrementHours = function() { - if (!$scope.noDecrementHours()) { - addSecondsToSelected(-hourStep * 60 * 60); - } - }; - - $scope.incrementMinutes = function() { - if (!$scope.noIncrementMinutes()) { - addSecondsToSelected(minuteStep * 60); - } - }; - - $scope.decrementMinutes = function() { - if (!$scope.noDecrementMinutes()) { - addSecondsToSelected(-minuteStep * 60); - } - }; - - $scope.incrementSeconds = function() { - if (!$scope.noIncrementSeconds()) { - addSecondsToSelected(secondStep); - } - }; - - $scope.decrementSeconds = function() { - if (!$scope.noDecrementSeconds()) { - addSecondsToSelected(-secondStep); - } - }; - - $scope.toggleMeridian = function() { - var minutes = getMinutesFromTemplate(), - hours = getHoursFromTemplate(); - - if (!$scope.noToggleMeridian()) { - if (angular.isDefined(minutes) && angular.isDefined(hours)) { - addSecondsToSelected(12 * 60 * (selected.getHours() < 12 ? 60 : -60)); - } else { - $scope.meridian = $scope.meridian === meridians[0] ? meridians[1] : meridians[0]; - } - } - }; - - $scope.blur = function() { - ngModelCtrl.$setTouched(); - }; - - $scope.$on('$destroy', function() { - while (watchers.length) { - watchers.shift()(); - } - }); -}]) - -.directive('uibTimepicker', ['uibTimepickerConfig', function(uibTimepickerConfig) { - return { - require: ['uibTimepicker', '?^ngModel'], - controller: 'UibTimepickerController', - controllerAs: 'timepicker', - replace: true, - scope: {}, - templateUrl: function(element, attrs) { - return attrs.templateUrl || uibTimepickerConfig.templateUrl; - }, - link: function(scope, element, attrs, ctrls) { - var timepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - if (ngModelCtrl) { - timepickerCtrl.init(ngModelCtrl, element.find('input')); - } - } - }; -}]); - -angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap.position']) - -/** - * A helper service that can parse typeahead's syntax (string provided by users) - * Extracted to a separate service for ease of unit testing - */ - .factory('uibTypeaheadParser', ['$parse', function($parse) { - // 00000111000000000000022200000000000000003333333333333330000000000044000 - var TYPEAHEAD_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/; - return { - parse: function(input) { - var match = input.match(TYPEAHEAD_REGEXP); - if (!match) { - throw new Error( - 'Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_"' + - ' but got "' + input + '".'); - } - - return { - itemName: match[3], - source: $parse(match[4]), - viewMapper: $parse(match[2] || match[1]), - modelMapper: $parse(match[1]) - }; - } - }; - }]) - - .controller('UibTypeaheadController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$q', '$timeout', '$document', '$window', '$rootScope', '$$debounce', '$uibPosition', 'uibTypeaheadParser', - function(originalScope, element, attrs, $compile, $parse, $q, $timeout, $document, $window, $rootScope, $$debounce, $position, typeaheadParser) { - var HOT_KEYS = [9, 13, 27, 38, 40]; - var eventDebounceTime = 200; - var modelCtrl, ngModelOptions; - //SUPPORTED ATTRIBUTES (OPTIONS) - - //minimal no of characters that needs to be entered before typeahead kicks-in - var minLength = originalScope.$eval(attrs.typeaheadMinLength); - if (!minLength && minLength !== 0) { - minLength = 1; - } - - originalScope.$watch(attrs.typeaheadMinLength, function (newVal) { - minLength = !newVal && newVal !== 0 ? 1 : newVal; - }); - - //minimal wait time after last character typed before typeahead kicks-in - var waitTime = originalScope.$eval(attrs.typeaheadWaitMs) || 0; - - //should it restrict model values to the ones selected from the popup only? - var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false; - originalScope.$watch(attrs.typeaheadEditable, function (newVal) { - isEditable = newVal !== false; - }); - - //binding to a variable that indicates if matches are being retrieved asynchronously - var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop; - - //a function to determine if an event should cause selection - var isSelectEvent = attrs.typeaheadShouldSelect ? $parse(attrs.typeaheadShouldSelect) : function(scope, vals) { - var evt = vals.$event; - return evt.which === 13 || evt.which === 9; - }; - - //a callback executed when a match is selected - var onSelectCallback = $parse(attrs.typeaheadOnSelect); - - //should it select highlighted popup value when losing focus? - var isSelectOnBlur = angular.isDefined(attrs.typeaheadSelectOnBlur) ? originalScope.$eval(attrs.typeaheadSelectOnBlur) : false; - - //binding to a variable that indicates if there were no results after the query is completed - var isNoResultsSetter = $parse(attrs.typeaheadNoResults).assign || angular.noop; - - var inputFormatter = attrs.typeaheadInputFormatter ? $parse(attrs.typeaheadInputFormatter) : undefined; - - var appendToBody = attrs.typeaheadAppendToBody ? originalScope.$eval(attrs.typeaheadAppendToBody) : false; - - var appendTo = attrs.typeaheadAppendTo ? - originalScope.$eval(attrs.typeaheadAppendTo) : null; - - var focusFirst = originalScope.$eval(attrs.typeaheadFocusFirst) !== false; - - //If input matches an item of the list exactly, select it automatically - var selectOnExact = attrs.typeaheadSelectOnExact ? originalScope.$eval(attrs.typeaheadSelectOnExact) : false; - - //binding to a variable that indicates if dropdown is open - var isOpenSetter = $parse(attrs.typeaheadIsOpen).assign || angular.noop; - - var showHint = originalScope.$eval(attrs.typeaheadShowHint) || false; - - //INTERNAL VARIABLES - - //model setter executed upon match selection - var parsedModel = $parse(attrs.ngModel); - var invokeModelSetter = $parse(attrs.ngModel + '($$$p)'); - var $setModelValue = function(scope, newValue) { - if (angular.isFunction(parsedModel(originalScope)) && - ngModelOptions && ngModelOptions.$options && ngModelOptions.$options.getterSetter) { - return invokeModelSetter(scope, {$$$p: newValue}); - } - - return parsedModel.assign(scope, newValue); - }; - - //expressions used by typeahead - var parserResult = typeaheadParser.parse(attrs.uibTypeahead); - - var hasFocus; - - //Used to avoid bug in iOS webview where iOS keyboard does not fire - //mousedown & mouseup events - //Issue #3699 - var selected; - - //create a child scope for the typeahead directive so we are not polluting original scope - //with typeahead-specific data (matches, query etc.) - var scope = originalScope.$new(); - var offDestroy = originalScope.$on('$destroy', function() { - scope.$destroy(); - }); - scope.$on('$destroy', offDestroy); - - // WAI-ARIA - var popupId = 'typeahead-' + scope.$id + '-' + Math.floor(Math.random() * 10000); - element.attr({ - 'aria-autocomplete': 'list', - 'aria-expanded': false, - 'aria-owns': popupId - }); - - var inputsContainer, hintInputElem; - //add read-only input to show hint - if (showHint) { - inputsContainer = angular.element('
'); - inputsContainer.css('position', 'relative'); - element.after(inputsContainer); - hintInputElem = element.clone(); - hintInputElem.attr('placeholder', ''); - hintInputElem.attr('tabindex', '-1'); - hintInputElem.val(''); - hintInputElem.css({ - 'position': 'absolute', - 'top': '0px', - 'left': '0px', - 'border-color': 'transparent', - 'box-shadow': 'none', - 'opacity': 1, - 'background': 'none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)', - 'color': '#999' - }); - element.css({ - 'position': 'relative', - 'vertical-align': 'top', - 'background-color': 'transparent' - }); - inputsContainer.append(hintInputElem); - hintInputElem.after(element); - } - - //pop-up element used to display matches - var popUpEl = angular.element('
'); - popUpEl.attr({ - id: popupId, - matches: 'matches', - active: 'activeIdx', - select: 'select(activeIdx, evt)', - 'move-in-progress': 'moveInProgress', - query: 'query', - position: 'position', - 'assign-is-open': 'assignIsOpen(isOpen)', - debounce: 'debounceUpdate' - }); - //custom item template - if (angular.isDefined(attrs.typeaheadTemplateUrl)) { - popUpEl.attr('template-url', attrs.typeaheadTemplateUrl); - } - - if (angular.isDefined(attrs.typeaheadPopupTemplateUrl)) { - popUpEl.attr('popup-template-url', attrs.typeaheadPopupTemplateUrl); - } - - var resetHint = function() { - if (showHint) { - hintInputElem.val(''); - } - }; - - var resetMatches = function() { - scope.matches = []; - scope.activeIdx = -1; - element.attr('aria-expanded', false); - resetHint(); - }; - - var getMatchId = function(index) { - return popupId + '-option-' + index; - }; - - // Indicate that the specified match is the active (pre-selected) item in the list owned by this typeahead. - // This attribute is added or removed automatically when the `activeIdx` changes. - scope.$watch('activeIdx', function(index) { - if (index < 0) { - element.removeAttr('aria-activedescendant'); - } else { - element.attr('aria-activedescendant', getMatchId(index)); - } - }); - - var inputIsExactMatch = function(inputValue, index) { - if (scope.matches.length > index && inputValue) { - return inputValue.toUpperCase() === scope.matches[index].label.toUpperCase(); - } - - return false; - }; - - var getMatchesAsync = function(inputValue, evt) { - var locals = {$viewValue: inputValue}; - isLoadingSetter(originalScope, true); - isNoResultsSetter(originalScope, false); - $q.when(parserResult.source(originalScope, locals)).then(function(matches) { - //it might happen that several async queries were in progress if a user were typing fast - //but we are interested only in responses that correspond to the current view value - var onCurrentRequest = inputValue === modelCtrl.$viewValue; - if (onCurrentRequest && hasFocus) { - if (matches && matches.length > 0) { - scope.activeIdx = focusFirst ? 0 : -1; - isNoResultsSetter(originalScope, false); - scope.matches.length = 0; - - //transform labels - for (var i = 0; i < matches.length; i++) { - locals[parserResult.itemName] = matches[i]; - scope.matches.push({ - id: getMatchId(i), - label: parserResult.viewMapper(scope, locals), - model: matches[i] - }); - } - - scope.query = inputValue; - //position pop-up with matches - we need to re-calculate its position each time we are opening a window - //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page - //due to other elements being rendered - recalculatePosition(); - - element.attr('aria-expanded', true); - - //Select the single remaining option if user input matches - if (selectOnExact && scope.matches.length === 1 && inputIsExactMatch(inputValue, 0)) { - if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) { - $$debounce(function() { - scope.select(0, evt); - }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']); - } else { - scope.select(0, evt); - } - } - - if (showHint) { - var firstLabel = scope.matches[0].label; - if (angular.isString(inputValue) && - inputValue.length > 0 && - firstLabel.slice(0, inputValue.length).toUpperCase() === inputValue.toUpperCase()) { - hintInputElem.val(inputValue + firstLabel.slice(inputValue.length)); - } else { - hintInputElem.val(''); - } - } - } else { - resetMatches(); - isNoResultsSetter(originalScope, true); - } - } - if (onCurrentRequest) { - isLoadingSetter(originalScope, false); - } - }, function() { - resetMatches(); - isLoadingSetter(originalScope, false); - isNoResultsSetter(originalScope, true); - }); - }; - - // bind events only if appendToBody params exist - performance feature - if (appendToBody) { - angular.element($window).on('resize', fireRecalculating); - $document.find('body').on('scroll', fireRecalculating); - } - - // Declare the debounced function outside recalculating for - // proper debouncing - var debouncedRecalculate = $$debounce(function() { - // if popup is visible - if (scope.matches.length) { - recalculatePosition(); - } - - scope.moveInProgress = false; - }, eventDebounceTime); - - // Default progress type - scope.moveInProgress = false; - - function fireRecalculating() { - if (!scope.moveInProgress) { - scope.moveInProgress = true; - scope.$digest(); - } - - debouncedRecalculate(); - } - - // recalculate actual position and set new values to scope - // after digest loop is popup in right position - function recalculatePosition() { - scope.position = appendToBody ? $position.offset(element) : $position.position(element); - scope.position.top += element.prop('offsetHeight'); - } - - //we need to propagate user's query so we can higlight matches - scope.query = undefined; - - //Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later - var timeoutPromise; - - var scheduleSearchWithTimeout = function(inputValue) { - timeoutPromise = $timeout(function() { - getMatchesAsync(inputValue); - }, waitTime); - }; - - var cancelPreviousTimeout = function() { - if (timeoutPromise) { - $timeout.cancel(timeoutPromise); - } - }; - - resetMatches(); - - scope.assignIsOpen = function (isOpen) { - isOpenSetter(originalScope, isOpen); - }; - - scope.select = function(activeIdx, evt) { - //called from within the $digest() cycle - var locals = {}; - var model, item; - - selected = true; - locals[parserResult.itemName] = item = scope.matches[activeIdx].model; - model = parserResult.modelMapper(originalScope, locals); - $setModelValue(originalScope, model); - modelCtrl.$setValidity('editable', true); - modelCtrl.$setValidity('parse', true); - - onSelectCallback(originalScope, { - $item: item, - $model: model, - $label: parserResult.viewMapper(originalScope, locals), - $event: evt - }); - - resetMatches(); - - //return focus to the input element if a match was selected via a mouse click event - // use timeout to avoid $rootScope:inprog error - if (scope.$eval(attrs.typeaheadFocusOnSelect) !== false) { - $timeout(function() { element[0].focus(); }, 0, false); - } - }; - - //bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27) - element.on('keydown', function(evt) { - //typeahead is open and an "interesting" key was pressed - if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) { - return; - } - - var shouldSelect = isSelectEvent(originalScope, {$event: evt}); - - /** - * if there's nothing selected (i.e. focusFirst) and enter or tab is hit - * or - * shift + tab is pressed to bring focus to the previous element - * then clear the results - */ - if (scope.activeIdx === -1 && shouldSelect || evt.which === 9 && !!evt.shiftKey) { - resetMatches(); - scope.$digest(); - return; - } - - evt.preventDefault(); - var target; - switch (evt.which) { - case 27: // escape - evt.stopPropagation(); - - resetMatches(); - originalScope.$digest(); - break; - case 38: // up arrow - scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1; - scope.$digest(); - target = popUpEl.find('li')[scope.activeIdx]; - target.parentNode.scrollTop = target.offsetTop; - break; - case 40: // down arrow - scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length; - scope.$digest(); - target = popUpEl.find('li')[scope.activeIdx]; - target.parentNode.scrollTop = target.offsetTop; - break; - default: - if (shouldSelect) { - scope.$apply(function() { - if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) { - $$debounce(function() { - scope.select(scope.activeIdx, evt); - }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']); - } else { - scope.select(scope.activeIdx, evt); - } - }); - } - } - }); - - element.bind('focus', function (evt) { - hasFocus = true; - if (minLength === 0 && !modelCtrl.$viewValue) { - $timeout(function() { - getMatchesAsync(modelCtrl.$viewValue, evt); - }, 0); - } - }); - - element.bind('blur', function(evt) { - if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) { - selected = true; - scope.$apply(function() { - if (angular.isObject(scope.debounceUpdate) && angular.isNumber(scope.debounceUpdate.blur)) { - $$debounce(function() { - scope.select(scope.activeIdx, evt); - }, scope.debounceUpdate.blur); - } else { - scope.select(scope.activeIdx, evt); - } - }); - } - if (!isEditable && modelCtrl.$error.editable) { - modelCtrl.$setViewValue(); - // Reset validity as we are clearing - modelCtrl.$setValidity('editable', true); - modelCtrl.$setValidity('parse', true); - element.val(''); - } - hasFocus = false; - selected = false; - }); - - // Keep reference to click handler to unbind it. - var dismissClickHandler = function(evt) { - // Issue #3973 - // Firefox treats right click as a click on document - if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) { - resetMatches(); - if (!$rootScope.$$phase) { - originalScope.$digest(); - } - } - }; - - $document.on('click', dismissClickHandler); - - originalScope.$on('$destroy', function() { - $document.off('click', dismissClickHandler); - if (appendToBody || appendTo) { - $popup.remove(); - } - - if (appendToBody) { - angular.element($window).off('resize', fireRecalculating); - $document.find('body').off('scroll', fireRecalculating); - } - // Prevent jQuery cache memory leak - popUpEl.remove(); - - if (showHint) { - inputsContainer.remove(); - } - }); - - var $popup = $compile(popUpEl)(scope); - - if (appendToBody) { - $document.find('body').append($popup); - } else if (appendTo) { - angular.element(appendTo).eq(0).append($popup); - } else { - element.after($popup); - } - - this.init = function(_modelCtrl, _ngModelOptions) { - modelCtrl = _modelCtrl; - ngModelOptions = _ngModelOptions; - - scope.debounceUpdate = modelCtrl.$options && $parse(modelCtrl.$options.debounce)(originalScope); - - //plug into $parsers pipeline to open a typeahead on view changes initiated from DOM - //$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue - modelCtrl.$parsers.unshift(function(inputValue) { - hasFocus = true; - - if (minLength === 0 || inputValue && inputValue.length >= minLength) { - if (waitTime > 0) { - cancelPreviousTimeout(); - scheduleSearchWithTimeout(inputValue); - } else { - getMatchesAsync(inputValue); - } - } else { - isLoadingSetter(originalScope, false); - cancelPreviousTimeout(); - resetMatches(); - } - - if (isEditable) { - return inputValue; - } - - if (!inputValue) { - // Reset in case user had typed something previously. - modelCtrl.$setValidity('editable', true); - return null; - } - - modelCtrl.$setValidity('editable', false); - return undefined; - }); - - modelCtrl.$formatters.push(function(modelValue) { - var candidateViewValue, emptyViewValue; - var locals = {}; - - // The validity may be set to false via $parsers (see above) if - // the model is restricted to selected values. If the model - // is set manually it is considered to be valid. - if (!isEditable) { - modelCtrl.$setValidity('editable', true); - } - - if (inputFormatter) { - locals.$model = modelValue; - return inputFormatter(originalScope, locals); - } - - //it might happen that we don't have enough info to properly render input value - //we need to check for this situation and simply return model value if we can't apply custom formatting - locals[parserResult.itemName] = modelValue; - candidateViewValue = parserResult.viewMapper(originalScope, locals); - locals[parserResult.itemName] = undefined; - emptyViewValue = parserResult.viewMapper(originalScope, locals); - - return candidateViewValue !== emptyViewValue ? candidateViewValue : modelValue; - }); - }; - }]) - - .directive('uibTypeahead', function() { - return { - controller: 'UibTypeaheadController', - require: ['ngModel', '^?ngModelOptions', 'uibTypeahead'], - link: function(originalScope, element, attrs, ctrls) { - ctrls[2].init(ctrls[0], ctrls[1]); - } - }; - }) - - .directive('uibTypeaheadPopup', ['$$debounce', function($$debounce) { - return { - scope: { - matches: '=', - query: '=', - active: '=', - position: '&', - moveInProgress: '=', - select: '&', - assignIsOpen: '&', - debounce: '&' - }, - replace: true, - templateUrl: function(element, attrs) { - return attrs.popupTemplateUrl || 'uib/template/typeahead/typeahead-popup.html'; - }, - link: function(scope, element, attrs) { - scope.templateUrl = attrs.templateUrl; - - scope.isOpen = function() { - var isDropdownOpen = scope.matches.length > 0; - scope.assignIsOpen({ isOpen: isDropdownOpen }); - return isDropdownOpen; - }; - - scope.isActive = function(matchIdx) { - return scope.active === matchIdx; - }; - - scope.selectActive = function(matchIdx) { - scope.active = matchIdx; - }; - - scope.selectMatch = function(activeIdx, evt) { - var debounce = scope.debounce(); - if (angular.isNumber(debounce) || angular.isObject(debounce)) { - $$debounce(function() { - scope.select({activeIdx: activeIdx, evt: evt}); - }, angular.isNumber(debounce) ? debounce : debounce['default']); - } else { - scope.select({activeIdx: activeIdx, evt: evt}); - } - }; - } - }; - }]) - - .directive('uibTypeaheadMatch', ['$templateRequest', '$compile', '$parse', function($templateRequest, $compile, $parse) { - return { - scope: { - index: '=', - match: '=', - query: '=' - }, - link: function(scope, element, attrs) { - var tplUrl = $parse(attrs.templateUrl)(scope.$parent) || 'uib/template/typeahead/typeahead-match.html'; - $templateRequest(tplUrl).then(function(tplContent) { - var tplEl = angular.element(tplContent.trim()); - element.replaceWith(tplEl); - $compile(tplEl)(scope); - }); - } - }; - }]) - - .filter('uibTypeaheadHighlight', ['$sce', '$injector', '$log', function($sce, $injector, $log) { - var isSanitizePresent; - isSanitizePresent = $injector.has('$sanitize'); - - function escapeRegexp(queryToEscape) { - // Regex: capture the whole query string and replace it with the string that will be used to match - // the results, for example if the capture is "a" the result will be \a - return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'); - } - - function containsHtml(matchItem) { - return /<.*>/g.test(matchItem); - } - - return function(matchItem, query) { - if (!isSanitizePresent && containsHtml(matchItem)) { - $log.warn('Unsafe use of typeahead please use ngSanitize'); // Warn the user about the danger - } - matchItem = query ? ('' + matchItem).replace(new RegExp(escapeRegexp(query), 'gi'), '$&') : matchItem; // Replaces the capture string with a the same string inside of a "strong" tag - if (!isSanitizePresent) { - matchItem = $sce.trustAsHtml(matchItem); // If $sanitize is not present we pack the string in a $sce object for the ng-bind-html directive - } - return matchItem; - }; - }]); - -angular.module("uib/template/accordion/accordion-group.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/accordion/accordion-group.html", - "
\n" + - "
\n" + - "

\n" + - " {{heading}}\n" + - "

\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/accordion/accordion.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/accordion/accordion.html", - "
"); -}]); - -angular.module("uib/template/alert/alert.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/alert/alert.html", - "
\n" + - " \n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/carousel/carousel.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/carousel/carousel.html", - "
\n" + - "
\n" + - " 1\">\n" + - " \n" + - " previous\n" + - " \n" + - " 1\">\n" + - " \n" + - " next\n" + - " \n" + - "
    1\">\n" + - "
  1. \n" + - " slide {{ $index + 1 }} of {{ slides.length }}, currently active\n" + - "
  2. \n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/carousel/slide.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/carousel/slide.html", - "
\n" + - ""); -}]); - -angular.module("uib/template/datepicker/datepicker.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/datepicker/datepicker.html", - "
\n" + - " \n" + - " \n" + - " \n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/datepicker/day.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/datepicker/day.html", - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "
{{::label.abbr}}
{{ weekNumbers[$index] }}\n" + - " \n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/datepicker/month.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/datepicker/month.html", - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "
\n" + - " \n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/datepicker/year.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/datepicker/year.html", - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "
\n" + - " \n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/datepickerPopup/popup.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/datepickerPopup/popup.html", - "
\n" + - "
    \n" + - "
  • \n" + - "
  • \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "
  • \n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/modal/backdrop.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/modal/backdrop.html", - "
\n" + - ""); -}]); - -angular.module("uib/template/modal/window.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/modal/window.html", - "
\n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/pager/pager.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/pager/pager.html", - "\n" + - ""); -}]); - -angular.module("uib/template/pagination/pagination.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/pagination/pagination.html", - "\n" + - ""); -}]); - -angular.module("uib/template/tooltip/tooltip-html-popup.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/tooltip/tooltip-html-popup.html", - "
\n" + - "
\n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/tooltip/tooltip-popup.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/tooltip/tooltip-popup.html", - "
\n" + - "
\n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/tooltip/tooltip-template-popup.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/tooltip/tooltip-template-popup.html", - "
\n" + - "
\n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/popover/popover-html.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/popover/popover-html.html", - "
\n" + - "
\n" + - "\n" + - "
\n" + - "

\n" + - "
\n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/popover/popover-template.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/popover/popover-template.html", - "
\n" + - "
\n" + - "\n" + - "
\n" + - "

\n" + - "
\n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/popover/popover.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/popover/popover.html", - "
\n" + - "
\n" + - "\n" + - "
\n" + - "

\n" + - "
\n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/progressbar/bar.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/progressbar/bar.html", - "
\n" + - ""); -}]); - -angular.module("uib/template/progressbar/progress.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/progressbar/progress.html", - "
"); -}]); - -angular.module("uib/template/progressbar/progressbar.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/progressbar/progressbar.html", - "
\n" + - "
\n" + - "
\n" + - ""); -}]); - -angular.module("uib/template/rating/rating.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/rating/rating.html", - "\n" + - " ({{ $index < value ? '*' : ' ' }})\n" + - " \n" + - "\n" + - ""); -}]); - -angular.module("uib/template/tabs/tab.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/tabs/tab.html", - "
  • \n" + - " {{heading}}\n" + - "
  • \n" + - ""); -}]); - -angular.module("uib/template/tabs/tabset.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/tabs/tabset.html", - "
    \n" + - "
      \n" + - "
      \n" + - "
      \n" + - "
      \n" + - "
      \n" + - "
      \n" + - ""); -}]); - -angular.module("uib/template/timepicker/timepicker.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/timepicker/timepicker.html", - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "
        
      \n" + - " \n" + - " :\n" + - " \n" + - " :\n" + - " \n" + - "
        
      \n" + - ""); -}]); - -angular.module("uib/template/typeahead/typeahead-match.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/typeahead/typeahead-match.html", - "\n" + - ""); -}]); - -angular.module("uib/template/typeahead/typeahead-popup.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("uib/template/typeahead/typeahead-popup.html", - "
        \n" + - "
      • \n" + - "
        \n" + - "
      • \n" + - "
      \n" + - ""); -}]); -angular.module('ui.bootstrap.carousel').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibCarouselCss && angular.element(document).find('head').prepend(''); angular.$$uibCarouselCss = true; }); -angular.module('ui.bootstrap.datepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerCss && angular.element(document).find('head').prepend(''); angular.$$uibDatepickerCss = true; }); -angular.module('ui.bootstrap.position').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibPositionCss && angular.element(document).find('head').prepend(''); angular.$$uibPositionCss = true; }); -angular.module('ui.bootstrap.datepickerPopup').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerpopupCss && angular.element(document).find('head').prepend(''); angular.$$uibDatepickerpopupCss = true; }); -angular.module('ui.bootstrap.tooltip').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTooltipCss && angular.element(document).find('head').prepend(''); angular.$$uibTooltipCss = true; }); -angular.module('ui.bootstrap.timepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTimepickerCss && angular.element(document).find('head').prepend(''); angular.$$uibTimepickerCss = true; }); -angular.module('ui.bootstrap.typeahead').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTypeaheadCss && angular.element(document).find('head').prepend(''); angular.$$uibTypeaheadCss = true; }); \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js deleted file mode 100644 index 341830b1d2..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * angular-ui-bootstrap - * http://angular-ui.github.io/bootstrap/ - - * Version: 1.3.3 - 2016-05-22 - * License: MIT - */angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/datepickerPopup/popup.html","uib/template/modal/backdrop.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$q","$parse","$injector",function(a,b,c,d){var e=d.has("$animateCss")?d.get("$animateCss"):null;return{link:function(d,f,g){function h(){f.hasClass("collapse")&&f.hasClass("in")||b.resolve(l(d)).then(function(){f.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),e?e(f,{addClass:"in",easing:"ease",to:{height:f[0].scrollHeight+"px"}}).start()["finally"](i):a.addClass(f,"in",{to:{height:f[0].scrollHeight+"px"}}).then(i)})}function i(){f.removeClass("collapsing").addClass("collapse").css({height:"auto"}),m(d)}function j(){return f.hasClass("collapse")||f.hasClass("in")?void b.resolve(n(d)).then(function(){f.css({height:f[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),e?e(f,{removeClass:"in",to:{height:"0"}}).start()["finally"](k):a.removeClass(f,"in",{to:{height:"0"}}).then(k)}):k()}function k(){f.css({height:"0"}),f.removeClass("collapsing").addClass("collapse"),o(d)}var l=c(g.expanding),m=c(g.expanded),n=c(g.collapsing),o=c(g.collapsed);d.$eval(g.uibCollapse)||f.addClass("in").addClass("collapse").attr("aria-expanded",!0).attr("aria-hidden",!1).css({height:"auto"}),d.$watch(g.uibCollapse,function(a){a?j():h()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(c){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",panelClass:"@?",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.openClass=c.openClass||"panel-open",a.panelClass=c.panelClass||"panel-default",a.$watch("isOpen",function(c){b.toggleClass(a.openClass,!!c),c&&d.closeOthers(a)}),a.toggleOpen=function(b){a.isDisabled||b&&32!==b.which||(a.isOpen=!a.isOpen)};var e="accordiongroup-"+a.$id+"-"+Math.floor(1e4*Math.random());a.headingId=e+"-tab",a.panelId=e+"-panel"}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("uibAccordionTransclude",function(){function a(){return"uib-accordion-header,data-uib-accordion-header,x-uib-accordion-header,uib\\:accordion-header,[uib-accordion-header],[data-uib-accordion-header],[x-uib-accordion-header]"}return{require:"^uibAccordionGroup",link:function(b,c,d,e){b.$watch(function(){return e[d.uibAccordionTransclude]},function(b){if(b){var d=angular.element(c[0].querySelector(a()));d.html(""),d.append(b)}})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$attrs","$interpolate","$timeout",function(a,b,c,d){a.closeable=!!b.close;var e=angular.isDefined(b.dismissOnTimeout)?c(b.dismissOnTimeout)(a.$parent):null;e&&d(function(){a.close()},parseInt(e,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",templateUrl:function(a,b){return b.templateUrl||"uib/template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(a){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(b,c,d,e){var f=e[0],g=e[1],h=a(d.uibUncheckable);c.find("input").css({display:"none"}),g.$render=function(){c.toggleClass(f.activeClass,angular.equals(g.$modelValue,b.$eval(d.uibBtnRadio)))},c.on(f.toggleEvent,function(){if(!d.disabled){var a=c.hasClass(f.activeClass);a&&!angular.isDefined(d.uncheckable)||b.$apply(function(){g.$setViewValue(a?null:b.$eval(d.uibBtnRadio)),g.$render()})}}),d.uibUncheckable&&b.$watch(h,function(a){d.$set("uncheckable",a?"":void 0)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){return angular.isDefined(b)?a.$eval(b):c}var h=d[0],i=d[1];b.find("input").css({display:"none"}),i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.on(h.toggleEvent,function(){c.disabled||a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(a,b,c,d,e){function f(){for(;t.length;)t.shift()}function g(a){for(var b=0;b1){q[d].element.data(r,c.direction);var j=p.getCurrentIndex();angular.isNumber(j)&&q[j].element&&q[j].element.data(r,c.direction),a.$currentTransition=!0,e.on("addClass",q[d].element,function(b,c){if("close"===c&&(a.$currentTransition=null,e.off("addClass",b),t.length)){var d=t.pop().slide,g=d.index,i=g>p.getCurrentIndex()?"next":"prev";f(),h(d,g,i)}})}a.active=c.index,s=c.index,g(d),l()}}function i(a){for(var b=0;b0&&(n=c(m,b))}function m(){var b=+a.interval;o&&!isNaN(b)&&b>0&&q.length?a.next():a.pause()}var n,o,p=this,q=p.slides=a.slides=[],r="uib-slideDirection",s=a.active,t=[],u=!1;p.addSlide=function(b,c){q.push({slide:b,element:c}),q.sort(function(a,b){return+a.slide.index-+b.slide.index}),(b.index===a.active||1===q.length&&!angular.isNumber(a.active))&&(a.$currentTransition&&(a.$currentTransition=null),s=b.index,a.active=b.index,g(s),p.select(q[i(b)]),1===q.length&&a.play())},p.getCurrentIndex=function(){for(var a=0;a0&&s===c?c>=q.length?(s=q.length-1,a.active=s,g(s),p.select(q[q.length-1])):(s=c,a.active=s,g(s),p.select(q[c])):s>c&&(s--,a.active=s),0===q.length&&(s=null,a.active=null,f())},p.select=a.select=function(b,c){var d=i(b.slide);void 0===c&&(c=d>p.getCurrentIndex()?"next":"prev"),b.slide.index===s||a.$currentTransition?b&&b.slide.index!==s&&a.$currentTransition&&t.push(q[d]):h(b.slide,d,c)},a.indexOfSlide=function(a){return+a.slide.index},a.isActive=function(b){return a.active===b.slide.index},a.isPrevDisabled=function(){return 0===a.active&&a.noWrap()},a.isNextDisabled=function(){return a.active===q.length-1&&a.noWrap()},a.pause=function(){a.noPause||(o=!1,j())},a.play=function(){o||(o=!0,l())},a.$on("$destroy",function(){u=!0,j()}),a.$watch("noTransition",function(a){e.enabled(b,!a)}),a.$watch("interval",l),a.$watchCollection("slides",k),a.$watch("active",function(a){if(angular.isNumber(a)&&s!==a){for(var b=0;b-1){var g=!1;a=a.split("");for(var h=f;h-1){a=a.split(""),e[f]="("+d.regex+")",a[f]="$";for(var g=f+1,h=f+d.key.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,key:d.key,apply:d[b],matcher:d.regex})}}),{regex:new RegExp("^"+e.join("")+"$"),map:d(c,"index")}}function f(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}function g(a){return parseInt(a,10)}function h(a,b){return a&&b?l(a,b):a}function i(a,b){return a&&b?l(a,b,!0):a}function j(a,b){a=a.replace(/:/g,"");var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return isNaN(c)?b:c}function k(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function l(a,b,c){c=c?-1:1;var d=a.getTimezoneOffset(),e=j(b,d);return k(a,c*(e-d))}var m,n,o=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){m=b.id,this.parsers={},this.formatters={},n=[{key:"yyyy",regex:"\\d{4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(a){a=+a,this.year=69>a?a+2e3:a+1900},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){var b=a.getMonth();return/^[0-9]$/.test(b)?c(a,"MM"):c(a,"M")}},{key:"MMMM",regex:b.DATETIME_FORMATS.MONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.MONTH.indexOf(a)},formatter:function(a){return c(a,"MMMM")}},{key:"MMM",regex:b.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.SHORTMONTH.indexOf(a)},formatter:function(a){return c(a,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){var b=a.getDate();return/^[1-9]$/.test(b)?c(a,"dd"):c(a,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"d")}},{key:"EEEE",regex:b.DATETIME_FORMATS.DAY.join("|"),formatter:function(a){return c(a,"EEEE")}},{key:"EEE",regex:b.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(a){return c(a,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a},formatter:function(a){return c(a,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"s")}},{key:"a",regex:b.DATETIME_FORMATS.AMPMS.join("|"),apply:function(a){12===this.hours&&(this.hours=0),"PM"===a&&(this.hours+=12)},formatter:function(a){return c(a,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(a){var b=a.match(/([+-])(\d{2})(\d{2})/),c=b[1],d=b[2],e=b[3];this.hours+=g(c+d),this.minutes+=g(c+e)},formatter:function(a){return c(a,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(a){return c(a,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(a){return c(a,"w")}},{key:"GGGG",regex:b.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(a){return c(a,"GGGG")}},{key:"GGG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GGG")}},{key:"GG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GG")}},{key:"G",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"G")}}]},this.init(),this.filter=function(a,c){if(!angular.isDate(a)||isNaN(a)||!c)return"";c=b.DATETIME_FORMATS[c]||c,b.id!==m&&this.init(),this.formatters[c]||(this.formatters[c]=e(c,"formatter"));var d=this.formatters[c],f=d.map,g=c;return f.reduce(function(b,c,d){var e=g.match(new RegExp("(.*)"+c.key));e&&angular.isString(e[1])&&(b+=e[1],g=g.replace(e[1]+c.key,""));var h=d===f.length-1?g:"";return c.apply?b+c.apply.call(null,a)+h:b+h},"")},this.parse=function(c,d,g){if(!angular.isString(c)||!d)return c;d=b.DATETIME_FORMATS[d]||d,d=d.replace(o,"\\$&"),b.id!==m&&this.init(),this.parsers[d]||(this.parsers[d]=e(d,"apply"));var h=this.parsers[d],i=h.regex,j=h.map,k=c.match(i),l=!1;if(k&&k.length){var n,p;angular.isDate(g)&&!isNaN(g.getTime())?n={year:g.getFullYear(),month:g.getMonth(),date:g.getDate(),hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()}:(g&&a.warn("dateparser:","baseDate is not a valid date"),n={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var q=1,r=k.length;r>q;q++){var s=j[q-1];"Z"===s.matcher&&(l=!0),s.apply&&s.apply.call(n,k[q])}var t=l?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,u=l?Date.prototype.setUTCHours:Date.prototype.setHours;return f(n.year,n.month,n.date)&&(!angular.isDate(g)||isNaN(g.getTime())||l?(p=new Date(0),t.call(p,n.year,n.month,n.date),u.call(p,n.hours||0,n.minutes||0,n.seconds||0,n.milliseconds||0)):(p=new Date(g),t.call(p,n.year,n.month,n.date),u.call(p,n.hours,n.minutes,n.seconds,n.milliseconds))),p}},this.toTimezone=h,this.fromTimezone=i,this.timezoneToOffset=j,this.addDateMinutes=k,this.convertTimezoneToLocal=l}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(a){var b=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,c=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(d,e){function f(a,b,c){i.push(a),j.push({scope:a,element:b}),o.forEach(function(b,c){g(b,a)}),a.$on("$destroy",h)}function g(b,d){var e=b.match(c),f=d.$eval(e[1]),g=e[2],h=k[b];if(!h){var i=function(b){var c=null;j.some(function(a){var d=a.scope.$eval(m);return d===b?(c=a,!0):void 0}),h.lastActivated!==c&&(h.lastActivated&&a.removeClass(h.lastActivated.element,f),c&&a.addClass(c.element,f),h.lastActivated=c)};k[b]=h={lastActivated:null,scope:d,watchFn:i,compareWithExp:g,watcher:d.$watch(g,i)}}h.watchFn(d.$eval(g))}function h(a){var b=a.targetScope,c=i.indexOf(b);if(i.splice(c,1),j.splice(c,1),i.length){var d=i[0];angular.forEach(k,function(a){a.scope===b&&(a.watcher=d.$watch(a.compareWithExp,a.watchFn),a.scope=d)})}else k={}}var i=[],j=[],k={},l=e.uibIsClass.match(b),m=l[2],n=l[1],o=n.split(",");return f}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(a,b,c,d,e,f,g,h,i,j,k){function l(b){a.datepickerMode=b,a.datepickerOptions.datepickerMode=b}var m=this,n={$setViewValue:angular.noop},o={},p=[];!!b.datepickerOptions;a.datepickerOptions||(a.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(b){switch(b){case"customClass":case"dateDisabled":a[b]=a.datepickerOptions[b]||angular.noop;break;case"datepickerMode":a.datepickerMode=angular.isDefined(a.datepickerOptions.datepickerMode)?a.datepickerOptions.datepickerMode:h.datepickerMode;break;case"formatDay":case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":m[b]=angular.isDefined(a.datepickerOptions[b])?d(a.datepickerOptions[b])(a.$parent):h[b];break;case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":m[b]=angular.isDefined(a.datepickerOptions[b])?a.datepickerOptions[b]:h[b];break;case"startingDay":angular.isDefined(a.datepickerOptions.startingDay)?m.startingDay=a.datepickerOptions.startingDay:angular.isNumber(h.startingDay)?m.startingDay=h.startingDay:m.startingDay=(e.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":a.$watch("datepickerOptions."+b,function(a){a?angular.isDate(a)?m[b]=k.fromTimezone(new Date(a),o.timezone):(i&&f.warn("Literal date support has been deprecated, please switch to date object usage"),m[b]=new Date(g(a,"medium"))):m[b]=h[b]?k.fromTimezone(new Date(h[b]),o.timezone):null,m.refreshView()});break;case"maxMode":case"minMode":a.datepickerOptions[b]?a.$watch(function(){return a.datepickerOptions[b]},function(c){m[b]=a[b]=angular.isDefined(c)?c:datepickerOptions[b],("minMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)m.modes.indexOf(m[b]))&&(a.datepickerMode=m[b],a.datepickerOptions.datepickerMode=m[b])}):m[b]=a[b]=h[b]||null}}),a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),a.disabled=angular.isDefined(b.disabled)||!1,angular.isDefined(b.ngDisabled)&&p.push(a.$parent.$watch(b.ngDisabled,function(b){a.disabled=b,m.refreshView()})),a.isActive=function(b){return 0===m.compare(b.date,m.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(b){n=b,o=b.$options||h.ngModelOptions,a.datepickerOptions.initDate?(m.activeDate=k.fromTimezone(a.datepickerOptions.initDate,o.timezone)||new Date,a.$watch("datepickerOptions.initDate",function(a){a&&(n.$isEmpty(n.$modelValue)||n.$invalid)&&(m.activeDate=k.fromTimezone(a,o.timezone),m.refreshView())})):m.activeDate=new Date;var c=n.$modelValue?new Date(n.$modelValue):new Date;this.activeDate=isNaN(c)?k.fromTimezone(new Date,o.timezone):k.fromTimezone(c,o.timezone),n.$render=function(){m.render()}},this.render=function(){if(n.$viewValue){var a=new Date(n.$viewValue),b=!isNaN(a);b?this.activeDate=k.fromTimezone(a,o.timezone):j||f.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){a.selectedDt=null,this._refreshView(),a.activeDt&&(a.activeDateId=a.activeDt.uid);var b=n.$viewValue?new Date(n.$viewValue):null;b=k.fromTimezone(b,o.timezone),n.$setValidity("dateDisabled",!b||this.element&&!this.isDisabled(b))}},this.createDateObject=function(b,c){var d=n.$viewValue?new Date(n.$viewValue):null;d=k.fromTimezone(d,o.timezone);var e=new Date;e=k.fromTimezone(e,o.timezone);var f=this.compare(b,e),g={date:b,label:k.filter(b,c),selected:d&&0===this.compare(b,d),disabled:this.isDisabled(b),past:0>f,current:0===f,future:f>0,customClass:this.customClass(b)||null};return d&&0===this.compare(b,d)&&(a.selectedDt=g),m.activeDate&&0===this.compare(g.date,m.activeDate)&&(a.activeDt=g),g},this.isDisabled=function(b){return a.disabled||this.minDate&&this.compare(b,this.minDate)<0||this.maxDate&&this.compare(b,this.maxDate)>0||a.dateDisabled&&a.dateDisabled({date:b,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===m.minMode){var c=n.$viewValue?k.fromTimezone(new Date(n.$viewValue),o.timezone):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),c=k.toTimezone(c,o.timezone),n.$setViewValue(c),n.$render()}else m.activeDate=b,l(m.modes[m.modes.indexOf(a.datepickerMode)-1]),a.$emit("uib:datepicker.mode");a.$broadcast("uib:datepicker.focus")},a.move=function(a){var b=m.activeDate.getFullYear()+a*(m.step.years||0),c=m.activeDate.getMonth()+a*(m.step.months||0);m.activeDate.setFullYear(b,c,1),m.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===m.maxMode&&1===b||a.datepickerMode===m.minMode&&-1===b||(l(m.modes[m.modes.indexOf(a.datepickerMode)+b]),a.$emit("uib:datepicker.mode"))},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var q=function(){m.element[0].focus()};a.$on("uib:datepicker.focus",q),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey&&!a.disabled)if(b.preventDefault(),m.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(m.isDisabled(m.activeDate))return;a.select(m.activeDate)}else!b.ctrlKey||"up"!==c&&"down"!==c?(m.handleKeyDown(c,b),m.refreshView()):a.toggleMode("up"===c?1:-1)},a.$on("$destroy",function(){for(;p.length;)p.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?f[b]:29}function e(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}var f=[31,28,31,30,31,30,31,31,30,31,30,31];this.step={months:1},this.element=b,this.init=function(b){angular.extend(b,this),a.showWeeks=b.showWeeks,b.refreshView()},this.getDates=function(a,b){for(var c,d=new Array(b),e=new Date(a),f=0;b>f;)c=new Date(e),d[f++]=c,e.setDate(e.getDate()+1);return d},this._refreshView=function(){var b=this.activeDate.getFullYear(),d=this.activeDate.getMonth(),f=new Date(this.activeDate);f.setFullYear(b,d,1);var g=this.startingDay-f.getDay(),h=g>0?7-g:-g,i=new Date(f);h>0&&i.setDate(-h+1);for(var j=this.getDates(i,42),k=0;42>k;k++)j[k]=angular.extend(this.createDateObject(j[k],this.formatDay),{secondary:j[k].getMonth()!==d,uid:a.uniqueId+"-"+k});a.labels=new Array(7);for(var l=0;7>l;l++)a.labels[l]={abbr:c(j[l].date,this.formatDayHeader),full:c(j[l].date,"EEEE")};if(a.title=c(this.activeDate,this.formatDayTitle),a.rows=this.split(j,7),a.showWeeks){a.weekNumbers=[];for(var m=(11-this.startingDay)%7,n=a.rows.length,o=0;n>o;o++)a.weekNumbers.push(e(a.rows[o][m].date))}},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth(),a.getDate()),d=new Date(b.getFullYear(),b.getMonth(),b.getDate());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getDate();if("left"===a)c-=1;else if("up"===a)c-=7;else if("right"===a)c+=1;else if("down"===a)c+=7;else if("pageup"===a||"pagedown"===a){var e=this.activeDate.getMonth()+("pageup"===a?-1:1);this.activeDate.setMonth(e,1),c=Math.min(d(this.activeDate.getFullYear(),this.activeDate.getMonth()),c)}else"home"===a?c=1:"end"===a&&(c=d(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(c)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(a,b,c){this.step={years:1},this.element=b,this.init=function(a){angular.extend(a,this),a.refreshView()},this._refreshView=function(){for(var b,d=new Array(12),e=this.activeDate.getFullYear(),f=0;12>f;f++)b=new Date(this.activeDate),b.setFullYear(e,f,1),d[f]=angular.extend(this.createDateObject(b,this.formatMonth),{uid:a.uniqueId+"-"+f});a.title=c(this.activeDate,this.formatMonthTitle),a.rows=this.split(d,3)},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth()),d=new Date(b.getFullYear(),b.getMonth());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getMonth();if("left"===a)c-=1;else if("up"===a)c-=3;else if("right"===a)c+=1;else if("down"===a)c+=3;else if("pageup"===a||"pagedown"===a){var d=this.activeDate.getFullYear()+("pageup"===a?-1:1);this.activeDate.setFullYear(d)}else"home"===a?c=0:"end"===a&&(c=11);this.activeDate.setMonth(c)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a){return parseInt((a-1)/f,10)*f+1}var e,f;this.element=b,this.yearpickerInit=function(){e=this.yearColumns,f=this.yearRows*e,this.step={years:f}},this._refreshView=function(){for(var b,c=new Array(f),g=0,h=d(this.activeDate.getFullYear());f>g;g++)b=new Date(this.activeDate),b.setFullYear(h+g,0,1),c[g]=angular.extend(this.createDateObject(b,this.formatYear),{uid:a.uniqueId+"-"+g});a.title=[c[0].label,c[f-1].label].join(" - "),a.rows=this.split(c,e),a.columns=e},this.compare=function(a,b){return a.getFullYear()-b.getFullYear()},this.handleKeyDown=function(a,b){var c=this.activeDate.getFullYear();"left"===a?c-=1:"up"===a?c-=e:"right"===a?c+=1:"down"===a?c+=e:"pageup"===a||"pagedown"===a?c+=("pageup"===a?-1:1)*f:"home"===a?c=d(this.activeDate.getFullYear()):"end"===a&&(c=d(this.activeDate.getFullYear())+f-1),this.activeDate.setFullYear(c)}}]).directive("uibDatepicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],controller:"UibDatepickerController",controllerAs:"datepicker",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}).directive("uibDaypicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],controller:"UibDaypickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibMonthpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],controller:"UibMonthpickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibYearpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],controller:"UibYearpickerController",link:function(a,b,c,d){var e=d[0];angular.extend(e,d[1]),e.yearpickerInit(),e.refreshView()}}}),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(a,b){var c,d,e={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},f={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},g=/(HTML|BODY)/;return{getRawNode:function(a){return a.nodeName?a:a[0]||a},parseStyle:function(a){return a=parseFloat(a),isFinite(a)?a:0},offsetParent:function(c){function d(a){return"static"===(b.getComputedStyle(a).position||"static")}c=this.getRawNode(c);for(var e=c.offsetParent||a[0].documentElement;e&&e!==a[0].documentElement&&d(e);)e=e.offsetParent;return e||a[0].documentElement},scrollbarWidth:function(e){if(e){if(angular.isUndefined(d)){var f=a.find("body");f.addClass("uib-position-body-scrollbar-measure"),d=b.innerWidth-f[0].clientWidth,d=isFinite(d)?d:0,f.removeClass("uib-position-body-scrollbar-measure")}return d}if(angular.isUndefined(c)){var g=angular.element('
      ');a.find("body").append(g),c=g[0].offsetWidth-g[0].clientWidth,c=isFinite(c)?c:0,g.remove()}return c},scrollbarPadding:function(a){a=this.getRawNode(a);var c=b.getComputedStyle(a),d=this.parseStyle(c.paddingRight),e=this.parseStyle(c.paddingBottom),f=this.scrollParent(a,!1,!0),h=this.scrollbarWidth(f,g.test(f.tagName));return{scrollbarWidth:h,widthOverflow:f.scrollWidth>f.clientWidth,right:d+h,originalRight:d,heightOverflow:f.scrollHeight>f.clientHeight, -bottom:e+h,originalBottom:e}},isScrollable:function(a,c){a=this.getRawNode(a);var d=c?e.hidden:e.normal,f=b.getComputedStyle(a);return d.test(f.overflow+f.overflowY+f.overflowX)},scrollParent:function(c,d,f){c=this.getRawNode(c);var g=d?e.hidden:e.normal,h=a[0].documentElement,i=b.getComputedStyle(c);if(f&&g.test(i.overflow+i.overflowY+i.overflowX))return c;var j="absolute"===i.position,k=c.parentElement||h;if(k===h||"fixed"===i.position)return h;for(;k.parentElement&&k!==h;){var l=b.getComputedStyle(k);if(j&&"static"!==l.position&&(j=!1),!j&&g.test(l.overflow+l.overflowY+l.overflowX))break;k=k.parentElement}return k},position:function(c,d){c=this.getRawNode(c);var e=this.offset(c);if(d){var f=b.getComputedStyle(c);e.top-=this.parseStyle(f.marginTop),e.left-=this.parseStyle(f.marginLeft)}var g=this.offsetParent(c),h={top:0,left:0};return g!==a[0].documentElement&&(h=this.offset(g),h.top+=g.clientTop-g.scrollTop,h.left+=g.clientLeft-g.scrollLeft),{width:Math.round(angular.isNumber(e.width)?e.width:c.offsetWidth),height:Math.round(angular.isNumber(e.height)?e.height:c.offsetHeight),top:Math.round(e.top-h.top),left:Math.round(e.left-h.left)}},offset:function(c){c=this.getRawNode(c);var d=c.getBoundingClientRect();return{width:Math.round(angular.isNumber(d.width)?d.width:c.offsetWidth),height:Math.round(angular.isNumber(d.height)?d.height:c.offsetHeight),top:Math.round(d.top+(b.pageYOffset||a[0].documentElement.scrollTop)),left:Math.round(d.left+(b.pageXOffset||a[0].documentElement.scrollLeft))}},viewportOffset:function(c,d,e){c=this.getRawNode(c),e=e!==!1;var f=c.getBoundingClientRect(),g={top:0,left:0,bottom:0,right:0},h=d?a[0].documentElement:this.scrollParent(c),i=h.getBoundingClientRect();if(g.top=i.top+h.clientTop,g.left=i.left+h.clientLeft,h===a[0].documentElement&&(g.top+=b.pageYOffset,g.left+=b.pageXOffset),g.bottom=g.top+h.clientHeight,g.right=g.left+h.clientWidth,e){var j=b.getComputedStyle(h);g.top+=this.parseStyle(j.paddingTop),g.bottom-=this.parseStyle(j.paddingBottom),g.left+=this.parseStyle(j.paddingLeft),g.right-=this.parseStyle(j.paddingRight)}return{top:Math.round(f.top-g.top),bottom:Math.round(g.bottom-f.bottom),left:Math.round(f.left-g.left),right:Math.round(g.right-f.right)}},parsePlacement:function(a){var b=f.auto.test(a);return b&&(a=a.replace(f.auto,"")),a=a.split("-"),a[0]=a[0]||"top",f.primary.test(a[0])||(a[0]="top"),a[1]=a[1]||"center",f.secondary.test(a[1])||(a[1]="center"),b?a[2]=!0:a[2]=!1,a},positionElements:function(a,c,d,e){a=this.getRawNode(a),c=this.getRawNode(c);var g=angular.isDefined(c.offsetWidth)?c.offsetWidth:c.prop("offsetWidth"),h=angular.isDefined(c.offsetHeight)?c.offsetHeight:c.prop("offsetHeight");d=this.parsePlacement(d);var i=e?this.offset(a):this.position(a),j={top:0,left:0,placement:""};if(d[2]){var k=this.viewportOffset(a,e),l=b.getComputedStyle(c),m={width:g+Math.round(Math.abs(this.parseStyle(l.marginLeft)+this.parseStyle(l.marginRight))),height:h+Math.round(Math.abs(this.parseStyle(l.marginTop)+this.parseStyle(l.marginBottom)))};if(d[0]="top"===d[0]&&m.height>k.top&&m.height<=k.bottom?"bottom":"bottom"===d[0]&&m.height>k.bottom&&m.height<=k.top?"top":"left"===d[0]&&m.width>k.left&&m.width<=k.right?"right":"right"===d[0]&&m.width>k.right&&m.width<=k.left?"left":d[0],d[1]="top"===d[1]&&m.height-i.height>k.bottom&&m.height-i.height<=k.top?"bottom":"bottom"===d[1]&&m.height-i.height>k.top&&m.height-i.height<=k.bottom?"top":"left"===d[1]&&m.width-i.width>k.right&&m.width-i.width<=k.left?"right":"right"===d[1]&&m.width-i.width>k.left&&m.width-i.width<=k.right?"left":d[1],"center"===d[1])if(f.vertical.test(d[0])){var n=i.width/2-g/2;k.left+n<0&&m.width-i.width<=k.right?d[1]="left":k.right+n<0&&m.width-i.width<=k.left&&(d[1]="right")}else{var o=i.height/2-m.height/2;k.top+o<0&&m.height-i.height<=k.bottom?d[1]="top":k.bottom+o<0&&m.height-i.height<=k.top&&(d[1]="bottom")}}switch(d[0]){case"top":j.top=i.top-h;break;case"bottom":j.top=i.top+i.height;break;case"left":j.left=i.left-g;break;case"right":j.left=i.left+i.width}switch(d[1]){case"top":j.top=i.top;break;case"bottom":j.top=i.top+i.height-h;break;case"left":j.left=i.left;break;case"right":j.left=i.left+i.width-g;break;case"center":f.vertical.test(d[0])?j.left=i.left+i.width/2-g/2:j.top=i.top+i.height/2-h/2}return j.top=Math.round(j.top),j.left=Math.round(j.left),j.placement="center"===d[1]?d[0]:d[0]+"-"+d[1],j},positionArrow:function(a,c){a=this.getRawNode(a);var d=a.querySelector(".tooltip-inner, .popover-inner");if(d){var e=angular.element(d).hasClass("tooltip-inner"),g=e?a.querySelector(".tooltip-arrow"):a.querySelector(".arrow");if(g){var h={top:"",bottom:"",left:"",right:""};if(c=this.parsePlacement(c),"center"===c[1])return void angular.element(g).css(h);var i="border-"+c[0]+"-width",j=b.getComputedStyle(g)[i],k="border-";k+=f.vertical.test(c[0])?c[0]+"-"+c[1]:c[1]+"-"+c[0],k+="-radius";var l=b.getComputedStyle(e?d:a)[k];switch(c[0]){case"top":h.bottom=e?"0":"-"+j;break;case"bottom":h.top=e?"0":"-"+j;break;case"left":h.right=e?"0":"-"+j;break;case"right":h.left=e?"0":"-"+j}h[c[1]]=l,angular.element(g).css(h)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(b){var c=l.parse(b,w,a.date);if(isNaN(c))for(var d=0;d
      "),G?(J=G.timezone,a.ngModelOptions=angular.copy(G),a.ngModelOptions.timezone=null,a.ngModelOptions.updateOnDefault===!0&&(a.ngModelOptions.updateOn=a.ngModelOptions.updateOn?a.ngModelOptions.updateOn+" default":"default"),C.attr("ng-model-options","ngModelOptions")):J=null,C.attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":A}),D=angular.element(C.children()[0]),D.attr("template-url",B),a.datepickerOptions||(a.datepickerOptions={}),K&&"month"===c.type&&(a.datepickerOptions.datepickerMode="month",a.datepickerOptions.minMode="month"),D.attr("datepicker-options","datepickerOptions"),K?F.$formatters.push(function(b){return a.date=l.fromTimezone(b,J),b}):(F.$$parserName="date",F.$validators.date=s,F.$parsers.unshift(r),F.$formatters.push(function(b){return F.$isEmpty(b)?(a.date=b,b):(angular.isNumber(b)&&(b=new Date(b)),a.date=l.fromTimezone(b,J),l.filter(a.date,w))})),F.$viewChangeListeners.push(function(){a.date=q(F.$viewValue)}),b.on("keydown",u),H=d(C)(a),C.remove(),y?h.find("body").append(H):b.after(H),a.$on("$destroy",function(){for(a.isOpen===!0&&(i.$$phase||a.$apply(function(){a.isOpen=!1})),H.remove(),b.off("keydown",u),h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v);L.length;)L.shift()()})},a.getText=function(b){return a[b+"Text"]||m[b+"Text"]},a.isDisabled=function(b){"today"===b&&(b=l.fromTimezone(new Date,J));var c={};return angular.forEach(["minDate","maxDate"],function(b){a.datepickerOptions[b]?angular.isDate(a.datepickerOptions[b])?c[b]=l.fromTimezone(new Date(a.datepickerOptions[b]),J):(p&&e.warn("Literal date support has been deprecated, please switch to date object usage"),c[b]=new Date(k(a.datepickerOptions[b],"medium"))):c[b]=null}),a.datepickerOptions&&c.minDate&&a.compare(b,c.minDate)<0||c.maxDate&&a.compare(b,c.maxDate)>0},a.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},a.dateSelection=function(c){angular.isDefined(c)&&(a.date=c);var d=a.date?l.filter(a.date,w):null;b.val(d),F.$setViewValue(d),x&&(a.isOpen=!1,b[0].focus())},a.keydown=function(c){27===c.which&&(c.stopPropagation(),a.isOpen=!1,b[0].focus())},a.select=function(b,c){if(c.stopPropagation(),"today"===b){var d=new Date;angular.isDate(a.date)?(b=new Date(a.date),b.setFullYear(d.getFullYear(),d.getMonth(),d.getDate())):b=new Date(d.setHours(0,0,0,0))}a.dateSelection(b)},a.close=function(c){c.stopPropagation(),a.isOpen=!1,b[0].focus()},a.disabled=angular.isDefined(c.disabled)||!1,c.ngDisabled&&L.push(a.$parent.$watch(f(c.ngDisabled),function(b){a.disabled=b})),a.$watch("isOpen",function(d){d?a.disabled?a.isOpen=!1:n(function(){v(),z&&a.$broadcast("uib:datepicker.focus"),h.on("click",t);var d=c.popupPlacement?c.popupPlacement:m.placement;y||j.parsePlacement(d)[2]?(E=E||angular.element(j.scrollParent(b)),E&&E.on("scroll",v)):E=null,angular.element(g).on("resize",v)},0,!1):(h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v))}),a.$on("uib:datepicker.mode",function(){n(v,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibDatepickerPopupWrap",function(){return{replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(a){return function(b,c){var d;return function(){var e=this,f=Array.prototype.slice.call(arguments);d&&a.cancel(d),d=a(function(){b.apply(e,f)},c)}}}]),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b,f){c||(a.on("click",d),f.on("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b,f){c===b&&(c=null,a.off("click",d),f.off("keydown",e))};var d=function(a){if(c&&!(a&&"disabled"===c.getAutoClose()||a&&3===a.which)){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getDropdownElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which?(a.stopPropagation(),c.focusToggleElement(),d()):c.isKeynavEnabled()&&-1!==[38,40].indexOf(a.which)&&c.isOpen&&(a.preventDefault(),a.stopPropagation(),c.focusDropdownEntry(a.which))}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(a,b,c,d,e,f,g,h,i,j,k){var l,m,n=this,o=a.$new(),p=e.appendToOpenClass,q=e.openClass,r=angular.noop,s=c.onToggle?d(c.onToggle):angular.noop,t=!1,u=null,v=!1,w=i.find("body");b.addClass("dropdown"),this.init=function(){if(c.isOpen&&(m=d(c.isOpen),r=m.assign,a.$watch(m,function(a){o.isOpen=!!a})),angular.isDefined(c.dropdownAppendTo)){var e=d(c.dropdownAppendTo)(o);e&&(u=angular.element(e))}t=angular.isDefined(c.dropdownAppendToBody),v=angular.isDefined(c.keyboardNav),t&&!u&&(u=w),u&&n.dropdownMenu&&(u.append(n.dropdownMenu),b.on("$destroy",function(){n.dropdownMenu.remove()}))},this.toggle=function(a){return o.isOpen=arguments.length?!!a:!o.isOpen,angular.isFunction(r)&&r(o,o.isOpen),o.isOpen},this.isOpen=function(){return o.isOpen},o.getToggleElement=function(){return n.toggleElement},o.getAutoClose=function(){return c.autoClose||"always"},o.getElement=function(){return b},o.isKeynavEnabled=function(){return v},o.focusDropdownEntry=function(a){var c=n.dropdownMenu?angular.element(n.dropdownMenu).find("a"):b.find("ul").eq(0).find("a");switch(a){case 40:angular.isNumber(n.selectedOption)?n.selectedOption=n.selectedOption===c.length-1?n.selectedOption:n.selectedOption+1:n.selectedOption=0;break;case 38:angular.isNumber(n.selectedOption)?n.selectedOption=0===n.selectedOption?0:n.selectedOption-1:n.selectedOption=c.length-1}c[n.selectedOption].focus()},o.getDropdownElement=function(){return n.dropdownMenu},o.focusToggleElement=function(){n.toggleElement&&n.toggleElement[0].focus()},o.$watch("isOpen",function(c,d){if(u&&n.dropdownMenu){var e,i,m,v=h.positionElements(b,n.dropdownMenu,"bottom-left",!0);if(e={top:v.top+"px",display:c?"block":"none"},i=n.dropdownMenu.hasClass("dropdown-menu-right"),i?(e.left="auto",m=h.scrollbarWidth(!0),e.right=window.innerWidth-m-(v.left+b.prop("offsetWidth"))+"px"):(e.left=v.left+"px",e.right="auto"),!t){var w=h.offset(u);e.top=v.top-w.top+"px",i?e.right=window.innerWidth-(v.left-w.left+b.prop("offsetWidth"))+"px":e.left=v.left-w.left+"px"}n.dropdownMenu.css(e)}var x=u?u:b,y=x.hasClass(u?p:q);if(y===!c&&g[c?"addClass":"removeClass"](x,u?p:q).then(function(){angular.isDefined(c)&&c!==d&&s(a,{open:!!c})}),c)n.dropdownMenuTemplateUrl&&k(n.dropdownMenuTemplateUrl).then(function(a){l=o.$new(),j(a.trim())(l,function(a){var b=a;n.dropdownMenu.replaceWith(b),n.dropdownMenu=b})}),o.focusToggleElement(),f.open(o,b);else{if(n.dropdownMenuTemplateUrl){l&&l.$destroy();var z=angular.element('');n.dropdownMenu.replaceWith(z),n.dropdownMenu=z}f.close(o,b),n.selectedOption=null}angular.isFunction(r)&&r(a,c)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(a,b,c,d){d.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(a,b,c,d){if(d&&!angular.isDefined(c.dropdownNested)){b.addClass("dropdown-menu");var e=c.templateUrl;e&&(d.dropdownMenuTemplateUrl=e),d.dropdownMenu||(d.dropdownMenu=b)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(a,b,c,d){if(d){b.addClass("dropdown-toggle"),d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c-1&&y>a&&(a=y),a}function l(a,b){var c=v.get(a).value,d=c.appendTo;v.remove(a),z=v.top(),z&&(y=parseInt(z.value.modalDomEl.attr("index"),10)),o(c.modalDomEl,c.modalScope,function(){var b=c.openedClass||u;w.remove(b,a);var e=w.hasKey(b);d.toggleClass(b,e),!e&&t&&t.heightOverflow&&t.scrollbarWidth&&(t.originalRight?d.css({paddingRight:t.originalRight+"px"}):d.css({paddingRight:""}),t=null),m(!0)},c.closedDeferred),n(),b&&b.focus?b.focus():d.focus&&d.focus()}function m(a){var b;v.length()>0&&(b=v.top().value,b.modalDomEl.toggleClass(b.windowTopClass||"",a))}function n(){if(r&&-1===k()){var a=s;o(r,s,function(){a=null}),r=void 0,s=void 0}}function o(b,c,d,e){function g(){g.done||(g.done=!0,a.leave(b).then(function(){b.remove(),e&&e.resolve()}),c.$destroy(),d&&d())}var h,i=null,j=function(){return h||(h=f.defer(),i=h.promise),function(){h.resolve()}};return c.$broadcast(x.NOW_CLOSING_EVENT,j),f.when(i).then(g)}function p(a){if(a.isDefaultPrevented())return a;var b=v.top();if(b)switch(a.which){case 27:b.value.keyboard&&(a.preventDefault(),e.$apply(function(){x.dismiss(b.key,"escape key press")}));break;case 9:var c=x.loadFocusElementList(b),d=!1;a.shiftKey?(x.isFocusInFirstItem(a,c)||x.isModalFocused(a,b))&&(d=x.focusLastFocusableElement(c)):x.isFocusInLastItem(a,c)&&(d=x.focusFirstFocusableElement(c)),d&&(a.preventDefault(),a.stopPropagation())}}function q(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var r,s,t,u="modal-open",v=h.createNew(),w=g.createNew(),x={NOW_CLOSING_EVENT:"modal.stack.now-closing"},y=0,z=null,A="a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]";return e.$watch(k,function(a){s&&(s.index=a)}),c.on("keydown",p),e.$on("$destroy",function(){c.off("keydown",p)}),x.open=function(b,f){var g=c[0].activeElement,h=f.openedClass||u;m(!1),z=v.top(),v.add(b,{deferred:f.deferred,renderDeferred:f.renderDeferred,closedDeferred:f.closedDeferred,modalScope:f.scope,backdrop:f.backdrop,keyboard:f.keyboard,openedClass:f.openedClass,windowTopClass:f.windowTopClass,animation:f.animation,appendTo:f.appendTo}),w.put(h,b);var j=f.appendTo,l=k();if(!j.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");l>=0&&!r&&(s=e.$new(!0),s.modalOptions=f,s.index=l,r=angular.element('
      '),r.attr("backdrop-class",f.backdropClass),f.animation&&r.attr("modal-animation","true"),d(r)(s),a.enter(r,j),t=i.scrollbarPadding(j),t.heightOverflow&&t.scrollbarWidth&&j.css({paddingRight:t.right+"px"})),y=z?parseInt(z.value.modalDomEl.attr("index"),10)+1:0;var n=angular.element('
      ');n.attr({"template-url":f.windowTemplateUrl,"window-class":f.windowClass,"window-top-class":f.windowTopClass,size:f.size,index:y,animate:"animate"}).html(f.content),f.animation&&n.attr("modal-animation","true"),j.addClass(h),a.enter(d(n)(f.scope),j),v.top().value.modalDomEl=n,v.top().value.modalOpener=g},x.close=function(a,b){var c=v.get(a);return c&&q(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),l(a,c.value.modalOpener),!0):!c},x.dismiss=function(a,b){var c=v.get(a);return c&&q(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),l(a,c.value.modalOpener),!0):!c},x.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},x.getTop=function(){return v.top()},x.modalRendered=function(a){var b=v.get(a);b&&b.value.renderDeferred.resolve()},x.focusFirstFocusableElement=function(a){return a.length>0?(a[0].focus(),!0):!1},x.focusLastFocusableElement=function(a){return a.length>0?(a[a.length-1].focus(),!0):!1},x.isModalFocused=function(a,b){if(a&&b){var c=b.value.modalDomEl;if(c&&c.length)return(a.target||a.srcElement)===c[0]}return!1},x.isFocusInFirstItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[0]:!1},x.isFocusInLastItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[b.length-1]:!1},x.loadFocusElementList=function(a){if(a){var b=a.value.modalDomEl;if(b&&b.length){var c=b[0].querySelectorAll(A);return c?Array.prototype.filter.call(c,function(a){return j(a)}):c}}},x}]).provider("$uibModal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?c.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(e){function j(){return r}var l=c.defer(),m=c.defer(),n=c.defer(),o=c.defer(),p={result:l.promise,opened:m.promise,closed:n.promise,rendered:o.promise,close:function(a){return h.close(p,a)},dismiss:function(a){return h.dismiss(p,a)}};if(e=angular.extend({},a.options,e),e.resolve=e.resolve||{},e.appendTo=e.appendTo||d.find("body").eq(0),!e.template&&!e.templateUrl)throw new Error("One of template or templateUrl options is required.");var q,r=c.all([i(e),g.resolve(e.resolve,{},null,null)]);return q=k=c.all([k]).then(j,j).then(function(a){var c=e.scope||b,d=c.$new();d.$close=p.close,d.$dismiss=p.dismiss,d.$on("$destroy",function(){d.$$uibDestructionScheduled||d.$dismiss("$uibUnscheduledDestruction")});var g,i,j={};e.controller&&(j.$scope=d,j.$scope.$resolve={},j.$uibModalInstance=p,angular.forEach(a[1],function(a,b){j[b]=a,j.$scope.$resolve[b]=a}),i=f(e.controller,j,!0,e.controllerAs),e.controllerAs&&e.bindToController&&(g=i.instance,g.$close=d.$close,g.$dismiss=d.$dismiss,angular.extend(g,{$resolve:j.$scope.$resolve},c)),g=i(),angular.isFunction(g.$onInit)&&g.$onInit()),h.open(p,{scope:d,deferred:l,renderDeferred:o,closedDeferred:n,content:a[0],animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowTopClass:e.windowTopClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,size:e.size,openedClass:e.openedClass,appendTo:e.appendTo}),m.resolve(!0)},function(a){m.reject(a),l.reject(a)})["finally"](function(){k===q&&(k=null)}),p},j}]};return a}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(a){return{create:function(b,c,d){b.setNumPages=d.numPages?a(d.numPages).assign:angular.noop,b.ngModelCtrl={$setViewValue:angular.noop},b._watchers=[],b.init=function(a,e){b.ngModelCtrl=a,b.config=e,a.$render=function(){b.render()},d.itemsPerPage?b._watchers.push(c.$parent.$watch(d.itemsPerPage,function(a){b.itemsPerPage=parseInt(a,10),c.totalPages=b.calculateTotalPages(),b.updatePage()})):b.itemsPerPage=e.itemsPerPage,c.$watch("totalItems",function(a,d){(angular.isDefined(a)||a!==d)&&(c.totalPages=b.calculateTotalPages(),b.updatePage())})},b.calculateTotalPages=function(){var a=b.itemsPerPage<1?1:Math.ceil(c.totalItems/b.itemsPerPage);return Math.max(a||0,1)},b.render=function(){c.page=parseInt(b.ngModelCtrl.$viewValue,10)||1},c.selectPage=function(a,d){d&&d.preventDefault();var e=!c.ngDisabled||!d;e&&c.page!==a&&a>0&&a<=c.totalPages&&(d&&d.target&&d.target.blur(),b.ngModelCtrl.$setViewValue(a),b.ngModelCtrl.$render())},c.getText=function(a){return c[a+"Text"]||b.config[a+"Text"]},c.noPrevious=function(){return 1===c.page},c.noNext=function(){return c.page===c.totalPages},b.updatePage=function(){b.setNumPages(c.$parent,c.totalPages),c.page>c.totalPages?c.selectPage(c.totalPages):b.ngModelCtrl.$render()},c.$on("$destroy",function(){for(;b._watchers.length;)b._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(a,b,c,d){a.align=angular.isDefined(b.align)?a.$parent.$eval(b.align):d.align,c.create(this,a,b)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(a){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],controller:"UibPagerController",controllerAs:"pager",templateUrl:function(a,b){return b.templateUrl||"uib/template/pager/pager.html"},replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&f.init(g,a)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(a,b,c,d,e){function f(a,b,c){return{number:a,text:b,active:c}}function g(a,b){var c=[],d=1,e=b,g=angular.isDefined(i)&&b>i;g&&(j?(d=Math.max(a-Math.floor(i/2),1),e=d+i-1,e>b&&(e=b,d=e-i+1)):(d=(Math.ceil(a/i)-1)*i+1,e=Math.min(d+i-1,b)));for(var h=d;e>=h;h++){var n=f(h,m(h),h===a);c.push(n)}if(g&&i>0&&(!j||k||l)){if(d>1){if(!l||d>3){var o=f(d-1,"...",!1);c.unshift(o)}if(l){if(3===d){var p=f(2,"2",!1);c.unshift(p)}var q=f(1,"1",!1);c.unshift(q)}}if(b>e){if(!l||b-2>e){var r=f(e+1,"...",!1);c.push(r)}if(l){if(e===b-2){var s=f(b-1,b-1,!1);c.push(s)}var t=f(b,b,!1);c.push(t)}}}return c}var h=this,i=angular.isDefined(b.maxSize)?a.$parent.$eval(b.maxSize):e.maxSize,j=angular.isDefined(b.rotate)?a.$parent.$eval(b.rotate):e.rotate,k=angular.isDefined(b.forceEllipses)?a.$parent.$eval(b.forceEllipses):e.forceEllipses,l=angular.isDefined(b.boundaryLinkNumbers)?a.$parent.$eval(b.boundaryLinkNumbers):e.boundaryLinkNumbers,m=angular.isDefined(b.pageLabel)?function(c){return a.$parent.$eval(b.pageLabel,{$page:c})}:angular.identity;a.boundaryLinks=angular.isDefined(b.boundaryLinks)?a.$parent.$eval(b.boundaryLinks):e.boundaryLinks,a.directionLinks=angular.isDefined(b.directionLinks)?a.$parent.$eval(b.directionLinks):e.directionLinks,d.create(this,a,b),b.maxSize&&h._watchers.push(a.$parent.$watch(c(b.maxSize),function(a){i=parseInt(a,10),h.render()}));var n=this.render;this.render=function(){n(),a.page>0&&a.page<=a.totalPages&&(a.pages=g(a.page,a.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(a,b){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"uib/template/pagination/pagination.html"},replace:!0,link:function(a,c,d,e){var f=e[0],g=e[1];g&&f.init(g,b)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(e,f,g,h,i,j,k,l,m){function n(a){if(27===a.which){var b=o.top();b&&(b.value.close(),o.removeTop(),b=null)}}var o=m.createNew();return h.on("keypress",n),k.$on("$destroy",function(){h.off("keypress",n)}),function(e,k,m,n){function p(a){var b=(a||n.trigger||m).split(" "),d=b.map(function(a){ -return c[a]||a});return{show:b,hide:d}}n=angular.extend({},b,d,n);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="
      ';return{compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){N.isOpen?q():m()}function m(){M&&!a.$eval(d[k+"Enable"])||(u(),x(),N.popupDelay?G||(G=g(r,N.popupDelay,!1)):r())}function q(){s(),N.popupCloseDelay?H||(H=g(t,N.popupCloseDelay,!1)):t()}function r(){return s(),u(),N.content?(v(),void N.$evalAsync(function(){N.isOpen=!0,y(!0),S()})):angular.noop}function s(){G&&(g.cancel(G),G=null),I&&(g.cancel(I),I=null)}function t(){N&&N.$evalAsync(function(){N&&(N.isOpen=!1,y(!1),N.animation?F||(F=g(w,150,!1)):w())})}function u(){H&&(g.cancel(H),H=null),F&&(g.cancel(F),F=null)}function v(){D||(E=N.$new(),D=c(E,function(a){K?h.find("body").append(a):b.after(a)}),z())}function w(){s(),u(),A(),D&&(D.remove(),D=null),E&&(E.$destroy(),E=null)}function x(){N.title=d[k+"Title"],Q?N.content=Q(a):N.content=d[e],N.popupClass=d[k+"Class"],N.placement=angular.isDefined(d[k+"Placement"])?d[k+"Placement"]:n.placement;var b=i.parsePlacement(N.placement);J=b[1]?b[0]+"-"+b[1]:b[0];var c=parseInt(d[k+"PopupDelay"],10),f=parseInt(d[k+"PopupCloseDelay"],10);N.popupDelay=isNaN(c)?n.popupDelay:c,N.popupCloseDelay=isNaN(f)?n.popupCloseDelay:f}function y(b){P&&angular.isFunction(P.assign)&&P.assign(a,b)}function z(){R.length=0,Q?(R.push(a.$watch(Q,function(a){N.content=a,!a&&N.isOpen&&t()})),R.push(E.$watch(function(){O||(O=!0,E.$$postDigest(function(){O=!1,N&&N.isOpen&&S()}))}))):R.push(d.$observe(e,function(a){N.content=a,!a&&N.isOpen?t():S()})),R.push(d.$observe(k+"Title",function(a){N.title=a,N.isOpen&&S()})),R.push(d.$observe(k+"Placement",function(a){N.placement=a?a:n.placement,N.isOpen&&S()}))}function A(){R.length&&(angular.forEach(R,function(a){a()}),R.length=0)}function B(a){N&&N.isOpen&&D&&(b[0].contains(a.target)||D[0].contains(a.target)||q())}function C(){var a=d[k+"Trigger"];T(),L=p(a),"none"!==L.show&&L.show.forEach(function(a,c){"outsideClick"===a?(b.on("click",j),h.on("click",B)):a===L.hide[c]?b.on(a,j):a&&(b.on(a,m),b.on(L.hide[c],q)),b.on("keypress",function(a){27===a.which&&q()})})}var D,E,F,G,H,I,J,K=angular.isDefined(n.appendToBody)?n.appendToBody:!1,L=p(void 0),M=angular.isDefined(d[k+"Enable"]),N=a.$new(!0),O=!1,P=angular.isDefined(d[k+"IsOpen"])?l(d[k+"IsOpen"]):!1,Q=n.useContentExp?l(d[e]):!1,R=[],S=function(){D&&D.html()&&(I||(I=g(function(){var a=i.positionElements(b,D,N.placement,K);D.css({top:a.top+"px",left:a.left+"px"}),D.hasClass(a.placement.split("-")[0])||(D.removeClass(J.split("-")[0]),D.addClass(a.placement.split("-")[0])),D.hasClass(n.placementClassPrefix+a.placement)||(D.removeClass(n.placementClassPrefix+J),D.addClass(n.placementClassPrefix+a.placement)),D.hasClass("uib-position-measure")?(i.positionArrow(D,a.placement),D.removeClass("uib-position-measure")):J!==a.placement&&i.positionArrow(D,a.placement),J=a.placement,I=null},0,!1)))};N.origScope=a,N.isOpen=!1,o.add(N,{close:t}),N.contentExp=function(){return N.content},d.$observe("disabled",function(a){a&&s(),a&&N.isOpen&&t()}),P&&a.$watch(P,function(a){N&&!a===N.isOpen&&j()});var T=function(){L.show.forEach(function(a){"outsideClick"===a?b.off("click",j):(b.off(a,m),b.off(a,j))}),L.hide.forEach(function(a){"outsideClick"===a?h.off("click",B):b.off(a,q)})};C();var U=a.$eval(d[k+"Animation"]);N.animation=angular.isDefined(U)?!!U:n.animation;var V,W=k+"AppendToBody";V=W in d&&void 0===d[W]?!0:a.$eval(d[W]),K=angular.isDefined(V)?V:K,a.$on("$destroy",function(){T(),w(),o.remove(N),N=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.uibTooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("uibTooltipClasses",["$uibPosition",function(a){return{restrict:"A",link:function(b,c,d){if(b.placement){var e=a.parsePlacement(b.placement);c.addClass(e[0])}b.popupClass&&c.addClass(b.popupClass),b.animation()&&c.addClass(d.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(a){return a("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(a){return a("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(a){return a("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{replace:!0,scope:{uibTitle:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(a){return a("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",uibTitle:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(a){return a("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{replace:!0,scope:{uibTitle:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(a){return a("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(a,b,c){function d(){return angular.isDefined(a.maxParam)?a.maxParam:c.max}var e=this,f=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=d(),this.addBar=function(a,b,c){f||b.css({transition:"none"}),this.bars.push(a),a.max=d(),a.title=c&&angular.isDefined(c.title)?c.title:"progressbar",a.$watch("value",function(b){a.recalculatePercentage()}),a.recalculatePercentage=function(){var b=e.bars.reduce(function(a,b){return b.percent=+(100*b.value/b.max).toFixed(2),a+b.percent},0);b>100&&(a.percent-=b-100)},a.$on("$destroy",function(){b=null,e.removeBar(a)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1),this.bars.forEach(function(a){a.recalculatePercentage()})},a.$watch("maxParam",function(a){e.bars.forEach(function(a){a.max=d(),a.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b,c)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]),{title:c.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(a,b,c){var d={$setViewValue:angular.noop},e=this;this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff,this.enableReset=angular.isDefined(b.enableReset)?a.$parent.$eval(b.enableReset):c.enableReset;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){if(!a.readonly&&b>=0&&b<=a.range.length){var c=e.enableReset&&d.$viewValue===b?0:b;d.$setViewValue(c),d.$render()}},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue,a.title=e.getTitle(a.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(a){function b(a){for(var b=0;bb.index?1:a.index0&&13>b:b>=0&&24>b;return c&&""!==a.hours?(a.showMeridian&&(12===b&&(b=0),a.meridian===v[1]&&(b+=12)),b):void 0}function i(){var b=+a.minutes,c=b>=0&&60>b;return c&&""!==a.minutes?b:void 0}function j(){var b=+a.seconds;return b>=0&&60>b?b:void 0}function k(a,b){return null===a?"":angular.isDefined(a)&&a.toString().length<2&&!b?"0"+a:a.toString()}function l(a){m(),u.$setViewValue(new Date(s)),n(a)}function m(){u.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1,a.invalidSeconds=!1}function n(b){if(u.$modelValue){var c=s.getHours(),d=s.getMinutes(),e=s.getSeconds();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:k(c,!w),"m"!==b&&(a.minutes=k(d)),a.meridian=s.getHours()<12?v[0]:v[1],"s"!==b&&(a.seconds=k(e)),a.meridian=s.getHours()<12?v[0]:v[1]}else a.hours=null,a.minutes=null,a.seconds=null,a.meridian=v[0]}function o(a){s=q(s,a),l()}function p(a,b){return q(a,60*b)}function q(a,b){var c=new Date(a.getTime()+1e3*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes(),c.getSeconds()),d}function r(){return(null===a.hours||""===a.hours)&&(null===a.minutes||""===a.minutes)&&(!a.showSeconds||a.showSeconds&&(null===a.seconds||""===a.seconds))}var s=new Date,t=[],u={$setViewValue:angular.noop},v=angular.isDefined(c.meridians)?a.$parent.$eval(c.meridians):g.meridians||f.DATETIME_FORMATS.AMPMS,w=angular.isDefined(c.padHours)?a.$parent.$eval(c.padHours):!0;a.tabindex=angular.isDefined(c.tabindex)?c.tabindex:0,b.removeAttr("tabindex"),this.init=function(b,d){u=b,u.$render=this.render,u.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),f=d.eq(1),h=d.eq(2),i=angular.isDefined(c.mousewheel)?a.$parent.$eval(c.mousewheel):g.mousewheel;i&&this.setupMousewheelEvents(e,f,h);var j=angular.isDefined(c.arrowkeys)?a.$parent.$eval(c.arrowkeys):g.arrowkeys;j&&this.setupArrowkeyEvents(e,f,h),a.readonlyInput=angular.isDefined(c.readonlyInput)?a.$parent.$eval(c.readonlyInput):g.readonlyInput,this.setupInputEvents(e,f,h)};var x=g.hourStep;c.hourStep&&t.push(a.$parent.$watch(d(c.hourStep),function(a){x=+a}));var y=g.minuteStep;c.minuteStep&&t.push(a.$parent.$watch(d(c.minuteStep),function(a){y=+a}));var z;t.push(a.$parent.$watch(d(c.min),function(a){var b=new Date(a);z=isNaN(b)?void 0:b}));var A;t.push(a.$parent.$watch(d(c.max),function(a){var b=new Date(a);A=isNaN(b)?void 0:b}));var B=!1;c.ngDisabled&&t.push(a.$parent.$watch(d(c.ngDisabled),function(a){B=a})),a.noIncrementHours=function(){var a=p(s,60*x);return B||a>A||s>a&&z>a},a.noDecrementHours=function(){var a=p(s,60*-x);return B||z>a||a>s&&a>A},a.noIncrementMinutes=function(){var a=p(s,y);return B||a>A||s>a&&z>a},a.noDecrementMinutes=function(){var a=p(s,-y);return B||z>a||a>s&&a>A},a.noIncrementSeconds=function(){var a=q(s,C);return B||a>A||s>a&&z>a},a.noDecrementSeconds=function(){var a=q(s,-C);return B||z>a||a>s&&a>A},a.noToggleMeridian=function(){return s.getHours()<12?B||p(s,720)>A:B||p(s,-720)0};b.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()}),d.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementSeconds():a.decrementSeconds()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c,d){b.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply()))}),c.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply()))}),d.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementSeconds(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementSeconds(),a.$apply()))})},this.setupInputEvents=function(b,c,d){if(a.readonlyInput)return a.updateHours=angular.noop,a.updateMinutes=angular.noop,void(a.updateSeconds=angular.noop);var e=function(b,c,d){u.$setViewValue(null),u.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c),angular.isDefined(d)&&(a.invalidSeconds=d)};a.updateHours=function(){var a=h(),b=i();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(a),s.setMinutes(b),z>s||s>A?e(!0):l("h")):e(!0)},b.bind("blur",function(b){u.$setTouched(),r()?m():null===a.hours||""===a.hours?e(!0):!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=k(a.hours,!w)})}),a.updateMinutes=function(){var a=i(),b=h();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(b),s.setMinutes(a),z>s||s>A?e(void 0,!0):l("m")):e(void 0,!0)},c.bind("blur",function(b){u.$setTouched(),r()?m():null===a.minutes?e(void 0,!0):!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=k(a.minutes)})}),a.updateSeconds=function(){var a=j();u.$setDirty(),angular.isDefined(a)?(s.setSeconds(a),l("s")):e(void 0,void 0,!0)},d.bind("blur",function(b){r()?m():!a.invalidSeconds&&a.seconds<10&&a.$apply(function(){a.seconds=k(a.seconds)})})},this.render=function(){var b=u.$viewValue;isNaN(b)?(u.$setValidity("time",!1),e.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(s=b),z>s||s>A?(u.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):m(),n())},a.showSpinners=angular.isDefined(c.showSpinners)?a.$parent.$eval(c.showSpinners):g.showSpinners,a.incrementHours=function(){a.noIncrementHours()||o(60*x*60)},a.decrementHours=function(){a.noDecrementHours()||o(60*-x*60)},a.incrementMinutes=function(){a.noIncrementMinutes()||o(60*y)},a.decrementMinutes=function(){a.noDecrementMinutes()||o(60*-y)},a.incrementSeconds=function(){a.noIncrementSeconds()||o(C)},a.decrementSeconds=function(){a.noDecrementSeconds()||o(-C)},a.toggleMeridian=function(){var b=i(),c=h();a.noToggleMeridian()||(angular.isDefined(b)&&angular.isDefined(c)?o(720*(s.getHours()<12?60:-60)):a.meridian=a.meridian===v[0]?v[1]:v[0])},a.blur=function(){u.$setTouched()},a.$on("$destroy",function(){for(;t.length;)t.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(a){return{require:["uibTimepicker","?^ngModel"],controller:"UibTimepickerController",controllerAs:"timepicker",replace:!0,scope:{},templateUrl:function(b,c){return c.templateUrl||a.templateUrl},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){O.moveInProgress||(O.moveInProgress=!0,O.$digest()),Z()}function o(){O.position=E?l.offset(b):l.position(b),O.position.top+=b.prop("offsetHeight")}var p,q,r=[9,13,27,38,40],s=200,t=a.$eval(c.typeaheadMinLength);t||0===t||(t=1),a.$watch(c.typeaheadMinLength,function(a){t=a||0===a?a:1});var u=a.$eval(c.typeaheadWaitMs)||0,v=a.$eval(c.typeaheadEditable)!==!1;a.$watch(c.typeaheadEditable,function(a){v=a!==!1});var w,x,y=e(c.typeaheadLoading).assign||angular.noop,z=c.typeaheadShouldSelect?e(c.typeaheadShouldSelect):function(a,b){var c=b.$event;return 13===c.which||9===c.which},A=e(c.typeaheadOnSelect),B=angular.isDefined(c.typeaheadSelectOnBlur)?a.$eval(c.typeaheadSelectOnBlur):!1,C=e(c.typeaheadNoResults).assign||angular.noop,D=c.typeaheadInputFormatter?e(c.typeaheadInputFormatter):void 0,E=c.typeaheadAppendToBody?a.$eval(c.typeaheadAppendToBody):!1,F=c.typeaheadAppendTo?a.$eval(c.typeaheadAppendTo):null,G=a.$eval(c.typeaheadFocusFirst)!==!1,H=c.typeaheadSelectOnExact?a.$eval(c.typeaheadSelectOnExact):!1,I=e(c.typeaheadIsOpen).assign||angular.noop,J=a.$eval(c.typeaheadShowHint)||!1,K=e(c.ngModel),L=e(c.ngModel+"($$$p)"),M=function(b,c){return angular.isFunction(K(a))&&q&&q.$options&&q.$options.getterSetter?L(b,{$$$p:c}):K.assign(b,c)},N=m.parse(c.uibTypeahead),O=a.$new(),P=a.$on("$destroy",function(){O.$destroy()});O.$on("$destroy",P);var Q="typeahead-"+O.$id+"-"+Math.floor(1e4*Math.random());b.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":Q});var R,S;J&&(R=angular.element("
      "),R.css("position","relative"),b.after(R),S=b.clone(),S.attr("placeholder",""),S.attr("tabindex","-1"),S.val(""),S.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),b.css({position:"relative","vertical-align":"top","background-color":"transparent"}),R.append(S),S.after(b));var T=angular.element("
      ");T.attr({id:Q,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(c.typeaheadTemplateUrl)&&T.attr("template-url",c.typeaheadTemplateUrl),angular.isDefined(c.typeaheadPopupTemplateUrl)&&T.attr("popup-template-url",c.typeaheadPopupTemplateUrl);var U=function(){J&&S.val("")},V=function(){O.matches=[],O.activeIdx=-1,b.attr("aria-expanded",!1),U()},W=function(a){return Q+"-option-"+a};O.$watch("activeIdx",function(a){0>a?b.removeAttr("aria-activedescendant"):b.attr("aria-activedescendant",W(a))});var X=function(a,b){return O.matches.length>b&&a?a.toUpperCase()===O.matches[b].label.toUpperCase():!1},Y=function(c,d){var e={$viewValue:c};y(a,!0),C(a,!1),f.when(N.source(a,e)).then(function(f){var g=c===p.$viewValue;if(g&&w)if(f&&f.length>0){O.activeIdx=G?0:-1,C(a,!1),O.matches.length=0;for(var h=0;h0&&i.slice(0,c.length).toUpperCase()===c.toUpperCase()?S.val(c+i.slice(c.length)):S.val("")}}else V(),C(a,!0);g&&y(a,!1)},function(){V(),y(a,!1),C(a,!0)})};E&&(angular.element(i).on("resize",n),h.find("body").on("scroll",n));var Z=k(function(){O.matches.length&&o(),O.moveInProgress=!1},s);O.moveInProgress=!1,O.query=void 0;var $,_=function(a){$=g(function(){Y(a)},u)},aa=function(){$&&g.cancel($)};V(),O.assignIsOpen=function(b){I(a,b)},O.select=function(d,e){var f,h,i={};x=!0,i[N.itemName]=h=O.matches[d].model,f=N.modelMapper(a,i),M(a,f),p.$setValidity("editable",!0),p.$setValidity("parse",!0),A(a,{$item:h,$model:f,$label:N.viewMapper(a,i),$event:e}),V(),O.$eval(c.typeaheadFocusOnSelect)!==!1&&g(function(){b[0].focus()},0,!1)},b.on("keydown",function(b){if(0!==O.matches.length&&-1!==r.indexOf(b.which)){var c=z(a,{$event:b});if(-1===O.activeIdx&&c||9===b.which&&b.shiftKey)return V(),void O.$digest();b.preventDefault();var d;switch(b.which){case 27:b.stopPropagation(),V(),a.$digest();break;case 38:O.activeIdx=(O.activeIdx>0?O.activeIdx:O.matches.length)-1,O.$digest(),d=T.find("li")[O.activeIdx],d.parentNode.scrollTop=d.offsetTop;break;case 40:O.activeIdx=(O.activeIdx+1)%O.matches.length,O.$digest(),d=T.find("li")[O.activeIdx],d.parentNode.scrollTop=d.offsetTop;break;default:c&&O.$apply(function(){angular.isNumber(O.debounceUpdate)||angular.isObject(O.debounceUpdate)?k(function(){O.select(O.activeIdx,b)},angular.isNumber(O.debounceUpdate)?O.debounceUpdate:O.debounceUpdate["default"]):O.select(O.activeIdx,b)})}}}),b.bind("focus",function(a){w=!0,0!==t||p.$viewValue||g(function(){Y(p.$viewValue,a)},0)}),b.bind("blur",function(a){B&&O.matches.length&&-1!==O.activeIdx&&!x&&(x=!0,O.$apply(function(){angular.isObject(O.debounceUpdate)&&angular.isNumber(O.debounceUpdate.blur)?k(function(){O.select(O.activeIdx,a)},O.debounceUpdate.blur):O.select(O.activeIdx,a)})),!v&&p.$error.editable&&(p.$setViewValue(),p.$setValidity("editable",!0),p.$setValidity("parse",!0),b.val("")),w=!1,x=!1});var ba=function(c){b[0]!==c.target&&3!==c.which&&0!==O.matches.length&&(V(),j.$$phase||a.$digest())};h.on("click",ba),a.$on("$destroy",function(){h.off("click",ba),(E||F)&&ca.remove(),E&&(angular.element(i).off("resize",n),h.find("body").off("scroll",n)),T.remove(),J&&R.remove()});var ca=d(T)(O);E?h.find("body").append(ca):F?angular.element(F).eq(0).append(ca):b.after(ca),this.init=function(b,c){p=b,q=c,O.debounceUpdate=p.$options&&e(p.$options.debounce)(a),p.$parsers.unshift(function(b){return w=!0,0===t||b&&b.length>=t?u>0?(aa(),_(b)):Y(b):(y(a,!1),aa(),V()),v?b:b?void p.$setValidity("editable",!1):(p.$setValidity("editable",!0),null)}),p.$formatters.push(function(b){var c,d,e={};return v||p.$setValidity("editable",!0),D?(e.$model=b,D(a,e)):(e[N.itemName]=b,c=N.viewMapper(a,e),e[N.itemName]=void 0,d=N.viewMapper(a,e),c!==d?c:b)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","^?ngModelOptions","uibTypeahead"],link:function(a,b,c,d){d[2].init(d[0],d[1])}}}).directive("uibTypeaheadPopup",["$$debounce",function(a){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(b,c,d){b.templateUrl=d.templateUrl,b.isOpen=function(){var a=b.matches.length>0;return b.assignIsOpen({isOpen:a}),a},b.isActive=function(a){return b.active===a},b.selectActive=function(a){b.active=a},b.selectMatch=function(c,d){var e=b.debounce();angular.isNumber(e)||angular.isObject(e)?a(function(){b.select({activeIdx:c,evt:d})},angular.isNumber(e)?e:e["default"]):b.select({activeIdx:c,evt:d})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"uib/template/typeahead/typeahead-match.html";a(g).then(function(a){var c=angular.element(a.trim());e.replaceWith(c),b(c)(d)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"$&"):b,f||(b=a.trustAsHtml(b)),b}}]),angular.module("uib/template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("uib/template/accordion/accordion-group.html",'
      \n \n
      \n
      \n
      \n
      \n')}]),angular.module("uib/template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("uib/template/accordion/accordion.html",'
      ')}]),angular.module("uib/template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("uib/template/alert/alert.html",'\n')}]),angular.module("uib/template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("uib/template/carousel/carousel.html",'\n'); -}]),angular.module("uib/template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("uib/template/carousel/slide.html",'
      \n')}]),angular.module("uib/template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/datepicker.html",'
      \n \n \n \n
      \n')}]),angular.module("uib/template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/day.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      {{::label.abbr}}
      {{ weekNumbers[$index] }}\n \n
      \n')}]),angular.module("uib/template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/month.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n
      \n \n
      \n')}]),angular.module("uib/template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/year.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n
      \n \n
      \n')}]),angular.module("uib/template/datepickerPopup/popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepickerPopup/popup.html",'
      \n \n
      \n')}]),angular.module("uib/template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("uib/template/modal/backdrop.html",'\n')}]),angular.module("uib/template/modal/window.html",[]).run(["$templateCache",function(a){a.put("uib/template/modal/window.html",'\n')}]),angular.module("uib/template/pager/pager.html",[]).run(["$templateCache",function(a){a.put("uib/template/pager/pager.html",'\n')}]),angular.module("uib/template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("uib/template/pagination/pagination.html",'\n')}]),angular.module("uib/template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-html-popup.html",'
      \n
      \n
      \n
      \n')}]),angular.module("uib/template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-popup.html",'
      \n
      \n
      \n
      \n')}]),angular.module("uib/template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-template-popup.html",'
      \n
      \n
      \n
      \n')}]),angular.module("uib/template/popover/popover-html.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover-html.html",'
      \n
      \n\n
      \n

      \n
      \n
      \n
      \n')}]),angular.module("uib/template/popover/popover-template.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover-template.html",'
      \n
      \n\n
      \n

      \n
      \n
      \n
      \n')}]),angular.module("uib/template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover.html",'
      \n
      \n\n
      \n

      \n
      \n
      \n
      \n')}]),angular.module("uib/template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/bar.html",'
      \n')}]),angular.module("uib/template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/progress.html",'
      ')}]),angular.module("uib/template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/progressbar.html",'
      \n
      \n
      \n')}]),angular.module("uib/template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("uib/template/rating/rating.html",'\n ({{ $index < value ? \'*\' : \' \' }})\n \n\n')}]),angular.module("uib/template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("uib/template/tabs/tab.html",'\n')}]),angular.module("uib/template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("uib/template/tabs/tabset.html",'
      \n \n
      \n
      \n
      \n
      \n
      \n')}]),angular.module("uib/template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("uib/template/timepicker/timepicker.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
        
      \n \n :\n \n :\n \n
        
      \n')}]),angular.module("uib/template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("uib/template/typeahead/typeahead-match.html",'\n')}]),angular.module("uib/template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/typeahead/typeahead-popup.html",'\n')}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend(''),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend(''),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend(''),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend(''),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend(''),angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend(''),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend(''),angular.$$uibTypeaheadCss=!0}); \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap.js deleted file mode 100644 index 8ec4bbcb37..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap.js +++ /dev/null @@ -1,6924 +0,0 @@ -/* - * angular-ui-bootstrap - * http://angular-ui.github.io/bootstrap/ - - * Version: 1.3.3 - 2016-05-22 - * License: MIT - */angular.module("ui.bootstrap", ["ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]); -angular.module('ui.bootstrap.collapse', []) - - .directive('uibCollapse', ['$animate', '$q', '$parse', '$injector', function($animate, $q, $parse, $injector) { - var $animateCss = $injector.has('$animateCss') ? $injector.get('$animateCss') : null; - return { - link: function(scope, element, attrs) { - var expandingExpr = $parse(attrs.expanding), - expandedExpr = $parse(attrs.expanded), - collapsingExpr = $parse(attrs.collapsing), - collapsedExpr = $parse(attrs.collapsed); - - if (!scope.$eval(attrs.uibCollapse)) { - element.addClass('in') - .addClass('collapse') - .attr('aria-expanded', true) - .attr('aria-hidden', false) - .css({height: 'auto'}); - } - - function expand() { - if (element.hasClass('collapse') && element.hasClass('in')) { - return; - } - - $q.resolve(expandingExpr(scope)) - .then(function() { - element.removeClass('collapse') - .addClass('collapsing') - .attr('aria-expanded', true) - .attr('aria-hidden', false); - - if ($animateCss) { - $animateCss(element, { - addClass: 'in', - easing: 'ease', - to: { height: element[0].scrollHeight + 'px' } - }).start()['finally'](expandDone); - } else { - $animate.addClass(element, 'in', { - to: { height: element[0].scrollHeight + 'px' } - }).then(expandDone); - } - }); - } - - function expandDone() { - element.removeClass('collapsing') - .addClass('collapse') - .css({height: 'auto'}); - expandedExpr(scope); - } - - function collapse() { - if (!element.hasClass('collapse') && !element.hasClass('in')) { - return collapseDone(); - } - - $q.resolve(collapsingExpr(scope)) - .then(function() { - element - // IMPORTANT: The height must be set before adding "collapsing" class. - // Otherwise, the browser attempts to animate from height 0 (in - // collapsing class) to the given height here. - .css({height: element[0].scrollHeight + 'px'}) - // initially all panel collapse have the collapse class, this removal - // prevents the animation from jumping to collapsed state - .removeClass('collapse') - .addClass('collapsing') - .attr('aria-expanded', false) - .attr('aria-hidden', true); - - if ($animateCss) { - $animateCss(element, { - removeClass: 'in', - to: {height: '0'} - }).start()['finally'](collapseDone); - } else { - $animate.removeClass(element, 'in', { - to: {height: '0'} - }).then(collapseDone); - } - }); - } - - function collapseDone() { - element.css({height: '0'}); // Required so that collapse works when animation is disabled - element.removeClass('collapsing') - .addClass('collapse'); - collapsedExpr(scope); - } - - scope.$watch(attrs.uibCollapse, function(shouldCollapse) { - if (shouldCollapse) { - collapse(); - } else { - expand(); - } - }); - } - }; - }]); - -angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse']) - -.constant('uibAccordionConfig', { - closeOthers: true -}) - -.controller('UibAccordionController', ['$scope', '$attrs', 'uibAccordionConfig', function($scope, $attrs, accordionConfig) { - // This array keeps track of the accordion groups - this.groups = []; - - // Ensure that all the groups in this accordion are closed, unless close-others explicitly says not to - this.closeOthers = function(openGroup) { - var closeOthers = angular.isDefined($attrs.closeOthers) ? - $scope.$eval($attrs.closeOthers) : accordionConfig.closeOthers; - if (closeOthers) { - angular.forEach(this.groups, function(group) { - if (group !== openGroup) { - group.isOpen = false; - } - }); - } - }; - - // This is called from the accordion-group directive to add itself to the accordion - this.addGroup = function(groupScope) { - var that = this; - this.groups.push(groupScope); - - groupScope.$on('$destroy', function(event) { - that.removeGroup(groupScope); - }); - }; - - // This is called from the accordion-group directive when to remove itself - this.removeGroup = function(group) { - var index = this.groups.indexOf(group); - if (index !== -1) { - this.groups.splice(index, 1); - } - }; -}]) - -// The accordion directive simply sets up the directive controller -// and adds an accordion CSS class to itself element. -.directive('uibAccordion', function() { - return { - controller: 'UibAccordionController', - controllerAs: 'accordion', - transclude: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/accordion/accordion.html'; - } - }; -}) - -// The accordion-group directive indicates a block of html that will expand and collapse in an accordion -.directive('uibAccordionGroup', function() { - return { - require: '^uibAccordion', // We need this directive to be inside an accordion - transclude: true, // It transcludes the contents of the directive into the template - replace: true, // The element containing the directive will be replaced with the template - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/accordion/accordion-group.html'; - }, - scope: { - heading: '@', // Interpolate the heading attribute onto this scope - panelClass: '@?', // Ditto with panelClass - isOpen: '=?', - isDisabled: '=?' - }, - controller: function() { - this.setHeading = function(element) { - this.heading = element; - }; - }, - link: function(scope, element, attrs, accordionCtrl) { - accordionCtrl.addGroup(scope); - - scope.openClass = attrs.openClass || 'panel-open'; - scope.panelClass = attrs.panelClass || 'panel-default'; - scope.$watch('isOpen', function(value) { - element.toggleClass(scope.openClass, !!value); - if (value) { - accordionCtrl.closeOthers(scope); - } - }); - - scope.toggleOpen = function($event) { - if (!scope.isDisabled) { - if (!$event || $event.which === 32) { - scope.isOpen = !scope.isOpen; - } - } - }; - - var id = 'accordiongroup-' + scope.$id + '-' + Math.floor(Math.random() * 10000); - scope.headingId = id + '-tab'; - scope.panelId = id + '-panel'; - } - }; -}) - -// Use accordion-heading below an accordion-group to provide a heading containing HTML -.directive('uibAccordionHeading', function() { - return { - transclude: true, // Grab the contents to be used as the heading - template: '', // In effect remove this element! - replace: true, - require: '^uibAccordionGroup', - link: function(scope, element, attrs, accordionGroupCtrl, transclude) { - // Pass the heading to the accordion-group controller - // so that it can be transcluded into the right place in the template - // [The second parameter to transclude causes the elements to be cloned so that they work in ng-repeat] - accordionGroupCtrl.setHeading(transclude(scope, angular.noop)); - } - }; -}) - -// Use in the accordion-group template to indicate where you want the heading to be transcluded -// You must provide the property on the accordion-group controller that will hold the transcluded element -.directive('uibAccordionTransclude', function() { - return { - require: '^uibAccordionGroup', - link: function(scope, element, attrs, controller) { - scope.$watch(function() { return controller[attrs.uibAccordionTransclude]; }, function(heading) { - if (heading) { - var elem = angular.element(element[0].querySelector(getHeaderSelectors())); - elem.html(''); - elem.append(heading); - } - }); - } - }; - - function getHeaderSelectors() { - return 'uib-accordion-header,' + - 'data-uib-accordion-header,' + - 'x-uib-accordion-header,' + - 'uib\\:accordion-header,' + - '[uib-accordion-header],' + - '[data-uib-accordion-header],' + - '[x-uib-accordion-header]'; - } -}); - -angular.module('ui.bootstrap.alert', []) - -.controller('UibAlertController', ['$scope', '$attrs', '$interpolate', '$timeout', function($scope, $attrs, $interpolate, $timeout) { - $scope.closeable = !!$attrs.close; - - var dismissOnTimeout = angular.isDefined($attrs.dismissOnTimeout) ? - $interpolate($attrs.dismissOnTimeout)($scope.$parent) : null; - - if (dismissOnTimeout) { - $timeout(function() { - $scope.close(); - }, parseInt(dismissOnTimeout, 10)); - } -}]) - -.directive('uibAlert', function() { - return { - controller: 'UibAlertController', - controllerAs: 'alert', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/alert/alert.html'; - }, - transclude: true, - replace: true, - scope: { - type: '@', - close: '&' - } - }; -}); - -angular.module('ui.bootstrap.buttons', []) - -.constant('uibButtonConfig', { - activeClass: 'active', - toggleEvent: 'click' -}) - -.controller('UibButtonsController', ['uibButtonConfig', function(buttonConfig) { - this.activeClass = buttonConfig.activeClass || 'active'; - this.toggleEvent = buttonConfig.toggleEvent || 'click'; -}]) - -.directive('uibBtnRadio', ['$parse', function($parse) { - return { - require: ['uibBtnRadio', 'ngModel'], - controller: 'UibButtonsController', - controllerAs: 'buttons', - link: function(scope, element, attrs, ctrls) { - var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - var uncheckableExpr = $parse(attrs.uibUncheckable); - - element.find('input').css({display: 'none'}); - - //model -> UI - ngModelCtrl.$render = function() { - element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, scope.$eval(attrs.uibBtnRadio))); - }; - - //ui->model - element.on(buttonsCtrl.toggleEvent, function() { - if (attrs.disabled) { - return; - } - - var isActive = element.hasClass(buttonsCtrl.activeClass); - - if (!isActive || angular.isDefined(attrs.uncheckable)) { - scope.$apply(function() { - ngModelCtrl.$setViewValue(isActive ? null : scope.$eval(attrs.uibBtnRadio)); - ngModelCtrl.$render(); - }); - } - }); - - if (attrs.uibUncheckable) { - scope.$watch(uncheckableExpr, function(uncheckable) { - attrs.$set('uncheckable', uncheckable ? '' : undefined); - }); - } - } - }; -}]) - -.directive('uibBtnCheckbox', function() { - return { - require: ['uibBtnCheckbox', 'ngModel'], - controller: 'UibButtonsController', - controllerAs: 'button', - link: function(scope, element, attrs, ctrls) { - var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - element.find('input').css({display: 'none'}); - - function getTrueValue() { - return getCheckboxValue(attrs.btnCheckboxTrue, true); - } - - function getFalseValue() { - return getCheckboxValue(attrs.btnCheckboxFalse, false); - } - - function getCheckboxValue(attribute, defaultValue) { - return angular.isDefined(attribute) ? scope.$eval(attribute) : defaultValue; - } - - //model -> UI - ngModelCtrl.$render = function() { - element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue())); - }; - - //ui->model - element.on(buttonsCtrl.toggleEvent, function() { - if (attrs.disabled) { - return; - } - - scope.$apply(function() { - ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass) ? getFalseValue() : getTrueValue()); - ngModelCtrl.$render(); - }); - }); - } - }; -}); - -angular.module('ui.bootstrap.carousel', []) - -.controller('UibCarouselController', ['$scope', '$element', '$interval', '$timeout', '$animate', function($scope, $element, $interval, $timeout, $animate) { - var self = this, - slides = self.slides = $scope.slides = [], - SLIDE_DIRECTION = 'uib-slideDirection', - currentIndex = $scope.active, - currentInterval, isPlaying, bufferedTransitions = []; - - var destroyed = false; - - self.addSlide = function(slide, element) { - slides.push({ - slide: slide, - element: element - }); - slides.sort(function(a, b) { - return +a.slide.index - +b.slide.index; - }); - //if this is the first slide or the slide is set to active, select it - if (slide.index === $scope.active || slides.length === 1 && !angular.isNumber($scope.active)) { - if ($scope.$currentTransition) { - $scope.$currentTransition = null; - } - - currentIndex = slide.index; - $scope.active = slide.index; - setActive(currentIndex); - self.select(slides[findSlideIndex(slide)]); - if (slides.length === 1) { - $scope.play(); - } - } - }; - - self.getCurrentIndex = function() { - for (var i = 0; i < slides.length; i++) { - if (slides[i].slide.index === currentIndex) { - return i; - } - } - }; - - self.next = $scope.next = function() { - var newIndex = (self.getCurrentIndex() + 1) % slides.length; - - if (newIndex === 0 && $scope.noWrap()) { - $scope.pause(); - return; - } - - return self.select(slides[newIndex], 'next'); - }; - - self.prev = $scope.prev = function() { - var newIndex = self.getCurrentIndex() - 1 < 0 ? slides.length - 1 : self.getCurrentIndex() - 1; - - if ($scope.noWrap() && newIndex === slides.length - 1) { - $scope.pause(); - return; - } - - return self.select(slides[newIndex], 'prev'); - }; - - self.removeSlide = function(slide) { - var index = findSlideIndex(slide); - - var bufferedIndex = bufferedTransitions.indexOf(slides[index]); - if (bufferedIndex !== -1) { - bufferedTransitions.splice(bufferedIndex, 1); - } - - //get the index of the slide inside the carousel - slides.splice(index, 1); - if (slides.length > 0 && currentIndex === index) { - if (index >= slides.length) { - currentIndex = slides.length - 1; - $scope.active = currentIndex; - setActive(currentIndex); - self.select(slides[slides.length - 1]); - } else { - currentIndex = index; - $scope.active = currentIndex; - setActive(currentIndex); - self.select(slides[index]); - } - } else if (currentIndex > index) { - currentIndex--; - $scope.active = currentIndex; - } - - //clean the active value when no more slide - if (slides.length === 0) { - currentIndex = null; - $scope.active = null; - clearBufferedTransitions(); - } - }; - - /* direction: "prev" or "next" */ - self.select = $scope.select = function(nextSlide, direction) { - var nextIndex = findSlideIndex(nextSlide.slide); - //Decide direction if it's not given - if (direction === undefined) { - direction = nextIndex > self.getCurrentIndex() ? 'next' : 'prev'; - } - //Prevent this user-triggered transition from occurring if there is already one in progress - if (nextSlide.slide.index !== currentIndex && - !$scope.$currentTransition) { - goNext(nextSlide.slide, nextIndex, direction); - } else if (nextSlide && nextSlide.slide.index !== currentIndex && $scope.$currentTransition) { - bufferedTransitions.push(slides[nextIndex]); - } - }; - - /* Allow outside people to call indexOf on slides array */ - $scope.indexOfSlide = function(slide) { - return +slide.slide.index; - }; - - $scope.isActive = function(slide) { - return $scope.active === slide.slide.index; - }; - - $scope.isPrevDisabled = function() { - return $scope.active === 0 && $scope.noWrap(); - }; - - $scope.isNextDisabled = function() { - return $scope.active === slides.length - 1 && $scope.noWrap(); - }; - - $scope.pause = function() { - if (!$scope.noPause) { - isPlaying = false; - resetTimer(); - } - }; - - $scope.play = function() { - if (!isPlaying) { - isPlaying = true; - restartTimer(); - } - }; - - $scope.$on('$destroy', function() { - destroyed = true; - resetTimer(); - }); - - $scope.$watch('noTransition', function(noTransition) { - $animate.enabled($element, !noTransition); - }); - - $scope.$watch('interval', restartTimer); - - $scope.$watchCollection('slides', resetTransition); - - $scope.$watch('active', function(index) { - if (angular.isNumber(index) && currentIndex !== index) { - for (var i = 0; i < slides.length; i++) { - if (slides[i].slide.index === index) { - index = i; - break; - } - } - - var slide = slides[index]; - if (slide) { - setActive(index); - self.select(slides[index]); - currentIndex = index; - } - } - }); - - function clearBufferedTransitions() { - while (bufferedTransitions.length) { - bufferedTransitions.shift(); - } - } - - function getSlideByIndex(index) { - for (var i = 0, l = slides.length; i < l; ++i) { - if (slides[i].index === index) { - return slides[i]; - } - } - } - - function setActive(index) { - for (var i = 0; i < slides.length; i++) { - slides[i].slide.active = i === index; - } - } - - function goNext(slide, index, direction) { - if (destroyed) { - return; - } - - angular.extend(slide, {direction: direction}); - angular.extend(slides[currentIndex].slide || {}, {direction: direction}); - if ($animate.enabled($element) && !$scope.$currentTransition && - slides[index].element && self.slides.length > 1) { - slides[index].element.data(SLIDE_DIRECTION, slide.direction); - var currentIdx = self.getCurrentIndex(); - - if (angular.isNumber(currentIdx) && slides[currentIdx].element) { - slides[currentIdx].element.data(SLIDE_DIRECTION, slide.direction); - } - - $scope.$currentTransition = true; - $animate.on('addClass', slides[index].element, function(element, phase) { - if (phase === 'close') { - $scope.$currentTransition = null; - $animate.off('addClass', element); - if (bufferedTransitions.length) { - var nextSlide = bufferedTransitions.pop().slide; - var nextIndex = nextSlide.index; - var nextDirection = nextIndex > self.getCurrentIndex() ? 'next' : 'prev'; - clearBufferedTransitions(); - - goNext(nextSlide, nextIndex, nextDirection); - } - } - }); - } - - $scope.active = slide.index; - currentIndex = slide.index; - setActive(index); - - //every time you change slides, reset the timer - restartTimer(); - } - - function findSlideIndex(slide) { - for (var i = 0; i < slides.length; i++) { - if (slides[i].slide === slide) { - return i; - } - } - } - - function resetTimer() { - if (currentInterval) { - $interval.cancel(currentInterval); - currentInterval = null; - } - } - - function resetTransition(slides) { - if (!slides.length) { - $scope.$currentTransition = null; - clearBufferedTransitions(); - } - } - - function restartTimer() { - resetTimer(); - var interval = +$scope.interval; - if (!isNaN(interval) && interval > 0) { - currentInterval = $interval(timerFn, interval); - } - } - - function timerFn() { - var interval = +$scope.interval; - if (isPlaying && !isNaN(interval) && interval > 0 && slides.length) { - $scope.next(); - } else { - $scope.pause(); - } - } -}]) - -.directive('uibCarousel', function() { - return { - transclude: true, - replace: true, - controller: 'UibCarouselController', - controllerAs: 'carousel', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/carousel/carousel.html'; - }, - scope: { - active: '=', - interval: '=', - noTransition: '=', - noPause: '=', - noWrap: '&' - } - }; -}) - -.directive('uibSlide', function() { - return { - require: '^uibCarousel', - transclude: true, - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/carousel/slide.html'; - }, - scope: { - actual: '=?', - index: '=?' - }, - link: function (scope, element, attrs, carouselCtrl) { - carouselCtrl.addSlide(scope, element); - //when the scope is destroyed then remove the slide from the current slides array - scope.$on('$destroy', function() { - carouselCtrl.removeSlide(scope); - }); - } - }; -}) - -.animation('.item', ['$animateCss', -function($animateCss) { - var SLIDE_DIRECTION = 'uib-slideDirection'; - - function removeClass(element, className, callback) { - element.removeClass(className); - if (callback) { - callback(); - } - } - - return { - beforeAddClass: function(element, className, done) { - if (className === 'active') { - var stopped = false; - var direction = element.data(SLIDE_DIRECTION); - var directionClass = direction === 'next' ? 'left' : 'right'; - var removeClassFn = removeClass.bind(this, element, - directionClass + ' ' + direction, done); - element.addClass(direction); - - $animateCss(element, {addClass: directionClass}) - .start() - .done(removeClassFn); - - return function() { - stopped = true; - }; - } - done(); - }, - beforeRemoveClass: function (element, className, done) { - if (className === 'active') { - var stopped = false; - var direction = element.data(SLIDE_DIRECTION); - var directionClass = direction === 'next' ? 'left' : 'right'; - var removeClassFn = removeClass.bind(this, element, directionClass, done); - - $animateCss(element, {addClass: directionClass}) - .start() - .done(removeClassFn); - - return function() { - stopped = true; - }; - } - done(); - } - }; -}]); - -angular.module('ui.bootstrap.dateparser', []) - -.service('uibDateParser', ['$log', '$locale', 'dateFilter', 'orderByFilter', function($log, $locale, dateFilter, orderByFilter) { - // Pulled from https://github.com/mbostock/d3/blob/master/src/format/requote.js - var SPECIAL_CHARACTERS_REGEXP = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; - - var localeId; - var formatCodeToRegex; - - this.init = function() { - localeId = $locale.id; - - this.parsers = {}; - this.formatters = {}; - - formatCodeToRegex = [ - { - key: 'yyyy', - regex: '\\d{4}', - apply: function(value) { this.year = +value; }, - formatter: function(date) { - var _date = new Date(); - _date.setFullYear(Math.abs(date.getFullYear())); - return dateFilter(_date, 'yyyy'); - } - }, - { - key: 'yy', - regex: '\\d{2}', - apply: function(value) { value = +value; this.year = value < 69 ? value + 2000 : value + 1900; }, - formatter: function(date) { - var _date = new Date(); - _date.setFullYear(Math.abs(date.getFullYear())); - return dateFilter(_date, 'yy'); - } - }, - { - key: 'y', - regex: '\\d{1,4}', - apply: function(value) { this.year = +value; }, - formatter: function(date) { - var _date = new Date(); - _date.setFullYear(Math.abs(date.getFullYear())); - return dateFilter(_date, 'y'); - } - }, - { - key: 'M!', - regex: '0?[1-9]|1[0-2]', - apply: function(value) { this.month = value - 1; }, - formatter: function(date) { - var value = date.getMonth(); - if (/^[0-9]$/.test(value)) { - return dateFilter(date, 'MM'); - } - - return dateFilter(date, 'M'); - } - }, - { - key: 'MMMM', - regex: $locale.DATETIME_FORMATS.MONTH.join('|'), - apply: function(value) { this.month = $locale.DATETIME_FORMATS.MONTH.indexOf(value); }, - formatter: function(date) { return dateFilter(date, 'MMMM'); } - }, - { - key: 'MMM', - regex: $locale.DATETIME_FORMATS.SHORTMONTH.join('|'), - apply: function(value) { this.month = $locale.DATETIME_FORMATS.SHORTMONTH.indexOf(value); }, - formatter: function(date) { return dateFilter(date, 'MMM'); } - }, - { - key: 'MM', - regex: '0[1-9]|1[0-2]', - apply: function(value) { this.month = value - 1; }, - formatter: function(date) { return dateFilter(date, 'MM'); } - }, - { - key: 'M', - regex: '[1-9]|1[0-2]', - apply: function(value) { this.month = value - 1; }, - formatter: function(date) { return dateFilter(date, 'M'); } - }, - { - key: 'd!', - regex: '[0-2]?[0-9]{1}|3[0-1]{1}', - apply: function(value) { this.date = +value; }, - formatter: function(date) { - var value = date.getDate(); - if (/^[1-9]$/.test(value)) { - return dateFilter(date, 'dd'); - } - - return dateFilter(date, 'd'); - } - }, - { - key: 'dd', - regex: '[0-2][0-9]{1}|3[0-1]{1}', - apply: function(value) { this.date = +value; }, - formatter: function(date) { return dateFilter(date, 'dd'); } - }, - { - key: 'd', - regex: '[1-2]?[0-9]{1}|3[0-1]{1}', - apply: function(value) { this.date = +value; }, - formatter: function(date) { return dateFilter(date, 'd'); } - }, - { - key: 'EEEE', - regex: $locale.DATETIME_FORMATS.DAY.join('|'), - formatter: function(date) { return dateFilter(date, 'EEEE'); } - }, - { - key: 'EEE', - regex: $locale.DATETIME_FORMATS.SHORTDAY.join('|'), - formatter: function(date) { return dateFilter(date, 'EEE'); } - }, - { - key: 'HH', - regex: '(?:0|1)[0-9]|2[0-3]', - apply: function(value) { this.hours = +value; }, - formatter: function(date) { return dateFilter(date, 'HH'); } - }, - { - key: 'hh', - regex: '0[0-9]|1[0-2]', - apply: function(value) { this.hours = +value; }, - formatter: function(date) { return dateFilter(date, 'hh'); } - }, - { - key: 'H', - regex: '1?[0-9]|2[0-3]', - apply: function(value) { this.hours = +value; }, - formatter: function(date) { return dateFilter(date, 'H'); } - }, - { - key: 'h', - regex: '[0-9]|1[0-2]', - apply: function(value) { this.hours = +value; }, - formatter: function(date) { return dateFilter(date, 'h'); } - }, - { - key: 'mm', - regex: '[0-5][0-9]', - apply: function(value) { this.minutes = +value; }, - formatter: function(date) { return dateFilter(date, 'mm'); } - }, - { - key: 'm', - regex: '[0-9]|[1-5][0-9]', - apply: function(value) { this.minutes = +value; }, - formatter: function(date) { return dateFilter(date, 'm'); } - }, - { - key: 'sss', - regex: '[0-9][0-9][0-9]', - apply: function(value) { this.milliseconds = +value; }, - formatter: function(date) { return dateFilter(date, 'sss'); } - }, - { - key: 'ss', - regex: '[0-5][0-9]', - apply: function(value) { this.seconds = +value; }, - formatter: function(date) { return dateFilter(date, 'ss'); } - }, - { - key: 's', - regex: '[0-9]|[1-5][0-9]', - apply: function(value) { this.seconds = +value; }, - formatter: function(date) { return dateFilter(date, 's'); } - }, - { - key: 'a', - regex: $locale.DATETIME_FORMATS.AMPMS.join('|'), - apply: function(value) { - if (this.hours === 12) { - this.hours = 0; - } - - if (value === 'PM') { - this.hours += 12; - } - }, - formatter: function(date) { return dateFilter(date, 'a'); } - }, - { - key: 'Z', - regex: '[+-]\\d{4}', - apply: function(value) { - var matches = value.match(/([+-])(\d{2})(\d{2})/), - sign = matches[1], - hours = matches[2], - minutes = matches[3]; - this.hours += toInt(sign + hours); - this.minutes += toInt(sign + minutes); - }, - formatter: function(date) { - return dateFilter(date, 'Z'); - } - }, - { - key: 'ww', - regex: '[0-4][0-9]|5[0-3]', - formatter: function(date) { return dateFilter(date, 'ww'); } - }, - { - key: 'w', - regex: '[0-9]|[1-4][0-9]|5[0-3]', - formatter: function(date) { return dateFilter(date, 'w'); } - }, - { - key: 'GGGG', - regex: $locale.DATETIME_FORMATS.ERANAMES.join('|').replace(/\s/g, '\\s'), - formatter: function(date) { return dateFilter(date, 'GGGG'); } - }, - { - key: 'GGG', - regex: $locale.DATETIME_FORMATS.ERAS.join('|'), - formatter: function(date) { return dateFilter(date, 'GGG'); } - }, - { - key: 'GG', - regex: $locale.DATETIME_FORMATS.ERAS.join('|'), - formatter: function(date) { return dateFilter(date, 'GG'); } - }, - { - key: 'G', - regex: $locale.DATETIME_FORMATS.ERAS.join('|'), - formatter: function(date) { return dateFilter(date, 'G'); } - } - ]; - }; - - this.init(); - - function createParser(format, func) { - var map = [], regex = format.split(''); - - // check for literal values - var quoteIndex = format.indexOf('\''); - if (quoteIndex > -1) { - var inLiteral = false; - format = format.split(''); - for (var i = quoteIndex; i < format.length; i++) { - if (inLiteral) { - if (format[i] === '\'') { - if (i + 1 < format.length && format[i+1] === '\'') { // escaped single quote - format[i+1] = '$'; - regex[i+1] = ''; - } else { // end of literal - regex[i] = ''; - inLiteral = false; - } - } - format[i] = '$'; - } else { - if (format[i] === '\'') { // start of literal - format[i] = '$'; - regex[i] = ''; - inLiteral = true; - } - } - } - - format = format.join(''); - } - - angular.forEach(formatCodeToRegex, function(data) { - var index = format.indexOf(data.key); - - if (index > -1) { - format = format.split(''); - - regex[index] = '(' + data.regex + ')'; - format[index] = '$'; // Custom symbol to define consumed part of format - for (var i = index + 1, n = index + data.key.length; i < n; i++) { - regex[i] = ''; - format[i] = '$'; - } - format = format.join(''); - - map.push({ - index: index, - key: data.key, - apply: data[func], - matcher: data.regex - }); - } - }); - - return { - regex: new RegExp('^' + regex.join('') + '$'), - map: orderByFilter(map, 'index') - }; - } - - this.filter = function(date, format) { - if (!angular.isDate(date) || isNaN(date) || !format) { - return ''; - } - - format = $locale.DATETIME_FORMATS[format] || format; - - if ($locale.id !== localeId) { - this.init(); - } - - if (!this.formatters[format]) { - this.formatters[format] = createParser(format, 'formatter'); - } - - var parser = this.formatters[format], - map = parser.map; - - var _format = format; - - return map.reduce(function(str, mapper, i) { - var match = _format.match(new RegExp('(.*)' + mapper.key)); - if (match && angular.isString(match[1])) { - str += match[1]; - _format = _format.replace(match[1] + mapper.key, ''); - } - - var endStr = i === map.length - 1 ? _format : ''; - - if (mapper.apply) { - return str + mapper.apply.call(null, date) + endStr; - } - - return str + endStr; - }, ''); - }; - - this.parse = function(input, format, baseDate) { - if (!angular.isString(input) || !format) { - return input; - } - - format = $locale.DATETIME_FORMATS[format] || format; - format = format.replace(SPECIAL_CHARACTERS_REGEXP, '\\$&'); - - if ($locale.id !== localeId) { - this.init(); - } - - if (!this.parsers[format]) { - this.parsers[format] = createParser(format, 'apply'); - } - - var parser = this.parsers[format], - regex = parser.regex, - map = parser.map, - results = input.match(regex), - tzOffset = false; - if (results && results.length) { - var fields, dt; - if (angular.isDate(baseDate) && !isNaN(baseDate.getTime())) { - fields = { - year: baseDate.getFullYear(), - month: baseDate.getMonth(), - date: baseDate.getDate(), - hours: baseDate.getHours(), - minutes: baseDate.getMinutes(), - seconds: baseDate.getSeconds(), - milliseconds: baseDate.getMilliseconds() - }; - } else { - if (baseDate) { - $log.warn('dateparser:', 'baseDate is not a valid date'); - } - fields = { year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 }; - } - - for (var i = 1, n = results.length; i < n; i++) { - var mapper = map[i - 1]; - if (mapper.matcher === 'Z') { - tzOffset = true; - } - - if (mapper.apply) { - mapper.apply.call(fields, results[i]); - } - } - - var datesetter = tzOffset ? Date.prototype.setUTCFullYear : - Date.prototype.setFullYear; - var timesetter = tzOffset ? Date.prototype.setUTCHours : - Date.prototype.setHours; - - if (isValid(fields.year, fields.month, fields.date)) { - if (angular.isDate(baseDate) && !isNaN(baseDate.getTime()) && !tzOffset) { - dt = new Date(baseDate); - datesetter.call(dt, fields.year, fields.month, fields.date); - timesetter.call(dt, fields.hours, fields.minutes, - fields.seconds, fields.milliseconds); - } else { - dt = new Date(0); - datesetter.call(dt, fields.year, fields.month, fields.date); - timesetter.call(dt, fields.hours || 0, fields.minutes || 0, - fields.seconds || 0, fields.milliseconds || 0); - } - } - - return dt; - } - }; - - // Check if date is valid for specific month (and year for February). - // Month: 0 = Jan, 1 = Feb, etc - function isValid(year, month, date) { - if (date < 1) { - return false; - } - - if (month === 1 && date > 28) { - return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0); - } - - if (month === 3 || month === 5 || month === 8 || month === 10) { - return date < 31; - } - - return true; - } - - function toInt(str) { - return parseInt(str, 10); - } - - this.toTimezone = toTimezone; - this.fromTimezone = fromTimezone; - this.timezoneToOffset = timezoneToOffset; - this.addDateMinutes = addDateMinutes; - this.convertTimezoneToLocal = convertTimezoneToLocal; - - function toTimezone(date, timezone) { - return date && timezone ? convertTimezoneToLocal(date, timezone) : date; - } - - function fromTimezone(date, timezone) { - return date && timezone ? convertTimezoneToLocal(date, timezone, true) : date; - } - - //https://github.com/angular/angular.js/blob/622c42169699ec07fc6daaa19fe6d224e5d2f70e/src/Angular.js#L1207 - function timezoneToOffset(timezone, fallback) { - timezone = timezone.replace(/:/g, ''); - var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000; - return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset; - } - - function addDateMinutes(date, minutes) { - date = new Date(date.getTime()); - date.setMinutes(date.getMinutes() + minutes); - return date; - } - - function convertTimezoneToLocal(date, timezone, reverse) { - reverse = reverse ? -1 : 1; - var dateTimezoneOffset = date.getTimezoneOffset(); - var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); - return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset)); - } -}]); - -// Avoiding use of ng-class as it creates a lot of watchers when a class is to be applied to -// at most one element. -angular.module('ui.bootstrap.isClass', []) -.directive('uibIsClass', [ - '$animate', -function ($animate) { - // 11111111 22222222 - var ON_REGEXP = /^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/; - // 11111111 22222222 - var IS_REGEXP = /^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/; - - var dataPerTracked = {}; - - return { - restrict: 'A', - compile: function(tElement, tAttrs) { - var linkedScopes = []; - var instances = []; - var expToData = {}; - var lastActivated = null; - var onExpMatches = tAttrs.uibIsClass.match(ON_REGEXP); - var onExp = onExpMatches[2]; - var expsStr = onExpMatches[1]; - var exps = expsStr.split(','); - - return linkFn; - - function linkFn(scope, element, attrs) { - linkedScopes.push(scope); - instances.push({ - scope: scope, - element: element - }); - - exps.forEach(function(exp, k) { - addForExp(exp, scope); - }); - - scope.$on('$destroy', removeScope); - } - - function addForExp(exp, scope) { - var matches = exp.match(IS_REGEXP); - var clazz = scope.$eval(matches[1]); - var compareWithExp = matches[2]; - var data = expToData[exp]; - if (!data) { - var watchFn = function(compareWithVal) { - var newActivated = null; - instances.some(function(instance) { - var thisVal = instance.scope.$eval(onExp); - if (thisVal === compareWithVal) { - newActivated = instance; - return true; - } - }); - if (data.lastActivated !== newActivated) { - if (data.lastActivated) { - $animate.removeClass(data.lastActivated.element, clazz); - } - if (newActivated) { - $animate.addClass(newActivated.element, clazz); - } - data.lastActivated = newActivated; - } - }; - expToData[exp] = data = { - lastActivated: null, - scope: scope, - watchFn: watchFn, - compareWithExp: compareWithExp, - watcher: scope.$watch(compareWithExp, watchFn) - }; - } - data.watchFn(scope.$eval(compareWithExp)); - } - - function removeScope(e) { - var removedScope = e.targetScope; - var index = linkedScopes.indexOf(removedScope); - linkedScopes.splice(index, 1); - instances.splice(index, 1); - if (linkedScopes.length) { - var newWatchScope = linkedScopes[0]; - angular.forEach(expToData, function(data) { - if (data.scope === removedScope) { - data.watcher = newWatchScope.$watch(data.compareWithExp, data.watchFn); - data.scope = newWatchScope; - } - }); - } else { - expToData = {}; - } - } - } - }; -}]); -angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.isClass']) - -.value('$datepickerSuppressError', false) - -.value('$datepickerLiteralWarning', true) - -.constant('uibDatepickerConfig', { - datepickerMode: 'day', - formatDay: 'dd', - formatMonth: 'MMMM', - formatYear: 'yyyy', - formatDayHeader: 'EEE', - formatDayTitle: 'MMMM yyyy', - formatMonthTitle: 'yyyy', - maxDate: null, - maxMode: 'year', - minDate: null, - minMode: 'day', - ngModelOptions: {}, - shortcutPropagation: false, - showWeeks: true, - yearColumns: 5, - yearRows: 4 -}) - -.controller('UibDatepickerController', ['$scope', '$attrs', '$parse', '$interpolate', '$locale', '$log', 'dateFilter', 'uibDatepickerConfig', '$datepickerLiteralWarning', '$datepickerSuppressError', 'uibDateParser', - function($scope, $attrs, $parse, $interpolate, $locale, $log, dateFilter, datepickerConfig, $datepickerLiteralWarning, $datepickerSuppressError, dateParser) { - var self = this, - ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl; - ngModelOptions = {}, - watchListeners = [], - optionsUsed = !!$attrs.datepickerOptions; - - if (!$scope.datepickerOptions) { - $scope.datepickerOptions = {}; - } - - // Modes chain - this.modes = ['day', 'month', 'year']; - - [ - 'customClass', - 'dateDisabled', - 'datepickerMode', - 'formatDay', - 'formatDayHeader', - 'formatDayTitle', - 'formatMonth', - 'formatMonthTitle', - 'formatYear', - 'maxDate', - 'maxMode', - 'minDate', - 'minMode', - 'showWeeks', - 'shortcutPropagation', - 'startingDay', - 'yearColumns', - 'yearRows' - ].forEach(function(key) { - switch (key) { - case 'customClass': - case 'dateDisabled': - $scope[key] = $scope.datepickerOptions[key] || angular.noop; - break; - case 'datepickerMode': - $scope.datepickerMode = angular.isDefined($scope.datepickerOptions.datepickerMode) ? - $scope.datepickerOptions.datepickerMode : datepickerConfig.datepickerMode; - break; - case 'formatDay': - case 'formatDayHeader': - case 'formatDayTitle': - case 'formatMonth': - case 'formatMonthTitle': - case 'formatYear': - self[key] = angular.isDefined($scope.datepickerOptions[key]) ? - $interpolate($scope.datepickerOptions[key])($scope.$parent) : - datepickerConfig[key]; - break; - case 'showWeeks': - case 'shortcutPropagation': - case 'yearColumns': - case 'yearRows': - self[key] = angular.isDefined($scope.datepickerOptions[key]) ? - $scope.datepickerOptions[key] : datepickerConfig[key]; - break; - case 'startingDay': - if (angular.isDefined($scope.datepickerOptions.startingDay)) { - self.startingDay = $scope.datepickerOptions.startingDay; - } else if (angular.isNumber(datepickerConfig.startingDay)) { - self.startingDay = datepickerConfig.startingDay; - } else { - self.startingDay = ($locale.DATETIME_FORMATS.FIRSTDAYOFWEEK + 8) % 7; - } - - break; - case 'maxDate': - case 'minDate': - $scope.$watch('datepickerOptions.' + key, function(value) { - if (value) { - if (angular.isDate(value)) { - self[key] = dateParser.fromTimezone(new Date(value), ngModelOptions.timezone); - } else { - if ($datepickerLiteralWarning) { - $log.warn('Literal date support has been deprecated, please switch to date object usage'); - } - - self[key] = new Date(dateFilter(value, 'medium')); - } - } else { - self[key] = datepickerConfig[key] ? - dateParser.fromTimezone(new Date(datepickerConfig[key]), ngModelOptions.timezone) : - null; - } - - self.refreshView(); - }); - - break; - case 'maxMode': - case 'minMode': - if ($scope.datepickerOptions[key]) { - $scope.$watch(function() { return $scope.datepickerOptions[key]; }, function(value) { - self[key] = $scope[key] = angular.isDefined(value) ? value : datepickerOptions[key]; - if (key === 'minMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) < self.modes.indexOf(self[key]) || - key === 'maxMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) > self.modes.indexOf(self[key])) { - $scope.datepickerMode = self[key]; - $scope.datepickerOptions.datepickerMode = self[key]; - } - }); - } else { - self[key] = $scope[key] = datepickerConfig[key] || null; - } - - break; - } - }); - - $scope.uniqueId = 'datepicker-' + $scope.$id + '-' + Math.floor(Math.random() * 10000); - - $scope.disabled = angular.isDefined($attrs.disabled) || false; - if (angular.isDefined($attrs.ngDisabled)) { - watchListeners.push($scope.$parent.$watch($attrs.ngDisabled, function(disabled) { - $scope.disabled = disabled; - self.refreshView(); - })); - } - - $scope.isActive = function(dateObject) { - if (self.compare(dateObject.date, self.activeDate) === 0) { - $scope.activeDateId = dateObject.uid; - return true; - } - return false; - }; - - this.init = function(ngModelCtrl_) { - ngModelCtrl = ngModelCtrl_; - ngModelOptions = ngModelCtrl_.$options || datepickerConfig.ngModelOptions; - if ($scope.datepickerOptions.initDate) { - self.activeDate = dateParser.fromTimezone($scope.datepickerOptions.initDate, ngModelOptions.timezone) || new Date(); - $scope.$watch('datepickerOptions.initDate', function(initDate) { - if (initDate && (ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue) || ngModelCtrl.$invalid)) { - self.activeDate = dateParser.fromTimezone(initDate, ngModelOptions.timezone); - self.refreshView(); - } - }); - } else { - self.activeDate = new Date(); - } - - var date = ngModelCtrl.$modelValue ? new Date(ngModelCtrl.$modelValue) : new Date(); - this.activeDate = !isNaN(date) ? - dateParser.fromTimezone(date, ngModelOptions.timezone) : - dateParser.fromTimezone(new Date(), ngModelOptions.timezone); - - ngModelCtrl.$render = function() { - self.render(); - }; - }; - - this.render = function() { - if (ngModelCtrl.$viewValue) { - var date = new Date(ngModelCtrl.$viewValue), - isValid = !isNaN(date); - - if (isValid) { - this.activeDate = dateParser.fromTimezone(date, ngModelOptions.timezone); - } else if (!$datepickerSuppressError) { - $log.error('Datepicker directive: "ng-model" value must be a Date object'); - } - } - this.refreshView(); - }; - - this.refreshView = function() { - if (this.element) { - $scope.selectedDt = null; - this._refreshView(); - if ($scope.activeDt) { - $scope.activeDateId = $scope.activeDt.uid; - } - - var date = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null; - date = dateParser.fromTimezone(date, ngModelOptions.timezone); - ngModelCtrl.$setValidity('dateDisabled', !date || - this.element && !this.isDisabled(date)); - } - }; - - this.createDateObject = function(date, format) { - var model = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null; - model = dateParser.fromTimezone(model, ngModelOptions.timezone); - var today = new Date(); - today = dateParser.fromTimezone(today, ngModelOptions.timezone); - var time = this.compare(date, today); - var dt = { - date: date, - label: dateParser.filter(date, format), - selected: model && this.compare(date, model) === 0, - disabled: this.isDisabled(date), - past: time < 0, - current: time === 0, - future: time > 0, - customClass: this.customClass(date) || null - }; - - if (model && this.compare(date, model) === 0) { - $scope.selectedDt = dt; - } - - if (self.activeDate && this.compare(dt.date, self.activeDate) === 0) { - $scope.activeDt = dt; - } - - return dt; - }; - - this.isDisabled = function(date) { - return $scope.disabled || - this.minDate && this.compare(date, this.minDate) < 0 || - this.maxDate && this.compare(date, this.maxDate) > 0 || - $scope.dateDisabled && $scope.dateDisabled({date: date, mode: $scope.datepickerMode}); - }; - - this.customClass = function(date) { - return $scope.customClass({date: date, mode: $scope.datepickerMode}); - }; - - // Split array into smaller arrays - this.split = function(arr, size) { - var arrays = []; - while (arr.length > 0) { - arrays.push(arr.splice(0, size)); - } - return arrays; - }; - - $scope.select = function(date) { - if ($scope.datepickerMode === self.minMode) { - var dt = ngModelCtrl.$viewValue ? dateParser.fromTimezone(new Date(ngModelCtrl.$viewValue), ngModelOptions.timezone) : new Date(0, 0, 0, 0, 0, 0, 0); - dt.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); - dt = dateParser.toTimezone(dt, ngModelOptions.timezone); - ngModelCtrl.$setViewValue(dt); - ngModelCtrl.$render(); - } else { - self.activeDate = date; - setMode(self.modes[self.modes.indexOf($scope.datepickerMode) - 1]); - - $scope.$emit('uib:datepicker.mode'); - } - - $scope.$broadcast('uib:datepicker.focus'); - }; - - $scope.move = function(direction) { - var year = self.activeDate.getFullYear() + direction * (self.step.years || 0), - month = self.activeDate.getMonth() + direction * (self.step.months || 0); - self.activeDate.setFullYear(year, month, 1); - self.refreshView(); - }; - - $scope.toggleMode = function(direction) { - direction = direction || 1; - - if ($scope.datepickerMode === self.maxMode && direction === 1 || - $scope.datepickerMode === self.minMode && direction === -1) { - return; - } - - setMode(self.modes[self.modes.indexOf($scope.datepickerMode) + direction]); - - $scope.$emit('uib:datepicker.mode'); - }; - - // Key event mapper - $scope.keys = { 13: 'enter', 32: 'space', 33: 'pageup', 34: 'pagedown', 35: 'end', 36: 'home', 37: 'left', 38: 'up', 39: 'right', 40: 'down' }; - - var focusElement = function() { - self.element[0].focus(); - }; - - // Listen for focus requests from popup directive - $scope.$on('uib:datepicker.focus', focusElement); - - $scope.keydown = function(evt) { - var key = $scope.keys[evt.which]; - - if (!key || evt.shiftKey || evt.altKey || $scope.disabled) { - return; - } - - evt.preventDefault(); - if (!self.shortcutPropagation) { - evt.stopPropagation(); - } - - if (key === 'enter' || key === 'space') { - if (self.isDisabled(self.activeDate)) { - return; // do nothing - } - $scope.select(self.activeDate); - } else if (evt.ctrlKey && (key === 'up' || key === 'down')) { - $scope.toggleMode(key === 'up' ? 1 : -1); - } else { - self.handleKeyDown(key, evt); - self.refreshView(); - } - }; - - $scope.$on('$destroy', function() { - //Clear all watch listeners on destroy - while (watchListeners.length) { - watchListeners.shift()(); - } - }); - - function setMode(mode) { - $scope.datepickerMode = mode; - $scope.datepickerOptions.datepickerMode = mode; - } -}]) - -.controller('UibDaypickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) { - var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - - this.step = { months: 1 }; - this.element = $element; - function getDaysInMonth(year, month) { - return month === 1 && year % 4 === 0 && - (year % 100 !== 0 || year % 400 === 0) ? 29 : DAYS_IN_MONTH[month]; - } - - this.init = function(ctrl) { - angular.extend(ctrl, this); - scope.showWeeks = ctrl.showWeeks; - ctrl.refreshView(); - }; - - this.getDates = function(startDate, n) { - var dates = new Array(n), current = new Date(startDate), i = 0, date; - while (i < n) { - date = new Date(current); - dates[i++] = date; - current.setDate(current.getDate() + 1); - } - return dates; - }; - - this._refreshView = function() { - var year = this.activeDate.getFullYear(), - month = this.activeDate.getMonth(), - firstDayOfMonth = new Date(this.activeDate); - - firstDayOfMonth.setFullYear(year, month, 1); - - var difference = this.startingDay - firstDayOfMonth.getDay(), - numDisplayedFromPreviousMonth = difference > 0 ? - 7 - difference : - difference, - firstDate = new Date(firstDayOfMonth); - - if (numDisplayedFromPreviousMonth > 0) { - firstDate.setDate(-numDisplayedFromPreviousMonth + 1); - } - - // 42 is the number of days on a six-week calendar - var days = this.getDates(firstDate, 42); - for (var i = 0; i < 42; i ++) { - days[i] = angular.extend(this.createDateObject(days[i], this.formatDay), { - secondary: days[i].getMonth() !== month, - uid: scope.uniqueId + '-' + i - }); - } - - scope.labels = new Array(7); - for (var j = 0; j < 7; j++) { - scope.labels[j] = { - abbr: dateFilter(days[j].date, this.formatDayHeader), - full: dateFilter(days[j].date, 'EEEE') - }; - } - - scope.title = dateFilter(this.activeDate, this.formatDayTitle); - scope.rows = this.split(days, 7); - - if (scope.showWeeks) { - scope.weekNumbers = []; - var thursdayIndex = (4 + 7 - this.startingDay) % 7, - numWeeks = scope.rows.length; - for (var curWeek = 0; curWeek < numWeeks; curWeek++) { - scope.weekNumbers.push( - getISO8601WeekNumber(scope.rows[curWeek][thursdayIndex].date)); - } - } - }; - - this.compare = function(date1, date2) { - var _date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()); - var _date2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()); - _date1.setFullYear(date1.getFullYear()); - _date2.setFullYear(date2.getFullYear()); - return _date1 - _date2; - }; - - function getISO8601WeekNumber(date) { - var checkDate = new Date(date); - checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); // Thursday - var time = checkDate.getTime(); - checkDate.setMonth(0); // Compare with Jan 1 - checkDate.setDate(1); - return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; - } - - this.handleKeyDown = function(key, evt) { - var date = this.activeDate.getDate(); - - if (key === 'left') { - date = date - 1; - } else if (key === 'up') { - date = date - 7; - } else if (key === 'right') { - date = date + 1; - } else if (key === 'down') { - date = date + 7; - } else if (key === 'pageup' || key === 'pagedown') { - var month = this.activeDate.getMonth() + (key === 'pageup' ? - 1 : 1); - this.activeDate.setMonth(month, 1); - date = Math.min(getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth()), date); - } else if (key === 'home') { - date = 1; - } else if (key === 'end') { - date = getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth()); - } - this.activeDate.setDate(date); - }; -}]) - -.controller('UibMonthpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) { - this.step = { years: 1 }; - this.element = $element; - - this.init = function(ctrl) { - angular.extend(ctrl, this); - ctrl.refreshView(); - }; - - this._refreshView = function() { - var months = new Array(12), - year = this.activeDate.getFullYear(), - date; - - for (var i = 0; i < 12; i++) { - date = new Date(this.activeDate); - date.setFullYear(year, i, 1); - months[i] = angular.extend(this.createDateObject(date, this.formatMonth), { - uid: scope.uniqueId + '-' + i - }); - } - - scope.title = dateFilter(this.activeDate, this.formatMonthTitle); - scope.rows = this.split(months, 3); - }; - - this.compare = function(date1, date2) { - var _date1 = new Date(date1.getFullYear(), date1.getMonth()); - var _date2 = new Date(date2.getFullYear(), date2.getMonth()); - _date1.setFullYear(date1.getFullYear()); - _date2.setFullYear(date2.getFullYear()); - return _date1 - _date2; - }; - - this.handleKeyDown = function(key, evt) { - var date = this.activeDate.getMonth(); - - if (key === 'left') { - date = date - 1; - } else if (key === 'up') { - date = date - 3; - } else if (key === 'right') { - date = date + 1; - } else if (key === 'down') { - date = date + 3; - } else if (key === 'pageup' || key === 'pagedown') { - var year = this.activeDate.getFullYear() + (key === 'pageup' ? - 1 : 1); - this.activeDate.setFullYear(year); - } else if (key === 'home') { - date = 0; - } else if (key === 'end') { - date = 11; - } - this.activeDate.setMonth(date); - }; -}]) - -.controller('UibYearpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) { - var columns, range; - this.element = $element; - - function getStartingYear(year) { - return parseInt((year - 1) / range, 10) * range + 1; - } - - this.yearpickerInit = function() { - columns = this.yearColumns; - range = this.yearRows * columns; - this.step = { years: range }; - }; - - this._refreshView = function() { - var years = new Array(range), date; - - for (var i = 0, start = getStartingYear(this.activeDate.getFullYear()); i < range; i++) { - date = new Date(this.activeDate); - date.setFullYear(start + i, 0, 1); - years[i] = angular.extend(this.createDateObject(date, this.formatYear), { - uid: scope.uniqueId + '-' + i - }); - } - - scope.title = [years[0].label, years[range - 1].label].join(' - '); - scope.rows = this.split(years, columns); - scope.columns = columns; - }; - - this.compare = function(date1, date2) { - return date1.getFullYear() - date2.getFullYear(); - }; - - this.handleKeyDown = function(key, evt) { - var date = this.activeDate.getFullYear(); - - if (key === 'left') { - date = date - 1; - } else if (key === 'up') { - date = date - columns; - } else if (key === 'right') { - date = date + 1; - } else if (key === 'down') { - date = date + columns; - } else if (key === 'pageup' || key === 'pagedown') { - date += (key === 'pageup' ? - 1 : 1) * range; - } else if (key === 'home') { - date = getStartingYear(this.activeDate.getFullYear()); - } else if (key === 'end') { - date = getStartingYear(this.activeDate.getFullYear()) + range - 1; - } - this.activeDate.setFullYear(date); - }; -}]) - -.directive('uibDatepicker', function() { - return { - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepicker/datepicker.html'; - }, - scope: { - datepickerOptions: '=?' - }, - require: ['uibDatepicker', '^ngModel'], - controller: 'UibDatepickerController', - controllerAs: 'datepicker', - link: function(scope, element, attrs, ctrls) { - var datepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - datepickerCtrl.init(ngModelCtrl); - } - }; -}) - -.directive('uibDaypicker', function() { - return { - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepicker/day.html'; - }, - require: ['^uibDatepicker', 'uibDaypicker'], - controller: 'UibDaypickerController', - link: function(scope, element, attrs, ctrls) { - var datepickerCtrl = ctrls[0], - daypickerCtrl = ctrls[1]; - - daypickerCtrl.init(datepickerCtrl); - } - }; -}) - -.directive('uibMonthpicker', function() { - return { - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepicker/month.html'; - }, - require: ['^uibDatepicker', 'uibMonthpicker'], - controller: 'UibMonthpickerController', - link: function(scope, element, attrs, ctrls) { - var datepickerCtrl = ctrls[0], - monthpickerCtrl = ctrls[1]; - - monthpickerCtrl.init(datepickerCtrl); - } - }; -}) - -.directive('uibYearpicker', function() { - return { - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepicker/year.html'; - }, - require: ['^uibDatepicker', 'uibYearpicker'], - controller: 'UibYearpickerController', - link: function(scope, element, attrs, ctrls) { - var ctrl = ctrls[0]; - angular.extend(ctrl, ctrls[1]); - ctrl.yearpickerInit(); - - ctrl.refreshView(); - } - }; -}); - -angular.module('ui.bootstrap.position', []) - -/** - * A set of utility methods for working with the DOM. - * It is meant to be used where we need to absolute-position elements in - * relation to another element (this is the case for tooltips, popovers, - * typeahead suggestions etc.). - */ - .factory('$uibPosition', ['$document', '$window', function($document, $window) { - /** - * Used by scrollbarWidth() function to cache scrollbar's width. - * Do not access this variable directly, use scrollbarWidth() instead. - */ - var SCROLLBAR_WIDTH; - /** - * scrollbar on body and html element in IE and Edge overlay - * content and should be considered 0 width. - */ - var BODY_SCROLLBAR_WIDTH; - var OVERFLOW_REGEX = { - normal: /(auto|scroll)/, - hidden: /(auto|scroll|hidden)/ - }; - var PLACEMENT_REGEX = { - auto: /\s?auto?\s?/i, - primary: /^(top|bottom|left|right)$/, - secondary: /^(top|bottom|left|right|center)$/, - vertical: /^(top|bottom)$/ - }; - var BODY_REGEX = /(HTML|BODY)/; - - return { - - /** - * Provides a raw DOM element from a jQuery/jQLite element. - * - * @param {element} elem - The element to convert. - * - * @returns {element} A HTML element. - */ - getRawNode: function(elem) { - return elem.nodeName ? elem : elem[0] || elem; - }, - - /** - * Provides a parsed number for a style property. Strips - * units and casts invalid numbers to 0. - * - * @param {string} value - The style value to parse. - * - * @returns {number} A valid number. - */ - parseStyle: function(value) { - value = parseFloat(value); - return isFinite(value) ? value : 0; - }, - - /** - * Provides the closest positioned ancestor. - * - * @param {element} element - The element to get the offest parent for. - * - * @returns {element} The closest positioned ancestor. - */ - offsetParent: function(elem) { - elem = this.getRawNode(elem); - - var offsetParent = elem.offsetParent || $document[0].documentElement; - - function isStaticPositioned(el) { - return ($window.getComputedStyle(el).position || 'static') === 'static'; - } - - while (offsetParent && offsetParent !== $document[0].documentElement && isStaticPositioned(offsetParent)) { - offsetParent = offsetParent.offsetParent; - } - - return offsetParent || $document[0].documentElement; - }, - - /** - * Provides the scrollbar width, concept from TWBS measureScrollbar() - * function in https://github.com/twbs/bootstrap/blob/master/js/modal.js - * In IE and Edge, scollbar on body and html element overlay and should - * return a width of 0. - * - * @returns {number} The width of the browser scollbar. - */ - scrollbarWidth: function(isBody) { - if (isBody) { - if (angular.isUndefined(BODY_SCROLLBAR_WIDTH)) { - var bodyElem = $document.find('body'); - bodyElem.addClass('uib-position-body-scrollbar-measure'); - BODY_SCROLLBAR_WIDTH = $window.innerWidth - bodyElem[0].clientWidth; - BODY_SCROLLBAR_WIDTH = isFinite(BODY_SCROLLBAR_WIDTH) ? BODY_SCROLLBAR_WIDTH : 0; - bodyElem.removeClass('uib-position-body-scrollbar-measure'); - } - return BODY_SCROLLBAR_WIDTH; - } - - if (angular.isUndefined(SCROLLBAR_WIDTH)) { - var scrollElem = angular.element('
      '); - $document.find('body').append(scrollElem); - SCROLLBAR_WIDTH = scrollElem[0].offsetWidth - scrollElem[0].clientWidth; - SCROLLBAR_WIDTH = isFinite(SCROLLBAR_WIDTH) ? SCROLLBAR_WIDTH : 0; - scrollElem.remove(); - } - - return SCROLLBAR_WIDTH; - }, - - /** - * Provides the padding required on an element to replace the scrollbar. - * - * @returns {object} An object with the following properties: - *
        - *
      • **scrollbarWidth**: the width of the scrollbar
      • - *
      • **widthOverflow**: whether the the width is overflowing
      • - *
      • **right**: the amount of right padding on the element needed to replace the scrollbar
      • - *
      • **rightOriginal**: the amount of right padding currently on the element
      • - *
      • **heightOverflow**: whether the the height is overflowing
      • - *
      • **bottom**: the amount of bottom padding on the element needed to replace the scrollbar
      • - *
      • **bottomOriginal**: the amount of bottom padding currently on the element
      • - *
      - */ - scrollbarPadding: function(elem) { - elem = this.getRawNode(elem); - - var elemStyle = $window.getComputedStyle(elem); - var paddingRight = this.parseStyle(elemStyle.paddingRight); - var paddingBottom = this.parseStyle(elemStyle.paddingBottom); - var scrollParent = this.scrollParent(elem, false, true); - var scrollbarWidth = this.scrollbarWidth(scrollParent, BODY_REGEX.test(scrollParent.tagName)); - - return { - scrollbarWidth: scrollbarWidth, - widthOverflow: scrollParent.scrollWidth > scrollParent.clientWidth, - right: paddingRight + scrollbarWidth, - originalRight: paddingRight, - heightOverflow: scrollParent.scrollHeight > scrollParent.clientHeight, - bottom: paddingBottom + scrollbarWidth, - originalBottom: paddingBottom - }; - }, - - /** - * Checks to see if the element is scrollable. - * - * @param {element} elem - The element to check. - * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered, - * default is false. - * - * @returns {boolean} Whether the element is scrollable. - */ - isScrollable: function(elem, includeHidden) { - elem = this.getRawNode(elem); - - var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal; - var elemStyle = $window.getComputedStyle(elem); - return overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX); - }, - - /** - * Provides the closest scrollable ancestor. - * A port of the jQuery UI scrollParent method: - * https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js - * - * @param {element} elem - The element to find the scroll parent of. - * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered, - * default is false. - * @param {boolean=} [includeSelf=false] - Should the element being passed be - * included in the scrollable llokup. - * - * @returns {element} A HTML element. - */ - scrollParent: function(elem, includeHidden, includeSelf) { - elem = this.getRawNode(elem); - - var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal; - var documentEl = $document[0].documentElement; - var elemStyle = $window.getComputedStyle(elem); - if (includeSelf && overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX)) { - return elem; - } - var excludeStatic = elemStyle.position === 'absolute'; - var scrollParent = elem.parentElement || documentEl; - - if (scrollParent === documentEl || elemStyle.position === 'fixed') { - return documentEl; - } - - while (scrollParent.parentElement && scrollParent !== documentEl) { - var spStyle = $window.getComputedStyle(scrollParent); - if (excludeStatic && spStyle.position !== 'static') { - excludeStatic = false; - } - - if (!excludeStatic && overflowRegex.test(spStyle.overflow + spStyle.overflowY + spStyle.overflowX)) { - break; - } - scrollParent = scrollParent.parentElement; - } - - return scrollParent; - }, - - /** - * Provides read-only equivalent of jQuery's position function: - * http://api.jquery.com/position/ - distance to closest positioned - * ancestor. Does not account for margins by default like jQuery position. - * - * @param {element} elem - The element to caclulate the position on. - * @param {boolean=} [includeMargins=false] - Should margins be accounted - * for, default is false. - * - * @returns {object} An object with the following properties: - *
        - *
      • **width**: the width of the element
      • - *
      • **height**: the height of the element
      • - *
      • **top**: distance to top edge of offset parent
      • - *
      • **left**: distance to left edge of offset parent
      • - *
      - */ - position: function(elem, includeMagins) { - elem = this.getRawNode(elem); - - var elemOffset = this.offset(elem); - if (includeMagins) { - var elemStyle = $window.getComputedStyle(elem); - elemOffset.top -= this.parseStyle(elemStyle.marginTop); - elemOffset.left -= this.parseStyle(elemStyle.marginLeft); - } - var parent = this.offsetParent(elem); - var parentOffset = {top: 0, left: 0}; - - if (parent !== $document[0].documentElement) { - parentOffset = this.offset(parent); - parentOffset.top += parent.clientTop - parent.scrollTop; - parentOffset.left += parent.clientLeft - parent.scrollLeft; - } - - return { - width: Math.round(angular.isNumber(elemOffset.width) ? elemOffset.width : elem.offsetWidth), - height: Math.round(angular.isNumber(elemOffset.height) ? elemOffset.height : elem.offsetHeight), - top: Math.round(elemOffset.top - parentOffset.top), - left: Math.round(elemOffset.left - parentOffset.left) - }; - }, - - /** - * Provides read-only equivalent of jQuery's offset function: - * http://api.jquery.com/offset/ - distance to viewport. Does - * not account for borders, margins, or padding on the body - * element. - * - * @param {element} elem - The element to calculate the offset on. - * - * @returns {object} An object with the following properties: - *
        - *
      • **width**: the width of the element
      • - *
      • **height**: the height of the element
      • - *
      • **top**: distance to top edge of viewport
      • - *
      • **right**: distance to bottom edge of viewport
      • - *
      - */ - offset: function(elem) { - elem = this.getRawNode(elem); - - var elemBCR = elem.getBoundingClientRect(); - return { - width: Math.round(angular.isNumber(elemBCR.width) ? elemBCR.width : elem.offsetWidth), - height: Math.round(angular.isNumber(elemBCR.height) ? elemBCR.height : elem.offsetHeight), - top: Math.round(elemBCR.top + ($window.pageYOffset || $document[0].documentElement.scrollTop)), - left: Math.round(elemBCR.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft)) - }; - }, - - /** - * Provides offset distance to the closest scrollable ancestor - * or viewport. Accounts for border and scrollbar width. - * - * Right and bottom dimensions represent the distance to the - * respective edge of the viewport element. If the element - * edge extends beyond the viewport, a negative value will be - * reported. - * - * @param {element} elem - The element to get the viewport offset for. - * @param {boolean=} [useDocument=false] - Should the viewport be the document element instead - * of the first scrollable element, default is false. - * @param {boolean=} [includePadding=true] - Should the padding on the offset parent element - * be accounted for, default is true. - * - * @returns {object} An object with the following properties: - *
        - *
      • **top**: distance to the top content edge of viewport element
      • - *
      • **bottom**: distance to the bottom content edge of viewport element
      • - *
      • **left**: distance to the left content edge of viewport element
      • - *
      • **right**: distance to the right content edge of viewport element
      • - *
      - */ - viewportOffset: function(elem, useDocument, includePadding) { - elem = this.getRawNode(elem); - includePadding = includePadding !== false ? true : false; - - var elemBCR = elem.getBoundingClientRect(); - var offsetBCR = {top: 0, left: 0, bottom: 0, right: 0}; - - var offsetParent = useDocument ? $document[0].documentElement : this.scrollParent(elem); - var offsetParentBCR = offsetParent.getBoundingClientRect(); - - offsetBCR.top = offsetParentBCR.top + offsetParent.clientTop; - offsetBCR.left = offsetParentBCR.left + offsetParent.clientLeft; - if (offsetParent === $document[0].documentElement) { - offsetBCR.top += $window.pageYOffset; - offsetBCR.left += $window.pageXOffset; - } - offsetBCR.bottom = offsetBCR.top + offsetParent.clientHeight; - offsetBCR.right = offsetBCR.left + offsetParent.clientWidth; - - if (includePadding) { - var offsetParentStyle = $window.getComputedStyle(offsetParent); - offsetBCR.top += this.parseStyle(offsetParentStyle.paddingTop); - offsetBCR.bottom -= this.parseStyle(offsetParentStyle.paddingBottom); - offsetBCR.left += this.parseStyle(offsetParentStyle.paddingLeft); - offsetBCR.right -= this.parseStyle(offsetParentStyle.paddingRight); - } - - return { - top: Math.round(elemBCR.top - offsetBCR.top), - bottom: Math.round(offsetBCR.bottom - elemBCR.bottom), - left: Math.round(elemBCR.left - offsetBCR.left), - right: Math.round(offsetBCR.right - elemBCR.right) - }; - }, - - /** - * Provides an array of placement values parsed from a placement string. - * Along with the 'auto' indicator, supported placement strings are: - *
        - *
      • top: element on top, horizontally centered on host element.
      • - *
      • top-left: element on top, left edge aligned with host element left edge.
      • - *
      • top-right: element on top, lerightft edge aligned with host element right edge.
      • - *
      • bottom: element on bottom, horizontally centered on host element.
      • - *
      • bottom-left: element on bottom, left edge aligned with host element left edge.
      • - *
      • bottom-right: element on bottom, right edge aligned with host element right edge.
      • - *
      • left: element on left, vertically centered on host element.
      • - *
      • left-top: element on left, top edge aligned with host element top edge.
      • - *
      • left-bottom: element on left, bottom edge aligned with host element bottom edge.
      • - *
      • right: element on right, vertically centered on host element.
      • - *
      • right-top: element on right, top edge aligned with host element top edge.
      • - *
      • right-bottom: element on right, bottom edge aligned with host element bottom edge.
      • - *
      - * A placement string with an 'auto' indicator is expected to be - * space separated from the placement, i.e: 'auto bottom-left' If - * the primary and secondary placement values do not match 'top, - * bottom, left, right' then 'top' will be the primary placement and - * 'center' will be the secondary placement. If 'auto' is passed, true - * will be returned as the 3rd value of the array. - * - * @param {string} placement - The placement string to parse. - * - * @returns {array} An array with the following values - *
        - *
      • **[0]**: The primary placement.
      • - *
      • **[1]**: The secondary placement.
      • - *
      • **[2]**: If auto is passed: true, else undefined.
      • - *
      - */ - parsePlacement: function(placement) { - var autoPlace = PLACEMENT_REGEX.auto.test(placement); - if (autoPlace) { - placement = placement.replace(PLACEMENT_REGEX.auto, ''); - } - - placement = placement.split('-'); - - placement[0] = placement[0] || 'top'; - if (!PLACEMENT_REGEX.primary.test(placement[0])) { - placement[0] = 'top'; - } - - placement[1] = placement[1] || 'center'; - if (!PLACEMENT_REGEX.secondary.test(placement[1])) { - placement[1] = 'center'; - } - - if (autoPlace) { - placement[2] = true; - } else { - placement[2] = false; - } - - return placement; - }, - - /** - * Provides coordinates for an element to be positioned relative to - * another element. Passing 'auto' as part of the placement parameter - * will enable smart placement - where the element fits. i.e: - * 'auto left-top' will check to see if there is enough space to the left - * of the hostElem to fit the targetElem, if not place right (same for secondary - * top placement). Available space is calculated using the viewportOffset - * function. - * - * @param {element} hostElem - The element to position against. - * @param {element} targetElem - The element to position. - * @param {string=} [placement=top] - The placement for the targetElem, - * default is 'top'. 'center' is assumed as secondary placement for - * 'top', 'left', 'right', and 'bottom' placements. Available placements are: - *
        - *
      • top
      • - *
      • top-right
      • - *
      • top-left
      • - *
      • bottom
      • - *
      • bottom-left
      • - *
      • bottom-right
      • - *
      • left
      • - *
      • left-top
      • - *
      • left-bottom
      • - *
      • right
      • - *
      • right-top
      • - *
      • right-bottom
      • - *
      - * @param {boolean=} [appendToBody=false] - Should the top and left values returned - * be calculated from the body element, default is false. - * - * @returns {object} An object with the following properties: - *
        - *
      • **top**: Value for targetElem top.
      • - *
      • **left**: Value for targetElem left.
      • - *
      • **placement**: The resolved placement.
      • - *
      - */ - positionElements: function(hostElem, targetElem, placement, appendToBody) { - hostElem = this.getRawNode(hostElem); - targetElem = this.getRawNode(targetElem); - - // need to read from prop to support tests. - var targetWidth = angular.isDefined(targetElem.offsetWidth) ? targetElem.offsetWidth : targetElem.prop('offsetWidth'); - var targetHeight = angular.isDefined(targetElem.offsetHeight) ? targetElem.offsetHeight : targetElem.prop('offsetHeight'); - - placement = this.parsePlacement(placement); - - var hostElemPos = appendToBody ? this.offset(hostElem) : this.position(hostElem); - var targetElemPos = {top: 0, left: 0, placement: ''}; - - if (placement[2]) { - var viewportOffset = this.viewportOffset(hostElem, appendToBody); - - var targetElemStyle = $window.getComputedStyle(targetElem); - var adjustedSize = { - width: targetWidth + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginLeft) + this.parseStyle(targetElemStyle.marginRight))), - height: targetHeight + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginTop) + this.parseStyle(targetElemStyle.marginBottom))) - }; - - placement[0] = placement[0] === 'top' && adjustedSize.height > viewportOffset.top && adjustedSize.height <= viewportOffset.bottom ? 'bottom' : - placement[0] === 'bottom' && adjustedSize.height > viewportOffset.bottom && adjustedSize.height <= viewportOffset.top ? 'top' : - placement[0] === 'left' && adjustedSize.width > viewportOffset.left && adjustedSize.width <= viewportOffset.right ? 'right' : - placement[0] === 'right' && adjustedSize.width > viewportOffset.right && adjustedSize.width <= viewportOffset.left ? 'left' : - placement[0]; - - placement[1] = placement[1] === 'top' && adjustedSize.height - hostElemPos.height > viewportOffset.bottom && adjustedSize.height - hostElemPos.height <= viewportOffset.top ? 'bottom' : - placement[1] === 'bottom' && adjustedSize.height - hostElemPos.height > viewportOffset.top && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom ? 'top' : - placement[1] === 'left' && adjustedSize.width - hostElemPos.width > viewportOffset.right && adjustedSize.width - hostElemPos.width <= viewportOffset.left ? 'right' : - placement[1] === 'right' && adjustedSize.width - hostElemPos.width > viewportOffset.left && adjustedSize.width - hostElemPos.width <= viewportOffset.right ? 'left' : - placement[1]; - - if (placement[1] === 'center') { - if (PLACEMENT_REGEX.vertical.test(placement[0])) { - var xOverflow = hostElemPos.width / 2 - targetWidth / 2; - if (viewportOffset.left + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.right) { - placement[1] = 'left'; - } else if (viewportOffset.right + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.left) { - placement[1] = 'right'; - } - } else { - var yOverflow = hostElemPos.height / 2 - adjustedSize.height / 2; - if (viewportOffset.top + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom) { - placement[1] = 'top'; - } else if (viewportOffset.bottom + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.top) { - placement[1] = 'bottom'; - } - } - } - } - - switch (placement[0]) { - case 'top': - targetElemPos.top = hostElemPos.top - targetHeight; - break; - case 'bottom': - targetElemPos.top = hostElemPos.top + hostElemPos.height; - break; - case 'left': - targetElemPos.left = hostElemPos.left - targetWidth; - break; - case 'right': - targetElemPos.left = hostElemPos.left + hostElemPos.width; - break; - } - - switch (placement[1]) { - case 'top': - targetElemPos.top = hostElemPos.top; - break; - case 'bottom': - targetElemPos.top = hostElemPos.top + hostElemPos.height - targetHeight; - break; - case 'left': - targetElemPos.left = hostElemPos.left; - break; - case 'right': - targetElemPos.left = hostElemPos.left + hostElemPos.width - targetWidth; - break; - case 'center': - if (PLACEMENT_REGEX.vertical.test(placement[0])) { - targetElemPos.left = hostElemPos.left + hostElemPos.width / 2 - targetWidth / 2; - } else { - targetElemPos.top = hostElemPos.top + hostElemPos.height / 2 - targetHeight / 2; - } - break; - } - - targetElemPos.top = Math.round(targetElemPos.top); - targetElemPos.left = Math.round(targetElemPos.left); - targetElemPos.placement = placement[1] === 'center' ? placement[0] : placement[0] + '-' + placement[1]; - - return targetElemPos; - }, - - /** - * Provides a way for positioning tooltip & dropdown - * arrows when using placement options beyond the standard - * left, right, top, or bottom. - * - * @param {element} elem - The tooltip/dropdown element. - * @param {string} placement - The placement for the elem. - */ - positionArrow: function(elem, placement) { - elem = this.getRawNode(elem); - - var innerElem = elem.querySelector('.tooltip-inner, .popover-inner'); - if (!innerElem) { - return; - } - - var isTooltip = angular.element(innerElem).hasClass('tooltip-inner'); - - var arrowElem = isTooltip ? elem.querySelector('.tooltip-arrow') : elem.querySelector('.arrow'); - if (!arrowElem) { - return; - } - - var arrowCss = { - top: '', - bottom: '', - left: '', - right: '' - }; - - placement = this.parsePlacement(placement); - if (placement[1] === 'center') { - // no adjustment necessary - just reset styles - angular.element(arrowElem).css(arrowCss); - return; - } - - var borderProp = 'border-' + placement[0] + '-width'; - var borderWidth = $window.getComputedStyle(arrowElem)[borderProp]; - - var borderRadiusProp = 'border-'; - if (PLACEMENT_REGEX.vertical.test(placement[0])) { - borderRadiusProp += placement[0] + '-' + placement[1]; - } else { - borderRadiusProp += placement[1] + '-' + placement[0]; - } - borderRadiusProp += '-radius'; - var borderRadius = $window.getComputedStyle(isTooltip ? innerElem : elem)[borderRadiusProp]; - - switch (placement[0]) { - case 'top': - arrowCss.bottom = isTooltip ? '0' : '-' + borderWidth; - break; - case 'bottom': - arrowCss.top = isTooltip ? '0' : '-' + borderWidth; - break; - case 'left': - arrowCss.right = isTooltip ? '0' : '-' + borderWidth; - break; - case 'right': - arrowCss.left = isTooltip ? '0' : '-' + borderWidth; - break; - } - - arrowCss[placement[1]] = borderRadius; - - angular.element(arrowElem).css(arrowCss); - } - }; - }]); - -angular.module('ui.bootstrap.datepickerPopup', ['ui.bootstrap.datepicker', 'ui.bootstrap.position']) - -.value('$datepickerPopupLiteralWarning', true) - -.constant('uibDatepickerPopupConfig', { - altInputFormats: [], - appendToBody: false, - clearText: 'Clear', - closeOnDateSelection: true, - closeText: 'Done', - currentText: 'Today', - datepickerPopup: 'yyyy-MM-dd', - datepickerPopupTemplateUrl: 'uib/template/datepickerPopup/popup.html', - datepickerTemplateUrl: 'uib/template/datepicker/datepicker.html', - html5Types: { - date: 'yyyy-MM-dd', - 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss', - 'month': 'yyyy-MM' - }, - onOpenFocus: true, - showButtonBar: true, - placement: 'auto bottom-left' -}) - -.controller('UibDatepickerPopupController', ['$scope', '$element', '$attrs', '$compile', '$log', '$parse', '$window', '$document', '$rootScope', '$uibPosition', 'dateFilter', 'uibDateParser', 'uibDatepickerPopupConfig', '$timeout', 'uibDatepickerConfig', '$datepickerPopupLiteralWarning', -function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $rootScope, $position, dateFilter, dateParser, datepickerPopupConfig, $timeout, datepickerConfig, $datepickerPopupLiteralWarning) { - var cache = {}, - isHtml5DateInput = false; - var dateFormat, closeOnDateSelection, appendToBody, onOpenFocus, - datepickerPopupTemplateUrl, datepickerTemplateUrl, popupEl, datepickerEl, scrollParentEl, - ngModel, ngModelOptions, $popup, altInputFormats, watchListeners = [], - timezone; - - this.init = function(_ngModel_) { - ngModel = _ngModel_; - ngModelOptions = _ngModel_.$options; - closeOnDateSelection = angular.isDefined($attrs.closeOnDateSelection) ? - $scope.$parent.$eval($attrs.closeOnDateSelection) : - datepickerPopupConfig.closeOnDateSelection; - appendToBody = angular.isDefined($attrs.datepickerAppendToBody) ? - $scope.$parent.$eval($attrs.datepickerAppendToBody) : - datepickerPopupConfig.appendToBody; - onOpenFocus = angular.isDefined($attrs.onOpenFocus) ? - $scope.$parent.$eval($attrs.onOpenFocus) : datepickerPopupConfig.onOpenFocus; - datepickerPopupTemplateUrl = angular.isDefined($attrs.datepickerPopupTemplateUrl) ? - $attrs.datepickerPopupTemplateUrl : - datepickerPopupConfig.datepickerPopupTemplateUrl; - datepickerTemplateUrl = angular.isDefined($attrs.datepickerTemplateUrl) ? - $attrs.datepickerTemplateUrl : datepickerPopupConfig.datepickerTemplateUrl; - altInputFormats = angular.isDefined($attrs.altInputFormats) ? - $scope.$parent.$eval($attrs.altInputFormats) : - datepickerPopupConfig.altInputFormats; - - $scope.showButtonBar = angular.isDefined($attrs.showButtonBar) ? - $scope.$parent.$eval($attrs.showButtonBar) : - datepickerPopupConfig.showButtonBar; - - if (datepickerPopupConfig.html5Types[$attrs.type]) { - dateFormat = datepickerPopupConfig.html5Types[$attrs.type]; - isHtml5DateInput = true; - } else { - dateFormat = $attrs.uibDatepickerPopup || datepickerPopupConfig.datepickerPopup; - $attrs.$observe('uibDatepickerPopup', function(value, oldValue) { - var newDateFormat = value || datepickerPopupConfig.datepickerPopup; - // Invalidate the $modelValue to ensure that formatters re-run - // FIXME: Refactor when PR is merged: https://github.com/angular/angular.js/pull/10764 - if (newDateFormat !== dateFormat) { - dateFormat = newDateFormat; - ngModel.$modelValue = null; - - if (!dateFormat) { - throw new Error('uibDatepickerPopup must have a date format specified.'); - } - } - }); - } - - if (!dateFormat) { - throw new Error('uibDatepickerPopup must have a date format specified.'); - } - - if (isHtml5DateInput && $attrs.uibDatepickerPopup) { - throw new Error('HTML5 date input types do not support custom formats.'); - } - - // popup element used to display calendar - popupEl = angular.element('
      '); - if (ngModelOptions) { - timezone = ngModelOptions.timezone; - $scope.ngModelOptions = angular.copy(ngModelOptions); - $scope.ngModelOptions.timezone = null; - if ($scope.ngModelOptions.updateOnDefault === true) { - $scope.ngModelOptions.updateOn = $scope.ngModelOptions.updateOn ? - $scope.ngModelOptions.updateOn + ' default' : 'default'; - } - - popupEl.attr('ng-model-options', 'ngModelOptions'); - } else { - timezone = null; - } - - popupEl.attr({ - 'ng-model': 'date', - 'ng-change': 'dateSelection(date)', - 'template-url': datepickerPopupTemplateUrl - }); - - // datepicker element - datepickerEl = angular.element(popupEl.children()[0]); - datepickerEl.attr('template-url', datepickerTemplateUrl); - - if (!$scope.datepickerOptions) { - $scope.datepickerOptions = {}; - } - - if (isHtml5DateInput) { - if ($attrs.type === 'month') { - $scope.datepickerOptions.datepickerMode = 'month'; - $scope.datepickerOptions.minMode = 'month'; - } - } - - datepickerEl.attr('datepicker-options', 'datepickerOptions'); - - if (!isHtml5DateInput) { - // Internal API to maintain the correct ng-invalid-[key] class - ngModel.$$parserName = 'date'; - ngModel.$validators.date = validator; - ngModel.$parsers.unshift(parseDate); - ngModel.$formatters.push(function(value) { - if (ngModel.$isEmpty(value)) { - $scope.date = value; - return value; - } - - if (angular.isNumber(value)) { - value = new Date(value); - } - - $scope.date = dateParser.fromTimezone(value, timezone); - - return dateParser.filter($scope.date, dateFormat); - }); - } else { - ngModel.$formatters.push(function(value) { - $scope.date = dateParser.fromTimezone(value, timezone); - return value; - }); - } - - // Detect changes in the view from the text box - ngModel.$viewChangeListeners.push(function() { - $scope.date = parseDateString(ngModel.$viewValue); - }); - - $element.on('keydown', inputKeydownBind); - - $popup = $compile(popupEl)($scope); - // Prevent jQuery cache memory leak (template is now redundant after linking) - popupEl.remove(); - - if (appendToBody) { - $document.find('body').append($popup); - } else { - $element.after($popup); - } - - $scope.$on('$destroy', function() { - if ($scope.isOpen === true) { - if (!$rootScope.$$phase) { - $scope.$apply(function() { - $scope.isOpen = false; - }); - } - } - - $popup.remove(); - $element.off('keydown', inputKeydownBind); - $document.off('click', documentClickBind); - if (scrollParentEl) { - scrollParentEl.off('scroll', positionPopup); - } - angular.element($window).off('resize', positionPopup); - - //Clear all watch listeners on destroy - while (watchListeners.length) { - watchListeners.shift()(); - } - }); - }; - - $scope.getText = function(key) { - return $scope[key + 'Text'] || datepickerPopupConfig[key + 'Text']; - }; - - $scope.isDisabled = function(date) { - if (date === 'today') { - date = dateParser.fromTimezone(new Date(), timezone); - } - - var dates = {}; - angular.forEach(['minDate', 'maxDate'], function(key) { - if (!$scope.datepickerOptions[key]) { - dates[key] = null; - } else if (angular.isDate($scope.datepickerOptions[key])) { - dates[key] = dateParser.fromTimezone(new Date($scope.datepickerOptions[key]), timezone); - } else { - if ($datepickerPopupLiteralWarning) { - $log.warn('Literal date support has been deprecated, please switch to date object usage'); - } - - dates[key] = new Date(dateFilter($scope.datepickerOptions[key], 'medium')); - } - }); - - return $scope.datepickerOptions && - dates.minDate && $scope.compare(date, dates.minDate) < 0 || - dates.maxDate && $scope.compare(date, dates.maxDate) > 0; - }; - - $scope.compare = function(date1, date2) { - return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()); - }; - - // Inner change - $scope.dateSelection = function(dt) { - if (angular.isDefined(dt)) { - $scope.date = dt; - } - var date = $scope.date ? dateParser.filter($scope.date, dateFormat) : null; // Setting to NULL is necessary for form validators to function - $element.val(date); - ngModel.$setViewValue(date); - - if (closeOnDateSelection) { - $scope.isOpen = false; - $element[0].focus(); - } - }; - - $scope.keydown = function(evt) { - if (evt.which === 27) { - evt.stopPropagation(); - $scope.isOpen = false; - $element[0].focus(); - } - }; - - $scope.select = function(date, evt) { - evt.stopPropagation(); - - if (date === 'today') { - var today = new Date(); - if (angular.isDate($scope.date)) { - date = new Date($scope.date); - date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate()); - } else { - date = new Date(today.setHours(0, 0, 0, 0)); - } - } - $scope.dateSelection(date); - }; - - $scope.close = function(evt) { - evt.stopPropagation(); - - $scope.isOpen = false; - $element[0].focus(); - }; - - $scope.disabled = angular.isDefined($attrs.disabled) || false; - if ($attrs.ngDisabled) { - watchListeners.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(disabled) { - $scope.disabled = disabled; - })); - } - - $scope.$watch('isOpen', function(value) { - if (value) { - if (!$scope.disabled) { - $timeout(function() { - positionPopup(); - - if (onOpenFocus) { - $scope.$broadcast('uib:datepicker.focus'); - } - - $document.on('click', documentClickBind); - - var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement; - if (appendToBody || $position.parsePlacement(placement)[2]) { - scrollParentEl = scrollParentEl || angular.element($position.scrollParent($element)); - if (scrollParentEl) { - scrollParentEl.on('scroll', positionPopup); - } - } else { - scrollParentEl = null; - } - - angular.element($window).on('resize', positionPopup); - }, 0, false); - } else { - $scope.isOpen = false; - } - } else { - $document.off('click', documentClickBind); - if (scrollParentEl) { - scrollParentEl.off('scroll', positionPopup); - } - angular.element($window).off('resize', positionPopup); - } - }); - - function cameltoDash(string) { - return string.replace(/([A-Z])/g, function($1) { return '-' + $1.toLowerCase(); }); - } - - function parseDateString(viewValue) { - var date = dateParser.parse(viewValue, dateFormat, $scope.date); - if (isNaN(date)) { - for (var i = 0; i < altInputFormats.length; i++) { - date = dateParser.parse(viewValue, altInputFormats[i], $scope.date); - if (!isNaN(date)) { - return date; - } - } - } - return date; - } - - function parseDate(viewValue) { - if (angular.isNumber(viewValue)) { - // presumably timestamp to date object - viewValue = new Date(viewValue); - } - - if (!viewValue) { - return null; - } - - if (angular.isDate(viewValue) && !isNaN(viewValue)) { - return viewValue; - } - - if (angular.isString(viewValue)) { - var date = parseDateString(viewValue); - if (!isNaN(date)) { - return dateParser.toTimezone(date, timezone); - } - } - - return ngModel.$options && ngModel.$options.allowInvalid ? viewValue : undefined; - } - - function validator(modelValue, viewValue) { - var value = modelValue || viewValue; - - if (!$attrs.ngRequired && !value) { - return true; - } - - if (angular.isNumber(value)) { - value = new Date(value); - } - - if (!value) { - return true; - } - - if (angular.isDate(value) && !isNaN(value)) { - return true; - } - - if (angular.isString(value)) { - return !isNaN(parseDateString(viewValue)); - } - - return false; - } - - function documentClickBind(event) { - if (!$scope.isOpen && $scope.disabled) { - return; - } - - var popup = $popup[0]; - var dpContainsTarget = $element[0].contains(event.target); - // The popup node may not be an element node - // In some browsers (IE) only element nodes have the 'contains' function - var popupContainsTarget = popup.contains !== undefined && popup.contains(event.target); - if ($scope.isOpen && !(dpContainsTarget || popupContainsTarget)) { - $scope.$apply(function() { - $scope.isOpen = false; - }); - } - } - - function inputKeydownBind(evt) { - if (evt.which === 27 && $scope.isOpen) { - evt.preventDefault(); - evt.stopPropagation(); - $scope.$apply(function() { - $scope.isOpen = false; - }); - $element[0].focus(); - } else if (evt.which === 40 && !$scope.isOpen) { - evt.preventDefault(); - evt.stopPropagation(); - $scope.$apply(function() { - $scope.isOpen = true; - }); - } - } - - function positionPopup() { - if ($scope.isOpen) { - var dpElement = angular.element($popup[0].querySelector('.uib-datepicker-popup')); - var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement; - var position = $position.positionElements($element, dpElement, placement, appendToBody); - dpElement.css({top: position.top + 'px', left: position.left + 'px'}); - if (dpElement.hasClass('uib-position-measure')) { - dpElement.removeClass('uib-position-measure'); - } - } - } - - $scope.$on('uib:datepicker.mode', function() { - $timeout(positionPopup, 0, false); - }); -}]) - -.directive('uibDatepickerPopup', function() { - return { - require: ['ngModel', 'uibDatepickerPopup'], - controller: 'UibDatepickerPopupController', - scope: { - datepickerOptions: '=?', - isOpen: '=?', - currentText: '@', - clearText: '@', - closeText: '@' - }, - link: function(scope, element, attrs, ctrls) { - var ngModel = ctrls[0], - ctrl = ctrls[1]; - - ctrl.init(ngModel); - } - }; -}) - -.directive('uibDatepickerPopupWrap', function() { - return { - replace: true, - transclude: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/datepickerPopup/popup.html'; - } - }; -}); - -angular.module('ui.bootstrap.debounce', []) -/** - * A helper, internal service that debounces a function - */ - .factory('$$debounce', ['$timeout', function($timeout) { - return function(callback, debounceTime) { - var timeoutPromise; - - return function() { - var self = this; - var args = Array.prototype.slice.call(arguments); - if (timeoutPromise) { - $timeout.cancel(timeoutPromise); - } - - timeoutPromise = $timeout(function() { - callback.apply(self, args); - }, debounceTime); - }; - }; - }]); - -angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) - -.constant('uibDropdownConfig', { - appendToOpenClass: 'uib-dropdown-open', - openClass: 'open' -}) - -.service('uibDropdownService', ['$document', '$rootScope', function($document, $rootScope) { - var openScope = null; - - this.open = function(dropdownScope, element) { - if (!openScope) { - $document.on('click', closeDropdown); - element.on('keydown', keybindFilter); - } - - if (openScope && openScope !== dropdownScope) { - openScope.isOpen = false; - } - - openScope = dropdownScope; - }; - - this.close = function(dropdownScope, element) { - if (openScope === dropdownScope) { - openScope = null; - $document.off('click', closeDropdown); - element.off('keydown', keybindFilter); - } - }; - - var closeDropdown = function(evt) { - // This method may still be called during the same mouse event that - // unbound this event handler. So check openScope before proceeding. - if (!openScope) { return; } - - if (evt && openScope.getAutoClose() === 'disabled') { return; } - - if (evt && evt.which === 3) { return; } - - var toggleElement = openScope.getToggleElement(); - if (evt && toggleElement && toggleElement[0].contains(evt.target)) { - return; - } - - var dropdownElement = openScope.getDropdownElement(); - if (evt && openScope.getAutoClose() === 'outsideClick' && - dropdownElement && dropdownElement[0].contains(evt.target)) { - return; - } - - openScope.isOpen = false; - - if (!$rootScope.$$phase) { - openScope.$apply(); - } - }; - - var keybindFilter = function(evt) { - if (evt.which === 27) { - evt.stopPropagation(); - openScope.focusToggleElement(); - closeDropdown(); - } else if (openScope.isKeynavEnabled() && [38, 40].indexOf(evt.which) !== -1 && openScope.isOpen) { - evt.preventDefault(); - evt.stopPropagation(); - openScope.focusDropdownEntry(evt.which); - } - }; -}]) - -.controller('UibDropdownController', ['$scope', '$element', '$attrs', '$parse', 'uibDropdownConfig', 'uibDropdownService', '$animate', '$uibPosition', '$document', '$compile', '$templateRequest', function($scope, $element, $attrs, $parse, dropdownConfig, uibDropdownService, $animate, $position, $document, $compile, $templateRequest) { - var self = this, - scope = $scope.$new(), // create a child scope so we are not polluting original one - templateScope, - appendToOpenClass = dropdownConfig.appendToOpenClass, - openClass = dropdownConfig.openClass, - getIsOpen, - setIsOpen = angular.noop, - toggleInvoker = $attrs.onToggle ? $parse($attrs.onToggle) : angular.noop, - appendToBody = false, - appendTo = null, - keynavEnabled = false, - selectedOption = null, - body = $document.find('body'); - - $element.addClass('dropdown'); - - this.init = function() { - if ($attrs.isOpen) { - getIsOpen = $parse($attrs.isOpen); - setIsOpen = getIsOpen.assign; - - $scope.$watch(getIsOpen, function(value) { - scope.isOpen = !!value; - }); - } - - if (angular.isDefined($attrs.dropdownAppendTo)) { - var appendToEl = $parse($attrs.dropdownAppendTo)(scope); - if (appendToEl) { - appendTo = angular.element(appendToEl); - } - } - - appendToBody = angular.isDefined($attrs.dropdownAppendToBody); - keynavEnabled = angular.isDefined($attrs.keyboardNav); - - if (appendToBody && !appendTo) { - appendTo = body; - } - - if (appendTo && self.dropdownMenu) { - appendTo.append(self.dropdownMenu); - $element.on('$destroy', function handleDestroyEvent() { - self.dropdownMenu.remove(); - }); - } - }; - - this.toggle = function(open) { - scope.isOpen = arguments.length ? !!open : !scope.isOpen; - if (angular.isFunction(setIsOpen)) { - setIsOpen(scope, scope.isOpen); - } - - return scope.isOpen; - }; - - // Allow other directives to watch status - this.isOpen = function() { - return scope.isOpen; - }; - - scope.getToggleElement = function() { - return self.toggleElement; - }; - - scope.getAutoClose = function() { - return $attrs.autoClose || 'always'; //or 'outsideClick' or 'disabled' - }; - - scope.getElement = function() { - return $element; - }; - - scope.isKeynavEnabled = function() { - return keynavEnabled; - }; - - scope.focusDropdownEntry = function(keyCode) { - var elems = self.dropdownMenu ? //If append to body is used. - angular.element(self.dropdownMenu).find('a') : - $element.find('ul').eq(0).find('a'); - - switch (keyCode) { - case 40: { - if (!angular.isNumber(self.selectedOption)) { - self.selectedOption = 0; - } else { - self.selectedOption = self.selectedOption === elems.length - 1 ? - self.selectedOption : - self.selectedOption + 1; - } - break; - } - case 38: { - if (!angular.isNumber(self.selectedOption)) { - self.selectedOption = elems.length - 1; - } else { - self.selectedOption = self.selectedOption === 0 ? - 0 : self.selectedOption - 1; - } - break; - } - } - elems[self.selectedOption].focus(); - }; - - scope.getDropdownElement = function() { - return self.dropdownMenu; - }; - - scope.focusToggleElement = function() { - if (self.toggleElement) { - self.toggleElement[0].focus(); - } - }; - - scope.$watch('isOpen', function(isOpen, wasOpen) { - if (appendTo && self.dropdownMenu) { - var pos = $position.positionElements($element, self.dropdownMenu, 'bottom-left', true), - css, - rightalign, - scrollbarWidth; - - css = { - top: pos.top + 'px', - display: isOpen ? 'block' : 'none' - }; - - rightalign = self.dropdownMenu.hasClass('dropdown-menu-right'); - if (!rightalign) { - css.left = pos.left + 'px'; - css.right = 'auto'; - } else { - css.left = 'auto'; - scrollbarWidth = $position.scrollbarWidth(true); - css.right = window.innerWidth - scrollbarWidth - - (pos.left + $element.prop('offsetWidth')) + 'px'; - } - - // Need to adjust our positioning to be relative to the appendTo container - // if it's not the body element - if (!appendToBody) { - var appendOffset = $position.offset(appendTo); - - css.top = pos.top - appendOffset.top + 'px'; - - if (!rightalign) { - css.left = pos.left - appendOffset.left + 'px'; - } else { - css.right = window.innerWidth - - (pos.left - appendOffset.left + $element.prop('offsetWidth')) + 'px'; - } - } - - self.dropdownMenu.css(css); - } - - var openContainer = appendTo ? appendTo : $element; - var hasOpenClass = openContainer.hasClass(appendTo ? appendToOpenClass : openClass); - - if (hasOpenClass === !isOpen) { - $animate[isOpen ? 'addClass' : 'removeClass'](openContainer, appendTo ? appendToOpenClass : openClass).then(function() { - if (angular.isDefined(isOpen) && isOpen !== wasOpen) { - toggleInvoker($scope, { open: !!isOpen }); - } - }); - } - - if (isOpen) { - if (self.dropdownMenuTemplateUrl) { - $templateRequest(self.dropdownMenuTemplateUrl).then(function(tplContent) { - templateScope = scope.$new(); - $compile(tplContent.trim())(templateScope, function(dropdownElement) { - var newEl = dropdownElement; - self.dropdownMenu.replaceWith(newEl); - self.dropdownMenu = newEl; - }); - }); - } - - scope.focusToggleElement(); - uibDropdownService.open(scope, $element); - } else { - if (self.dropdownMenuTemplateUrl) { - if (templateScope) { - templateScope.$destroy(); - } - var newEl = angular.element(''); - self.dropdownMenu.replaceWith(newEl); - self.dropdownMenu = newEl; - } - - uibDropdownService.close(scope, $element); - self.selectedOption = null; - } - - if (angular.isFunction(setIsOpen)) { - setIsOpen($scope, isOpen); - } - }); -}]) - -.directive('uibDropdown', function() { - return { - controller: 'UibDropdownController', - link: function(scope, element, attrs, dropdownCtrl) { - dropdownCtrl.init(); - } - }; -}) - -.directive('uibDropdownMenu', function() { - return { - restrict: 'A', - require: '?^uibDropdown', - link: function(scope, element, attrs, dropdownCtrl) { - if (!dropdownCtrl || angular.isDefined(attrs.dropdownNested)) { - return; - } - - element.addClass('dropdown-menu'); - - var tplUrl = attrs.templateUrl; - if (tplUrl) { - dropdownCtrl.dropdownMenuTemplateUrl = tplUrl; - } - - if (!dropdownCtrl.dropdownMenu) { - dropdownCtrl.dropdownMenu = element; - } - } - }; -}) - -.directive('uibDropdownToggle', function() { - return { - require: '?^uibDropdown', - link: function(scope, element, attrs, dropdownCtrl) { - if (!dropdownCtrl) { - return; - } - - element.addClass('dropdown-toggle'); - - dropdownCtrl.toggleElement = element; - - var toggleDropdown = function(event) { - event.preventDefault(); - - if (!element.hasClass('disabled') && !attrs.disabled) { - scope.$apply(function() { - dropdownCtrl.toggle(); - }); - } - }; - - element.bind('click', toggleDropdown); - - // WAI-ARIA - element.attr({ 'aria-haspopup': true, 'aria-expanded': false }); - scope.$watch(dropdownCtrl.isOpen, function(isOpen) { - element.attr('aria-expanded', !!isOpen); - }); - - scope.$on('$destroy', function() { - element.unbind('click', toggleDropdown); - }); - } - }; -}); - -angular.module('ui.bootstrap.stackedMap', []) -/** - * A helper, internal data structure that acts as a map but also allows getting / removing - * elements in the LIFO order - */ - .factory('$$stackedMap', function() { - return { - createNew: function() { - var stack = []; - - return { - add: function(key, value) { - stack.push({ - key: key, - value: value - }); - }, - get: function(key) { - for (var i = 0; i < stack.length; i++) { - if (key === stack[i].key) { - return stack[i]; - } - } - }, - keys: function() { - var keys = []; - for (var i = 0; i < stack.length; i++) { - keys.push(stack[i].key); - } - return keys; - }, - top: function() { - return stack[stack.length - 1]; - }, - remove: function(key) { - var idx = -1; - for (var i = 0; i < stack.length; i++) { - if (key === stack[i].key) { - idx = i; - break; - } - } - return stack.splice(idx, 1)[0]; - }, - removeTop: function() { - return stack.splice(stack.length - 1, 1)[0]; - }, - length: function() { - return stack.length; - } - }; - } - }; - }); -angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.position']) -/** - * A helper, internal data structure that stores all references attached to key - */ - .factory('$$multiMap', function() { - return { - createNew: function() { - var map = {}; - - return { - entries: function() { - return Object.keys(map).map(function(key) { - return { - key: key, - value: map[key] - }; - }); - }, - get: function(key) { - return map[key]; - }, - hasKey: function(key) { - return !!map[key]; - }, - keys: function() { - return Object.keys(map); - }, - put: function(key, value) { - if (!map[key]) { - map[key] = []; - } - - map[key].push(value); - }, - remove: function(key, value) { - var values = map[key]; - - if (!values) { - return; - } - - var idx = values.indexOf(value); - - if (idx !== -1) { - values.splice(idx, 1); - } - - if (!values.length) { - delete map[key]; - } - } - }; - } - }; - }) - -/** - * Pluggable resolve mechanism for the modal resolve resolution - * Supports UI Router's $resolve service - */ - .provider('$uibResolve', function() { - var resolve = this; - this.resolver = null; - - this.setResolver = function(resolver) { - this.resolver = resolver; - }; - - this.$get = ['$injector', '$q', function($injector, $q) { - var resolver = resolve.resolver ? $injector.get(resolve.resolver) : null; - return { - resolve: function(invocables, locals, parent, self) { - if (resolver) { - return resolver.resolve(invocables, locals, parent, self); - } - - var promises = []; - - angular.forEach(invocables, function(value) { - if (angular.isFunction(value) || angular.isArray(value)) { - promises.push($q.resolve($injector.invoke(value))); - } else if (angular.isString(value)) { - promises.push($q.resolve($injector.get(value))); - } else { - promises.push($q.resolve(value)); - } - }); - - return $q.all(promises).then(function(resolves) { - var resolveObj = {}; - var resolveIter = 0; - angular.forEach(invocables, function(value, key) { - resolveObj[key] = resolves[resolveIter++]; - }); - - return resolveObj; - }); - } - }; - }]; - }) - -/** - * A helper directive for the $modal service. It creates a backdrop element. - */ - .directive('uibModalBackdrop', ['$animate', '$injector', '$uibModalStack', - function($animate, $injector, $modalStack) { - return { - replace: true, - templateUrl: 'uib/template/modal/backdrop.html', - compile: function(tElement, tAttrs) { - tElement.addClass(tAttrs.backdropClass); - return linkFn; - } - }; - - function linkFn(scope, element, attrs) { - if (attrs.modalInClass) { - $animate.addClass(element, attrs.modalInClass); - - scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) { - var done = setIsAsync(); - if (scope.modalOptions.animation) { - $animate.removeClass(element, attrs.modalInClass).then(done); - } else { - done(); - } - }); - } - } - }]) - - .directive('uibModalWindow', ['$uibModalStack', '$q', '$animateCss', '$document', - function($modalStack, $q, $animateCss, $document) { - return { - scope: { - index: '@' - }, - replace: true, - transclude: true, - templateUrl: function(tElement, tAttrs) { - return tAttrs.templateUrl || 'uib/template/modal/window.html'; - }, - link: function(scope, element, attrs) { - element.addClass(attrs.windowClass || ''); - element.addClass(attrs.windowTopClass || ''); - scope.size = attrs.size; - - scope.close = function(evt) { - var modal = $modalStack.getTop(); - if (modal && modal.value.backdrop && - modal.value.backdrop !== 'static' && - evt.target === evt.currentTarget) { - evt.preventDefault(); - evt.stopPropagation(); - $modalStack.dismiss(modal.key, 'backdrop click'); - } - }; - - // moved from template to fix issue #2280 - element.on('click', scope.close); - - // This property is only added to the scope for the purpose of detecting when this directive is rendered. - // We can detect that by using this property in the template associated with this directive and then use - // {@link Attribute#$observe} on it. For more details please see {@link TableColumnResize}. - scope.$isRendered = true; - - // Deferred object that will be resolved when this modal is render. - var modalRenderDeferObj = $q.defer(); - // Observe function will be called on next digest cycle after compilation, ensuring that the DOM is ready. - // In order to use this way of finding whether DOM is ready, we need to observe a scope property used in modal's template. - attrs.$observe('modalRender', function(value) { - if (value === 'true') { - modalRenderDeferObj.resolve(); - } - }); - - modalRenderDeferObj.promise.then(function() { - var animationPromise = null; - - if (attrs.modalInClass) { - animationPromise = $animateCss(element, { - addClass: attrs.modalInClass - }).start(); - - scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) { - var done = setIsAsync(); - $animateCss(element, { - removeClass: attrs.modalInClass - }).start().then(done); - }); - } - - - $q.when(animationPromise).then(function() { - // Notify {@link $modalStack} that modal is rendered. - var modal = $modalStack.getTop(); - if (modal) { - $modalStack.modalRendered(modal.key); - } - - /** - * If something within the freshly-opened modal already has focus (perhaps via a - * directive that causes focus). then no need to try and focus anything. - */ - if (!($document[0].activeElement && element[0].contains($document[0].activeElement))) { - var inputWithAutofocus = element[0].querySelector('[autofocus]'); - /** - * Auto-focusing of a freshly-opened modal element causes any child elements - * with the autofocus attribute to lose focus. This is an issue on touch - * based devices which will show and then hide the onscreen keyboard. - * Attempts to refocus the autofocus element via JavaScript will not reopen - * the onscreen keyboard. Fixed by updated the focusing logic to only autofocus - * the modal element if the modal does not contain an autofocus element. - */ - if (inputWithAutofocus) { - inputWithAutofocus.focus(); - } else { - element[0].focus(); - } - } - }); - }); - } - }; - }]) - - .directive('uibModalAnimationClass', function() { - return { - compile: function(tElement, tAttrs) { - if (tAttrs.modalAnimation) { - tElement.addClass(tAttrs.uibModalAnimationClass); - } - } - }; - }) - - .directive('uibModalTransclude', function() { - return { - link: function(scope, element, attrs, controller, transclude) { - transclude(scope.$parent, function(clone) { - element.empty(); - element.append(clone); - }); - } - }; - }) - - .factory('$uibModalStack', ['$animate', '$animateCss', '$document', - '$compile', '$rootScope', '$q', '$$multiMap', '$$stackedMap', '$uibPosition', - function($animate, $animateCss, $document, $compile, $rootScope, $q, $$multiMap, $$stackedMap, $uibPosition) { - var OPENED_MODAL_CLASS = 'modal-open'; - - var backdropDomEl, backdropScope; - var openedWindows = $$stackedMap.createNew(); - var openedClasses = $$multiMap.createNew(); - var $modalStack = { - NOW_CLOSING_EVENT: 'modal.stack.now-closing' - }; - var topModalIndex = 0; - var previousTopOpenedModal = null; - - //Modal focus behavior - var tabableSelector = 'a[href], area[href], input:not([disabled]), ' + - 'button:not([disabled]),select:not([disabled]), textarea:not([disabled]), ' + - 'iframe, object, embed, *[tabindex], *[contenteditable=true]'; - var scrollbarPadding; - - function isVisible(element) { - return !!(element.offsetWidth || - element.offsetHeight || - element.getClientRects().length); - } - - function backdropIndex() { - var topBackdropIndex = -1; - var opened = openedWindows.keys(); - for (var i = 0; i < opened.length; i++) { - if (openedWindows.get(opened[i]).value.backdrop) { - topBackdropIndex = i; - } - } - - // If any backdrop exist, ensure that it's index is always - // right below the top modal - if (topBackdropIndex > -1 && topBackdropIndex < topModalIndex) { - topBackdropIndex = topModalIndex; - } - return topBackdropIndex; - } - - $rootScope.$watch(backdropIndex, function(newBackdropIndex) { - if (backdropScope) { - backdropScope.index = newBackdropIndex; - } - }); - - function removeModalWindow(modalInstance, elementToReceiveFocus) { - var modalWindow = openedWindows.get(modalInstance).value; - var appendToElement = modalWindow.appendTo; - - //clean up the stack - openedWindows.remove(modalInstance); - previousTopOpenedModal = openedWindows.top(); - if (previousTopOpenedModal) { - topModalIndex = parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10); - } - - removeAfterAnimate(modalWindow.modalDomEl, modalWindow.modalScope, function() { - var modalBodyClass = modalWindow.openedClass || OPENED_MODAL_CLASS; - openedClasses.remove(modalBodyClass, modalInstance); - var areAnyOpen = openedClasses.hasKey(modalBodyClass); - appendToElement.toggleClass(modalBodyClass, areAnyOpen); - if (!areAnyOpen && scrollbarPadding && scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) { - if (scrollbarPadding.originalRight) { - appendToElement.css({paddingRight: scrollbarPadding.originalRight + 'px'}); - } else { - appendToElement.css({paddingRight: ''}); - } - scrollbarPadding = null; - } - toggleTopWindowClass(true); - }, modalWindow.closedDeferred); - checkRemoveBackdrop(); - - //move focus to specified element if available, or else to body - if (elementToReceiveFocus && elementToReceiveFocus.focus) { - elementToReceiveFocus.focus(); - } else if (appendToElement.focus) { - appendToElement.focus(); - } - } - - // Add or remove "windowTopClass" from the top window in the stack - function toggleTopWindowClass(toggleSwitch) { - var modalWindow; - - if (openedWindows.length() > 0) { - modalWindow = openedWindows.top().value; - modalWindow.modalDomEl.toggleClass(modalWindow.windowTopClass || '', toggleSwitch); - } - } - - function checkRemoveBackdrop() { - //remove backdrop if no longer needed - if (backdropDomEl && backdropIndex() === -1) { - var backdropScopeRef = backdropScope; - removeAfterAnimate(backdropDomEl, backdropScope, function() { - backdropScopeRef = null; - }); - backdropDomEl = undefined; - backdropScope = undefined; - } - } - - function removeAfterAnimate(domEl, scope, done, closedDeferred) { - var asyncDeferred; - var asyncPromise = null; - var setIsAsync = function() { - if (!asyncDeferred) { - asyncDeferred = $q.defer(); - asyncPromise = asyncDeferred.promise; - } - - return function asyncDone() { - asyncDeferred.resolve(); - }; - }; - scope.$broadcast($modalStack.NOW_CLOSING_EVENT, setIsAsync); - - // Note that it's intentional that asyncPromise might be null. - // That's when setIsAsync has not been called during the - // NOW_CLOSING_EVENT broadcast. - return $q.when(asyncPromise).then(afterAnimating); - - function afterAnimating() { - if (afterAnimating.done) { - return; - } - afterAnimating.done = true; - - $animate.leave(domEl).then(function() { - domEl.remove(); - if (closedDeferred) { - closedDeferred.resolve(); - } - }); - - scope.$destroy(); - if (done) { - done(); - } - } - } - - $document.on('keydown', keydownListener); - - $rootScope.$on('$destroy', function() { - $document.off('keydown', keydownListener); - }); - - function keydownListener(evt) { - if (evt.isDefaultPrevented()) { - return evt; - } - - var modal = openedWindows.top(); - if (modal) { - switch (evt.which) { - case 27: { - if (modal.value.keyboard) { - evt.preventDefault(); - $rootScope.$apply(function() { - $modalStack.dismiss(modal.key, 'escape key press'); - }); - } - break; - } - case 9: { - var list = $modalStack.loadFocusElementList(modal); - var focusChanged = false; - if (evt.shiftKey) { - if ($modalStack.isFocusInFirstItem(evt, list) || $modalStack.isModalFocused(evt, modal)) { - focusChanged = $modalStack.focusLastFocusableElement(list); - } - } else { - if ($modalStack.isFocusInLastItem(evt, list)) { - focusChanged = $modalStack.focusFirstFocusableElement(list); - } - } - - if (focusChanged) { - evt.preventDefault(); - evt.stopPropagation(); - } - - break; - } - } - } - } - - $modalStack.open = function(modalInstance, modal) { - var modalOpener = $document[0].activeElement, - modalBodyClass = modal.openedClass || OPENED_MODAL_CLASS; - - toggleTopWindowClass(false); - - // Store the current top first, to determine what index we ought to use - // for the current top modal - previousTopOpenedModal = openedWindows.top(); - - openedWindows.add(modalInstance, { - deferred: modal.deferred, - renderDeferred: modal.renderDeferred, - closedDeferred: modal.closedDeferred, - modalScope: modal.scope, - backdrop: modal.backdrop, - keyboard: modal.keyboard, - openedClass: modal.openedClass, - windowTopClass: modal.windowTopClass, - animation: modal.animation, - appendTo: modal.appendTo - }); - - openedClasses.put(modalBodyClass, modalInstance); - - var appendToElement = modal.appendTo, - currBackdropIndex = backdropIndex(); - - if (!appendToElement.length) { - throw new Error('appendTo element not found. Make sure that the element passed is in DOM.'); - } - - if (currBackdropIndex >= 0 && !backdropDomEl) { - backdropScope = $rootScope.$new(true); - backdropScope.modalOptions = modal; - backdropScope.index = currBackdropIndex; - backdropDomEl = angular.element('
      '); - backdropDomEl.attr('backdrop-class', modal.backdropClass); - if (modal.animation) { - backdropDomEl.attr('modal-animation', 'true'); - } - $compile(backdropDomEl)(backdropScope); - $animate.enter(backdropDomEl, appendToElement); - scrollbarPadding = $uibPosition.scrollbarPadding(appendToElement); - if (scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) { - appendToElement.css({paddingRight: scrollbarPadding.right + 'px'}); - } - } - - // Set the top modal index based on the index of the previous top modal - topModalIndex = previousTopOpenedModal ? parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10) + 1 : 0; - var angularDomEl = angular.element('
      '); - angularDomEl.attr({ - 'template-url': modal.windowTemplateUrl, - 'window-class': modal.windowClass, - 'window-top-class': modal.windowTopClass, - 'size': modal.size, - 'index': topModalIndex, - 'animate': 'animate' - }).html(modal.content); - if (modal.animation) { - angularDomEl.attr('modal-animation', 'true'); - } - - appendToElement.addClass(modalBodyClass); - $animate.enter($compile(angularDomEl)(modal.scope), appendToElement); - - openedWindows.top().value.modalDomEl = angularDomEl; - openedWindows.top().value.modalOpener = modalOpener; - }; - - function broadcastClosing(modalWindow, resultOrReason, closing) { - return !modalWindow.value.modalScope.$broadcast('modal.closing', resultOrReason, closing).defaultPrevented; - } - - $modalStack.close = function(modalInstance, result) { - var modalWindow = openedWindows.get(modalInstance); - if (modalWindow && broadcastClosing(modalWindow, result, true)) { - modalWindow.value.modalScope.$$uibDestructionScheduled = true; - modalWindow.value.deferred.resolve(result); - removeModalWindow(modalInstance, modalWindow.value.modalOpener); - return true; - } - return !modalWindow; - }; - - $modalStack.dismiss = function(modalInstance, reason) { - var modalWindow = openedWindows.get(modalInstance); - if (modalWindow && broadcastClosing(modalWindow, reason, false)) { - modalWindow.value.modalScope.$$uibDestructionScheduled = true; - modalWindow.value.deferred.reject(reason); - removeModalWindow(modalInstance, modalWindow.value.modalOpener); - return true; - } - return !modalWindow; - }; - - $modalStack.dismissAll = function(reason) { - var topModal = this.getTop(); - while (topModal && this.dismiss(topModal.key, reason)) { - topModal = this.getTop(); - } - }; - - $modalStack.getTop = function() { - return openedWindows.top(); - }; - - $modalStack.modalRendered = function(modalInstance) { - var modalWindow = openedWindows.get(modalInstance); - if (modalWindow) { - modalWindow.value.renderDeferred.resolve(); - } - }; - - $modalStack.focusFirstFocusableElement = function(list) { - if (list.length > 0) { - list[0].focus(); - return true; - } - return false; - }; - - $modalStack.focusLastFocusableElement = function(list) { - if (list.length > 0) { - list[list.length - 1].focus(); - return true; - } - return false; - }; - - $modalStack.isModalFocused = function(evt, modalWindow) { - if (evt && modalWindow) { - var modalDomEl = modalWindow.value.modalDomEl; - if (modalDomEl && modalDomEl.length) { - return (evt.target || evt.srcElement) === modalDomEl[0]; - } - } - return false; - }; - - $modalStack.isFocusInFirstItem = function(evt, list) { - if (list.length > 0) { - return (evt.target || evt.srcElement) === list[0]; - } - return false; - }; - - $modalStack.isFocusInLastItem = function(evt, list) { - if (list.length > 0) { - return (evt.target || evt.srcElement) === list[list.length - 1]; - } - return false; - }; - - $modalStack.loadFocusElementList = function(modalWindow) { - if (modalWindow) { - var modalDomE1 = modalWindow.value.modalDomEl; - if (modalDomE1 && modalDomE1.length) { - var elements = modalDomE1[0].querySelectorAll(tabableSelector); - return elements ? - Array.prototype.filter.call(elements, function(element) { - return isVisible(element); - }) : elements; - } - } - }; - - return $modalStack; - }]) - - .provider('$uibModal', function() { - var $modalProvider = { - options: { - animation: true, - backdrop: true, //can also be false or 'static' - keyboard: true - }, - $get: ['$rootScope', '$q', '$document', '$templateRequest', '$controller', '$uibResolve', '$uibModalStack', - function ($rootScope, $q, $document, $templateRequest, $controller, $uibResolve, $modalStack) { - var $modal = {}; - - function getTemplatePromise(options) { - return options.template ? $q.when(options.template) : - $templateRequest(angular.isFunction(options.templateUrl) ? - options.templateUrl() : options.templateUrl); - } - - var promiseChain = null; - $modal.getPromiseChain = function() { - return promiseChain; - }; - - $modal.open = function(modalOptions) { - var modalResultDeferred = $q.defer(); - var modalOpenedDeferred = $q.defer(); - var modalClosedDeferred = $q.defer(); - var modalRenderDeferred = $q.defer(); - - //prepare an instance of a modal to be injected into controllers and returned to a caller - var modalInstance = { - result: modalResultDeferred.promise, - opened: modalOpenedDeferred.promise, - closed: modalClosedDeferred.promise, - rendered: modalRenderDeferred.promise, - close: function (result) { - return $modalStack.close(modalInstance, result); - }, - dismiss: function (reason) { - return $modalStack.dismiss(modalInstance, reason); - } - }; - - //merge and clean up options - modalOptions = angular.extend({}, $modalProvider.options, modalOptions); - modalOptions.resolve = modalOptions.resolve || {}; - modalOptions.appendTo = modalOptions.appendTo || $document.find('body').eq(0); - - //verify options - if (!modalOptions.template && !modalOptions.templateUrl) { - throw new Error('One of template or templateUrl options is required.'); - } - - var templateAndResolvePromise = - $q.all([getTemplatePromise(modalOptions), $uibResolve.resolve(modalOptions.resolve, {}, null, null)]); - - function resolveWithTemplate() { - return templateAndResolvePromise; - } - - // Wait for the resolution of the existing promise chain. - // Then switch to our own combined promise dependency (regardless of how the previous modal fared). - // Then add to $modalStack and resolve opened. - // Finally clean up the chain variable if no subsequent modal has overwritten it. - var samePromise; - samePromise = promiseChain = $q.all([promiseChain]) - .then(resolveWithTemplate, resolveWithTemplate) - .then(function resolveSuccess(tplAndVars) { - var providedScope = modalOptions.scope || $rootScope; - - var modalScope = providedScope.$new(); - modalScope.$close = modalInstance.close; - modalScope.$dismiss = modalInstance.dismiss; - - modalScope.$on('$destroy', function() { - if (!modalScope.$$uibDestructionScheduled) { - modalScope.$dismiss('$uibUnscheduledDestruction'); - } - }); - - var ctrlInstance, ctrlInstantiate, ctrlLocals = {}; - - //controllers - if (modalOptions.controller) { - ctrlLocals.$scope = modalScope; - ctrlLocals.$scope.$resolve = {}; - ctrlLocals.$uibModalInstance = modalInstance; - angular.forEach(tplAndVars[1], function(value, key) { - ctrlLocals[key] = value; - ctrlLocals.$scope.$resolve[key] = value; - }); - - // the third param will make the controller instantiate later,private api - // @see https://github.com/angular/angular.js/blob/master/src/ng/controller.js#L126 - ctrlInstantiate = $controller(modalOptions.controller, ctrlLocals, true, modalOptions.controllerAs); - if (modalOptions.controllerAs && modalOptions.bindToController) { - ctrlInstance = ctrlInstantiate.instance; - ctrlInstance.$close = modalScope.$close; - ctrlInstance.$dismiss = modalScope.$dismiss; - angular.extend(ctrlInstance, { - $resolve: ctrlLocals.$scope.$resolve - }, providedScope); - } - - ctrlInstance = ctrlInstantiate(); - - if (angular.isFunction(ctrlInstance.$onInit)) { - ctrlInstance.$onInit(); - } - } - - $modalStack.open(modalInstance, { - scope: modalScope, - deferred: modalResultDeferred, - renderDeferred: modalRenderDeferred, - closedDeferred: modalClosedDeferred, - content: tplAndVars[0], - animation: modalOptions.animation, - backdrop: modalOptions.backdrop, - keyboard: modalOptions.keyboard, - backdropClass: modalOptions.backdropClass, - windowTopClass: modalOptions.windowTopClass, - windowClass: modalOptions.windowClass, - windowTemplateUrl: modalOptions.windowTemplateUrl, - size: modalOptions.size, - openedClass: modalOptions.openedClass, - appendTo: modalOptions.appendTo - }); - modalOpenedDeferred.resolve(true); - - }, function resolveError(reason) { - modalOpenedDeferred.reject(reason); - modalResultDeferred.reject(reason); - })['finally'](function() { - if (promiseChain === samePromise) { - promiseChain = null; - } - }); - - return modalInstance; - }; - - return $modal; - } - ] - }; - - return $modalProvider; - }); - -angular.module('ui.bootstrap.paging', []) -/** - * Helper internal service for generating common controller code between the - * pager and pagination components - */ -.factory('uibPaging', ['$parse', function($parse) { - return { - create: function(ctrl, $scope, $attrs) { - ctrl.setNumPages = $attrs.numPages ? $parse($attrs.numPages).assign : angular.noop; - ctrl.ngModelCtrl = { $setViewValue: angular.noop }; // nullModelCtrl - ctrl._watchers = []; - - ctrl.init = function(ngModelCtrl, config) { - ctrl.ngModelCtrl = ngModelCtrl; - ctrl.config = config; - - ngModelCtrl.$render = function() { - ctrl.render(); - }; - - if ($attrs.itemsPerPage) { - ctrl._watchers.push($scope.$parent.$watch($attrs.itemsPerPage, function(value) { - ctrl.itemsPerPage = parseInt(value, 10); - $scope.totalPages = ctrl.calculateTotalPages(); - ctrl.updatePage(); - })); - } else { - ctrl.itemsPerPage = config.itemsPerPage; - } - - $scope.$watch('totalItems', function(newTotal, oldTotal) { - if (angular.isDefined(newTotal) || newTotal !== oldTotal) { - $scope.totalPages = ctrl.calculateTotalPages(); - ctrl.updatePage(); - } - }); - }; - - ctrl.calculateTotalPages = function() { - var totalPages = ctrl.itemsPerPage < 1 ? 1 : Math.ceil($scope.totalItems / ctrl.itemsPerPage); - return Math.max(totalPages || 0, 1); - }; - - ctrl.render = function() { - $scope.page = parseInt(ctrl.ngModelCtrl.$viewValue, 10) || 1; - }; - - $scope.selectPage = function(page, evt) { - if (evt) { - evt.preventDefault(); - } - - var clickAllowed = !$scope.ngDisabled || !evt; - if (clickAllowed && $scope.page !== page && page > 0 && page <= $scope.totalPages) { - if (evt && evt.target) { - evt.target.blur(); - } - ctrl.ngModelCtrl.$setViewValue(page); - ctrl.ngModelCtrl.$render(); - } - }; - - $scope.getText = function(key) { - return $scope[key + 'Text'] || ctrl.config[key + 'Text']; - }; - - $scope.noPrevious = function() { - return $scope.page === 1; - }; - - $scope.noNext = function() { - return $scope.page === $scope.totalPages; - }; - - ctrl.updatePage = function() { - ctrl.setNumPages($scope.$parent, $scope.totalPages); // Readonly variable - - if ($scope.page > $scope.totalPages) { - $scope.selectPage($scope.totalPages); - } else { - ctrl.ngModelCtrl.$render(); - } - }; - - $scope.$on('$destroy', function() { - while (ctrl._watchers.length) { - ctrl._watchers.shift()(); - } - }); - } - }; -}]); - -angular.module('ui.bootstrap.pager', ['ui.bootstrap.paging']) - -.controller('UibPagerController', ['$scope', '$attrs', 'uibPaging', 'uibPagerConfig', function($scope, $attrs, uibPaging, uibPagerConfig) { - $scope.align = angular.isDefined($attrs.align) ? $scope.$parent.$eval($attrs.align) : uibPagerConfig.align; - - uibPaging.create(this, $scope, $attrs); -}]) - -.constant('uibPagerConfig', { - itemsPerPage: 10, - previousText: '« Previous', - nextText: 'Next »', - align: true -}) - -.directive('uibPager', ['uibPagerConfig', function(uibPagerConfig) { - return { - scope: { - totalItems: '=', - previousText: '@', - nextText: '@', - ngDisabled: '=' - }, - require: ['uibPager', '?ngModel'], - controller: 'UibPagerController', - controllerAs: 'pager', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/pager/pager.html'; - }, - replace: true, - link: function(scope, element, attrs, ctrls) { - var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - if (!ngModelCtrl) { - return; // do nothing if no ng-model - } - - paginationCtrl.init(ngModelCtrl, uibPagerConfig); - } - }; -}]); - -angular.module('ui.bootstrap.pagination', ['ui.bootstrap.paging']) -.controller('UibPaginationController', ['$scope', '$attrs', '$parse', 'uibPaging', 'uibPaginationConfig', function($scope, $attrs, $parse, uibPaging, uibPaginationConfig) { - var ctrl = this; - // Setup configuration parameters - var maxSize = angular.isDefined($attrs.maxSize) ? $scope.$parent.$eval($attrs.maxSize) : uibPaginationConfig.maxSize, - rotate = angular.isDefined($attrs.rotate) ? $scope.$parent.$eval($attrs.rotate) : uibPaginationConfig.rotate, - forceEllipses = angular.isDefined($attrs.forceEllipses) ? $scope.$parent.$eval($attrs.forceEllipses) : uibPaginationConfig.forceEllipses, - boundaryLinkNumbers = angular.isDefined($attrs.boundaryLinkNumbers) ? $scope.$parent.$eval($attrs.boundaryLinkNumbers) : uibPaginationConfig.boundaryLinkNumbers, - pageLabel = angular.isDefined($attrs.pageLabel) ? function(idx) { return $scope.$parent.$eval($attrs.pageLabel, {$page: idx}); } : angular.identity; - $scope.boundaryLinks = angular.isDefined($attrs.boundaryLinks) ? $scope.$parent.$eval($attrs.boundaryLinks) : uibPaginationConfig.boundaryLinks; - $scope.directionLinks = angular.isDefined($attrs.directionLinks) ? $scope.$parent.$eval($attrs.directionLinks) : uibPaginationConfig.directionLinks; - - uibPaging.create(this, $scope, $attrs); - - if ($attrs.maxSize) { - ctrl._watchers.push($scope.$parent.$watch($parse($attrs.maxSize), function(value) { - maxSize = parseInt(value, 10); - ctrl.render(); - })); - } - - // Create page object used in template - function makePage(number, text, isActive) { - return { - number: number, - text: text, - active: isActive - }; - } - - function getPages(currentPage, totalPages) { - var pages = []; - - // Default page limits - var startPage = 1, endPage = totalPages; - var isMaxSized = angular.isDefined(maxSize) && maxSize < totalPages; - - // recompute if maxSize - if (isMaxSized) { - if (rotate) { - // Current page is displayed in the middle of the visible ones - startPage = Math.max(currentPage - Math.floor(maxSize / 2), 1); - endPage = startPage + maxSize - 1; - - // Adjust if limit is exceeded - if (endPage > totalPages) { - endPage = totalPages; - startPage = endPage - maxSize + 1; - } - } else { - // Visible pages are paginated with maxSize - startPage = (Math.ceil(currentPage / maxSize) - 1) * maxSize + 1; - - // Adjust last page if limit is exceeded - endPage = Math.min(startPage + maxSize - 1, totalPages); - } - } - - // Add page number links - for (var number = startPage; number <= endPage; number++) { - var page = makePage(number, pageLabel(number), number === currentPage); - pages.push(page); - } - - // Add links to move between page sets - if (isMaxSized && maxSize > 0 && (!rotate || forceEllipses || boundaryLinkNumbers)) { - if (startPage > 1) { - if (!boundaryLinkNumbers || startPage > 3) { //need ellipsis for all options unless range is too close to beginning - var previousPageSet = makePage(startPage - 1, '...', false); - pages.unshift(previousPageSet); - } - if (boundaryLinkNumbers) { - if (startPage === 3) { //need to replace ellipsis when the buttons would be sequential - var secondPageLink = makePage(2, '2', false); - pages.unshift(secondPageLink); - } - //add the first page - var firstPageLink = makePage(1, '1', false); - pages.unshift(firstPageLink); - } - } - - if (endPage < totalPages) { - if (!boundaryLinkNumbers || endPage < totalPages - 2) { //need ellipsis for all options unless range is too close to end - var nextPageSet = makePage(endPage + 1, '...', false); - pages.push(nextPageSet); - } - if (boundaryLinkNumbers) { - if (endPage === totalPages - 2) { //need to replace ellipsis when the buttons would be sequential - var secondToLastPageLink = makePage(totalPages - 1, totalPages - 1, false); - pages.push(secondToLastPageLink); - } - //add the last page - var lastPageLink = makePage(totalPages, totalPages, false); - pages.push(lastPageLink); - } - } - } - return pages; - } - - var originalRender = this.render; - this.render = function() { - originalRender(); - if ($scope.page > 0 && $scope.page <= $scope.totalPages) { - $scope.pages = getPages($scope.page, $scope.totalPages); - } - }; -}]) - -.constant('uibPaginationConfig', { - itemsPerPage: 10, - boundaryLinks: false, - boundaryLinkNumbers: false, - directionLinks: true, - firstText: 'First', - previousText: 'Previous', - nextText: 'Next', - lastText: 'Last', - rotate: true, - forceEllipses: false -}) - -.directive('uibPagination', ['$parse', 'uibPaginationConfig', function($parse, uibPaginationConfig) { - return { - scope: { - totalItems: '=', - firstText: '@', - previousText: '@', - nextText: '@', - lastText: '@', - ngDisabled:'=' - }, - require: ['uibPagination', '?ngModel'], - controller: 'UibPaginationController', - controllerAs: 'pagination', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/pagination/pagination.html'; - }, - replace: true, - link: function(scope, element, attrs, ctrls) { - var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - if (!ngModelCtrl) { - return; // do nothing if no ng-model - } - - paginationCtrl.init(ngModelCtrl, uibPaginationConfig); - } - }; -}]); - -/** - * The following features are still outstanding: animation as a - * function, placement as a function, inside, support for more triggers than - * just mouse enter/leave, html tooltips, and selector delegation. - */ -angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.stackedMap']) - -/** - * The $tooltip service creates tooltip- and popover-like directives as well as - * houses global options for them. - */ -.provider('$uibTooltip', function() { - // The default options tooltip and popover. - var defaultOptions = { - placement: 'top', - placementClassPrefix: '', - animation: true, - popupDelay: 0, - popupCloseDelay: 0, - useContentExp: false - }; - - // Default hide triggers for each show trigger - var triggerMap = { - 'mouseenter': 'mouseleave', - 'click': 'click', - 'outsideClick': 'outsideClick', - 'focus': 'blur', - 'none': '' - }; - - // The options specified to the provider globally. - var globalOptions = {}; - - /** - * `options({})` allows global configuration of all tooltips in the - * application. - * - * var app = angular.module( 'App', ['ui.bootstrap.tooltip'], function( $tooltipProvider ) { - * // place tooltips left instead of top by default - * $tooltipProvider.options( { placement: 'left' } ); - * }); - */ - this.options = function(value) { - angular.extend(globalOptions, value); - }; - - /** - * This allows you to extend the set of trigger mappings available. E.g.: - * - * $tooltipProvider.setTriggers( { 'openTrigger': 'closeTrigger' } ); - */ - this.setTriggers = function setTriggers(triggers) { - angular.extend(triggerMap, triggers); - }; - - /** - * This is a helper function for translating camel-case to snake_case. - */ - function snake_case(name) { - var regexp = /[A-Z]/g; - var separator = '-'; - return name.replace(regexp, function(letter, pos) { - return (pos ? separator : '') + letter.toLowerCase(); - }); - } - - /** - * Returns the actual instance of the $tooltip service. - * TODO support multiple triggers - */ - this.$get = ['$window', '$compile', '$timeout', '$document', '$uibPosition', '$interpolate', '$rootScope', '$parse', '$$stackedMap', function($window, $compile, $timeout, $document, $position, $interpolate, $rootScope, $parse, $$stackedMap) { - var openedTooltips = $$stackedMap.createNew(); - $document.on('keypress', keypressListener); - - $rootScope.$on('$destroy', function() { - $document.off('keypress', keypressListener); - }); - - function keypressListener(e) { - if (e.which === 27) { - var last = openedTooltips.top(); - if (last) { - last.value.close(); - openedTooltips.removeTop(); - last = null; - } - } - } - - return function $tooltip(ttType, prefix, defaultTriggerShow, options) { - options = angular.extend({}, defaultOptions, globalOptions, options); - - /** - * Returns an object of show and hide triggers. - * - * If a trigger is supplied, - * it is used to show the tooltip; otherwise, it will use the `trigger` - * option passed to the `$tooltipProvider.options` method; else it will - * default to the trigger supplied to this directive factory. - * - * The hide trigger is based on the show trigger. If the `trigger` option - * was passed to the `$tooltipProvider.options` method, it will use the - * mapped trigger from `triggerMap` or the passed trigger if the map is - * undefined; otherwise, it uses the `triggerMap` value of the show - * trigger; else it will just use the show trigger. - */ - function getTriggers(trigger) { - var show = (trigger || options.trigger || defaultTriggerShow).split(' '); - var hide = show.map(function(trigger) { - return triggerMap[trigger] || trigger; - }); - return { - show: show, - hide: hide - }; - } - - var directiveName = snake_case(ttType); - - var startSym = $interpolate.startSymbol(); - var endSym = $interpolate.endSymbol(); - var template = - '
      ' + - '
      '; - - return { - compile: function(tElem, tAttrs) { - var tooltipLinker = $compile(template); - - return function link(scope, element, attrs, tooltipCtrl) { - var tooltip; - var tooltipLinkedScope; - var transitionTimeout; - var showTimeout; - var hideTimeout; - var positionTimeout; - var appendToBody = angular.isDefined(options.appendToBody) ? options.appendToBody : false; - var triggers = getTriggers(undefined); - var hasEnableExp = angular.isDefined(attrs[prefix + 'Enable']); - var ttScope = scope.$new(true); - var repositionScheduled = false; - var isOpenParse = angular.isDefined(attrs[prefix + 'IsOpen']) ? $parse(attrs[prefix + 'IsOpen']) : false; - var contentParse = options.useContentExp ? $parse(attrs[ttType]) : false; - var observers = []; - var lastPlacement; - - var positionTooltip = function() { - // check if tooltip exists and is not empty - if (!tooltip || !tooltip.html()) { return; } - - if (!positionTimeout) { - positionTimeout = $timeout(function() { - var ttPosition = $position.positionElements(element, tooltip, ttScope.placement, appendToBody); - tooltip.css({ top: ttPosition.top + 'px', left: ttPosition.left + 'px' }); - - if (!tooltip.hasClass(ttPosition.placement.split('-')[0])) { - tooltip.removeClass(lastPlacement.split('-')[0]); - tooltip.addClass(ttPosition.placement.split('-')[0]); - } - - if (!tooltip.hasClass(options.placementClassPrefix + ttPosition.placement)) { - tooltip.removeClass(options.placementClassPrefix + lastPlacement); - tooltip.addClass(options.placementClassPrefix + ttPosition.placement); - } - - // first time through tt element will have the - // uib-position-measure class or if the placement - // has changed we need to position the arrow. - if (tooltip.hasClass('uib-position-measure')) { - $position.positionArrow(tooltip, ttPosition.placement); - tooltip.removeClass('uib-position-measure'); - } else if (lastPlacement !== ttPosition.placement) { - $position.positionArrow(tooltip, ttPosition.placement); - } - lastPlacement = ttPosition.placement; - - positionTimeout = null; - }, 0, false); - } - }; - - // Set up the correct scope to allow transclusion later - ttScope.origScope = scope; - - // By default, the tooltip is not open. - // TODO add ability to start tooltip opened - ttScope.isOpen = false; - openedTooltips.add(ttScope, { - close: hide - }); - - function toggleTooltipBind() { - if (!ttScope.isOpen) { - showTooltipBind(); - } else { - hideTooltipBind(); - } - } - - // Show the tooltip with delay if specified, otherwise show it immediately - function showTooltipBind() { - if (hasEnableExp && !scope.$eval(attrs[prefix + 'Enable'])) { - return; - } - - cancelHide(); - prepareTooltip(); - - if (ttScope.popupDelay) { - // Do nothing if the tooltip was already scheduled to pop-up. - // This happens if show is triggered multiple times before any hide is triggered. - if (!showTimeout) { - showTimeout = $timeout(show, ttScope.popupDelay, false); - } - } else { - show(); - } - } - - function hideTooltipBind() { - cancelShow(); - - if (ttScope.popupCloseDelay) { - if (!hideTimeout) { - hideTimeout = $timeout(hide, ttScope.popupCloseDelay, false); - } - } else { - hide(); - } - } - - // Show the tooltip popup element. - function show() { - cancelShow(); - cancelHide(); - - // Don't show empty tooltips. - if (!ttScope.content) { - return angular.noop; - } - - createTooltip(); - - // And show the tooltip. - ttScope.$evalAsync(function() { - ttScope.isOpen = true; - assignIsOpen(true); - positionTooltip(); - }); - } - - function cancelShow() { - if (showTimeout) { - $timeout.cancel(showTimeout); - showTimeout = null; - } - - if (positionTimeout) { - $timeout.cancel(positionTimeout); - positionTimeout = null; - } - } - - // Hide the tooltip popup element. - function hide() { - if (!ttScope) { - return; - } - - // First things first: we don't show it anymore. - ttScope.$evalAsync(function() { - if (ttScope) { - ttScope.isOpen = false; - assignIsOpen(false); - // And now we remove it from the DOM. However, if we have animation, we - // need to wait for it to expire beforehand. - // FIXME: this is a placeholder for a port of the transitions library. - // The fade transition in TWBS is 150ms. - if (ttScope.animation) { - if (!transitionTimeout) { - transitionTimeout = $timeout(removeTooltip, 150, false); - } - } else { - removeTooltip(); - } - } - }); - } - - function cancelHide() { - if (hideTimeout) { - $timeout.cancel(hideTimeout); - hideTimeout = null; - } - - if (transitionTimeout) { - $timeout.cancel(transitionTimeout); - transitionTimeout = null; - } - } - - function createTooltip() { - // There can only be one tooltip element per directive shown at once. - if (tooltip) { - return; - } - - tooltipLinkedScope = ttScope.$new(); - tooltip = tooltipLinker(tooltipLinkedScope, function(tooltip) { - if (appendToBody) { - $document.find('body').append(tooltip); - } else { - element.after(tooltip); - } - }); - - prepObservers(); - } - - function removeTooltip() { - cancelShow(); - cancelHide(); - unregisterObservers(); - - if (tooltip) { - tooltip.remove(); - tooltip = null; - } - if (tooltipLinkedScope) { - tooltipLinkedScope.$destroy(); - tooltipLinkedScope = null; - } - } - - /** - * Set the initial scope values. Once - * the tooltip is created, the observers - * will be added to keep things in sync. - */ - function prepareTooltip() { - ttScope.title = attrs[prefix + 'Title']; - if (contentParse) { - ttScope.content = contentParse(scope); - } else { - ttScope.content = attrs[ttType]; - } - - ttScope.popupClass = attrs[prefix + 'Class']; - ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement; - var placement = $position.parsePlacement(ttScope.placement); - lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0]; - - var delay = parseInt(attrs[prefix + 'PopupDelay'], 10); - var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10); - ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay; - ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay; - } - - function assignIsOpen(isOpen) { - if (isOpenParse && angular.isFunction(isOpenParse.assign)) { - isOpenParse.assign(scope, isOpen); - } - } - - ttScope.contentExp = function() { - return ttScope.content; - }; - - /** - * Observe the relevant attributes. - */ - attrs.$observe('disabled', function(val) { - if (val) { - cancelShow(); - } - - if (val && ttScope.isOpen) { - hide(); - } - }); - - if (isOpenParse) { - scope.$watch(isOpenParse, function(val) { - if (ttScope && !val === ttScope.isOpen) { - toggleTooltipBind(); - } - }); - } - - function prepObservers() { - observers.length = 0; - - if (contentParse) { - observers.push( - scope.$watch(contentParse, function(val) { - ttScope.content = val; - if (!val && ttScope.isOpen) { - hide(); - } - }) - ); - - observers.push( - tooltipLinkedScope.$watch(function() { - if (!repositionScheduled) { - repositionScheduled = true; - tooltipLinkedScope.$$postDigest(function() { - repositionScheduled = false; - if (ttScope && ttScope.isOpen) { - positionTooltip(); - } - }); - } - }) - ); - } else { - observers.push( - attrs.$observe(ttType, function(val) { - ttScope.content = val; - if (!val && ttScope.isOpen) { - hide(); - } else { - positionTooltip(); - } - }) - ); - } - - observers.push( - attrs.$observe(prefix + 'Title', function(val) { - ttScope.title = val; - if (ttScope.isOpen) { - positionTooltip(); - } - }) - ); - - observers.push( - attrs.$observe(prefix + 'Placement', function(val) { - ttScope.placement = val ? val : options.placement; - if (ttScope.isOpen) { - positionTooltip(); - } - }) - ); - } - - function unregisterObservers() { - if (observers.length) { - angular.forEach(observers, function(observer) { - observer(); - }); - observers.length = 0; - } - } - - // hide tooltips/popovers for outsideClick trigger - function bodyHideTooltipBind(e) { - if (!ttScope || !ttScope.isOpen || !tooltip) { - return; - } - // make sure the tooltip/popover link or tool tooltip/popover itself were not clicked - if (!element[0].contains(e.target) && !tooltip[0].contains(e.target)) { - hideTooltipBind(); - } - } - - var unregisterTriggers = function() { - triggers.show.forEach(function(trigger) { - if (trigger === 'outsideClick') { - element.off('click', toggleTooltipBind); - } else { - element.off(trigger, showTooltipBind); - element.off(trigger, toggleTooltipBind); - } - }); - triggers.hide.forEach(function(trigger) { - if (trigger === 'outsideClick') { - $document.off('click', bodyHideTooltipBind); - } else { - element.off(trigger, hideTooltipBind); - } - }); - }; - - function prepTriggers() { - var val = attrs[prefix + 'Trigger']; - unregisterTriggers(); - - triggers = getTriggers(val); - - if (triggers.show !== 'none') { - triggers.show.forEach(function(trigger, idx) { - if (trigger === 'outsideClick') { - element.on('click', toggleTooltipBind); - $document.on('click', bodyHideTooltipBind); - } else if (trigger === triggers.hide[idx]) { - element.on(trigger, toggleTooltipBind); - } else if (trigger) { - element.on(trigger, showTooltipBind); - element.on(triggers.hide[idx], hideTooltipBind); - } - - element.on('keypress', function(e) { - if (e.which === 27) { - hideTooltipBind(); - } - }); - }); - } - } - - prepTriggers(); - - var animation = scope.$eval(attrs[prefix + 'Animation']); - ttScope.animation = angular.isDefined(animation) ? !!animation : options.animation; - - var appendToBodyVal; - var appendKey = prefix + 'AppendToBody'; - if (appendKey in attrs && attrs[appendKey] === undefined) { - appendToBodyVal = true; - } else { - appendToBodyVal = scope.$eval(attrs[appendKey]); - } - - appendToBody = angular.isDefined(appendToBodyVal) ? appendToBodyVal : appendToBody; - - // Make sure tooltip is destroyed and removed. - scope.$on('$destroy', function onDestroyTooltip() { - unregisterTriggers(); - removeTooltip(); - openedTooltips.remove(ttScope); - ttScope = null; - }); - }; - } - }; - }; - }]; -}) - -// This is mostly ngInclude code but with a custom scope -.directive('uibTooltipTemplateTransclude', [ - '$animate', '$sce', '$compile', '$templateRequest', -function ($animate, $sce, $compile, $templateRequest) { - return { - link: function(scope, elem, attrs) { - var origScope = scope.$eval(attrs.tooltipTemplateTranscludeScope); - - var changeCounter = 0, - currentScope, - previousElement, - currentElement; - - var cleanupLastIncludeContent = function() { - if (previousElement) { - previousElement.remove(); - previousElement = null; - } - - if (currentScope) { - currentScope.$destroy(); - currentScope = null; - } - - if (currentElement) { - $animate.leave(currentElement).then(function() { - previousElement = null; - }); - previousElement = currentElement; - currentElement = null; - } - }; - - scope.$watch($sce.parseAsResourceUrl(attrs.uibTooltipTemplateTransclude), function(src) { - var thisChangeId = ++changeCounter; - - if (src) { - //set the 2nd param to true to ignore the template request error so that the inner - //contents and scope can be cleaned up. - $templateRequest(src, true).then(function(response) { - if (thisChangeId !== changeCounter) { return; } - var newScope = origScope.$new(); - var template = response; - - var clone = $compile(template)(newScope, function(clone) { - cleanupLastIncludeContent(); - $animate.enter(clone, elem); - }); - - currentScope = newScope; - currentElement = clone; - - currentScope.$emit('$includeContentLoaded', src); - }, function() { - if (thisChangeId === changeCounter) { - cleanupLastIncludeContent(); - scope.$emit('$includeContentError', src); - } - }); - scope.$emit('$includeContentRequested', src); - } else { - cleanupLastIncludeContent(); - } - }); - - scope.$on('$destroy', cleanupLastIncludeContent); - } - }; -}]) - -/** - * Note that it's intentional that these classes are *not* applied through $animate. - * They must not be animated as they're expected to be present on the tooltip on - * initialization. - */ -.directive('uibTooltipClasses', ['$uibPosition', function($uibPosition) { - return { - restrict: 'A', - link: function(scope, element, attrs) { - // need to set the primary position so the - // arrow has space during position measure. - // tooltip.positionTooltip() - if (scope.placement) { - // // There are no top-left etc... classes - // // in TWBS, so we need the primary position. - var position = $uibPosition.parsePlacement(scope.placement); - element.addClass(position[0]); - } - - if (scope.popupClass) { - element.addClass(scope.popupClass); - } - - if (scope.animation()) { - element.addClass(attrs.tooltipAnimationClass); - } - } - }; -}]) - -.directive('uibTooltipPopup', function() { - return { - replace: true, - scope: { content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' }, - templateUrl: 'uib/template/tooltip/tooltip-popup.html' - }; -}) - -.directive('uibTooltip', [ '$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibTooltip', 'tooltip', 'mouseenter'); -}]) - -.directive('uibTooltipTemplatePopup', function() { - return { - replace: true, - scope: { contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&', - originScope: '&' }, - templateUrl: 'uib/template/tooltip/tooltip-template-popup.html' - }; -}) - -.directive('uibTooltipTemplate', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibTooltipTemplate', 'tooltip', 'mouseenter', { - useContentExp: true - }); -}]) - -.directive('uibTooltipHtmlPopup', function() { - return { - replace: true, - scope: { contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&' }, - templateUrl: 'uib/template/tooltip/tooltip-html-popup.html' - }; -}) - -.directive('uibTooltipHtml', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibTooltipHtml', 'tooltip', 'mouseenter', { - useContentExp: true - }); -}]); - -/** - * The following features are still outstanding: popup delay, animation as a - * function, placement as a function, inside, support for more triggers than - * just mouse enter/leave, and selector delegatation. - */ -angular.module('ui.bootstrap.popover', ['ui.bootstrap.tooltip']) - -.directive('uibPopoverTemplatePopup', function() { - return { - replace: true, - scope: { uibTitle: '@', contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&', - originScope: '&' }, - templateUrl: 'uib/template/popover/popover-template.html' - }; -}) - -.directive('uibPopoverTemplate', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibPopoverTemplate', 'popover', 'click', { - useContentExp: true - }); -}]) - -.directive('uibPopoverHtmlPopup', function() { - return { - replace: true, - scope: { contentExp: '&', uibTitle: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' }, - templateUrl: 'uib/template/popover/popover-html.html' - }; -}) - -.directive('uibPopoverHtml', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibPopoverHtml', 'popover', 'click', { - useContentExp: true - }); -}]) - -.directive('uibPopoverPopup', function() { - return { - replace: true, - scope: { uibTitle: '@', content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' }, - templateUrl: 'uib/template/popover/popover.html' - }; -}) - -.directive('uibPopover', ['$uibTooltip', function($uibTooltip) { - return $uibTooltip('uibPopover', 'popover', 'click'); -}]); - -angular.module('ui.bootstrap.progressbar', []) - -.constant('uibProgressConfig', { - animate: true, - max: 100 -}) - -.controller('UibProgressController', ['$scope', '$attrs', 'uibProgressConfig', function($scope, $attrs, progressConfig) { - var self = this, - animate = angular.isDefined($attrs.animate) ? $scope.$parent.$eval($attrs.animate) : progressConfig.animate; - - this.bars = []; - $scope.max = getMaxOrDefault(); - - this.addBar = function(bar, element, attrs) { - if (!animate) { - element.css({'transition': 'none'}); - } - - this.bars.push(bar); - - bar.max = getMaxOrDefault(); - bar.title = attrs && angular.isDefined(attrs.title) ? attrs.title : 'progressbar'; - - bar.$watch('value', function(value) { - bar.recalculatePercentage(); - }); - - bar.recalculatePercentage = function() { - var totalPercentage = self.bars.reduce(function(total, bar) { - bar.percent = +(100 * bar.value / bar.max).toFixed(2); - return total + bar.percent; - }, 0); - - if (totalPercentage > 100) { - bar.percent -= totalPercentage - 100; - } - }; - - bar.$on('$destroy', function() { - element = null; - self.removeBar(bar); - }); - }; - - this.removeBar = function(bar) { - this.bars.splice(this.bars.indexOf(bar), 1); - this.bars.forEach(function (bar) { - bar.recalculatePercentage(); - }); - }; - - //$attrs.$observe('maxParam', function(maxParam) { - $scope.$watch('maxParam', function(maxParam) { - self.bars.forEach(function(bar) { - bar.max = getMaxOrDefault(); - bar.recalculatePercentage(); - }); - }); - - function getMaxOrDefault () { - return angular.isDefined($scope.maxParam) ? $scope.maxParam : progressConfig.max; - } -}]) - -.directive('uibProgress', function() { - return { - replace: true, - transclude: true, - controller: 'UibProgressController', - require: 'uibProgress', - scope: { - maxParam: '=?max' - }, - templateUrl: 'uib/template/progressbar/progress.html' - }; -}) - -.directive('uibBar', function() { - return { - replace: true, - transclude: true, - require: '^uibProgress', - scope: { - value: '=', - type: '@' - }, - templateUrl: 'uib/template/progressbar/bar.html', - link: function(scope, element, attrs, progressCtrl) { - progressCtrl.addBar(scope, element, attrs); - } - }; -}) - -.directive('uibProgressbar', function() { - return { - replace: true, - transclude: true, - controller: 'UibProgressController', - scope: { - value: '=', - maxParam: '=?max', - type: '@' - }, - templateUrl: 'uib/template/progressbar/progressbar.html', - link: function(scope, element, attrs, progressCtrl) { - progressCtrl.addBar(scope, angular.element(element.children()[0]), {title: attrs.title}); - } - }; -}); - -angular.module('ui.bootstrap.rating', []) - -.constant('uibRatingConfig', { - max: 5, - stateOn: null, - stateOff: null, - enableReset: true, - titles : ['one', 'two', 'three', 'four', 'five'] -}) - -.controller('UibRatingController', ['$scope', '$attrs', 'uibRatingConfig', function($scope, $attrs, ratingConfig) { - var ngModelCtrl = { $setViewValue: angular.noop }, - self = this; - - this.init = function(ngModelCtrl_) { - ngModelCtrl = ngModelCtrl_; - ngModelCtrl.$render = this.render; - - ngModelCtrl.$formatters.push(function(value) { - if (angular.isNumber(value) && value << 0 !== value) { - value = Math.round(value); - } - - return value; - }); - - this.stateOn = angular.isDefined($attrs.stateOn) ? $scope.$parent.$eval($attrs.stateOn) : ratingConfig.stateOn; - this.stateOff = angular.isDefined($attrs.stateOff) ? $scope.$parent.$eval($attrs.stateOff) : ratingConfig.stateOff; - this.enableReset = angular.isDefined($attrs.enableReset) ? - $scope.$parent.$eval($attrs.enableReset) : ratingConfig.enableReset; - var tmpTitles = angular.isDefined($attrs.titles) ? $scope.$parent.$eval($attrs.titles) : ratingConfig.titles; - this.titles = angular.isArray(tmpTitles) && tmpTitles.length > 0 ? - tmpTitles : ratingConfig.titles; - - var ratingStates = angular.isDefined($attrs.ratingStates) ? - $scope.$parent.$eval($attrs.ratingStates) : - new Array(angular.isDefined($attrs.max) ? $scope.$parent.$eval($attrs.max) : ratingConfig.max); - $scope.range = this.buildTemplateObjects(ratingStates); - }; - - this.buildTemplateObjects = function(states) { - for (var i = 0, n = states.length; i < n; i++) { - states[i] = angular.extend({ index: i }, { stateOn: this.stateOn, stateOff: this.stateOff, title: this.getTitle(i) }, states[i]); - } - return states; - }; - - this.getTitle = function(index) { - if (index >= this.titles.length) { - return index + 1; - } - - return this.titles[index]; - }; - - $scope.rate = function(value) { - if (!$scope.readonly && value >= 0 && value <= $scope.range.length) { - var newViewValue = self.enableReset && ngModelCtrl.$viewValue === value ? 0 : value; - ngModelCtrl.$setViewValue(newViewValue); - ngModelCtrl.$render(); - } - }; - - $scope.enter = function(value) { - if (!$scope.readonly) { - $scope.value = value; - } - $scope.onHover({value: value}); - }; - - $scope.reset = function() { - $scope.value = ngModelCtrl.$viewValue; - $scope.onLeave(); - }; - - $scope.onKeydown = function(evt) { - if (/(37|38|39|40)/.test(evt.which)) { - evt.preventDefault(); - evt.stopPropagation(); - $scope.rate($scope.value + (evt.which === 38 || evt.which === 39 ? 1 : -1)); - } - }; - - this.render = function() { - $scope.value = ngModelCtrl.$viewValue; - $scope.title = self.getTitle($scope.value - 1); - }; -}]) - -.directive('uibRating', function() { - return { - require: ['uibRating', 'ngModel'], - scope: { - readonly: '=?readOnly', - onHover: '&', - onLeave: '&' - }, - controller: 'UibRatingController', - templateUrl: 'uib/template/rating/rating.html', - replace: true, - link: function(scope, element, attrs, ctrls) { - var ratingCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - ratingCtrl.init(ngModelCtrl); - } - }; -}); - -angular.module('ui.bootstrap.tabs', []) - -.controller('UibTabsetController', ['$scope', function ($scope) { - var ctrl = this, - oldIndex; - ctrl.tabs = []; - - ctrl.select = function(index, evt) { - if (!destroyed) { - var previousIndex = findTabIndex(oldIndex); - var previousSelected = ctrl.tabs[previousIndex]; - if (previousSelected) { - previousSelected.tab.onDeselect({ - $event: evt, - $selectedIndex: index - }); - if (evt && evt.isDefaultPrevented()) { - return; - } - previousSelected.tab.active = false; - } - - var selected = ctrl.tabs[index]; - if (selected) { - selected.tab.onSelect({ - $event: evt - }); - selected.tab.active = true; - ctrl.active = selected.index; - oldIndex = selected.index; - } else if (!selected && angular.isDefined(oldIndex)) { - ctrl.active = null; - oldIndex = null; - } - } - }; - - ctrl.addTab = function addTab(tab) { - ctrl.tabs.push({ - tab: tab, - index: tab.index - }); - ctrl.tabs.sort(function(t1, t2) { - if (t1.index > t2.index) { - return 1; - } - - if (t1.index < t2.index) { - return -1; - } - - return 0; - }); - - if (tab.index === ctrl.active || !angular.isDefined(ctrl.active) && ctrl.tabs.length === 1) { - var newActiveIndex = findTabIndex(tab.index); - ctrl.select(newActiveIndex); - } - }; - - ctrl.removeTab = function removeTab(tab) { - var index; - for (var i = 0; i < ctrl.tabs.length; i++) { - if (ctrl.tabs[i].tab === tab) { - index = i; - break; - } - } - - if (ctrl.tabs[index].index === ctrl.active) { - var newActiveTabIndex = index === ctrl.tabs.length - 1 ? - index - 1 : index + 1 % ctrl.tabs.length; - ctrl.select(newActiveTabIndex); - } - - ctrl.tabs.splice(index, 1); - }; - - $scope.$watch('tabset.active', function(val) { - if (angular.isDefined(val) && val !== oldIndex) { - ctrl.select(findTabIndex(val)); - } - }); - - var destroyed; - $scope.$on('$destroy', function() { - destroyed = true; - }); - - function findTabIndex(index) { - for (var i = 0; i < ctrl.tabs.length; i++) { - if (ctrl.tabs[i].index === index) { - return i; - } - } - } -}]) - -.directive('uibTabset', function() { - return { - transclude: true, - replace: true, - scope: {}, - bindToController: { - active: '=?', - type: '@' - }, - controller: 'UibTabsetController', - controllerAs: 'tabset', - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/tabs/tabset.html'; - }, - link: function(scope, element, attrs) { - scope.vertical = angular.isDefined(attrs.vertical) ? - scope.$parent.$eval(attrs.vertical) : false; - scope.justified = angular.isDefined(attrs.justified) ? - scope.$parent.$eval(attrs.justified) : false; - } - }; -}) - -.directive('uibTab', ['$parse', function($parse) { - return { - require: '^uibTabset', - replace: true, - templateUrl: function(element, attrs) { - return attrs.templateUrl || 'uib/template/tabs/tab.html'; - }, - transclude: true, - scope: { - heading: '@', - index: '=?', - classes: '@?', - onSelect: '&select', //This callback is called in contentHeadingTransclude - //once it inserts the tab's content into the dom - onDeselect: '&deselect' - }, - controller: function() { - //Empty controller so other directives can require being 'under' a tab - }, - controllerAs: 'tab', - link: function(scope, elm, attrs, tabsetCtrl, transclude) { - scope.disabled = false; - if (attrs.disable) { - scope.$parent.$watch($parse(attrs.disable), function(value) { - scope.disabled = !! value; - }); - } - - if (angular.isUndefined(attrs.index)) { - if (tabsetCtrl.tabs && tabsetCtrl.tabs.length) { - scope.index = Math.max.apply(null, tabsetCtrl.tabs.map(function(t) { return t.index; })) + 1; - } else { - scope.index = 0; - } - } - - if (angular.isUndefined(attrs.classes)) { - scope.classes = ''; - } - - scope.select = function(evt) { - if (!scope.disabled) { - var index; - for (var i = 0; i < tabsetCtrl.tabs.length; i++) { - if (tabsetCtrl.tabs[i].tab === scope) { - index = i; - break; - } - } - - tabsetCtrl.select(index, evt); - } - }; - - tabsetCtrl.addTab(scope); - scope.$on('$destroy', function() { - tabsetCtrl.removeTab(scope); - }); - - //We need to transclude later, once the content container is ready. - //when this link happens, we're inside a tab heading. - scope.$transcludeFn = transclude; - } - }; -}]) - -.directive('uibTabHeadingTransclude', function() { - return { - restrict: 'A', - require: '^uibTab', - link: function(scope, elm) { - scope.$watch('headingElement', function updateHeadingElement(heading) { - if (heading) { - elm.html(''); - elm.append(heading); - } - }); - } - }; -}) - -.directive('uibTabContentTransclude', function() { - return { - restrict: 'A', - require: '^uibTabset', - link: function(scope, elm, attrs) { - var tab = scope.$eval(attrs.uibTabContentTransclude).tab; - - //Now our tab is ready to be transcluded: both the tab heading area - //and the tab content area are loaded. Transclude 'em both. - tab.$transcludeFn(tab.$parent, function(contents) { - angular.forEach(contents, function(node) { - if (isTabHeading(node)) { - //Let tabHeadingTransclude know. - tab.headingElement = node; - } else { - elm.append(node); - } - }); - }); - } - }; - - function isTabHeading(node) { - return node.tagName && ( - node.hasAttribute('uib-tab-heading') || - node.hasAttribute('data-uib-tab-heading') || - node.hasAttribute('x-uib-tab-heading') || - node.tagName.toLowerCase() === 'uib-tab-heading' || - node.tagName.toLowerCase() === 'data-uib-tab-heading' || - node.tagName.toLowerCase() === 'x-uib-tab-heading' || - node.tagName.toLowerCase() === 'uib:tab-heading' - ); - } -}); - -angular.module('ui.bootstrap.timepicker', []) - -.constant('uibTimepickerConfig', { - hourStep: 1, - minuteStep: 1, - secondStep: 1, - showMeridian: true, - showSeconds: false, - meridians: null, - readonlyInput: false, - mousewheel: true, - arrowkeys: true, - showSpinners: true, - templateUrl: 'uib/template/timepicker/timepicker.html' -}) - -.controller('UibTimepickerController', ['$scope', '$element', '$attrs', '$parse', '$log', '$locale', 'uibTimepickerConfig', function($scope, $element, $attrs, $parse, $log, $locale, timepickerConfig) { - var selected = new Date(), - watchers = [], - ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl - meridians = angular.isDefined($attrs.meridians) ? $scope.$parent.$eval($attrs.meridians) : timepickerConfig.meridians || $locale.DATETIME_FORMATS.AMPMS, - padHours = angular.isDefined($attrs.padHours) ? $scope.$parent.$eval($attrs.padHours) : true; - - $scope.tabindex = angular.isDefined($attrs.tabindex) ? $attrs.tabindex : 0; - $element.removeAttr('tabindex'); - - this.init = function(ngModelCtrl_, inputs) { - ngModelCtrl = ngModelCtrl_; - ngModelCtrl.$render = this.render; - - ngModelCtrl.$formatters.unshift(function(modelValue) { - return modelValue ? new Date(modelValue) : null; - }); - - var hoursInputEl = inputs.eq(0), - minutesInputEl = inputs.eq(1), - secondsInputEl = inputs.eq(2); - - var mousewheel = angular.isDefined($attrs.mousewheel) ? $scope.$parent.$eval($attrs.mousewheel) : timepickerConfig.mousewheel; - - if (mousewheel) { - this.setupMousewheelEvents(hoursInputEl, minutesInputEl, secondsInputEl); - } - - var arrowkeys = angular.isDefined($attrs.arrowkeys) ? $scope.$parent.$eval($attrs.arrowkeys) : timepickerConfig.arrowkeys; - if (arrowkeys) { - this.setupArrowkeyEvents(hoursInputEl, minutesInputEl, secondsInputEl); - } - - $scope.readonlyInput = angular.isDefined($attrs.readonlyInput) ? $scope.$parent.$eval($attrs.readonlyInput) : timepickerConfig.readonlyInput; - this.setupInputEvents(hoursInputEl, minutesInputEl, secondsInputEl); - }; - - var hourStep = timepickerConfig.hourStep; - if ($attrs.hourStep) { - watchers.push($scope.$parent.$watch($parse($attrs.hourStep), function(value) { - hourStep = +value; - })); - } - - var minuteStep = timepickerConfig.minuteStep; - if ($attrs.minuteStep) { - watchers.push($scope.$parent.$watch($parse($attrs.minuteStep), function(value) { - minuteStep = +value; - })); - } - - var min; - watchers.push($scope.$parent.$watch($parse($attrs.min), function(value) { - var dt = new Date(value); - min = isNaN(dt) ? undefined : dt; - })); - - var max; - watchers.push($scope.$parent.$watch($parse($attrs.max), function(value) { - var dt = new Date(value); - max = isNaN(dt) ? undefined : dt; - })); - - var disabled = false; - if ($attrs.ngDisabled) { - watchers.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(value) { - disabled = value; - })); - } - - $scope.noIncrementHours = function() { - var incrementedSelected = addMinutes(selected, hourStep * 60); - return disabled || incrementedSelected > max || - incrementedSelected < selected && incrementedSelected < min; - }; - - $scope.noDecrementHours = function() { - var decrementedSelected = addMinutes(selected, -hourStep * 60); - return disabled || decrementedSelected < min || - decrementedSelected > selected && decrementedSelected > max; - }; - - $scope.noIncrementMinutes = function() { - var incrementedSelected = addMinutes(selected, minuteStep); - return disabled || incrementedSelected > max || - incrementedSelected < selected && incrementedSelected < min; - }; - - $scope.noDecrementMinutes = function() { - var decrementedSelected = addMinutes(selected, -minuteStep); - return disabled || decrementedSelected < min || - decrementedSelected > selected && decrementedSelected > max; - }; - - $scope.noIncrementSeconds = function() { - var incrementedSelected = addSeconds(selected, secondStep); - return disabled || incrementedSelected > max || - incrementedSelected < selected && incrementedSelected < min; - }; - - $scope.noDecrementSeconds = function() { - var decrementedSelected = addSeconds(selected, -secondStep); - return disabled || decrementedSelected < min || - decrementedSelected > selected && decrementedSelected > max; - }; - - $scope.noToggleMeridian = function() { - if (selected.getHours() < 12) { - return disabled || addMinutes(selected, 12 * 60) > max; - } - - return disabled || addMinutes(selected, -12 * 60) < min; - }; - - var secondStep = timepickerConfig.secondStep; - if ($attrs.secondStep) { - watchers.push($scope.$parent.$watch($parse($attrs.secondStep), function(value) { - secondStep = +value; - })); - } - - $scope.showSeconds = timepickerConfig.showSeconds; - if ($attrs.showSeconds) { - watchers.push($scope.$parent.$watch($parse($attrs.showSeconds), function(value) { - $scope.showSeconds = !!value; - })); - } - - // 12H / 24H mode - $scope.showMeridian = timepickerConfig.showMeridian; - if ($attrs.showMeridian) { - watchers.push($scope.$parent.$watch($parse($attrs.showMeridian), function(value) { - $scope.showMeridian = !!value; - - if (ngModelCtrl.$error.time) { - // Evaluate from template - var hours = getHoursFromTemplate(), minutes = getMinutesFromTemplate(); - if (angular.isDefined(hours) && angular.isDefined(minutes)) { - selected.setHours(hours); - refresh(); - } - } else { - updateTemplate(); - } - })); - } - - // Get $scope.hours in 24H mode if valid - function getHoursFromTemplate() { - var hours = +$scope.hours; - var valid = $scope.showMeridian ? hours > 0 && hours < 13 : - hours >= 0 && hours < 24; - if (!valid || $scope.hours === '') { - return undefined; - } - - if ($scope.showMeridian) { - if (hours === 12) { - hours = 0; - } - if ($scope.meridian === meridians[1]) { - hours = hours + 12; - } - } - return hours; - } - - function getMinutesFromTemplate() { - var minutes = +$scope.minutes; - var valid = minutes >= 0 && minutes < 60; - if (!valid || $scope.minutes === '') { - return undefined; - } - return minutes; - } - - function getSecondsFromTemplate() { - var seconds = +$scope.seconds; - return seconds >= 0 && seconds < 60 ? seconds : undefined; - } - - function pad(value, noPad) { - if (value === null) { - return ''; - } - - return angular.isDefined(value) && value.toString().length < 2 && !noPad ? - '0' + value : value.toString(); - } - - // Respond on mousewheel spin - this.setupMousewheelEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) { - var isScrollingUp = function(e) { - if (e.originalEvent) { - e = e.originalEvent; - } - //pick correct delta variable depending on event - var delta = e.wheelDelta ? e.wheelDelta : -e.deltaY; - return e.detail || delta > 0; - }; - - hoursInputEl.bind('mousewheel wheel', function(e) { - if (!disabled) { - $scope.$apply(isScrollingUp(e) ? $scope.incrementHours() : $scope.decrementHours()); - } - e.preventDefault(); - }); - - minutesInputEl.bind('mousewheel wheel', function(e) { - if (!disabled) { - $scope.$apply(isScrollingUp(e) ? $scope.incrementMinutes() : $scope.decrementMinutes()); - } - e.preventDefault(); - }); - - secondsInputEl.bind('mousewheel wheel', function(e) { - if (!disabled) { - $scope.$apply(isScrollingUp(e) ? $scope.incrementSeconds() : $scope.decrementSeconds()); - } - e.preventDefault(); - }); - }; - - // Respond on up/down arrowkeys - this.setupArrowkeyEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) { - hoursInputEl.bind('keydown', function(e) { - if (!disabled) { - if (e.which === 38) { // up - e.preventDefault(); - $scope.incrementHours(); - $scope.$apply(); - } else if (e.which === 40) { // down - e.preventDefault(); - $scope.decrementHours(); - $scope.$apply(); - } - } - }); - - minutesInputEl.bind('keydown', function(e) { - if (!disabled) { - if (e.which === 38) { // up - e.preventDefault(); - $scope.incrementMinutes(); - $scope.$apply(); - } else if (e.which === 40) { // down - e.preventDefault(); - $scope.decrementMinutes(); - $scope.$apply(); - } - } - }); - - secondsInputEl.bind('keydown', function(e) { - if (!disabled) { - if (e.which === 38) { // up - e.preventDefault(); - $scope.incrementSeconds(); - $scope.$apply(); - } else if (e.which === 40) { // down - e.preventDefault(); - $scope.decrementSeconds(); - $scope.$apply(); - } - } - }); - }; - - this.setupInputEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) { - if ($scope.readonlyInput) { - $scope.updateHours = angular.noop; - $scope.updateMinutes = angular.noop; - $scope.updateSeconds = angular.noop; - return; - } - - var invalidate = function(invalidHours, invalidMinutes, invalidSeconds) { - ngModelCtrl.$setViewValue(null); - ngModelCtrl.$setValidity('time', false); - if (angular.isDefined(invalidHours)) { - $scope.invalidHours = invalidHours; - } - - if (angular.isDefined(invalidMinutes)) { - $scope.invalidMinutes = invalidMinutes; - } - - if (angular.isDefined(invalidSeconds)) { - $scope.invalidSeconds = invalidSeconds; - } - }; - - $scope.updateHours = function() { - var hours = getHoursFromTemplate(), - minutes = getMinutesFromTemplate(); - - ngModelCtrl.$setDirty(); - - if (angular.isDefined(hours) && angular.isDefined(minutes)) { - selected.setHours(hours); - selected.setMinutes(minutes); - if (selected < min || selected > max) { - invalidate(true); - } else { - refresh('h'); - } - } else { - invalidate(true); - } - }; - - hoursInputEl.bind('blur', function(e) { - ngModelCtrl.$setTouched(); - if (modelIsEmpty()) { - makeValid(); - } else if ($scope.hours === null || $scope.hours === '') { - invalidate(true); - } else if (!$scope.invalidHours && $scope.hours < 10) { - $scope.$apply(function() { - $scope.hours = pad($scope.hours, !padHours); - }); - } - }); - - $scope.updateMinutes = function() { - var minutes = getMinutesFromTemplate(), - hours = getHoursFromTemplate(); - - ngModelCtrl.$setDirty(); - - if (angular.isDefined(minutes) && angular.isDefined(hours)) { - selected.setHours(hours); - selected.setMinutes(minutes); - if (selected < min || selected > max) { - invalidate(undefined, true); - } else { - refresh('m'); - } - } else { - invalidate(undefined, true); - } - }; - - minutesInputEl.bind('blur', function(e) { - ngModelCtrl.$setTouched(); - if (modelIsEmpty()) { - makeValid(); - } else if ($scope.minutes === null) { - invalidate(undefined, true); - } else if (!$scope.invalidMinutes && $scope.minutes < 10) { - $scope.$apply(function() { - $scope.minutes = pad($scope.minutes); - }); - } - }); - - $scope.updateSeconds = function() { - var seconds = getSecondsFromTemplate(); - - ngModelCtrl.$setDirty(); - - if (angular.isDefined(seconds)) { - selected.setSeconds(seconds); - refresh('s'); - } else { - invalidate(undefined, undefined, true); - } - }; - - secondsInputEl.bind('blur', function(e) { - if (modelIsEmpty()) { - makeValid(); - } else if (!$scope.invalidSeconds && $scope.seconds < 10) { - $scope.$apply( function() { - $scope.seconds = pad($scope.seconds); - }); - } - }); - - }; - - this.render = function() { - var date = ngModelCtrl.$viewValue; - - if (isNaN(date)) { - ngModelCtrl.$setValidity('time', false); - $log.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'); - } else { - if (date) { - selected = date; - } - - if (selected < min || selected > max) { - ngModelCtrl.$setValidity('time', false); - $scope.invalidHours = true; - $scope.invalidMinutes = true; - } else { - makeValid(); - } - updateTemplate(); - } - }; - - // Call internally when we know that model is valid. - function refresh(keyboardChange) { - makeValid(); - ngModelCtrl.$setViewValue(new Date(selected)); - updateTemplate(keyboardChange); - } - - function makeValid() { - ngModelCtrl.$setValidity('time', true); - $scope.invalidHours = false; - $scope.invalidMinutes = false; - $scope.invalidSeconds = false; - } - - function updateTemplate(keyboardChange) { - if (!ngModelCtrl.$modelValue) { - $scope.hours = null; - $scope.minutes = null; - $scope.seconds = null; - $scope.meridian = meridians[0]; - } else { - var hours = selected.getHours(), - minutes = selected.getMinutes(), - seconds = selected.getSeconds(); - - if ($scope.showMeridian) { - hours = hours === 0 || hours === 12 ? 12 : hours % 12; // Convert 24 to 12 hour system - } - - $scope.hours = keyboardChange === 'h' ? hours : pad(hours, !padHours); - if (keyboardChange !== 'm') { - $scope.minutes = pad(minutes); - } - $scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1]; - - if (keyboardChange !== 's') { - $scope.seconds = pad(seconds); - } - $scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1]; - } - } - - function addSecondsToSelected(seconds) { - selected = addSeconds(selected, seconds); - refresh(); - } - - function addMinutes(selected, minutes) { - return addSeconds(selected, minutes*60); - } - - function addSeconds(date, seconds) { - var dt = new Date(date.getTime() + seconds * 1000); - var newDate = new Date(date); - newDate.setHours(dt.getHours(), dt.getMinutes(), dt.getSeconds()); - return newDate; - } - - function modelIsEmpty() { - return ($scope.hours === null || $scope.hours === '') && - ($scope.minutes === null || $scope.minutes === '') && - (!$scope.showSeconds || $scope.showSeconds && ($scope.seconds === null || $scope.seconds === '')); - } - - $scope.showSpinners = angular.isDefined($attrs.showSpinners) ? - $scope.$parent.$eval($attrs.showSpinners) : timepickerConfig.showSpinners; - - $scope.incrementHours = function() { - if (!$scope.noIncrementHours()) { - addSecondsToSelected(hourStep * 60 * 60); - } - }; - - $scope.decrementHours = function() { - if (!$scope.noDecrementHours()) { - addSecondsToSelected(-hourStep * 60 * 60); - } - }; - - $scope.incrementMinutes = function() { - if (!$scope.noIncrementMinutes()) { - addSecondsToSelected(minuteStep * 60); - } - }; - - $scope.decrementMinutes = function() { - if (!$scope.noDecrementMinutes()) { - addSecondsToSelected(-minuteStep * 60); - } - }; - - $scope.incrementSeconds = function() { - if (!$scope.noIncrementSeconds()) { - addSecondsToSelected(secondStep); - } - }; - - $scope.decrementSeconds = function() { - if (!$scope.noDecrementSeconds()) { - addSecondsToSelected(-secondStep); - } - }; - - $scope.toggleMeridian = function() { - var minutes = getMinutesFromTemplate(), - hours = getHoursFromTemplate(); - - if (!$scope.noToggleMeridian()) { - if (angular.isDefined(minutes) && angular.isDefined(hours)) { - addSecondsToSelected(12 * 60 * (selected.getHours() < 12 ? 60 : -60)); - } else { - $scope.meridian = $scope.meridian === meridians[0] ? meridians[1] : meridians[0]; - } - } - }; - - $scope.blur = function() { - ngModelCtrl.$setTouched(); - }; - - $scope.$on('$destroy', function() { - while (watchers.length) { - watchers.shift()(); - } - }); -}]) - -.directive('uibTimepicker', ['uibTimepickerConfig', function(uibTimepickerConfig) { - return { - require: ['uibTimepicker', '?^ngModel'], - controller: 'UibTimepickerController', - controllerAs: 'timepicker', - replace: true, - scope: {}, - templateUrl: function(element, attrs) { - return attrs.templateUrl || uibTimepickerConfig.templateUrl; - }, - link: function(scope, element, attrs, ctrls) { - var timepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1]; - - if (ngModelCtrl) { - timepickerCtrl.init(ngModelCtrl, element.find('input')); - } - } - }; -}]); - -angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap.position']) - -/** - * A helper service that can parse typeahead's syntax (string provided by users) - * Extracted to a separate service for ease of unit testing - */ - .factory('uibTypeaheadParser', ['$parse', function($parse) { - // 00000111000000000000022200000000000000003333333333333330000000000044000 - var TYPEAHEAD_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/; - return { - parse: function(input) { - var match = input.match(TYPEAHEAD_REGEXP); - if (!match) { - throw new Error( - 'Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_"' + - ' but got "' + input + '".'); - } - - return { - itemName: match[3], - source: $parse(match[4]), - viewMapper: $parse(match[2] || match[1]), - modelMapper: $parse(match[1]) - }; - } - }; - }]) - - .controller('UibTypeaheadController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$q', '$timeout', '$document', '$window', '$rootScope', '$$debounce', '$uibPosition', 'uibTypeaheadParser', - function(originalScope, element, attrs, $compile, $parse, $q, $timeout, $document, $window, $rootScope, $$debounce, $position, typeaheadParser) { - var HOT_KEYS = [9, 13, 27, 38, 40]; - var eventDebounceTime = 200; - var modelCtrl, ngModelOptions; - //SUPPORTED ATTRIBUTES (OPTIONS) - - //minimal no of characters that needs to be entered before typeahead kicks-in - var minLength = originalScope.$eval(attrs.typeaheadMinLength); - if (!minLength && minLength !== 0) { - minLength = 1; - } - - originalScope.$watch(attrs.typeaheadMinLength, function (newVal) { - minLength = !newVal && newVal !== 0 ? 1 : newVal; - }); - - //minimal wait time after last character typed before typeahead kicks-in - var waitTime = originalScope.$eval(attrs.typeaheadWaitMs) || 0; - - //should it restrict model values to the ones selected from the popup only? - var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false; - originalScope.$watch(attrs.typeaheadEditable, function (newVal) { - isEditable = newVal !== false; - }); - - //binding to a variable that indicates if matches are being retrieved asynchronously - var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop; - - //a function to determine if an event should cause selection - var isSelectEvent = attrs.typeaheadShouldSelect ? $parse(attrs.typeaheadShouldSelect) : function(scope, vals) { - var evt = vals.$event; - return evt.which === 13 || evt.which === 9; - }; - - //a callback executed when a match is selected - var onSelectCallback = $parse(attrs.typeaheadOnSelect); - - //should it select highlighted popup value when losing focus? - var isSelectOnBlur = angular.isDefined(attrs.typeaheadSelectOnBlur) ? originalScope.$eval(attrs.typeaheadSelectOnBlur) : false; - - //binding to a variable that indicates if there were no results after the query is completed - var isNoResultsSetter = $parse(attrs.typeaheadNoResults).assign || angular.noop; - - var inputFormatter = attrs.typeaheadInputFormatter ? $parse(attrs.typeaheadInputFormatter) : undefined; - - var appendToBody = attrs.typeaheadAppendToBody ? originalScope.$eval(attrs.typeaheadAppendToBody) : false; - - var appendTo = attrs.typeaheadAppendTo ? - originalScope.$eval(attrs.typeaheadAppendTo) : null; - - var focusFirst = originalScope.$eval(attrs.typeaheadFocusFirst) !== false; - - //If input matches an item of the list exactly, select it automatically - var selectOnExact = attrs.typeaheadSelectOnExact ? originalScope.$eval(attrs.typeaheadSelectOnExact) : false; - - //binding to a variable that indicates if dropdown is open - var isOpenSetter = $parse(attrs.typeaheadIsOpen).assign || angular.noop; - - var showHint = originalScope.$eval(attrs.typeaheadShowHint) || false; - - //INTERNAL VARIABLES - - //model setter executed upon match selection - var parsedModel = $parse(attrs.ngModel); - var invokeModelSetter = $parse(attrs.ngModel + '($$$p)'); - var $setModelValue = function(scope, newValue) { - if (angular.isFunction(parsedModel(originalScope)) && - ngModelOptions && ngModelOptions.$options && ngModelOptions.$options.getterSetter) { - return invokeModelSetter(scope, {$$$p: newValue}); - } - - return parsedModel.assign(scope, newValue); - }; - - //expressions used by typeahead - var parserResult = typeaheadParser.parse(attrs.uibTypeahead); - - var hasFocus; - - //Used to avoid bug in iOS webview where iOS keyboard does not fire - //mousedown & mouseup events - //Issue #3699 - var selected; - - //create a child scope for the typeahead directive so we are not polluting original scope - //with typeahead-specific data (matches, query etc.) - var scope = originalScope.$new(); - var offDestroy = originalScope.$on('$destroy', function() { - scope.$destroy(); - }); - scope.$on('$destroy', offDestroy); - - // WAI-ARIA - var popupId = 'typeahead-' + scope.$id + '-' + Math.floor(Math.random() * 10000); - element.attr({ - 'aria-autocomplete': 'list', - 'aria-expanded': false, - 'aria-owns': popupId - }); - - var inputsContainer, hintInputElem; - //add read-only input to show hint - if (showHint) { - inputsContainer = angular.element('
      '); - inputsContainer.css('position', 'relative'); - element.after(inputsContainer); - hintInputElem = element.clone(); - hintInputElem.attr('placeholder', ''); - hintInputElem.attr('tabindex', '-1'); - hintInputElem.val(''); - hintInputElem.css({ - 'position': 'absolute', - 'top': '0px', - 'left': '0px', - 'border-color': 'transparent', - 'box-shadow': 'none', - 'opacity': 1, - 'background': 'none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)', - 'color': '#999' - }); - element.css({ - 'position': 'relative', - 'vertical-align': 'top', - 'background-color': 'transparent' - }); - inputsContainer.append(hintInputElem); - hintInputElem.after(element); - } - - //pop-up element used to display matches - var popUpEl = angular.element('
      '); - popUpEl.attr({ - id: popupId, - matches: 'matches', - active: 'activeIdx', - select: 'select(activeIdx, evt)', - 'move-in-progress': 'moveInProgress', - query: 'query', - position: 'position', - 'assign-is-open': 'assignIsOpen(isOpen)', - debounce: 'debounceUpdate' - }); - //custom item template - if (angular.isDefined(attrs.typeaheadTemplateUrl)) { - popUpEl.attr('template-url', attrs.typeaheadTemplateUrl); - } - - if (angular.isDefined(attrs.typeaheadPopupTemplateUrl)) { - popUpEl.attr('popup-template-url', attrs.typeaheadPopupTemplateUrl); - } - - var resetHint = function() { - if (showHint) { - hintInputElem.val(''); - } - }; - - var resetMatches = function() { - scope.matches = []; - scope.activeIdx = -1; - element.attr('aria-expanded', false); - resetHint(); - }; - - var getMatchId = function(index) { - return popupId + '-option-' + index; - }; - - // Indicate that the specified match is the active (pre-selected) item in the list owned by this typeahead. - // This attribute is added or removed automatically when the `activeIdx` changes. - scope.$watch('activeIdx', function(index) { - if (index < 0) { - element.removeAttr('aria-activedescendant'); - } else { - element.attr('aria-activedescendant', getMatchId(index)); - } - }); - - var inputIsExactMatch = function(inputValue, index) { - if (scope.matches.length > index && inputValue) { - return inputValue.toUpperCase() === scope.matches[index].label.toUpperCase(); - } - - return false; - }; - - var getMatchesAsync = function(inputValue, evt) { - var locals = {$viewValue: inputValue}; - isLoadingSetter(originalScope, true); - isNoResultsSetter(originalScope, false); - $q.when(parserResult.source(originalScope, locals)).then(function(matches) { - //it might happen that several async queries were in progress if a user were typing fast - //but we are interested only in responses that correspond to the current view value - var onCurrentRequest = inputValue === modelCtrl.$viewValue; - if (onCurrentRequest && hasFocus) { - if (matches && matches.length > 0) { - scope.activeIdx = focusFirst ? 0 : -1; - isNoResultsSetter(originalScope, false); - scope.matches.length = 0; - - //transform labels - for (var i = 0; i < matches.length; i++) { - locals[parserResult.itemName] = matches[i]; - scope.matches.push({ - id: getMatchId(i), - label: parserResult.viewMapper(scope, locals), - model: matches[i] - }); - } - - scope.query = inputValue; - //position pop-up with matches - we need to re-calculate its position each time we are opening a window - //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page - //due to other elements being rendered - recalculatePosition(); - - element.attr('aria-expanded', true); - - //Select the single remaining option if user input matches - if (selectOnExact && scope.matches.length === 1 && inputIsExactMatch(inputValue, 0)) { - if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) { - $$debounce(function() { - scope.select(0, evt); - }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']); - } else { - scope.select(0, evt); - } - } - - if (showHint) { - var firstLabel = scope.matches[0].label; - if (angular.isString(inputValue) && - inputValue.length > 0 && - firstLabel.slice(0, inputValue.length).toUpperCase() === inputValue.toUpperCase()) { - hintInputElem.val(inputValue + firstLabel.slice(inputValue.length)); - } else { - hintInputElem.val(''); - } - } - } else { - resetMatches(); - isNoResultsSetter(originalScope, true); - } - } - if (onCurrentRequest) { - isLoadingSetter(originalScope, false); - } - }, function() { - resetMatches(); - isLoadingSetter(originalScope, false); - isNoResultsSetter(originalScope, true); - }); - }; - - // bind events only if appendToBody params exist - performance feature - if (appendToBody) { - angular.element($window).on('resize', fireRecalculating); - $document.find('body').on('scroll', fireRecalculating); - } - - // Declare the debounced function outside recalculating for - // proper debouncing - var debouncedRecalculate = $$debounce(function() { - // if popup is visible - if (scope.matches.length) { - recalculatePosition(); - } - - scope.moveInProgress = false; - }, eventDebounceTime); - - // Default progress type - scope.moveInProgress = false; - - function fireRecalculating() { - if (!scope.moveInProgress) { - scope.moveInProgress = true; - scope.$digest(); - } - - debouncedRecalculate(); - } - - // recalculate actual position and set new values to scope - // after digest loop is popup in right position - function recalculatePosition() { - scope.position = appendToBody ? $position.offset(element) : $position.position(element); - scope.position.top += element.prop('offsetHeight'); - } - - //we need to propagate user's query so we can higlight matches - scope.query = undefined; - - //Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later - var timeoutPromise; - - var scheduleSearchWithTimeout = function(inputValue) { - timeoutPromise = $timeout(function() { - getMatchesAsync(inputValue); - }, waitTime); - }; - - var cancelPreviousTimeout = function() { - if (timeoutPromise) { - $timeout.cancel(timeoutPromise); - } - }; - - resetMatches(); - - scope.assignIsOpen = function (isOpen) { - isOpenSetter(originalScope, isOpen); - }; - - scope.select = function(activeIdx, evt) { - //called from within the $digest() cycle - var locals = {}; - var model, item; - - selected = true; - locals[parserResult.itemName] = item = scope.matches[activeIdx].model; - model = parserResult.modelMapper(originalScope, locals); - $setModelValue(originalScope, model); - modelCtrl.$setValidity('editable', true); - modelCtrl.$setValidity('parse', true); - - onSelectCallback(originalScope, { - $item: item, - $model: model, - $label: parserResult.viewMapper(originalScope, locals), - $event: evt - }); - - resetMatches(); - - //return focus to the input element if a match was selected via a mouse click event - // use timeout to avoid $rootScope:inprog error - if (scope.$eval(attrs.typeaheadFocusOnSelect) !== false) { - $timeout(function() { element[0].focus(); }, 0, false); - } - }; - - //bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27) - element.on('keydown', function(evt) { - //typeahead is open and an "interesting" key was pressed - if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) { - return; - } - - var shouldSelect = isSelectEvent(originalScope, {$event: evt}); - - /** - * if there's nothing selected (i.e. focusFirst) and enter or tab is hit - * or - * shift + tab is pressed to bring focus to the previous element - * then clear the results - */ - if (scope.activeIdx === -1 && shouldSelect || evt.which === 9 && !!evt.shiftKey) { - resetMatches(); - scope.$digest(); - return; - } - - evt.preventDefault(); - var target; - switch (evt.which) { - case 27: // escape - evt.stopPropagation(); - - resetMatches(); - originalScope.$digest(); - break; - case 38: // up arrow - scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1; - scope.$digest(); - target = popUpEl.find('li')[scope.activeIdx]; - target.parentNode.scrollTop = target.offsetTop; - break; - case 40: // down arrow - scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length; - scope.$digest(); - target = popUpEl.find('li')[scope.activeIdx]; - target.parentNode.scrollTop = target.offsetTop; - break; - default: - if (shouldSelect) { - scope.$apply(function() { - if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) { - $$debounce(function() { - scope.select(scope.activeIdx, evt); - }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']); - } else { - scope.select(scope.activeIdx, evt); - } - }); - } - } - }); - - element.bind('focus', function (evt) { - hasFocus = true; - if (minLength === 0 && !modelCtrl.$viewValue) { - $timeout(function() { - getMatchesAsync(modelCtrl.$viewValue, evt); - }, 0); - } - }); - - element.bind('blur', function(evt) { - if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) { - selected = true; - scope.$apply(function() { - if (angular.isObject(scope.debounceUpdate) && angular.isNumber(scope.debounceUpdate.blur)) { - $$debounce(function() { - scope.select(scope.activeIdx, evt); - }, scope.debounceUpdate.blur); - } else { - scope.select(scope.activeIdx, evt); - } - }); - } - if (!isEditable && modelCtrl.$error.editable) { - modelCtrl.$setViewValue(); - // Reset validity as we are clearing - modelCtrl.$setValidity('editable', true); - modelCtrl.$setValidity('parse', true); - element.val(''); - } - hasFocus = false; - selected = false; - }); - - // Keep reference to click handler to unbind it. - var dismissClickHandler = function(evt) { - // Issue #3973 - // Firefox treats right click as a click on document - if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) { - resetMatches(); - if (!$rootScope.$$phase) { - originalScope.$digest(); - } - } - }; - - $document.on('click', dismissClickHandler); - - originalScope.$on('$destroy', function() { - $document.off('click', dismissClickHandler); - if (appendToBody || appendTo) { - $popup.remove(); - } - - if (appendToBody) { - angular.element($window).off('resize', fireRecalculating); - $document.find('body').off('scroll', fireRecalculating); - } - // Prevent jQuery cache memory leak - popUpEl.remove(); - - if (showHint) { - inputsContainer.remove(); - } - }); - - var $popup = $compile(popUpEl)(scope); - - if (appendToBody) { - $document.find('body').append($popup); - } else if (appendTo) { - angular.element(appendTo).eq(0).append($popup); - } else { - element.after($popup); - } - - this.init = function(_modelCtrl, _ngModelOptions) { - modelCtrl = _modelCtrl; - ngModelOptions = _ngModelOptions; - - scope.debounceUpdate = modelCtrl.$options && $parse(modelCtrl.$options.debounce)(originalScope); - - //plug into $parsers pipeline to open a typeahead on view changes initiated from DOM - //$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue - modelCtrl.$parsers.unshift(function(inputValue) { - hasFocus = true; - - if (minLength === 0 || inputValue && inputValue.length >= minLength) { - if (waitTime > 0) { - cancelPreviousTimeout(); - scheduleSearchWithTimeout(inputValue); - } else { - getMatchesAsync(inputValue); - } - } else { - isLoadingSetter(originalScope, false); - cancelPreviousTimeout(); - resetMatches(); - } - - if (isEditable) { - return inputValue; - } - - if (!inputValue) { - // Reset in case user had typed something previously. - modelCtrl.$setValidity('editable', true); - return null; - } - - modelCtrl.$setValidity('editable', false); - return undefined; - }); - - modelCtrl.$formatters.push(function(modelValue) { - var candidateViewValue, emptyViewValue; - var locals = {}; - - // The validity may be set to false via $parsers (see above) if - // the model is restricted to selected values. If the model - // is set manually it is considered to be valid. - if (!isEditable) { - modelCtrl.$setValidity('editable', true); - } - - if (inputFormatter) { - locals.$model = modelValue; - return inputFormatter(originalScope, locals); - } - - //it might happen that we don't have enough info to properly render input value - //we need to check for this situation and simply return model value if we can't apply custom formatting - locals[parserResult.itemName] = modelValue; - candidateViewValue = parserResult.viewMapper(originalScope, locals); - locals[parserResult.itemName] = undefined; - emptyViewValue = parserResult.viewMapper(originalScope, locals); - - return candidateViewValue !== emptyViewValue ? candidateViewValue : modelValue; - }); - }; - }]) - - .directive('uibTypeahead', function() { - return { - controller: 'UibTypeaheadController', - require: ['ngModel', '^?ngModelOptions', 'uibTypeahead'], - link: function(originalScope, element, attrs, ctrls) { - ctrls[2].init(ctrls[0], ctrls[1]); - } - }; - }) - - .directive('uibTypeaheadPopup', ['$$debounce', function($$debounce) { - return { - scope: { - matches: '=', - query: '=', - active: '=', - position: '&', - moveInProgress: '=', - select: '&', - assignIsOpen: '&', - debounce: '&' - }, - replace: true, - templateUrl: function(element, attrs) { - return attrs.popupTemplateUrl || 'uib/template/typeahead/typeahead-popup.html'; - }, - link: function(scope, element, attrs) { - scope.templateUrl = attrs.templateUrl; - - scope.isOpen = function() { - var isDropdownOpen = scope.matches.length > 0; - scope.assignIsOpen({ isOpen: isDropdownOpen }); - return isDropdownOpen; - }; - - scope.isActive = function(matchIdx) { - return scope.active === matchIdx; - }; - - scope.selectActive = function(matchIdx) { - scope.active = matchIdx; - }; - - scope.selectMatch = function(activeIdx, evt) { - var debounce = scope.debounce(); - if (angular.isNumber(debounce) || angular.isObject(debounce)) { - $$debounce(function() { - scope.select({activeIdx: activeIdx, evt: evt}); - }, angular.isNumber(debounce) ? debounce : debounce['default']); - } else { - scope.select({activeIdx: activeIdx, evt: evt}); - } - }; - } - }; - }]) - - .directive('uibTypeaheadMatch', ['$templateRequest', '$compile', '$parse', function($templateRequest, $compile, $parse) { - return { - scope: { - index: '=', - match: '=', - query: '=' - }, - link: function(scope, element, attrs) { - var tplUrl = $parse(attrs.templateUrl)(scope.$parent) || 'uib/template/typeahead/typeahead-match.html'; - $templateRequest(tplUrl).then(function(tplContent) { - var tplEl = angular.element(tplContent.trim()); - element.replaceWith(tplEl); - $compile(tplEl)(scope); - }); - } - }; - }]) - - .filter('uibTypeaheadHighlight', ['$sce', '$injector', '$log', function($sce, $injector, $log) { - var isSanitizePresent; - isSanitizePresent = $injector.has('$sanitize'); - - function escapeRegexp(queryToEscape) { - // Regex: capture the whole query string and replace it with the string that will be used to match - // the results, for example if the capture is "a" the result will be \a - return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'); - } - - function containsHtml(matchItem) { - return /<.*>/g.test(matchItem); - } - - return function(matchItem, query) { - if (!isSanitizePresent && containsHtml(matchItem)) { - $log.warn('Unsafe use of typeahead please use ngSanitize'); // Warn the user about the danger - } - matchItem = query ? ('' + matchItem).replace(new RegExp(escapeRegexp(query), 'gi'), '$&') : matchItem; // Replaces the capture string with a the same string inside of a "strong" tag - if (!isSanitizePresent) { - matchItem = $sce.trustAsHtml(matchItem); // If $sanitize is not present we pack the string in a $sce object for the ng-bind-html directive - } - return matchItem; - }; - }]); -angular.module('ui.bootstrap.carousel').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibCarouselCss && angular.element(document).find('head').prepend(''); angular.$$uibCarouselCss = true; }); -angular.module('ui.bootstrap.datepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerCss && angular.element(document).find('head').prepend(''); angular.$$uibDatepickerCss = true; }); -angular.module('ui.bootstrap.position').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibPositionCss && angular.element(document).find('head').prepend(''); angular.$$uibPositionCss = true; }); -angular.module('ui.bootstrap.datepickerPopup').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerpopupCss && angular.element(document).find('head').prepend(''); angular.$$uibDatepickerpopupCss = true; }); -angular.module('ui.bootstrap.tooltip').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTooltipCss && angular.element(document).find('head').prepend(''); angular.$$uibTooltipCss = true; }); -angular.module('ui.bootstrap.timepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTimepickerCss && angular.element(document).find('head').prepend(''); angular.$$uibTimepickerCss = true; }); -angular.module('ui.bootstrap.typeahead').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTypeaheadCss && angular.element(document).find('head').prepend(''); angular.$$uibTypeaheadCss = true; }); \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap.min.js deleted file mode 100644 index c56583cf62..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * angular-ui-bootstrap - * http://angular-ui.github.io/bootstrap/ - - * Version: 1.3.3 - 2016-05-22 - * License: MIT - */angular.module("ui.bootstrap",["ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$q","$parse","$injector",function(a,b,c,d){var e=d.has("$animateCss")?d.get("$animateCss"):null;return{link:function(d,f,g){function h(){f.hasClass("collapse")&&f.hasClass("in")||b.resolve(l(d)).then(function(){f.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),e?e(f,{addClass:"in",easing:"ease",to:{height:f[0].scrollHeight+"px"}}).start()["finally"](i):a.addClass(f,"in",{to:{height:f[0].scrollHeight+"px"}}).then(i)})}function i(){f.removeClass("collapsing").addClass("collapse").css({height:"auto"}),m(d)}function j(){return f.hasClass("collapse")||f.hasClass("in")?void b.resolve(n(d)).then(function(){f.css({height:f[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),e?e(f,{removeClass:"in",to:{height:"0"}}).start()["finally"](k):a.removeClass(f,"in",{to:{height:"0"}}).then(k)}):k()}function k(){f.css({height:"0"}),f.removeClass("collapsing").addClass("collapse"),o(d)}var l=c(g.expanding),m=c(g.expanded),n=c(g.collapsing),o=c(g.collapsed);d.$eval(g.uibCollapse)||f.addClass("in").addClass("collapse").attr("aria-expanded",!0).attr("aria-hidden",!1).css({height:"auto"}),d.$watch(g.uibCollapse,function(a){a?j():h()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(c){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",panelClass:"@?",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.openClass=c.openClass||"panel-open",a.panelClass=c.panelClass||"panel-default",a.$watch("isOpen",function(c){b.toggleClass(a.openClass,!!c),c&&d.closeOthers(a)}),a.toggleOpen=function(b){a.isDisabled||b&&32!==b.which||(a.isOpen=!a.isOpen)};var e="accordiongroup-"+a.$id+"-"+Math.floor(1e4*Math.random());a.headingId=e+"-tab",a.panelId=e+"-panel"}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("uibAccordionTransclude",function(){function a(){return"uib-accordion-header,data-uib-accordion-header,x-uib-accordion-header,uib\\:accordion-header,[uib-accordion-header],[data-uib-accordion-header],[x-uib-accordion-header]"}return{require:"^uibAccordionGroup",link:function(b,c,d,e){b.$watch(function(){return e[d.uibAccordionTransclude]},function(b){if(b){var d=angular.element(c[0].querySelector(a()));d.html(""),d.append(b)}})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$attrs","$interpolate","$timeout",function(a,b,c,d){a.closeable=!!b.close;var e=angular.isDefined(b.dismissOnTimeout)?c(b.dismissOnTimeout)(a.$parent):null;e&&d(function(){a.close()},parseInt(e,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",templateUrl:function(a,b){return b.templateUrl||"uib/template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(a){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(b,c,d,e){var f=e[0],g=e[1],h=a(d.uibUncheckable);c.find("input").css({display:"none"}),g.$render=function(){c.toggleClass(f.activeClass,angular.equals(g.$modelValue,b.$eval(d.uibBtnRadio)))},c.on(f.toggleEvent,function(){if(!d.disabled){var a=c.hasClass(f.activeClass);a&&!angular.isDefined(d.uncheckable)||b.$apply(function(){g.$setViewValue(a?null:b.$eval(d.uibBtnRadio)),g.$render()})}}),d.uibUncheckable&&b.$watch(h,function(a){d.$set("uncheckable",a?"":void 0)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){return angular.isDefined(b)?a.$eval(b):c}var h=d[0],i=d[1];b.find("input").css({display:"none"}),i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.on(h.toggleEvent,function(){c.disabled||a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(a,b,c,d,e){function f(){for(;t.length;)t.shift()}function g(a){for(var b=0;b1){q[d].element.data(r,c.direction);var j=p.getCurrentIndex();angular.isNumber(j)&&q[j].element&&q[j].element.data(r,c.direction),a.$currentTransition=!0,e.on("addClass",q[d].element,function(b,c){if("close"===c&&(a.$currentTransition=null,e.off("addClass",b),t.length)){var d=t.pop().slide,g=d.index,i=g>p.getCurrentIndex()?"next":"prev";f(),h(d,g,i)}})}a.active=c.index,s=c.index,g(d),l()}}function i(a){for(var b=0;b0&&(n=c(m,b))}function m(){var b=+a.interval;o&&!isNaN(b)&&b>0&&q.length?a.next():a.pause()}var n,o,p=this,q=p.slides=a.slides=[],r="uib-slideDirection",s=a.active,t=[],u=!1;p.addSlide=function(b,c){q.push({slide:b,element:c}),q.sort(function(a,b){return+a.slide.index-+b.slide.index}),(b.index===a.active||1===q.length&&!angular.isNumber(a.active))&&(a.$currentTransition&&(a.$currentTransition=null),s=b.index,a.active=b.index,g(s),p.select(q[i(b)]),1===q.length&&a.play())},p.getCurrentIndex=function(){for(var a=0;a0&&s===c?c>=q.length?(s=q.length-1,a.active=s,g(s),p.select(q[q.length-1])):(s=c,a.active=s,g(s),p.select(q[c])):s>c&&(s--,a.active=s),0===q.length&&(s=null,a.active=null,f())},p.select=a.select=function(b,c){var d=i(b.slide);void 0===c&&(c=d>p.getCurrentIndex()?"next":"prev"),b.slide.index===s||a.$currentTransition?b&&b.slide.index!==s&&a.$currentTransition&&t.push(q[d]):h(b.slide,d,c)},a.indexOfSlide=function(a){return+a.slide.index},a.isActive=function(b){return a.active===b.slide.index},a.isPrevDisabled=function(){return 0===a.active&&a.noWrap()},a.isNextDisabled=function(){return a.active===q.length-1&&a.noWrap()},a.pause=function(){a.noPause||(o=!1,j())},a.play=function(){o||(o=!0,l())},a.$on("$destroy",function(){u=!0,j()}),a.$watch("noTransition",function(a){e.enabled(b,!a)}),a.$watch("interval",l),a.$watchCollection("slides",k),a.$watch("active",function(a){if(angular.isNumber(a)&&s!==a){for(var b=0;b-1){var g=!1;a=a.split("");for(var h=f;h-1){a=a.split(""),e[f]="("+d.regex+")",a[f]="$";for(var g=f+1,h=f+d.key.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,key:d.key,apply:d[b],matcher:d.regex})}}),{regex:new RegExp("^"+e.join("")+"$"),map:d(c,"index")}}function f(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}function g(a){return parseInt(a,10)}function h(a,b){return a&&b?l(a,b):a}function i(a,b){return a&&b?l(a,b,!0):a}function j(a,b){a=a.replace(/:/g,"");var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return isNaN(c)?b:c}function k(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function l(a,b,c){c=c?-1:1;var d=a.getTimezoneOffset(),e=j(b,d);return k(a,c*(e-d))}var m,n,o=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){m=b.id,this.parsers={},this.formatters={},n=[{key:"yyyy",regex:"\\d{4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(a){a=+a,this.year=69>a?a+2e3:a+1900},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){var b=a.getMonth();return/^[0-9]$/.test(b)?c(a,"MM"):c(a,"M")}},{key:"MMMM",regex:b.DATETIME_FORMATS.MONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.MONTH.indexOf(a)},formatter:function(a){return c(a,"MMMM")}},{key:"MMM",regex:b.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.SHORTMONTH.indexOf(a)},formatter:function(a){return c(a,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){var b=a.getDate();return/^[1-9]$/.test(b)?c(a,"dd"):c(a,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"d")}},{key:"EEEE",regex:b.DATETIME_FORMATS.DAY.join("|"),formatter:function(a){return c(a,"EEEE")}},{key:"EEE",regex:b.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(a){return c(a,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a},formatter:function(a){return c(a,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"s")}},{key:"a",regex:b.DATETIME_FORMATS.AMPMS.join("|"),apply:function(a){12===this.hours&&(this.hours=0),"PM"===a&&(this.hours+=12)},formatter:function(a){return c(a,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(a){var b=a.match(/([+-])(\d{2})(\d{2})/),c=b[1],d=b[2],e=b[3];this.hours+=g(c+d),this.minutes+=g(c+e)},formatter:function(a){return c(a,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(a){return c(a,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(a){return c(a,"w")}},{key:"GGGG",regex:b.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(a){return c(a,"GGGG")}},{key:"GGG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GGG")}},{key:"GG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GG")}},{key:"G",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"G")}}]},this.init(),this.filter=function(a,c){if(!angular.isDate(a)||isNaN(a)||!c)return"";c=b.DATETIME_FORMATS[c]||c,b.id!==m&&this.init(),this.formatters[c]||(this.formatters[c]=e(c,"formatter"));var d=this.formatters[c],f=d.map,g=c;return f.reduce(function(b,c,d){var e=g.match(new RegExp("(.*)"+c.key));e&&angular.isString(e[1])&&(b+=e[1],g=g.replace(e[1]+c.key,""));var h=d===f.length-1?g:"";return c.apply?b+c.apply.call(null,a)+h:b+h},"")},this.parse=function(c,d,g){if(!angular.isString(c)||!d)return c;d=b.DATETIME_FORMATS[d]||d,d=d.replace(o,"\\$&"),b.id!==m&&this.init(),this.parsers[d]||(this.parsers[d]=e(d,"apply"));var h=this.parsers[d],i=h.regex,j=h.map,k=c.match(i),l=!1;if(k&&k.length){var n,p;angular.isDate(g)&&!isNaN(g.getTime())?n={year:g.getFullYear(),month:g.getMonth(),date:g.getDate(),hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()}:(g&&a.warn("dateparser:","baseDate is not a valid date"),n={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var q=1,r=k.length;r>q;q++){var s=j[q-1];"Z"===s.matcher&&(l=!0),s.apply&&s.apply.call(n,k[q])}var t=l?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,u=l?Date.prototype.setUTCHours:Date.prototype.setHours;return f(n.year,n.month,n.date)&&(!angular.isDate(g)||isNaN(g.getTime())||l?(p=new Date(0),t.call(p,n.year,n.month,n.date),u.call(p,n.hours||0,n.minutes||0,n.seconds||0,n.milliseconds||0)):(p=new Date(g),t.call(p,n.year,n.month,n.date),u.call(p,n.hours,n.minutes,n.seconds,n.milliseconds))),p}},this.toTimezone=h,this.fromTimezone=i,this.timezoneToOffset=j,this.addDateMinutes=k,this.convertTimezoneToLocal=l}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(a){var b=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,c=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(d,e){function f(a,b,c){i.push(a),j.push({scope:a,element:b}),o.forEach(function(b,c){g(b,a)}),a.$on("$destroy",h)}function g(b,d){var e=b.match(c),f=d.$eval(e[1]),g=e[2],h=k[b];if(!h){var i=function(b){var c=null;j.some(function(a){var d=a.scope.$eval(m);return d===b?(c=a,!0):void 0}),h.lastActivated!==c&&(h.lastActivated&&a.removeClass(h.lastActivated.element,f),c&&a.addClass(c.element,f),h.lastActivated=c)};k[b]=h={lastActivated:null,scope:d,watchFn:i,compareWithExp:g,watcher:d.$watch(g,i)}}h.watchFn(d.$eval(g))}function h(a){var b=a.targetScope,c=i.indexOf(b);if(i.splice(c,1),j.splice(c,1),i.length){var d=i[0];angular.forEach(k,function(a){a.scope===b&&(a.watcher=d.$watch(a.compareWithExp,a.watchFn),a.scope=d)})}else k={}}var i=[],j=[],k={},l=e.uibIsClass.match(b),m=l[2],n=l[1],o=n.split(",");return f}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(a,b,c,d,e,f,g,h,i,j,k){function l(b){a.datepickerMode=b,a.datepickerOptions.datepickerMode=b}var m=this,n={$setViewValue:angular.noop},o={},p=[];!!b.datepickerOptions;a.datepickerOptions||(a.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(b){switch(b){case"customClass":case"dateDisabled":a[b]=a.datepickerOptions[b]||angular.noop;break;case"datepickerMode":a.datepickerMode=angular.isDefined(a.datepickerOptions.datepickerMode)?a.datepickerOptions.datepickerMode:h.datepickerMode;break;case"formatDay":case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":m[b]=angular.isDefined(a.datepickerOptions[b])?d(a.datepickerOptions[b])(a.$parent):h[b];break;case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":m[b]=angular.isDefined(a.datepickerOptions[b])?a.datepickerOptions[b]:h[b];break;case"startingDay":angular.isDefined(a.datepickerOptions.startingDay)?m.startingDay=a.datepickerOptions.startingDay:angular.isNumber(h.startingDay)?m.startingDay=h.startingDay:m.startingDay=(e.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":a.$watch("datepickerOptions."+b,function(a){a?angular.isDate(a)?m[b]=k.fromTimezone(new Date(a),o.timezone):(i&&f.warn("Literal date support has been deprecated, please switch to date object usage"),m[b]=new Date(g(a,"medium"))):m[b]=h[b]?k.fromTimezone(new Date(h[b]),o.timezone):null,m.refreshView()});break;case"maxMode":case"minMode":a.datepickerOptions[b]?a.$watch(function(){return a.datepickerOptions[b]},function(c){m[b]=a[b]=angular.isDefined(c)?c:datepickerOptions[b],("minMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)m.modes.indexOf(m[b]))&&(a.datepickerMode=m[b],a.datepickerOptions.datepickerMode=m[b])}):m[b]=a[b]=h[b]||null}}),a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),a.disabled=angular.isDefined(b.disabled)||!1,angular.isDefined(b.ngDisabled)&&p.push(a.$parent.$watch(b.ngDisabled,function(b){a.disabled=b,m.refreshView()})),a.isActive=function(b){return 0===m.compare(b.date,m.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(b){n=b,o=b.$options||h.ngModelOptions,a.datepickerOptions.initDate?(m.activeDate=k.fromTimezone(a.datepickerOptions.initDate,o.timezone)||new Date,a.$watch("datepickerOptions.initDate",function(a){a&&(n.$isEmpty(n.$modelValue)||n.$invalid)&&(m.activeDate=k.fromTimezone(a,o.timezone),m.refreshView())})):m.activeDate=new Date;var c=n.$modelValue?new Date(n.$modelValue):new Date;this.activeDate=isNaN(c)?k.fromTimezone(new Date,o.timezone):k.fromTimezone(c,o.timezone),n.$render=function(){m.render()}},this.render=function(){if(n.$viewValue){var a=new Date(n.$viewValue),b=!isNaN(a);b?this.activeDate=k.fromTimezone(a,o.timezone):j||f.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){a.selectedDt=null,this._refreshView(),a.activeDt&&(a.activeDateId=a.activeDt.uid);var b=n.$viewValue?new Date(n.$viewValue):null;b=k.fromTimezone(b,o.timezone),n.$setValidity("dateDisabled",!b||this.element&&!this.isDisabled(b))}},this.createDateObject=function(b,c){var d=n.$viewValue?new Date(n.$viewValue):null;d=k.fromTimezone(d,o.timezone);var e=new Date;e=k.fromTimezone(e,o.timezone);var f=this.compare(b,e),g={date:b,label:k.filter(b,c),selected:d&&0===this.compare(b,d),disabled:this.isDisabled(b),past:0>f,current:0===f,future:f>0,customClass:this.customClass(b)||null};return d&&0===this.compare(b,d)&&(a.selectedDt=g),m.activeDate&&0===this.compare(g.date,m.activeDate)&&(a.activeDt=g),g},this.isDisabled=function(b){return a.disabled||this.minDate&&this.compare(b,this.minDate)<0||this.maxDate&&this.compare(b,this.maxDate)>0||a.dateDisabled&&a.dateDisabled({date:b,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===m.minMode){var c=n.$viewValue?k.fromTimezone(new Date(n.$viewValue),o.timezone):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),c=k.toTimezone(c,o.timezone),n.$setViewValue(c),n.$render()}else m.activeDate=b,l(m.modes[m.modes.indexOf(a.datepickerMode)-1]),a.$emit("uib:datepicker.mode");a.$broadcast("uib:datepicker.focus")},a.move=function(a){var b=m.activeDate.getFullYear()+a*(m.step.years||0),c=m.activeDate.getMonth()+a*(m.step.months||0);m.activeDate.setFullYear(b,c,1),m.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===m.maxMode&&1===b||a.datepickerMode===m.minMode&&-1===b||(l(m.modes[m.modes.indexOf(a.datepickerMode)+b]),a.$emit("uib:datepicker.mode"))},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var q=function(){m.element[0].focus()};a.$on("uib:datepicker.focus",q),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey&&!a.disabled)if(b.preventDefault(),m.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(m.isDisabled(m.activeDate))return;a.select(m.activeDate)}else!b.ctrlKey||"up"!==c&&"down"!==c?(m.handleKeyDown(c,b),m.refreshView()):a.toggleMode("up"===c?1:-1)},a.$on("$destroy",function(){for(;p.length;)p.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?f[b]:29}function e(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}var f=[31,28,31,30,31,30,31,31,30,31,30,31];this.step={months:1},this.element=b,this.init=function(b){angular.extend(b,this),a.showWeeks=b.showWeeks,b.refreshView()},this.getDates=function(a,b){for(var c,d=new Array(b),e=new Date(a),f=0;b>f;)c=new Date(e),d[f++]=c,e.setDate(e.getDate()+1);return d},this._refreshView=function(){var b=this.activeDate.getFullYear(),d=this.activeDate.getMonth(),f=new Date(this.activeDate);f.setFullYear(b,d,1);var g=this.startingDay-f.getDay(),h=g>0?7-g:-g,i=new Date(f);h>0&&i.setDate(-h+1);for(var j=this.getDates(i,42),k=0;42>k;k++)j[k]=angular.extend(this.createDateObject(j[k],this.formatDay),{secondary:j[k].getMonth()!==d,uid:a.uniqueId+"-"+k});a.labels=new Array(7);for(var l=0;7>l;l++)a.labels[l]={abbr:c(j[l].date,this.formatDayHeader),full:c(j[l].date,"EEEE")};if(a.title=c(this.activeDate,this.formatDayTitle),a.rows=this.split(j,7),a.showWeeks){a.weekNumbers=[];for(var m=(11-this.startingDay)%7,n=a.rows.length,o=0;n>o;o++)a.weekNumbers.push(e(a.rows[o][m].date))}},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth(),a.getDate()),d=new Date(b.getFullYear(),b.getMonth(),b.getDate());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getDate();if("left"===a)c-=1;else if("up"===a)c-=7;else if("right"===a)c+=1;else if("down"===a)c+=7;else if("pageup"===a||"pagedown"===a){var e=this.activeDate.getMonth()+("pageup"===a?-1:1);this.activeDate.setMonth(e,1),c=Math.min(d(this.activeDate.getFullYear(),this.activeDate.getMonth()),c)}else"home"===a?c=1:"end"===a&&(c=d(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(c)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(a,b,c){this.step={years:1},this.element=b,this.init=function(a){angular.extend(a,this),a.refreshView()},this._refreshView=function(){for(var b,d=new Array(12),e=this.activeDate.getFullYear(),f=0;12>f;f++)b=new Date(this.activeDate),b.setFullYear(e,f,1),d[f]=angular.extend(this.createDateObject(b,this.formatMonth),{uid:a.uniqueId+"-"+f});a.title=c(this.activeDate,this.formatMonthTitle),a.rows=this.split(d,3)},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth()),d=new Date(b.getFullYear(),b.getMonth());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getMonth();if("left"===a)c-=1;else if("up"===a)c-=3;else if("right"===a)c+=1;else if("down"===a)c+=3;else if("pageup"===a||"pagedown"===a){var d=this.activeDate.getFullYear()+("pageup"===a?-1:1);this.activeDate.setFullYear(d)}else"home"===a?c=0:"end"===a&&(c=11);this.activeDate.setMonth(c)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a){return parseInt((a-1)/f,10)*f+1}var e,f;this.element=b,this.yearpickerInit=function(){e=this.yearColumns,f=this.yearRows*e,this.step={years:f}},this._refreshView=function(){for(var b,c=new Array(f),g=0,h=d(this.activeDate.getFullYear());f>g;g++)b=new Date(this.activeDate),b.setFullYear(h+g,0,1),c[g]=angular.extend(this.createDateObject(b,this.formatYear),{uid:a.uniqueId+"-"+g});a.title=[c[0].label,c[f-1].label].join(" - "),a.rows=this.split(c,e),a.columns=e},this.compare=function(a,b){return a.getFullYear()-b.getFullYear()},this.handleKeyDown=function(a,b){var c=this.activeDate.getFullYear();"left"===a?c-=1:"up"===a?c-=e:"right"===a?c+=1:"down"===a?c+=e:"pageup"===a||"pagedown"===a?c+=("pageup"===a?-1:1)*f:"home"===a?c=d(this.activeDate.getFullYear()):"end"===a&&(c=d(this.activeDate.getFullYear())+f-1),this.activeDate.setFullYear(c)}}]).directive("uibDatepicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],controller:"UibDatepickerController",controllerAs:"datepicker",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}).directive("uibDaypicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],controller:"UibDaypickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibMonthpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],controller:"UibMonthpickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibYearpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],controller:"UibYearpickerController",link:function(a,b,c,d){var e=d[0];angular.extend(e,d[1]),e.yearpickerInit(),e.refreshView()}}}),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(a,b){var c,d,e={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},f={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},g=/(HTML|BODY)/;return{getRawNode:function(a){return a.nodeName?a:a[0]||a},parseStyle:function(a){return a=parseFloat(a),isFinite(a)?a:0},offsetParent:function(c){function d(a){return"static"===(b.getComputedStyle(a).position||"static")}c=this.getRawNode(c);for(var e=c.offsetParent||a[0].documentElement;e&&e!==a[0].documentElement&&d(e);)e=e.offsetParent;return e||a[0].documentElement},scrollbarWidth:function(e){if(e){if(angular.isUndefined(d)){var f=a.find("body");f.addClass("uib-position-body-scrollbar-measure"),d=b.innerWidth-f[0].clientWidth,d=isFinite(d)?d:0,f.removeClass("uib-position-body-scrollbar-measure")}return d}if(angular.isUndefined(c)){var g=angular.element('
      ');a.find("body").append(g),c=g[0].offsetWidth-g[0].clientWidth,c=isFinite(c)?c:0,g.remove()}return c},scrollbarPadding:function(a){a=this.getRawNode(a);var c=b.getComputedStyle(a),d=this.parseStyle(c.paddingRight),e=this.parseStyle(c.paddingBottom),f=this.scrollParent(a,!1,!0),h=this.scrollbarWidth(f,g.test(f.tagName));return{scrollbarWidth:h,widthOverflow:f.scrollWidth>f.clientWidth,right:d+h,originalRight:d,heightOverflow:f.scrollHeight>f.clientHeight,bottom:e+h,originalBottom:e}},isScrollable:function(a,c){a=this.getRawNode(a);var d=c?e.hidden:e.normal,f=b.getComputedStyle(a);return d.test(f.overflow+f.overflowY+f.overflowX)},scrollParent:function(c,d,f){c=this.getRawNode(c);var g=d?e.hidden:e.normal,h=a[0].documentElement,i=b.getComputedStyle(c);if(f&&g.test(i.overflow+i.overflowY+i.overflowX))return c;var j="absolute"===i.position,k=c.parentElement||h;if(k===h||"fixed"===i.position)return h;for(;k.parentElement&&k!==h;){var l=b.getComputedStyle(k);if(j&&"static"!==l.position&&(j=!1),!j&&g.test(l.overflow+l.overflowY+l.overflowX))break;k=k.parentElement}return k},position:function(c,d){c=this.getRawNode(c);var e=this.offset(c);if(d){var f=b.getComputedStyle(c);e.top-=this.parseStyle(f.marginTop),e.left-=this.parseStyle(f.marginLeft)}var g=this.offsetParent(c),h={top:0,left:0};return g!==a[0].documentElement&&(h=this.offset(g),h.top+=g.clientTop-g.scrollTop,h.left+=g.clientLeft-g.scrollLeft),{width:Math.round(angular.isNumber(e.width)?e.width:c.offsetWidth),height:Math.round(angular.isNumber(e.height)?e.height:c.offsetHeight),top:Math.round(e.top-h.top),left:Math.round(e.left-h.left)}},offset:function(c){ -c=this.getRawNode(c);var d=c.getBoundingClientRect();return{width:Math.round(angular.isNumber(d.width)?d.width:c.offsetWidth),height:Math.round(angular.isNumber(d.height)?d.height:c.offsetHeight),top:Math.round(d.top+(b.pageYOffset||a[0].documentElement.scrollTop)),left:Math.round(d.left+(b.pageXOffset||a[0].documentElement.scrollLeft))}},viewportOffset:function(c,d,e){c=this.getRawNode(c),e=e!==!1;var f=c.getBoundingClientRect(),g={top:0,left:0,bottom:0,right:0},h=d?a[0].documentElement:this.scrollParent(c),i=h.getBoundingClientRect();if(g.top=i.top+h.clientTop,g.left=i.left+h.clientLeft,h===a[0].documentElement&&(g.top+=b.pageYOffset,g.left+=b.pageXOffset),g.bottom=g.top+h.clientHeight,g.right=g.left+h.clientWidth,e){var j=b.getComputedStyle(h);g.top+=this.parseStyle(j.paddingTop),g.bottom-=this.parseStyle(j.paddingBottom),g.left+=this.parseStyle(j.paddingLeft),g.right-=this.parseStyle(j.paddingRight)}return{top:Math.round(f.top-g.top),bottom:Math.round(g.bottom-f.bottom),left:Math.round(f.left-g.left),right:Math.round(g.right-f.right)}},parsePlacement:function(a){var b=f.auto.test(a);return b&&(a=a.replace(f.auto,"")),a=a.split("-"),a[0]=a[0]||"top",f.primary.test(a[0])||(a[0]="top"),a[1]=a[1]||"center",f.secondary.test(a[1])||(a[1]="center"),b?a[2]=!0:a[2]=!1,a},positionElements:function(a,c,d,e){a=this.getRawNode(a),c=this.getRawNode(c);var g=angular.isDefined(c.offsetWidth)?c.offsetWidth:c.prop("offsetWidth"),h=angular.isDefined(c.offsetHeight)?c.offsetHeight:c.prop("offsetHeight");d=this.parsePlacement(d);var i=e?this.offset(a):this.position(a),j={top:0,left:0,placement:""};if(d[2]){var k=this.viewportOffset(a,e),l=b.getComputedStyle(c),m={width:g+Math.round(Math.abs(this.parseStyle(l.marginLeft)+this.parseStyle(l.marginRight))),height:h+Math.round(Math.abs(this.parseStyle(l.marginTop)+this.parseStyle(l.marginBottom)))};if(d[0]="top"===d[0]&&m.height>k.top&&m.height<=k.bottom?"bottom":"bottom"===d[0]&&m.height>k.bottom&&m.height<=k.top?"top":"left"===d[0]&&m.width>k.left&&m.width<=k.right?"right":"right"===d[0]&&m.width>k.right&&m.width<=k.left?"left":d[0],d[1]="top"===d[1]&&m.height-i.height>k.bottom&&m.height-i.height<=k.top?"bottom":"bottom"===d[1]&&m.height-i.height>k.top&&m.height-i.height<=k.bottom?"top":"left"===d[1]&&m.width-i.width>k.right&&m.width-i.width<=k.left?"right":"right"===d[1]&&m.width-i.width>k.left&&m.width-i.width<=k.right?"left":d[1],"center"===d[1])if(f.vertical.test(d[0])){var n=i.width/2-g/2;k.left+n<0&&m.width-i.width<=k.right?d[1]="left":k.right+n<0&&m.width-i.width<=k.left&&(d[1]="right")}else{var o=i.height/2-m.height/2;k.top+o<0&&m.height-i.height<=k.bottom?d[1]="top":k.bottom+o<0&&m.height-i.height<=k.top&&(d[1]="bottom")}}switch(d[0]){case"top":j.top=i.top-h;break;case"bottom":j.top=i.top+i.height;break;case"left":j.left=i.left-g;break;case"right":j.left=i.left+i.width}switch(d[1]){case"top":j.top=i.top;break;case"bottom":j.top=i.top+i.height-h;break;case"left":j.left=i.left;break;case"right":j.left=i.left+i.width-g;break;case"center":f.vertical.test(d[0])?j.left=i.left+i.width/2-g/2:j.top=i.top+i.height/2-h/2}return j.top=Math.round(j.top),j.left=Math.round(j.left),j.placement="center"===d[1]?d[0]:d[0]+"-"+d[1],j},positionArrow:function(a,c){a=this.getRawNode(a);var d=a.querySelector(".tooltip-inner, .popover-inner");if(d){var e=angular.element(d).hasClass("tooltip-inner"),g=e?a.querySelector(".tooltip-arrow"):a.querySelector(".arrow");if(g){var h={top:"",bottom:"",left:"",right:""};if(c=this.parsePlacement(c),"center"===c[1])return void angular.element(g).css(h);var i="border-"+c[0]+"-width",j=b.getComputedStyle(g)[i],k="border-";k+=f.vertical.test(c[0])?c[0]+"-"+c[1]:c[1]+"-"+c[0],k+="-radius";var l=b.getComputedStyle(e?d:a)[k];switch(c[0]){case"top":h.bottom=e?"0":"-"+j;break;case"bottom":h.top=e?"0":"-"+j;break;case"left":h.right=e?"0":"-"+j;break;case"right":h.left=e?"0":"-"+j}h[c[1]]=l,angular.element(g).css(h)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(b){var c=l.parse(b,w,a.date);if(isNaN(c))for(var d=0;d
      "),G?(J=G.timezone,a.ngModelOptions=angular.copy(G),a.ngModelOptions.timezone=null,a.ngModelOptions.updateOnDefault===!0&&(a.ngModelOptions.updateOn=a.ngModelOptions.updateOn?a.ngModelOptions.updateOn+" default":"default"),C.attr("ng-model-options","ngModelOptions")):J=null,C.attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":A}),D=angular.element(C.children()[0]),D.attr("template-url",B),a.datepickerOptions||(a.datepickerOptions={}),K&&"month"===c.type&&(a.datepickerOptions.datepickerMode="month",a.datepickerOptions.minMode="month"),D.attr("datepicker-options","datepickerOptions"),K?F.$formatters.push(function(b){return a.date=l.fromTimezone(b,J),b}):(F.$$parserName="date",F.$validators.date=s,F.$parsers.unshift(r),F.$formatters.push(function(b){return F.$isEmpty(b)?(a.date=b,b):(angular.isNumber(b)&&(b=new Date(b)),a.date=l.fromTimezone(b,J),l.filter(a.date,w))})),F.$viewChangeListeners.push(function(){a.date=q(F.$viewValue)}),b.on("keydown",u),H=d(C)(a),C.remove(),y?h.find("body").append(H):b.after(H),a.$on("$destroy",function(){for(a.isOpen===!0&&(i.$$phase||a.$apply(function(){a.isOpen=!1})),H.remove(),b.off("keydown",u),h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v);L.length;)L.shift()()})},a.getText=function(b){return a[b+"Text"]||m[b+"Text"]},a.isDisabled=function(b){"today"===b&&(b=l.fromTimezone(new Date,J));var c={};return angular.forEach(["minDate","maxDate"],function(b){a.datepickerOptions[b]?angular.isDate(a.datepickerOptions[b])?c[b]=l.fromTimezone(new Date(a.datepickerOptions[b]),J):(p&&e.warn("Literal date support has been deprecated, please switch to date object usage"),c[b]=new Date(k(a.datepickerOptions[b],"medium"))):c[b]=null}),a.datepickerOptions&&c.minDate&&a.compare(b,c.minDate)<0||c.maxDate&&a.compare(b,c.maxDate)>0},a.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},a.dateSelection=function(c){angular.isDefined(c)&&(a.date=c);var d=a.date?l.filter(a.date,w):null;b.val(d),F.$setViewValue(d),x&&(a.isOpen=!1,b[0].focus())},a.keydown=function(c){27===c.which&&(c.stopPropagation(),a.isOpen=!1,b[0].focus())},a.select=function(b,c){if(c.stopPropagation(),"today"===b){var d=new Date;angular.isDate(a.date)?(b=new Date(a.date),b.setFullYear(d.getFullYear(),d.getMonth(),d.getDate())):b=new Date(d.setHours(0,0,0,0))}a.dateSelection(b)},a.close=function(c){c.stopPropagation(),a.isOpen=!1,b[0].focus()},a.disabled=angular.isDefined(c.disabled)||!1,c.ngDisabled&&L.push(a.$parent.$watch(f(c.ngDisabled),function(b){a.disabled=b})),a.$watch("isOpen",function(d){d?a.disabled?a.isOpen=!1:n(function(){v(),z&&a.$broadcast("uib:datepicker.focus"),h.on("click",t);var d=c.popupPlacement?c.popupPlacement:m.placement;y||j.parsePlacement(d)[2]?(E=E||angular.element(j.scrollParent(b)),E&&E.on("scroll",v)):E=null,angular.element(g).on("resize",v)},0,!1):(h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v))}),a.$on("uib:datepicker.mode",function(){n(v,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibDatepickerPopupWrap",function(){return{replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(a){return function(b,c){var d;return function(){var e=this,f=Array.prototype.slice.call(arguments);d&&a.cancel(d),d=a(function(){b.apply(e,f)},c)}}}]),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b,f){c||(a.on("click",d),f.on("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b,f){c===b&&(c=null,a.off("click",d),f.off("keydown",e))};var d=function(a){if(c&&!(a&&"disabled"===c.getAutoClose()||a&&3===a.which)){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getDropdownElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which?(a.stopPropagation(),c.focusToggleElement(),d()):c.isKeynavEnabled()&&-1!==[38,40].indexOf(a.which)&&c.isOpen&&(a.preventDefault(),a.stopPropagation(),c.focusDropdownEntry(a.which))}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(a,b,c,d,e,f,g,h,i,j,k){var l,m,n=this,o=a.$new(),p=e.appendToOpenClass,q=e.openClass,r=angular.noop,s=c.onToggle?d(c.onToggle):angular.noop,t=!1,u=null,v=!1,w=i.find("body");b.addClass("dropdown"),this.init=function(){if(c.isOpen&&(m=d(c.isOpen),r=m.assign,a.$watch(m,function(a){o.isOpen=!!a})),angular.isDefined(c.dropdownAppendTo)){var e=d(c.dropdownAppendTo)(o);e&&(u=angular.element(e))}t=angular.isDefined(c.dropdownAppendToBody),v=angular.isDefined(c.keyboardNav),t&&!u&&(u=w),u&&n.dropdownMenu&&(u.append(n.dropdownMenu),b.on("$destroy",function(){n.dropdownMenu.remove()}))},this.toggle=function(a){return o.isOpen=arguments.length?!!a:!o.isOpen,angular.isFunction(r)&&r(o,o.isOpen),o.isOpen},this.isOpen=function(){return o.isOpen},o.getToggleElement=function(){return n.toggleElement},o.getAutoClose=function(){return c.autoClose||"always"},o.getElement=function(){return b},o.isKeynavEnabled=function(){return v},o.focusDropdownEntry=function(a){var c=n.dropdownMenu?angular.element(n.dropdownMenu).find("a"):b.find("ul").eq(0).find("a");switch(a){case 40:angular.isNumber(n.selectedOption)?n.selectedOption=n.selectedOption===c.length-1?n.selectedOption:n.selectedOption+1:n.selectedOption=0;break;case 38:angular.isNumber(n.selectedOption)?n.selectedOption=0===n.selectedOption?0:n.selectedOption-1:n.selectedOption=c.length-1}c[n.selectedOption].focus()},o.getDropdownElement=function(){return n.dropdownMenu},o.focusToggleElement=function(){n.toggleElement&&n.toggleElement[0].focus()},o.$watch("isOpen",function(c,d){if(u&&n.dropdownMenu){var e,i,m,v=h.positionElements(b,n.dropdownMenu,"bottom-left",!0);if(e={top:v.top+"px",display:c?"block":"none"},i=n.dropdownMenu.hasClass("dropdown-menu-right"),i?(e.left="auto",m=h.scrollbarWidth(!0),e.right=window.innerWidth-m-(v.left+b.prop("offsetWidth"))+"px"):(e.left=v.left+"px",e.right="auto"),!t){var w=h.offset(u);e.top=v.top-w.top+"px",i?e.right=window.innerWidth-(v.left-w.left+b.prop("offsetWidth"))+"px":e.left=v.left-w.left+"px"}n.dropdownMenu.css(e)}var x=u?u:b,y=x.hasClass(u?p:q);if(y===!c&&g[c?"addClass":"removeClass"](x,u?p:q).then(function(){angular.isDefined(c)&&c!==d&&s(a,{open:!!c})}),c)n.dropdownMenuTemplateUrl&&k(n.dropdownMenuTemplateUrl).then(function(a){l=o.$new(),j(a.trim())(l,function(a){var b=a;n.dropdownMenu.replaceWith(b),n.dropdownMenu=b})}),o.focusToggleElement(),f.open(o,b);else{if(n.dropdownMenuTemplateUrl){l&&l.$destroy();var z=angular.element('');n.dropdownMenu.replaceWith(z),n.dropdownMenu=z}f.close(o,b),n.selectedOption=null}angular.isFunction(r)&&r(a,c)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(a,b,c,d){d.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(a,b,c,d){if(d&&!angular.isDefined(c.dropdownNested)){b.addClass("dropdown-menu");var e=c.templateUrl;e&&(d.dropdownMenuTemplateUrl=e),d.dropdownMenu||(d.dropdownMenu=b)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(a,b,c,d){if(d){b.addClass("dropdown-toggle"),d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c-1&&y>a&&(a=y),a}function l(a,b){var c=v.get(a).value,d=c.appendTo;v.remove(a),z=v.top(),z&&(y=parseInt(z.value.modalDomEl.attr("index"),10)),o(c.modalDomEl,c.modalScope,function(){var b=c.openedClass||u;w.remove(b,a);var e=w.hasKey(b);d.toggleClass(b,e),!e&&t&&t.heightOverflow&&t.scrollbarWidth&&(t.originalRight?d.css({paddingRight:t.originalRight+"px"}):d.css({paddingRight:""}),t=null),m(!0)},c.closedDeferred),n(),b&&b.focus?b.focus():d.focus&&d.focus()}function m(a){var b;v.length()>0&&(b=v.top().value,b.modalDomEl.toggleClass(b.windowTopClass||"",a))}function n(){if(r&&-1===k()){var a=s;o(r,s,function(){a=null}),r=void 0,s=void 0}}function o(b,c,d,e){function g(){g.done||(g.done=!0,a.leave(b).then(function(){b.remove(),e&&e.resolve()}),c.$destroy(),d&&d())}var h,i=null,j=function(){return h||(h=f.defer(),i=h.promise),function(){h.resolve()}};return c.$broadcast(x.NOW_CLOSING_EVENT,j),f.when(i).then(g)}function p(a){if(a.isDefaultPrevented())return a;var b=v.top();if(b)switch(a.which){case 27:b.value.keyboard&&(a.preventDefault(),e.$apply(function(){x.dismiss(b.key,"escape key press")}));break;case 9:var c=x.loadFocusElementList(b),d=!1;a.shiftKey?(x.isFocusInFirstItem(a,c)||x.isModalFocused(a,b))&&(d=x.focusLastFocusableElement(c)):x.isFocusInLastItem(a,c)&&(d=x.focusFirstFocusableElement(c)),d&&(a.preventDefault(),a.stopPropagation())}}function q(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var r,s,t,u="modal-open",v=h.createNew(),w=g.createNew(),x={NOW_CLOSING_EVENT:"modal.stack.now-closing"},y=0,z=null,A="a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]";return e.$watch(k,function(a){s&&(s.index=a)}),c.on("keydown",p),e.$on("$destroy",function(){c.off("keydown",p)}),x.open=function(b,f){var g=c[0].activeElement,h=f.openedClass||u;m(!1),z=v.top(),v.add(b,{deferred:f.deferred,renderDeferred:f.renderDeferred,closedDeferred:f.closedDeferred,modalScope:f.scope,backdrop:f.backdrop,keyboard:f.keyboard,openedClass:f.openedClass,windowTopClass:f.windowTopClass,animation:f.animation,appendTo:f.appendTo}),w.put(h,b);var j=f.appendTo,l=k();if(!j.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");l>=0&&!r&&(s=e.$new(!0),s.modalOptions=f,s.index=l,r=angular.element('
      '),r.attr("backdrop-class",f.backdropClass),f.animation&&r.attr("modal-animation","true"),d(r)(s),a.enter(r,j),t=i.scrollbarPadding(j),t.heightOverflow&&t.scrollbarWidth&&j.css({paddingRight:t.right+"px"})),y=z?parseInt(z.value.modalDomEl.attr("index"),10)+1:0;var n=angular.element('
      ');n.attr({"template-url":f.windowTemplateUrl,"window-class":f.windowClass,"window-top-class":f.windowTopClass,size:f.size,index:y,animate:"animate"}).html(f.content),f.animation&&n.attr("modal-animation","true"),j.addClass(h),a.enter(d(n)(f.scope),j),v.top().value.modalDomEl=n,v.top().value.modalOpener=g},x.close=function(a,b){var c=v.get(a);return c&&q(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),l(a,c.value.modalOpener),!0):!c},x.dismiss=function(a,b){var c=v.get(a);return c&&q(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),l(a,c.value.modalOpener),!0):!c},x.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},x.getTop=function(){return v.top()},x.modalRendered=function(a){var b=v.get(a);b&&b.value.renderDeferred.resolve()},x.focusFirstFocusableElement=function(a){return a.length>0?(a[0].focus(),!0):!1},x.focusLastFocusableElement=function(a){return a.length>0?(a[a.length-1].focus(),!0):!1},x.isModalFocused=function(a,b){if(a&&b){var c=b.value.modalDomEl;if(c&&c.length)return(a.target||a.srcElement)===c[0]}return!1},x.isFocusInFirstItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[0]:!1},x.isFocusInLastItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[b.length-1]:!1},x.loadFocusElementList=function(a){if(a){var b=a.value.modalDomEl;if(b&&b.length){var c=b[0].querySelectorAll(A);return c?Array.prototype.filter.call(c,function(a){return j(a)}):c}}},x}]).provider("$uibModal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?c.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(e){function j(){return r}var l=c.defer(),m=c.defer(),n=c.defer(),o=c.defer(),p={result:l.promise,opened:m.promise,closed:n.promise,rendered:o.promise,close:function(a){return h.close(p,a)},dismiss:function(a){return h.dismiss(p,a)}};if(e=angular.extend({},a.options,e),e.resolve=e.resolve||{},e.appendTo=e.appendTo||d.find("body").eq(0),!e.template&&!e.templateUrl)throw new Error("One of template or templateUrl options is required.");var q,r=c.all([i(e),g.resolve(e.resolve,{},null,null)]);return q=k=c.all([k]).then(j,j).then(function(a){var c=e.scope||b,d=c.$new();d.$close=p.close,d.$dismiss=p.dismiss,d.$on("$destroy",function(){d.$$uibDestructionScheduled||d.$dismiss("$uibUnscheduledDestruction")});var g,i,j={};e.controller&&(j.$scope=d,j.$scope.$resolve={},j.$uibModalInstance=p,angular.forEach(a[1],function(a,b){j[b]=a,j.$scope.$resolve[b]=a}),i=f(e.controller,j,!0,e.controllerAs),e.controllerAs&&e.bindToController&&(g=i.instance,g.$close=d.$close,g.$dismiss=d.$dismiss,angular.extend(g,{$resolve:j.$scope.$resolve},c)),g=i(),angular.isFunction(g.$onInit)&&g.$onInit()),h.open(p,{scope:d,deferred:l,renderDeferred:o,closedDeferred:n,content:a[0],animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowTopClass:e.windowTopClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,size:e.size,openedClass:e.openedClass,appendTo:e.appendTo}),m.resolve(!0)},function(a){m.reject(a),l.reject(a)})["finally"](function(){k===q&&(k=null)}),p},j}]};return a}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(a){return{create:function(b,c,d){b.setNumPages=d.numPages?a(d.numPages).assign:angular.noop,b.ngModelCtrl={$setViewValue:angular.noop},b._watchers=[],b.init=function(a,e){b.ngModelCtrl=a,b.config=e,a.$render=function(){b.render()},d.itemsPerPage?b._watchers.push(c.$parent.$watch(d.itemsPerPage,function(a){b.itemsPerPage=parseInt(a,10),c.totalPages=b.calculateTotalPages(),b.updatePage()})):b.itemsPerPage=e.itemsPerPage,c.$watch("totalItems",function(a,d){(angular.isDefined(a)||a!==d)&&(c.totalPages=b.calculateTotalPages(),b.updatePage())})},b.calculateTotalPages=function(){var a=b.itemsPerPage<1?1:Math.ceil(c.totalItems/b.itemsPerPage);return Math.max(a||0,1)},b.render=function(){c.page=parseInt(b.ngModelCtrl.$viewValue,10)||1},c.selectPage=function(a,d){d&&d.preventDefault();var e=!c.ngDisabled||!d;e&&c.page!==a&&a>0&&a<=c.totalPages&&(d&&d.target&&d.target.blur(),b.ngModelCtrl.$setViewValue(a),b.ngModelCtrl.$render())},c.getText=function(a){return c[a+"Text"]||b.config[a+"Text"]},c.noPrevious=function(){return 1===c.page},c.noNext=function(){return c.page===c.totalPages},b.updatePage=function(){b.setNumPages(c.$parent,c.totalPages),c.page>c.totalPages?c.selectPage(c.totalPages):b.ngModelCtrl.$render()},c.$on("$destroy",function(){for(;b._watchers.length;)b._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(a,b,c,d){a.align=angular.isDefined(b.align)?a.$parent.$eval(b.align):d.align,c.create(this,a,b)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(a){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],controller:"UibPagerController",controllerAs:"pager",templateUrl:function(a,b){return b.templateUrl||"uib/template/pager/pager.html"},replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&f.init(g,a)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(a,b,c,d,e){function f(a,b,c){return{number:a,text:b,active:c}}function g(a,b){var c=[],d=1,e=b,g=angular.isDefined(i)&&b>i;g&&(j?(d=Math.max(a-Math.floor(i/2),1),e=d+i-1,e>b&&(e=b,d=e-i+1)):(d=(Math.ceil(a/i)-1)*i+1,e=Math.min(d+i-1,b)));for(var h=d;e>=h;h++){var n=f(h,m(h),h===a);c.push(n)}if(g&&i>0&&(!j||k||l)){if(d>1){if(!l||d>3){var o=f(d-1,"...",!1);c.unshift(o)}if(l){if(3===d){var p=f(2,"2",!1);c.unshift(p)}var q=f(1,"1",!1);c.unshift(q)}}if(b>e){if(!l||b-2>e){var r=f(e+1,"...",!1);c.push(r)}if(l){if(e===b-2){var s=f(b-1,b-1,!1);c.push(s)}var t=f(b,b,!1);c.push(t)}}}return c}var h=this,i=angular.isDefined(b.maxSize)?a.$parent.$eval(b.maxSize):e.maxSize,j=angular.isDefined(b.rotate)?a.$parent.$eval(b.rotate):e.rotate,k=angular.isDefined(b.forceEllipses)?a.$parent.$eval(b.forceEllipses):e.forceEllipses,l=angular.isDefined(b.boundaryLinkNumbers)?a.$parent.$eval(b.boundaryLinkNumbers):e.boundaryLinkNumbers,m=angular.isDefined(b.pageLabel)?function(c){return a.$parent.$eval(b.pageLabel,{$page:c})}:angular.identity;a.boundaryLinks=angular.isDefined(b.boundaryLinks)?a.$parent.$eval(b.boundaryLinks):e.boundaryLinks,a.directionLinks=angular.isDefined(b.directionLinks)?a.$parent.$eval(b.directionLinks):e.directionLinks,d.create(this,a,b),b.maxSize&&h._watchers.push(a.$parent.$watch(c(b.maxSize),function(a){i=parseInt(a,10),h.render()}));var n=this.render;this.render=function(){n(),a.page>0&&a.page<=a.totalPages&&(a.pages=g(a.page,a.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(a,b){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"uib/template/pagination/pagination.html"},replace:!0,link:function(a,c,d,e){var f=e[0],g=e[1];g&&f.init(g,b)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(e,f,g,h,i,j,k,l,m){function n(a){if(27===a.which){var b=o.top();b&&(b.value.close(),o.removeTop(),b=null)}}var o=m.createNew();return h.on("keypress",n),k.$on("$destroy",function(){h.off("keypress",n)}),function(e,k,m,n){function p(a){var b=(a||n.trigger||m).split(" "),d=b.map(function(a){return c[a]||a});return{show:b,hide:d}}n=angular.extend({},b,d,n);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="
      ';return{compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){N.isOpen?q():m()}function m(){M&&!a.$eval(d[k+"Enable"])||(u(),x(),N.popupDelay?G||(G=g(r,N.popupDelay,!1)):r())}function q(){s(),N.popupCloseDelay?H||(H=g(t,N.popupCloseDelay,!1)):t()}function r(){return s(),u(),N.content?(v(),void N.$evalAsync(function(){N.isOpen=!0,y(!0),S()})):angular.noop}function s(){G&&(g.cancel(G),G=null),I&&(g.cancel(I),I=null)}function t(){N&&N.$evalAsync(function(){N&&(N.isOpen=!1,y(!1),N.animation?F||(F=g(w,150,!1)):w())})}function u(){H&&(g.cancel(H),H=null),F&&(g.cancel(F),F=null)}function v(){D||(E=N.$new(),D=c(E,function(a){K?h.find("body").append(a):b.after(a)}),z())}function w(){s(),u(),A(),D&&(D.remove(),D=null),E&&(E.$destroy(),E=null); -}function x(){N.title=d[k+"Title"],Q?N.content=Q(a):N.content=d[e],N.popupClass=d[k+"Class"],N.placement=angular.isDefined(d[k+"Placement"])?d[k+"Placement"]:n.placement;var b=i.parsePlacement(N.placement);J=b[1]?b[0]+"-"+b[1]:b[0];var c=parseInt(d[k+"PopupDelay"],10),f=parseInt(d[k+"PopupCloseDelay"],10);N.popupDelay=isNaN(c)?n.popupDelay:c,N.popupCloseDelay=isNaN(f)?n.popupCloseDelay:f}function y(b){P&&angular.isFunction(P.assign)&&P.assign(a,b)}function z(){R.length=0,Q?(R.push(a.$watch(Q,function(a){N.content=a,!a&&N.isOpen&&t()})),R.push(E.$watch(function(){O||(O=!0,E.$$postDigest(function(){O=!1,N&&N.isOpen&&S()}))}))):R.push(d.$observe(e,function(a){N.content=a,!a&&N.isOpen?t():S()})),R.push(d.$observe(k+"Title",function(a){N.title=a,N.isOpen&&S()})),R.push(d.$observe(k+"Placement",function(a){N.placement=a?a:n.placement,N.isOpen&&S()}))}function A(){R.length&&(angular.forEach(R,function(a){a()}),R.length=0)}function B(a){N&&N.isOpen&&D&&(b[0].contains(a.target)||D[0].contains(a.target)||q())}function C(){var a=d[k+"Trigger"];T(),L=p(a),"none"!==L.show&&L.show.forEach(function(a,c){"outsideClick"===a?(b.on("click",j),h.on("click",B)):a===L.hide[c]?b.on(a,j):a&&(b.on(a,m),b.on(L.hide[c],q)),b.on("keypress",function(a){27===a.which&&q()})})}var D,E,F,G,H,I,J,K=angular.isDefined(n.appendToBody)?n.appendToBody:!1,L=p(void 0),M=angular.isDefined(d[k+"Enable"]),N=a.$new(!0),O=!1,P=angular.isDefined(d[k+"IsOpen"])?l(d[k+"IsOpen"]):!1,Q=n.useContentExp?l(d[e]):!1,R=[],S=function(){D&&D.html()&&(I||(I=g(function(){var a=i.positionElements(b,D,N.placement,K);D.css({top:a.top+"px",left:a.left+"px"}),D.hasClass(a.placement.split("-")[0])||(D.removeClass(J.split("-")[0]),D.addClass(a.placement.split("-")[0])),D.hasClass(n.placementClassPrefix+a.placement)||(D.removeClass(n.placementClassPrefix+J),D.addClass(n.placementClassPrefix+a.placement)),D.hasClass("uib-position-measure")?(i.positionArrow(D,a.placement),D.removeClass("uib-position-measure")):J!==a.placement&&i.positionArrow(D,a.placement),J=a.placement,I=null},0,!1)))};N.origScope=a,N.isOpen=!1,o.add(N,{close:t}),N.contentExp=function(){return N.content},d.$observe("disabled",function(a){a&&s(),a&&N.isOpen&&t()}),P&&a.$watch(P,function(a){N&&!a===N.isOpen&&j()});var T=function(){L.show.forEach(function(a){"outsideClick"===a?b.off("click",j):(b.off(a,m),b.off(a,j))}),L.hide.forEach(function(a){"outsideClick"===a?h.off("click",B):b.off(a,q)})};C();var U=a.$eval(d[k+"Animation"]);N.animation=angular.isDefined(U)?!!U:n.animation;var V,W=k+"AppendToBody";V=W in d&&void 0===d[W]?!0:a.$eval(d[W]),K=angular.isDefined(V)?V:K,a.$on("$destroy",function(){T(),w(),o.remove(N),N=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.uibTooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("uibTooltipClasses",["$uibPosition",function(a){return{restrict:"A",link:function(b,c,d){if(b.placement){var e=a.parsePlacement(b.placement);c.addClass(e[0])}b.popupClass&&c.addClass(b.popupClass),b.animation()&&c.addClass(d.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(a){return a("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(a){return a("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(a){return a("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{replace:!0,scope:{uibTitle:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(a){return a("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",uibTitle:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(a){return a("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{replace:!0,scope:{uibTitle:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(a){return a("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(a,b,c){function d(){return angular.isDefined(a.maxParam)?a.maxParam:c.max}var e=this,f=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=d(),this.addBar=function(a,b,c){f||b.css({transition:"none"}),this.bars.push(a),a.max=d(),a.title=c&&angular.isDefined(c.title)?c.title:"progressbar",a.$watch("value",function(b){a.recalculatePercentage()}),a.recalculatePercentage=function(){var b=e.bars.reduce(function(a,b){return b.percent=+(100*b.value/b.max).toFixed(2),a+b.percent},0);b>100&&(a.percent-=b-100)},a.$on("$destroy",function(){b=null,e.removeBar(a)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1),this.bars.forEach(function(a){a.recalculatePercentage()})},a.$watch("maxParam",function(a){e.bars.forEach(function(a){a.max=d(),a.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b,c)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]),{title:c.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(a,b,c){var d={$setViewValue:angular.noop},e=this;this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff,this.enableReset=angular.isDefined(b.enableReset)?a.$parent.$eval(b.enableReset):c.enableReset;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){if(!a.readonly&&b>=0&&b<=a.range.length){var c=e.enableReset&&d.$viewValue===b?0:b;d.$setViewValue(c),d.$render()}},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue,a.title=e.getTitle(a.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(a){function b(a){for(var b=0;bb.index?1:a.index0&&13>b:b>=0&&24>b;return c&&""!==a.hours?(a.showMeridian&&(12===b&&(b=0),a.meridian===v[1]&&(b+=12)),b):void 0}function i(){var b=+a.minutes,c=b>=0&&60>b;return c&&""!==a.minutes?b:void 0}function j(){var b=+a.seconds;return b>=0&&60>b?b:void 0}function k(a,b){return null===a?"":angular.isDefined(a)&&a.toString().length<2&&!b?"0"+a:a.toString()}function l(a){m(),u.$setViewValue(new Date(s)),n(a)}function m(){u.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1,a.invalidSeconds=!1}function n(b){if(u.$modelValue){var c=s.getHours(),d=s.getMinutes(),e=s.getSeconds();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:k(c,!w),"m"!==b&&(a.minutes=k(d)),a.meridian=s.getHours()<12?v[0]:v[1],"s"!==b&&(a.seconds=k(e)),a.meridian=s.getHours()<12?v[0]:v[1]}else a.hours=null,a.minutes=null,a.seconds=null,a.meridian=v[0]}function o(a){s=q(s,a),l()}function p(a,b){return q(a,60*b)}function q(a,b){var c=new Date(a.getTime()+1e3*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes(),c.getSeconds()),d}function r(){return(null===a.hours||""===a.hours)&&(null===a.minutes||""===a.minutes)&&(!a.showSeconds||a.showSeconds&&(null===a.seconds||""===a.seconds))}var s=new Date,t=[],u={$setViewValue:angular.noop},v=angular.isDefined(c.meridians)?a.$parent.$eval(c.meridians):g.meridians||f.DATETIME_FORMATS.AMPMS,w=angular.isDefined(c.padHours)?a.$parent.$eval(c.padHours):!0;a.tabindex=angular.isDefined(c.tabindex)?c.tabindex:0,b.removeAttr("tabindex"),this.init=function(b,d){u=b,u.$render=this.render,u.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),f=d.eq(1),h=d.eq(2),i=angular.isDefined(c.mousewheel)?a.$parent.$eval(c.mousewheel):g.mousewheel;i&&this.setupMousewheelEvents(e,f,h);var j=angular.isDefined(c.arrowkeys)?a.$parent.$eval(c.arrowkeys):g.arrowkeys;j&&this.setupArrowkeyEvents(e,f,h),a.readonlyInput=angular.isDefined(c.readonlyInput)?a.$parent.$eval(c.readonlyInput):g.readonlyInput,this.setupInputEvents(e,f,h)};var x=g.hourStep;c.hourStep&&t.push(a.$parent.$watch(d(c.hourStep),function(a){x=+a}));var y=g.minuteStep;c.minuteStep&&t.push(a.$parent.$watch(d(c.minuteStep),function(a){y=+a}));var z;t.push(a.$parent.$watch(d(c.min),function(a){var b=new Date(a);z=isNaN(b)?void 0:b}));var A;t.push(a.$parent.$watch(d(c.max),function(a){var b=new Date(a);A=isNaN(b)?void 0:b}));var B=!1;c.ngDisabled&&t.push(a.$parent.$watch(d(c.ngDisabled),function(a){B=a})),a.noIncrementHours=function(){var a=p(s,60*x);return B||a>A||s>a&&z>a},a.noDecrementHours=function(){var a=p(s,60*-x);return B||z>a||a>s&&a>A},a.noIncrementMinutes=function(){var a=p(s,y);return B||a>A||s>a&&z>a},a.noDecrementMinutes=function(){var a=p(s,-y);return B||z>a||a>s&&a>A},a.noIncrementSeconds=function(){var a=q(s,C);return B||a>A||s>a&&z>a},a.noDecrementSeconds=function(){var a=q(s,-C);return B||z>a||a>s&&a>A},a.noToggleMeridian=function(){return s.getHours()<12?B||p(s,720)>A:B||p(s,-720)0};b.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()}),d.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementSeconds():a.decrementSeconds()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c,d){b.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply()))}),c.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply()))}),d.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementSeconds(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementSeconds(),a.$apply()))})},this.setupInputEvents=function(b,c,d){if(a.readonlyInput)return a.updateHours=angular.noop,a.updateMinutes=angular.noop,void(a.updateSeconds=angular.noop);var e=function(b,c,d){u.$setViewValue(null),u.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c),angular.isDefined(d)&&(a.invalidSeconds=d)};a.updateHours=function(){var a=h(),b=i();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(a),s.setMinutes(b),z>s||s>A?e(!0):l("h")):e(!0)},b.bind("blur",function(b){u.$setTouched(),r()?m():null===a.hours||""===a.hours?e(!0):!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=k(a.hours,!w)})}),a.updateMinutes=function(){var a=i(),b=h();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(b),s.setMinutes(a),z>s||s>A?e(void 0,!0):l("m")):e(void 0,!0)},c.bind("blur",function(b){u.$setTouched(),r()?m():null===a.minutes?e(void 0,!0):!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=k(a.minutes)})}),a.updateSeconds=function(){var a=j();u.$setDirty(),angular.isDefined(a)?(s.setSeconds(a),l("s")):e(void 0,void 0,!0)},d.bind("blur",function(b){r()?m():!a.invalidSeconds&&a.seconds<10&&a.$apply(function(){a.seconds=k(a.seconds)})})},this.render=function(){var b=u.$viewValue;isNaN(b)?(u.$setValidity("time",!1),e.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(s=b),z>s||s>A?(u.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):m(),n())},a.showSpinners=angular.isDefined(c.showSpinners)?a.$parent.$eval(c.showSpinners):g.showSpinners,a.incrementHours=function(){a.noIncrementHours()||o(60*x*60)},a.decrementHours=function(){a.noDecrementHours()||o(60*-x*60)},a.incrementMinutes=function(){a.noIncrementMinutes()||o(60*y)},a.decrementMinutes=function(){a.noDecrementMinutes()||o(60*-y)},a.incrementSeconds=function(){a.noIncrementSeconds()||o(C)},a.decrementSeconds=function(){a.noDecrementSeconds()||o(-C)},a.toggleMeridian=function(){var b=i(),c=h();a.noToggleMeridian()||(angular.isDefined(b)&&angular.isDefined(c)?o(720*(s.getHours()<12?60:-60)):a.meridian=a.meridian===v[0]?v[1]:v[0])},a.blur=function(){u.$setTouched()},a.$on("$destroy",function(){for(;t.length;)t.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(a){return{require:["uibTimepicker","?^ngModel"],controller:"UibTimepickerController",controllerAs:"timepicker",replace:!0,scope:{},templateUrl:function(b,c){return c.templateUrl||a.templateUrl},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){O.moveInProgress||(O.moveInProgress=!0,O.$digest()),Z()}function o(){O.position=E?l.offset(b):l.position(b),O.position.top+=b.prop("offsetHeight")}var p,q,r=[9,13,27,38,40],s=200,t=a.$eval(c.typeaheadMinLength);t||0===t||(t=1),a.$watch(c.typeaheadMinLength,function(a){t=a||0===a?a:1});var u=a.$eval(c.typeaheadWaitMs)||0,v=a.$eval(c.typeaheadEditable)!==!1;a.$watch(c.typeaheadEditable,function(a){v=a!==!1});var w,x,y=e(c.typeaheadLoading).assign||angular.noop,z=c.typeaheadShouldSelect?e(c.typeaheadShouldSelect):function(a,b){var c=b.$event;return 13===c.which||9===c.which},A=e(c.typeaheadOnSelect),B=angular.isDefined(c.typeaheadSelectOnBlur)?a.$eval(c.typeaheadSelectOnBlur):!1,C=e(c.typeaheadNoResults).assign||angular.noop,D=c.typeaheadInputFormatter?e(c.typeaheadInputFormatter):void 0,E=c.typeaheadAppendToBody?a.$eval(c.typeaheadAppendToBody):!1,F=c.typeaheadAppendTo?a.$eval(c.typeaheadAppendTo):null,G=a.$eval(c.typeaheadFocusFirst)!==!1,H=c.typeaheadSelectOnExact?a.$eval(c.typeaheadSelectOnExact):!1,I=e(c.typeaheadIsOpen).assign||angular.noop,J=a.$eval(c.typeaheadShowHint)||!1,K=e(c.ngModel),L=e(c.ngModel+"($$$p)"),M=function(b,c){return angular.isFunction(K(a))&&q&&q.$options&&q.$options.getterSetter?L(b,{$$$p:c}):K.assign(b,c)},N=m.parse(c.uibTypeahead),O=a.$new(),P=a.$on("$destroy",function(){O.$destroy()});O.$on("$destroy",P);var Q="typeahead-"+O.$id+"-"+Math.floor(1e4*Math.random());b.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":Q});var R,S;J&&(R=angular.element("
      "),R.css("position","relative"),b.after(R),S=b.clone(),S.attr("placeholder",""),S.attr("tabindex","-1"),S.val(""),S.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),b.css({position:"relative","vertical-align":"top","background-color":"transparent"}),R.append(S),S.after(b));var T=angular.element("
      ");T.attr({id:Q,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(c.typeaheadTemplateUrl)&&T.attr("template-url",c.typeaheadTemplateUrl),angular.isDefined(c.typeaheadPopupTemplateUrl)&&T.attr("popup-template-url",c.typeaheadPopupTemplateUrl);var U=function(){J&&S.val("")},V=function(){O.matches=[],O.activeIdx=-1,b.attr("aria-expanded",!1),U()},W=function(a){return Q+"-option-"+a};O.$watch("activeIdx",function(a){0>a?b.removeAttr("aria-activedescendant"):b.attr("aria-activedescendant",W(a))});var X=function(a,b){return O.matches.length>b&&a?a.toUpperCase()===O.matches[b].label.toUpperCase():!1},Y=function(c,d){var e={$viewValue:c};y(a,!0),C(a,!1),f.when(N.source(a,e)).then(function(f){var g=c===p.$viewValue;if(g&&w)if(f&&f.length>0){O.activeIdx=G?0:-1,C(a,!1),O.matches.length=0;for(var h=0;h0&&i.slice(0,c.length).toUpperCase()===c.toUpperCase()?S.val(c+i.slice(c.length)):S.val("")}}else V(),C(a,!0);g&&y(a,!1)},function(){V(),y(a,!1),C(a,!0)})};E&&(angular.element(i).on("resize",n),h.find("body").on("scroll",n));var Z=k(function(){O.matches.length&&o(),O.moveInProgress=!1},s);O.moveInProgress=!1,O.query=void 0;var $,_=function(a){$=g(function(){Y(a)},u)},aa=function(){$&&g.cancel($)};V(),O.assignIsOpen=function(b){I(a,b)},O.select=function(d,e){var f,h,i={};x=!0,i[N.itemName]=h=O.matches[d].model,f=N.modelMapper(a,i),M(a,f),p.$setValidity("editable",!0),p.$setValidity("parse",!0),A(a,{$item:h,$model:f,$label:N.viewMapper(a,i),$event:e}),V(),O.$eval(c.typeaheadFocusOnSelect)!==!1&&g(function(){b[0].focus()},0,!1)},b.on("keydown",function(b){if(0!==O.matches.length&&-1!==r.indexOf(b.which)){var c=z(a,{$event:b});if(-1===O.activeIdx&&c||9===b.which&&b.shiftKey)return V(),void O.$digest();b.preventDefault();var d;switch(b.which){case 27:b.stopPropagation(),V(),a.$digest();break;case 38:O.activeIdx=(O.activeIdx>0?O.activeIdx:O.matches.length)-1,O.$digest(),d=T.find("li")[O.activeIdx],d.parentNode.scrollTop=d.offsetTop;break;case 40:O.activeIdx=(O.activeIdx+1)%O.matches.length,O.$digest(),d=T.find("li")[O.activeIdx],d.parentNode.scrollTop=d.offsetTop;break;default:c&&O.$apply(function(){angular.isNumber(O.debounceUpdate)||angular.isObject(O.debounceUpdate)?k(function(){O.select(O.activeIdx,b)},angular.isNumber(O.debounceUpdate)?O.debounceUpdate:O.debounceUpdate["default"]):O.select(O.activeIdx,b)})}}}),b.bind("focus",function(a){w=!0,0!==t||p.$viewValue||g(function(){Y(p.$viewValue,a)},0)}),b.bind("blur",function(a){B&&O.matches.length&&-1!==O.activeIdx&&!x&&(x=!0,O.$apply(function(){angular.isObject(O.debounceUpdate)&&angular.isNumber(O.debounceUpdate.blur)?k(function(){O.select(O.activeIdx,a)},O.debounceUpdate.blur):O.select(O.activeIdx,a)})),!v&&p.$error.editable&&(p.$setViewValue(),p.$setValidity("editable",!0),p.$setValidity("parse",!0),b.val("")),w=!1,x=!1});var ba=function(c){b[0]!==c.target&&3!==c.which&&0!==O.matches.length&&(V(),j.$$phase||a.$digest())};h.on("click",ba),a.$on("$destroy",function(){h.off("click",ba),(E||F)&&ca.remove(),E&&(angular.element(i).off("resize",n),h.find("body").off("scroll",n)),T.remove(),J&&R.remove()});var ca=d(T)(O);E?h.find("body").append(ca):F?angular.element(F).eq(0).append(ca):b.after(ca),this.init=function(b,c){p=b,q=c,O.debounceUpdate=p.$options&&e(p.$options.debounce)(a),p.$parsers.unshift(function(b){return w=!0,0===t||b&&b.length>=t?u>0?(aa(),_(b)):Y(b):(y(a,!1),aa(),V()),v?b:b?void p.$setValidity("editable",!1):(p.$setValidity("editable",!0),null)}),p.$formatters.push(function(b){var c,d,e={};return v||p.$setValidity("editable",!0),D?(e.$model=b,D(a,e)):(e[N.itemName]=b,c=N.viewMapper(a,e),e[N.itemName]=void 0,d=N.viewMapper(a,e),c!==d?c:b)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","^?ngModelOptions","uibTypeahead"],link:function(a,b,c,d){d[2].init(d[0],d[1])}}}).directive("uibTypeaheadPopup",["$$debounce",function(a){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(b,c,d){b.templateUrl=d.templateUrl,b.isOpen=function(){var a=b.matches.length>0;return b.assignIsOpen({isOpen:a}),a},b.isActive=function(a){return b.active===a},b.selectActive=function(a){b.active=a},b.selectMatch=function(c,d){var e=b.debounce();angular.isNumber(e)||angular.isObject(e)?a(function(){b.select({activeIdx:c,evt:d})},angular.isNumber(e)?e:e["default"]):b.select({activeIdx:c,evt:d})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"uib/template/typeahead/typeahead-match.html";a(g).then(function(a){var c=angular.element(a.trim());e.replaceWith(c),b(c)(d)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"$&"):b,f||(b=a.trustAsHtml(b)),b}}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend(''),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend(''),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend(''),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend(''),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend(''), -angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend(''),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend(''),angular.$$uibTypeaheadCss=!0}); \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/.bower.json deleted file mode 100644 index c2dae471af..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/.bower.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "angular-cache-buster", - "version": "0.4.3", - "homepage": "https://github.com/saintmac/angular-cache-buster", - "authors": [ - "saintmac " - ], - "description": "Cache Buster for AngularJS $http (and $resource). Especially useful with Internet Explorer (IE8, IE9)", - "main": "angular-cache-buster.js", - "keywords": [ - "angularjs", - "cache", - "buster", - "ie8", - "ie9", - "$http", - "$resource" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "devDependencies": { - "angular": "~1.2.13", - "angular-mocks": "~1.2.13" - }, - "_release": "0.4.3", - "_resolution": { - "type": "version", - "tag": "0.4.3", - "commit": "c6c378db5cfc2431773e05743e72e1e97fa1ef16" - }, - "_source": "https://github.com/saintmac/angular-cache-buster.git", - "_target": "0.4.3", - "_originalSource": "angular-cache-buster" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/README.md deleted file mode 100644 index 23cf042d11..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/README.md +++ /dev/null @@ -1,37 +0,0 @@ -Cache Buster for Angular JS $http and $resource. -Especially useful with Internet Explorer (IE8, IE9) - -# install - - bower install angular-cache-buster --save - -In your app module definition, add `ngCacheBuster` as a dependency - - angular.module('myApp', ['ngCacheBuster']); - -# configure - -AngularCacheBuster adds a cache buster to any $http requests (and hence to $resource requests). -Since you probably want to maintain browser caching for your views, partials or other routes, you can supply a list of regexes that will be matched against all URL's. By default the supplied matchlist is a whitelist (i.e. busting everything not matching an entry in the list) but you can also set it to be a blacklist, (i.e. busting everything except the matching entries) - -For instance, if you want to bust everything except views in a 'partials' folder and images in a 'images' folder , you can configure AngularCacheBuster this way: - - angular.module('yourApp', ['ngCacheBuster']) - .config(function(httpRequestInterceptorCacheBusterProvider){ - httpRequestInterceptorCacheBusterProvider.setMatchlist([/.*partials.*/,/.*images.*/]); - }); - -If instead you want to allow everything to be cached, except your "/api/users" and "api/orders" (assuming they are the only things that change frequently), you can supply a matchlist as before, but pass in a second boolean argument "blacklist" set to true as well: - - - angular.module('yourApp', ['ngCacheBuster']) - .config(function(httpRequestInterceptorCacheBusterProvider){ - httpRequestInterceptorCacheBusterProvider.setMatchlist([/.*orders.*/,/.*users.*/],true); - }); - -# use - -That's it! All your resource calls will have a cache buster added for anything not in the whitelist, or if you specified "blacklist", for everything matching the blacklist, - -# test -`karma start` to launch the tests diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/angular-cache-buster.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/angular-cache-buster.js deleted file mode 100644 index a368a50085..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/angular-cache-buster.js +++ /dev/null @@ -1,62 +0,0 @@ -angular.module('ngCacheBuster', []) - .config(['$httpProvider', function($httpProvider) { - return $httpProvider.interceptors.push('httpRequestInterceptorCacheBuster'); - }]) - .provider('httpRequestInterceptorCacheBuster', function() { - - this.matchlist = [/.*partials.*/, /.*views.*/ ]; - this.logRequests = false; - - //Default to whitelist (i.e. block all except matches) - this.black=false; - - //Select blacklist or whitelist, default to whitelist - this.setMatchlist = function(list,black) { - this.black = typeof black != 'undefined' ? black : false - this.matchlist = list; - }; - - - this.setLogRequests = function(logRequests) { - this.logRequests = logRequests; - }; - - this.$get = ['$q', '$log', function($q, $log) { - var matchlist = this.matchlist; - var logRequests = this.logRequests; - var black = this.black; - if (logRequests) { - $log.log("Blacklist? ",black); - } - return { - 'request': function(config) { - //Blacklist by default, match with whitelist - var busted= !black; - - for(var i=0; i< matchlist.length; i++){ - if(config.url.match(matchlist[i])) { - busted=black; break; - } - } - - //Bust if the URL was on blacklist or not on whitelist - if (busted) { - var d = new Date(); - config.url = config.url.replace(/[?|&]cacheBuster=\d+/,''); - //Some url's allready have '?' attached - config.url+=config.url.indexOf('?') === -1 ? '?' : '&' - config.url += 'cacheBuster=' + d.getTime(); - } - - if (logRequests) { - var log='request.url =' + config.url - busted ? $log.warn(log) : $log.info(log) - } - - return config || $q.when(config); - } - } - }]; - }); - - diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/bower.json deleted file mode 100644 index 57187ed64f..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/bower.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "angular-cache-buster", - "version": "0.4.3", - "homepage": "https://github.com/saintmac/angular-cache-buster", - "authors": [ - "saintmac " - ], - "description": "Cache Buster for AngularJS $http (and $resource). Especially useful with Internet Explorer (IE8, IE9)", - "main": "angular-cache-buster.js", - "keywords": [ - "angularjs", - "cache", - "buster", - "ie8", - "ie9", - "$http", - "$resource" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "devDependencies": { - "angular": "~1.2.13", - "angular-mocks": "~1.2.13" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/karma.conf.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/karma.conf.js deleted file mode 100644 index 92dcc9ef65..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/karma.conf.js +++ /dev/null @@ -1,79 +0,0 @@ -// Karma configuration -// Generated on Sat Feb 22 2014 23:17:37 GMT+0100 (CET) - -module.exports = function(config) { - config.set({ - - // base path, that will be used to resolve files and exclude - basePath: '', - - - // frameworks to use - frameworks: ['jasmine'], - - - // list of files / patterns to load in the browser - files: [ - 'bower_components/angular/angular.js', - 'bower_components/angular-mocks/angular-mocks.js', - 'angular-cache-buster.js', - 'test/*.js' - ], - - - // list of files to exclude - exclude: [ - - ], - - - // test results reporter to use - // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' - reporters: ['progress'], - - - // web server port - port: 9876, - - - // enable / disable colors in the output (reporters and logs) - colors: true, - - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - - // Start these browsers, currently available: - // - Chrome - // - ChromeCanary - // - Firefox - // - Opera (has to be installed with `npm install karma-opera-launcher`) - // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`) - // - PhantomJS - // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) - browsers: ['Chrome'], - - - // If browser does not capture in given timeout [ms], kill it - captureTimeout: 60000, - - - // Continuous Integration mode - // if true, it capture browsers, run tests and exit - singleRun: false, - - plugins : [ - 'karma-junit-reporter', - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-script-launcher', - 'karma-jasmine' - ] - }); -}; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/package.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/package.json deleted file mode 100644 index 5f1c7b3ab6..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cache-buster/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "angular-cache-buster", - "version": "0.4.3", - "description": "Cache Buster for AngularJS $http (and $resource). Especially useful with Internet Explorer (IE8, IE9)", - "main": "angular-cache-buster.js", - "scripts": { - "test": "karma start" - }, - "repository": { - "type": "git", - "url": "git://github.com/saintmac/angular-cache-buster.git" - }, - "keywords": [ - "angularjs", - "$http", - "$resource", - "cache", - "buster", - "internet", - "explorer", - "ie8", - "ie9" - ], - "author": "saintmac (Martin Saint-Macary, http://vyte.in)", - "contributors": ["Alfred Bratterud "], - "license": "MIT", - "bugs": { - "url": "https://github.com/saintmac/angular-cache-buster/issues" - }, - "homepage": "https://github.com/saintmac/angular-cache-buster", - "devDependencies": { - "karma-script-launcher": "~0.1.0", - "karma-chrome-launcher": "~0.1.3", - "karma-firefox-launcher": "~0.1.3", - "karma-html2js-preprocessor": "~0.1.0", - "karma-jasmine": "~0.1.5", - "karma-coffee-preprocessor": "~0.1.3", - "requirejs": "~2.1.11", - "karma-requirejs": "~0.2.1", - "karma-phantomjs-launcher": "~0.1.2", - "karma": "~0.12.15" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/.bower.json deleted file mode 100644 index 59a3fe076a..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/.bower.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "angular-cookies", - "version": "1.5.8", - "license": "MIT", - "main": "./angular-cookies.js", - "ignore": [], - "dependencies": { - "angular": "1.5.8" - }, - "homepage": "https://github.com/angular/bower-angular-cookies", - "_release": "1.5.8", - "_resolution": { - "type": "version", - "tag": "v1.5.8", - "commit": "a2247a1efb436f0293289fb74ebd76fbe52a7422" - }, - "_source": "https://github.com/angular/bower-angular-cookies.git", - "_target": "1.5.8", - "_originalSource": "angular-cookies" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/LICENSE.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/LICENSE.md deleted file mode 100644 index 2c395eef1b..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Angular - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/README.md deleted file mode 100644 index 7b190d3461..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# packaged angular-cookies - -This repo is for distribution on `npm` and `bower`. The source for this module is in the -[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngCookies). -Please file issues and pull requests against that repo. - -## Install - -You can install this package either with `npm` or with `bower`. - -### npm - -```shell -npm install angular-cookies -``` - -Then add `ngCookies` as a dependency for your app: - -```javascript -angular.module('myApp', [require('angular-cookies')]); -``` - -### bower - -```shell -bower install angular-cookies -``` - -Add a ` -``` - -Then add `ngCookies` as a dependency for your app: - -```javascript -angular.module('myApp', ['ngCookies']); -``` - -## Documentation - -Documentation is available on the -[AngularJS docs site](http://docs.angularjs.org/api/ngCookies). - -## License - -The MIT License - -Copyright (c) 2010-2015 Google, Inc. http://angularjs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/angular-cookies.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/angular-cookies.js deleted file mode 100644 index a03ff49f2f..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/angular-cookies.js +++ /dev/null @@ -1,322 +0,0 @@ -/** - * @license AngularJS v1.5.8 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -/** - * @ngdoc module - * @name ngCookies - * @description - * - * # ngCookies - * - * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. - * - * - *
      - * - * See {@link ngCookies.$cookies `$cookies`} for usage. - */ - - -angular.module('ngCookies', ['ng']). - /** - * @ngdoc provider - * @name $cookiesProvider - * @description - * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service. - * */ - provider('$cookies', [function $CookiesProvider() { - /** - * @ngdoc property - * @name $cookiesProvider#defaults - * @description - * - * Object containing default options to pass when setting cookies. - * - * The object may have following properties: - * - * - **path** - `{string}` - The cookie will be available only for this path and its - * sub-paths. By default, this is the URL that appears in your `` tag. - * - **domain** - `{string}` - The cookie will be available only for this domain and - * its sub-domains. For security reasons the user agent will not accept the cookie - * if the current domain is not a sub-domain of this domain or equal to it. - * - **expires** - `{string|Date}` - String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT" - * or a Date object indicating the exact date/time this cookie will expire. - * - **secure** - `{boolean}` - If `true`, then the cookie will only be available through a - * secured connection. - * - * Note: By default, the address that appears in your `` tag will be used as the path. - * This is important so that cookies will be visible for all routes when html5mode is enabled. - * - **/ - var defaults = this.defaults = {}; - - function calcOptions(options) { - return options ? angular.extend({}, defaults, options) : defaults; - } - - /** - * @ngdoc service - * @name $cookies - * - * @description - * Provides read/write access to browser's cookies. - * - *
      - * Up until Angular 1.3, `$cookies` exposed properties that represented the - * current browser cookie values. In version 1.4, this behavior has changed, and - * `$cookies` now provides a standard api of getters, setters etc. - *
      - * - * Requires the {@link ngCookies `ngCookies`} module to be installed. - * - * @example - * - * ```js - * angular.module('cookiesExample', ['ngCookies']) - * .controller('ExampleController', ['$cookies', function($cookies) { - * // Retrieving a cookie - * var favoriteCookie = $cookies.get('myFavorite'); - * // Setting a cookie - * $cookies.put('myFavorite', 'oatmeal'); - * }]); - * ``` - */ - this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) { - return { - /** - * @ngdoc method - * @name $cookies#get - * - * @description - * Returns the value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {string} Raw cookie value. - */ - get: function(key) { - return $$cookieReader()[key]; - }, - - /** - * @ngdoc method - * @name $cookies#getObject - * - * @description - * Returns the deserialized value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {Object} Deserialized cookie value. - */ - getObject: function(key) { - var value = this.get(key); - return value ? angular.fromJson(value) : value; - }, - - /** - * @ngdoc method - * @name $cookies#getAll - * - * @description - * Returns a key value object with all the cookies - * - * @returns {Object} All cookies - */ - getAll: function() { - return $$cookieReader(); - }, - - /** - * @ngdoc method - * @name $cookies#put - * - * @description - * Sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {string} value Raw value to be stored. - * @param {Object=} options Options object. - * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults} - */ - put: function(key, value, options) { - $$cookieWriter(key, value, calcOptions(options)); - }, - - /** - * @ngdoc method - * @name $cookies#putObject - * - * @description - * Serializes and sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {Object} value Value to be stored. - * @param {Object=} options Options object. - * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults} - */ - putObject: function(key, value, options) { - this.put(key, angular.toJson(value), options); - }, - - /** - * @ngdoc method - * @name $cookies#remove - * - * @description - * Remove given cookie - * - * @param {string} key Id of the key-value pair to delete. - * @param {Object=} options Options object. - * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults} - */ - remove: function(key, options) { - $$cookieWriter(key, undefined, calcOptions(options)); - } - }; - }]; - }]); - -angular.module('ngCookies'). -/** - * @ngdoc service - * @name $cookieStore - * @deprecated - * @requires $cookies - * - * @description - * Provides a key-value (string-object) storage, that is backed by session cookies. - * Objects put or retrieved from this storage are automatically serialized or - * deserialized by angular's toJson/fromJson. - * - * Requires the {@link ngCookies `ngCookies`} module to be installed. - * - *
      - * **Note:** The $cookieStore service is **deprecated**. - * Please use the {@link ngCookies.$cookies `$cookies`} service instead. - *
      - * - * @example - * - * ```js - * angular.module('cookieStoreExample', ['ngCookies']) - * .controller('ExampleController', ['$cookieStore', function($cookieStore) { - * // Put cookie - * $cookieStore.put('myFavorite','oatmeal'); - * // Get cookie - * var favoriteCookie = $cookieStore.get('myFavorite'); - * // Removing a cookie - * $cookieStore.remove('myFavorite'); - * }]); - * ``` - */ - factory('$cookieStore', ['$cookies', function($cookies) { - - return { - /** - * @ngdoc method - * @name $cookieStore#get - * - * @description - * Returns the value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist. - */ - get: function(key) { - return $cookies.getObject(key); - }, - - /** - * @ngdoc method - * @name $cookieStore#put - * - * @description - * Sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {Object} value Value to be stored. - */ - put: function(key, value) { - $cookies.putObject(key, value); - }, - - /** - * @ngdoc method - * @name $cookieStore#remove - * - * @description - * Remove given cookie - * - * @param {string} key Id of the key-value pair to delete. - */ - remove: function(key) { - $cookies.remove(key); - } - }; - - }]); - -/** - * @name $$cookieWriter - * @requires $document - * - * @description - * This is a private service for writing cookies - * - * @param {string} name Cookie name - * @param {string=} value Cookie value (if undefined, cookie will be deleted) - * @param {Object=} options Object with options that need to be stored for the cookie. - */ -function $$CookieWriter($document, $log, $browser) { - var cookiePath = $browser.baseHref(); - var rawDocument = $document[0]; - - function buildCookieString(name, value, options) { - var path, expires; - options = options || {}; - expires = options.expires; - path = angular.isDefined(options.path) ? options.path : cookiePath; - if (angular.isUndefined(value)) { - expires = 'Thu, 01 Jan 1970 00:00:00 GMT'; - value = ''; - } - if (angular.isString(expires)) { - expires = new Date(expires); - } - - var str = encodeURIComponent(name) + '=' + encodeURIComponent(value); - str += path ? ';path=' + path : ''; - str += options.domain ? ';domain=' + options.domain : ''; - str += expires ? ';expires=' + expires.toUTCString() : ''; - str += options.secure ? ';secure' : ''; - - // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum: - // - 300 cookies - // - 20 cookies per unique domain - // - 4096 bytes per cookie - var cookieLength = str.length + 1; - if (cookieLength > 4096) { - $log.warn("Cookie '" + name + - "' possibly not set or overflowed because it was too large (" + - cookieLength + " > 4096 bytes)!"); - } - - return str; - } - - return function(name, value, options) { - rawDocument.cookie = buildCookieString(name, value, options); - }; -} - -$$CookieWriter.$inject = ['$document', '$log', '$browser']; - -angular.module('ngCookies').provider('$$cookieWriter', function $$CookieWriterProvider() { - this.$get = $$CookieWriter; -}); - - -})(window, window.angular); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/angular-cookies.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/angular-cookies.min.js deleted file mode 100644 index d767aee298..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/angular-cookies.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - AngularJS v1.5.8 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(n,c){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,void 0,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore", -["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular); -//# sourceMappingURL=angular-cookies.min.js.map diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/angular-cookies.min.js.map b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/angular-cookies.min.js.map deleted file mode 100644 index 42f748a7c0..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/angular-cookies.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular-cookies.min.js", -"lineCount":8, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CA2Q3BC,QAASA,EAAc,CAACC,CAAD,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jCT;AAiCyB,CAAC,UAAD,CAAa,QAAQ,CAACC,CAAD,CAAW,CAErD,MAAO,CAWLZ,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOW,EAAAV,UAAA,CAAmBD,CAAnB,CADU,CAXd,CAyBLI,IAAKA,QAAQ,CAACJ,CAAD,CAAMzB,CAAN,CAAa,CACxBoC,CAAAL,UAAA,CAAmBN,CAAnB,CAAwBzB,CAAxB,CADwB,CAzBrB,CAsCLiC,OAAQA,QAAQ,CAACR,CAAD,CAAM,CACpBW,CAAAH,OAAA,CAAgBR,CAAhB,CADoB,CAtCjB,CAF8C,CAAhC,CAjCzB,CAqIAjC,EAAA6C,QAAA,CAAyB,CAAC,WAAD,CAAc,MAAd,CAAsB,UAAtB,CAEzB9C,EAAA0B,OAAA,CAAe,WAAf,CAAAC,SAAA,CAAqC,gBAArC,CAAuDoB,QAA+B,EAAG,CACvF,IAAAjB,KAAA,CAAY7B,CAD2E,CAAzF,CAvT2B,CAA1B,CAAD,CA4TGF,MA5TH,CA4TWA,MAAAC,QA5TX;", -"sources":["angular-cookies.js"], -"names":["window","angular","$$CookieWriter","$document","$log","$browser","cookiePath","baseHref","rawDocument","name","value","options","path","expires","isDefined","isUndefined","isString","Date","str","encodeURIComponent","domain","toUTCString","secure","cookieLength","length","warn","cookie","module","provider","$CookiesProvider","defaults","$get","$$cookieReader","$$cookieWriter","get","key","getObject","fromJson","getAll","put","extend","putObject","toJson","remove","undefined","factory","$cookies","$inject","$$CookieWriterProvider"] -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/bower.json deleted file mode 100644 index 72f3a5f9e0..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/bower.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "angular-cookies", - "version": "1.5.8", - "license": "MIT", - "main": "./angular-cookies.js", - "ignore": [], - "dependencies": { - "angular": "1.5.8" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/index.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/index.js deleted file mode 100644 index 657667549a..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/index.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./angular-cookies'); -module.exports = 'ngCookies'; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/package.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/package.json deleted file mode 100644 index 296652c963..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-cookies/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "angular-cookies", - "version": "1.5.8", - "description": "AngularJS module for cookies", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/angular/angular.js.git" - }, - "keywords": [ - "angular", - "framework", - "browser", - "cookies", - "client-side" - ], - "author": "Angular Core Team ", - "license": "MIT", - "bugs": { - "url": "https://github.com/angular/angular.js/issues" - }, - "homepage": "http://angularjs.org", - "jspm": { - "shim": { - "angular-cookies": { - "deps": ["angular"] - } - } - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/.bower.json deleted file mode 100644 index 77fd928010..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/.bower.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "angular-loading-bar", - "main": [ - "build/loading-bar.js", - "build/loading-bar.css" - ], - "ignore": [ - "**/.*", - "node_modules", - "components", - "test", - "example" - ], - "dependencies": { - "angular": "^1.2.9" - }, - "devDependencies": { - "angular": "~1.2.23", - "angular-1.3": "angular#1.3", - "angular-1.4": "angular#1.4", - "angular-mocks": "~1.2.9", - "angular-mocks-1.3": "angular-mocks#1.3", - "angular-mocks-1.4": "angular-mocks#1.4", - "angular-animate": "~1.2.9", - "angular-animate-1.3": "angular-animate#1.3", - "angular-animate-1.4": "angular-animate#1.4" - }, - "resolutions": { - "angular": "~1.2.23" - }, - "homepage": "https://github.com/chieffancypants/angular-loading-bar", - "version": "0.9.0", - "_release": "0.9.0", - "_resolution": { - "type": "version", - "tag": "0.9.0", - "commit": "d734873e52ded18fa27d67f52272ae43267dfd63" - }, - "_source": "https://github.com/chieffancypants/angular-loading-bar.git", - "_target": "0.9.0", - "_originalSource": "angular-loading-bar" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/CHANGELOG.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/CHANGELOG.md deleted file mode 100644 index 8d124d0cff..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/CHANGELOG.md +++ /dev/null @@ -1,81 +0,0 @@ -Changelog -========== -## 0.9.0 -- resolved issue with parentSelector when parent has no children -([#244](https://github.com/chieffancypants/angular-loading-bar/pull/244)) -([#251](https://github.com/chieffancypants/angular-loading-bar/issues/251)) -([#239](https://github.com/chieffancypants/angular-loading-bar/issues/239)) -([#179](https://github.com/chieffancypants/angular-loading-bar/issues/179)) -- added style property to package.json -([#271](https://github.com/chieffancypants/angular-loading-bar/pull/271)) -([#231](https://github.com/chieffancypants/angular-loading-bar/pull/231)) -- Removed duplicated property declaration in CSS -([#226](https://github.com/chieffancypants/angular-loading-bar/pull/226)) - - - -## 0.8.0 -- auto incrementing is now configurable -([#209](https://github.com/chieffancypants/angular-loading-bar/pull/209)) -- removed `version` from bower.json -([#207](https://github.com/chieffancypants/angular-loading-bar/pull/207)) -- added support for webpack and browserify -([#200](https://github.com/chieffancypants/angular-loading-bar/pull/200)) -- spinner border radius 10px -> 50% -([#184](https://github.com/chieffancypants/angular-loading-bar/issues/184)) - - -## 0.7.1 -- Merge correct PR for broken interceptor detection ([#133](https://github.com/chieffancypants/angular-loading-bar/pull/133), [#50](https://github.com/chieffancypants/angular-loading-bar/pull/50)) - -## 0.7.0 -- Changes for animate.enter compatibility for 1.2 and 1.3 ([#170](https://github.com/chieffancypants/angular-loading-bar/pull/170)) -- Detect errors with other interceptors ([#133](https://github.com/chieffancypants/angular-loading-bar/pull/133), [#50](https://github.com/chieffancypants/angular-loading-bar/pull/50)) -- Provide more detail on response/responseError events ([#128](https://github.com/chieffancypants/angular-loading-bar/pull/128)) -- Change angular dependency in bower ([#126](https://github.com/chieffancypants/angular-loading-bar/issues/126)) - -## 0.6.0 -- Customize progress bar template: ([#111](https://github.com/chieffancypants/angular-loading-bar/pull/111)) -- Only append bar to first parent found ([#108](https://github.com/chieffancypants/angular-loading-bar/pull/108)) - -## 0.5.2: -Fixes for Angular 1.3 breaking changes: -- Circular dependencies: ([#98](https://github.com/chieffancypants/angular-loading-bar/issues/98)), ([#101](https://github.com/chieffancypants/angular-loading-bar/pull/101)) -- $animate no longer accepts callbacks: ([#102](https://github.com/chieffancypants/angular-loading-bar/pull/102)) - -## 0.5.1 -- Reworked cache logic to allow cache:true ([#96](https://github.com/chieffancypants/angular-loading-bar/pull/96)) - -## 0.5.0 -- Added spinner template configuration ([#82](https://github.com/chieffancypants/angular-loading-bar/pull/82)) -- $timeout was not canceled properly ([#79](https://github.com/chieffancypants/angular-loading-bar/pull/79)) - -## 0.4.3 -- update z-index to work with other css frameworks ([#69](https://github.com/chieffancypants/angular-loading-bar/pull/69)) -- ignoreLoadingBar not ignored when calculating percentage complete ([#70](https://github.com/chieffancypants/angular-loading-bar/pull/70)) - -## 0.4.2 -- Split loading bar into different modules so they can be included separately ([#46](https://github.com/chieffancypants/angular-loading-bar/issues/46)) - -## 0.4.1 -- Fix for route views defined on body where loading bar is also attached ([#56](https://github.com/chieffancypants/angular-loading-bar/issues/56)) - -## 0.4.0 -- Initial load percentage is now configurable ([#47](https://github.com/chieffancypants/angular-loading-bar/issues/47)) -- Peg graphic reworked so the loadingbar does not require CSS changes when not at the very top of the page ([#42](https://github.com/chieffancypants/angular-loading-bar/issues/42), [#45](https://github.com/chieffancypants/angular-loading-bar/issues/45), [#10](https://github.com/chieffancypants/angular-loading-bar/issues/10)) -- z-index of spinner increased to work with Bootstrap 3 z-indexes ([#53](https://github.com/chieffancypants/angular-loading-bar/issues/53)) - -## 0.3.0 -- Loading bar only appears on XHR requests with high latency ([#27](https://github.com/chieffancypants/angular-loading-bar/issues/27)) - -## 0.2.0 -- Progression bar not calculated correctly for consecutive calls within the 500ms delay ([#29](https://github.com/chieffancypants/angular-loading-bar/issues/29), [#32](https://github.com/chieffancypants/angular-loading-bar/issues/32)) -- Event broadcasts when loading (#31) - -## 0.1.1 -- Alias chieffancypants.loadingbar to angular-loading-bar (#25, #19) - -## 0.1.0 -- Fixed issues with Angular 1.2-rc3+ -- Ability to ignore particular XHR requests (#21) -- Broadcasting of events (#18) diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/CONTRIBUTING.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/CONTRIBUTING.md deleted file mode 100644 index aada2ccbad..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/CONTRIBUTING.md +++ /dev/null @@ -1,17 +0,0 @@ -### Submitting a PR -Excellent! You've chosen to help advance the project by either fixing a bug, or implementing a new feature. Before you put forth any work on a PR, please follow these steps: - -1. Ensure a similar PR has not already been opened or closed. -1. Clearly define the intent of the PR. The more detail, the more likelihood of it getting merged. -1. Is this a feature that would benefit the **majority** of users? This is a small library, and it intends to stay that way. If you do not believe most users of the project will benefit from your work, it should probably be added in your own application. -1. Be sure to include test cases that cover all newly introduced code. This part is essential, as any PRs without tests will be closed. -1. Link any [issues](https://github.com/chieffancypants/angular-loading-bar/issues) that are addressed by the PR. - -### Submitting a bug report -If you believe you've found a bug in the source code, and are unable to fix it yourself (by submitting a PR) please follow these steps: - -1. Ensure the bug has not already been reported by searching the [issues](https://github.com/chieffancypants/angular-loading-bar/issues) -1. Submit a reduced test case that clearly demonstrates the bug. This means submitting a plunker or jsfiddle with the bare minimum of code necessary to reproduce the bug. Without this, your issue may be closed as invalid. -1. Include any relevant browser information -1. If you're unable to fix this bug yourself, but can point to why it is occuring, please send that information along (line# or commit) - diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/Gruntfile.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/Gruntfile.js deleted file mode 100644 index d23ddf1bac..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/Gruntfile.js +++ /dev/null @@ -1,102 +0,0 @@ -/*global module:false*/ -module.exports = function(grunt) { - - grunt.initConfig({ - - // Metadata. - pkg: grunt.file.readJSON('package.json'), - banner: '/*! \n * <%= pkg.title || pkg.name %> v<%= pkg.version %>\n' + - ' * <%= pkg.homepage %>\n' + - ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + - ' * License: <%= pkg.license %>\n' + - ' */\n', - - // Task configuration. - uglify: { - options: { - banner: '<%= banner %>', - report: 'gzip' - }, - build: { - src: 'src/loading-bar.js', - dest: 'build/loading-bar.min.js' - } - }, - - cssmin: { - options: { - banner: '<%= banner %>', - report: 'gzip' - }, - minify: { - src: 'src/loading-bar.css', - dest: 'build/loading-bar.min.css' - } - }, - - karma: { - unit: { - configFile: 'test/karma-angular-1.2.conf.js', - singleRun: true, - coverageReporter: { - type: 'text', - dir: 'coverage/' - } - }, - unit13: { - configFile: 'test/karma-angular-1.3.conf.js', - singleRun: true, - coverageReporter: { - type: 'text', - dir: 'coverage/' - } - }, - unit14: { - configFile: 'test/karma-angular-1.4.conf.js', - singleRun: true, - coverageReporter: { - type: 'text', - dir: 'coverage/' - } - }, - watch: { - configFile: 'test/karma-angular-1.2.conf.js', - singleRun: false, - reporters: ['progress'] // Don't display coverage - } - }, - - jshint: { - jshintrc: '.jshintrc', - gruntfile: { - src: 'Gruntfile.js' - }, - src: { - src: ['src/*.js'] - } - }, - - concat: { - build: { - options: { - banner: '<%= banner %>' - }, - files: { - 'build/loading-bar.css': 'src/loading-bar.css', - 'build/loading-bar.js': 'src/loading-bar.js', - } - } - } - }); - - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-cssmin'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-karma'); - - grunt.registerTask('default', ['jshint', 'karma:unit', 'karma:unit13', 'karma:unit14', 'uglify', 'cssmin', 'concat:build']); - grunt.registerTask('test', ['karma:watch']); - grunt.registerTask('build', ['default']); - -}; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/ISSUE_TEMPLATE.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/ISSUE_TEMPLATE.md deleted file mode 100644 index 436af93a57..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,14 +0,0 @@ -#### Description of bug: - - -#### Expected result: - - -#### Actual result: - - -#### Browsers affected: - - -#### URL of reduced test case: - diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/LICENSE b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/LICENSE deleted file mode 100644 index 252c23aa19..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2014 Wes Cruver - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/PULL_REQUEST_TEMPLATE.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index a37ca3f5e9..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Summary: - -Provide a general description of the code changes in your pull -request. If bugs were fixed, please document the changes and why -they were introduced. - -Please ensure that your PR contains test cases that cover all new -code and any changes to existing code. Without tests, your PR is -likely to be closed without merging. - -#### Related issues: -Please review the [issues](https://github.com/chieffancypants/angular-loading-bar/issues) -page, and link any issues that are addressed or related to this PR. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/README.md deleted file mode 100644 index b195785f4c..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/README.md +++ /dev/null @@ -1,190 +0,0 @@ -angular-loading-bar -=================== - -The idea is simple: Add a loading bar / progress bar whenever an XHR request goes out in angular. Multiple requests within the same time period get bundled together such that each response increments the progress bar by the appropriate amount. - -This is mostly cool because you simply include it in your app, and it works. There's no complicated setup, and no need to maintain the state of the loading bar; it's all handled automatically by the interceptor. - -**Requirements:** AngularJS 1.2+ - -**File Size:** 2.4Kb minified, 0.5Kb gzipped - - -## Usage: - -1. include the loading bar as a dependency for your app. If you want animations, include `ngAnimate` as well. *note: ngAnimate is optional* - - ```js - angular.module('myApp', ['angular-loading-bar', 'ngAnimate']) - ``` - -2. include the supplied JS and CSS file (or create your own CSS to override defaults). - - ```html - - - ``` - -3. That's it -- you're done! - -#### via bower: -``` -$ bower install angular-loading-bar -``` -#### via npm: -``` -$ npm install angular-loading-bar -``` - -#### via CDN: -```html - - -``` - -## Why I created this -There are a couple projects similar to this out there, but none were ideal for me. All implementations I've seen require that you maintain state on behalf of the loading bar. In other words, you're setting the value of the loading/progress bar manually from potentially many different locations. This becomes complicated when you have a very large application with several services all making independent XHR requests. It becomes even more complicated if you want these services to be loosly coupled. - -Additionally, Angular was created as a highly testable framework, so it pains me to see Angular modules without tests. That is not the case here as this loading bar ships with 100% code coverage. - - -**Goals for this project:** - -1. Make it automatic -2. Unit tests, 100% coverage -3. Must work well with ngAnimate -4. Must be styled via external CSS (not inline) -5. No jQuery dependencies - - -## Configuration - -#### Turn the spinner on or off: -The insertion of the spinner can be controlled through configuration. It's on by default, but if you'd like to turn it off, simply configure the service: - -```js -angular.module('myApp', ['angular-loading-bar']) - .config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) { - cfpLoadingBarProvider.includeSpinner = false; - }]) -``` - -#### Turn the loading bar on or off: -Like the spinner configuration above, the loading bar can also be turned off for cases where you only want the spinner: - -```js -angular.module('myApp', ['angular-loading-bar']) - .config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) { - cfpLoadingBarProvider.includeBar = false; - }]) -``` - -#### Customize the template: -If you'd like to replace the default HTML template you can configure it by providing inline HTML as a string: - -```js -angular.module('myApp', ['angular-loading-bar']) - .config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) { - cfpLoadingBarProvider.spinnerTemplate = '
      Loading...
      '; - }]) -``` - -#### Latency Threshold -By default, the loading bar will only display after it has been waiting for a response for over 100ms. This helps keep things feeling snappy, and avoids the annoyingness of showing a loading bar every few seconds on really chatty applications. This threshold is totally configurable: - -```js -angular.module('myApp', ['angular-loading-bar']) - .config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) { - cfpLoadingBarProvider.latencyThreshold = 500; - }]) -``` - -#### Ignoring particular XHR requests: -The loading bar can also be forced to ignore certain requests, for example, when long-polling or periodically sending debugging information back to the server. - -```js -// ignore a particular $http GET: -$http.get('/status', { - ignoreLoadingBar: true -}); - -// ignore a particular $http POST. Note: POST and GET have different -// method signatures: -$http.post('/save', data, { - ignoreLoadingBar: true -}); - -``` - - -```js -// ignore particular $resource requests: -.factory('Restaurant', function($resource) { - return $resource('/api/restaurant/:id', {id: '@id'}, { - query: { - method: 'GET', - isArray: true, - ignoreLoadingBar: true - } - }); -}); - -``` - - - - -## How it works: -This library is split into two modules, an $http `interceptor`, and a `service`: - -**Interceptor** -The interceptor simply listens for all outgoing XHR requests, and then instructs the loadingBar service to start, stop, and increment accordingly. There is no public API for the interceptor. It can be used stand-alone by including `cfp.loadingBarInterceptor` as a dependency for your module. - -**Service** -The service is responsible for the presentation of the loading bar. It injects the loading bar into the DOM, adjusts the width whenever `set()` is called, and `complete()`s the whole show by removing the loading bar from the DOM. - -## Service API (advanced usage) -Under normal circumstances you won't need to use this. However, if you wish to use the loading bar without the interceptor, you can do that as well. Simply include the loading bar service as a dependency instead of the main `angular-loading-bar` module: - -```js -angular.module('myApp', ['cfp.loadingBar']) -``` - - -```js - -cfpLoadingBar.start(); -// will insert the loading bar into the DOM, and display its progress at 1%. -// It will automatically call `inc()` repeatedly to give the illusion that the page load is progressing. - -cfpLoadingBar.inc(); -// increments the loading bar by a random amount. -// It is important to note that the auto incrementing will begin to slow down as -// the progress increases. This is to prevent the loading bar from appearing -// completed (or almost complete) before the XHR request has responded. - -cfpLoadingBar.set(0.3) // Set the loading bar to 30% -cfpLoadingBar.status() // Returns the loading bar's progress. -// -> 0.3 - -cfpLoadingBar.complete() -// Set the loading bar's progress to 100%, and then remove it from the DOM. - -``` - -## Events -The loading bar broadcasts the following events over $rootScope allowing further customization: - -**`cfpLoadingBar:loading`** triggered upon each XHR request that is not already cached - -**`cfpLoadingBar:loaded`** triggered each time an XHR request recieves a response (either successful or error) - -**`cfpLoadingBar:started`** triggered once upon the first XHR request. Will trigger again if another request goes out after `cfpLoadingBar:completed` has triggered. - -**`cfpLoadingBar:completed`** triggered once when the all XHR requests have returned (either successfully or not) - -## Credits: -Credit goes to [rstacruz](https://github.com/rstacruz) for his excellent [nProgress](https://github.com/rstacruz/nprogress). - -## License: -Licensed under the MIT license diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/bower.json deleted file mode 100644 index f1d1f7a879..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/bower.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "angular-loading-bar", - "main": [ - "build/loading-bar.js", - "build/loading-bar.css" - ], - "ignore": [ - "**/.*", - "node_modules", - "components", - "test", - "example" - ], - "dependencies": { - "angular": "^1.2.9" - }, - "devDependencies": { - "angular": "~1.2.23", - "angular-1.3": "angular#1.3", - "angular-1.4": "angular#1.4", - "angular-mocks": "~1.2.9", - "angular-mocks-1.3": "angular-mocks#1.3", - "angular-mocks-1.4": "angular-mocks#1.4", - "angular-animate": "~1.2.9", - "angular-animate-1.3": "angular-animate#1.3", - "angular-animate-1.4": "angular-animate#1.4" - }, - "resolutions": { - "angular": "~1.2.23" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.css b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.css deleted file mode 100644 index 72408d1a99..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.css +++ /dev/null @@ -1,110 +0,0 @@ -/*! - * angular-loading-bar v0.9.0 - * https://chieffancypants.github.io/angular-loading-bar - * Copyright (c) 2016 Wes Cruver - * License: MIT - */ - -/* Make clicks pass-through */ -#loading-bar, -#loading-bar-spinner { - pointer-events: none; - -webkit-pointer-events: none; - -webkit-transition: 350ms linear all; - -moz-transition: 350ms linear all; - -o-transition: 350ms linear all; - transition: 350ms linear all; -} - -#loading-bar.ng-enter, -#loading-bar.ng-leave.ng-leave-active, -#loading-bar-spinner.ng-enter, -#loading-bar-spinner.ng-leave.ng-leave-active { - opacity: 0; -} - -#loading-bar.ng-enter.ng-enter-active, -#loading-bar.ng-leave, -#loading-bar-spinner.ng-enter.ng-enter-active, -#loading-bar-spinner.ng-leave { - opacity: 1; -} - -#loading-bar .bar { - -webkit-transition: width 350ms; - -moz-transition: width 350ms; - -o-transition: width 350ms; - transition: width 350ms; - - background: #29d; - position: fixed; - z-index: 10002; - top: 0; - left: 0; - width: 100%; - height: 2px; - border-bottom-right-radius: 1px; - border-top-right-radius: 1px; -} - -/* Fancy blur effect */ -#loading-bar .peg { - position: absolute; - width: 70px; - right: 0; - top: 0; - height: 2px; - opacity: .45; - -moz-box-shadow: #29d 1px 0 6px 1px; - -ms-box-shadow: #29d 1px 0 6px 1px; - -webkit-box-shadow: #29d 1px 0 6px 1px; - box-shadow: #29d 1px 0 6px 1px; - -moz-border-radius: 100%; - -webkit-border-radius: 100%; - border-radius: 100%; -} - -#loading-bar-spinner { - display: block; - position: fixed; - z-index: 10002; - top: 10px; - left: 10px; -} - -#loading-bar-spinner .spinner-icon { - width: 14px; - height: 14px; - - border: solid 2px transparent; - border-top-color: #29d; - border-left-color: #29d; - border-radius: 50%; - - -webkit-animation: loading-bar-spinner 400ms linear infinite; - -moz-animation: loading-bar-spinner 400ms linear infinite; - -ms-animation: loading-bar-spinner 400ms linear infinite; - -o-animation: loading-bar-spinner 400ms linear infinite; - animation: loading-bar-spinner 400ms linear infinite; -} - -@-webkit-keyframes loading-bar-spinner { - 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } - 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } -} -@-moz-keyframes loading-bar-spinner { - 0% { -moz-transform: rotate(0deg); transform: rotate(0deg); } - 100% { -moz-transform: rotate(360deg); transform: rotate(360deg); } -} -@-o-keyframes loading-bar-spinner { - 0% { -o-transform: rotate(0deg); transform: rotate(0deg); } - 100% { -o-transform: rotate(360deg); transform: rotate(360deg); } -} -@-ms-keyframes loading-bar-spinner { - 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } - 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); } -} -@keyframes loading-bar-spinner { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.js deleted file mode 100644 index 358a368714..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.js +++ /dev/null @@ -1,341 +0,0 @@ -/*! - * angular-loading-bar v0.9.0 - * https://chieffancypants.github.io/angular-loading-bar - * Copyright (c) 2016 Wes Cruver - * License: MIT - */ -/* - * angular-loading-bar - * - * intercepts XHR requests and creates a loading bar. - * Based on the excellent nprogress work by rstacruz (more info in readme) - * - * (c) 2013 Wes Cruver - * License: MIT - */ - - -(function() { - -'use strict'; - -// Alias the loading bar for various backwards compatibilities since the project has matured: -angular.module('angular-loading-bar', ['cfp.loadingBarInterceptor']); -angular.module('chieffancypants.loadingBar', ['cfp.loadingBarInterceptor']); - - -/** - * loadingBarInterceptor service - * - * Registers itself as an Angular interceptor and listens for XHR requests. - */ -angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar']) - .config(['$httpProvider', function ($httpProvider) { - - var interceptor = ['$q', '$cacheFactory', '$timeout', '$rootScope', '$log', 'cfpLoadingBar', function ($q, $cacheFactory, $timeout, $rootScope, $log, cfpLoadingBar) { - - /** - * The total number of requests made - */ - var reqsTotal = 0; - - /** - * The number of requests completed (either successfully or not) - */ - var reqsCompleted = 0; - - /** - * The amount of time spent fetching before showing the loading bar - */ - var latencyThreshold = cfpLoadingBar.latencyThreshold; - - /** - * $timeout handle for latencyThreshold - */ - var startTimeout; - - - /** - * calls cfpLoadingBar.complete() which removes the - * loading bar from the DOM. - */ - function setComplete() { - $timeout.cancel(startTimeout); - cfpLoadingBar.complete(); - reqsCompleted = 0; - reqsTotal = 0; - } - - /** - * Determine if the response has already been cached - * @param {Object} config the config option from the request - * @return {Boolean} retrns true if cached, otherwise false - */ - function isCached(config) { - var cache; - var defaultCache = $cacheFactory.get('$http'); - var defaults = $httpProvider.defaults; - - // Choose the proper cache source. Borrowed from angular: $http service - if ((config.cache || defaults.cache) && config.cache !== false && - (config.method === 'GET' || config.method === 'JSONP')) { - cache = angular.isObject(config.cache) ? config.cache - : angular.isObject(defaults.cache) ? defaults.cache - : defaultCache; - } - - var cached = cache !== undefined ? - cache.get(config.url) !== undefined : false; - - if (config.cached !== undefined && cached !== config.cached) { - return config.cached; - } - config.cached = cached; - return cached; - } - - - return { - 'request': function(config) { - // Check to make sure this request hasn't already been cached and that - // the requester didn't explicitly ask us to ignore this request: - if (!config.ignoreLoadingBar && !isCached(config)) { - $rootScope.$broadcast('cfpLoadingBar:loading', {url: config.url}); - if (reqsTotal === 0) { - startTimeout = $timeout(function() { - cfpLoadingBar.start(); - }, latencyThreshold); - } - reqsTotal++; - cfpLoadingBar.set(reqsCompleted / reqsTotal); - } - return config; - }, - - 'response': function(response) { - if (!response || !response.config) { - $log.error('Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50'); - return response; - } - - if (!response.config.ignoreLoadingBar && !isCached(response.config)) { - reqsCompleted++; - $rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url, result: response}); - if (reqsCompleted >= reqsTotal) { - setComplete(); - } else { - cfpLoadingBar.set(reqsCompleted / reqsTotal); - } - } - return response; - }, - - 'responseError': function(rejection) { - if (!rejection || !rejection.config) { - $log.error('Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50'); - return $q.reject(rejection); - } - - if (!rejection.config.ignoreLoadingBar && !isCached(rejection.config)) { - reqsCompleted++; - $rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url, result: rejection}); - if (reqsCompleted >= reqsTotal) { - setComplete(); - } else { - cfpLoadingBar.set(reqsCompleted / reqsTotal); - } - } - return $q.reject(rejection); - } - }; - }]; - - $httpProvider.interceptors.push(interceptor); - }]); - - -/** - * Loading Bar - * - * This service handles adding and removing the actual element in the DOM. - * Generally, best practices for DOM manipulation is to take place in a - * directive, but because the element itself is injected in the DOM only upon - * XHR requests, and it's likely needed on every view, the best option is to - * use a service. - */ -angular.module('cfp.loadingBar', []) - .provider('cfpLoadingBar', function() { - - this.autoIncrement = true; - this.includeSpinner = true; - this.includeBar = true; - this.latencyThreshold = 100; - this.startSize = 0.02; - this.parentSelector = 'body'; - this.spinnerTemplate = '
      '; - this.loadingBarTemplate = '
      '; - - this.$get = ['$injector', '$document', '$timeout', '$rootScope', function ($injector, $document, $timeout, $rootScope) { - var $animate; - var $parentSelector = this.parentSelector, - loadingBarContainer = angular.element(this.loadingBarTemplate), - loadingBar = loadingBarContainer.find('div').eq(0), - spinner = angular.element(this.spinnerTemplate); - - var incTimeout, - completeTimeout, - started = false, - status = 0; - - var autoIncrement = this.autoIncrement; - var includeSpinner = this.includeSpinner; - var includeBar = this.includeBar; - var startSize = this.startSize; - - /** - * Inserts the loading bar element into the dom, and sets it to 2% - */ - function _start() { - if (!$animate) { - $animate = $injector.get('$animate'); - } - - $timeout.cancel(completeTimeout); - - // do not continually broadcast the started event: - if (started) { - return; - } - - var document = $document[0]; - var parent = document.querySelector ? - document.querySelector($parentSelector) - : $document.find($parentSelector)[0] - ; - - if (! parent) { - parent = document.getElementsByTagName('body')[0]; - } - - var $parent = angular.element(parent); - var $after = parent.lastChild && angular.element(parent.lastChild); - - $rootScope.$broadcast('cfpLoadingBar:started'); - started = true; - - if (includeBar) { - $animate.enter(loadingBarContainer, $parent, $after); - } - - if (includeSpinner) { - $animate.enter(spinner, $parent, loadingBarContainer); - } - - _set(startSize); - } - - /** - * Set the loading bar's width to a certain percent. - * - * @param n any value between 0 and 1 - */ - function _set(n) { - if (!started) { - return; - } - var pct = (n * 100) + '%'; - loadingBar.css('width', pct); - status = n; - - // increment loadingbar to give the illusion that there is always - // progress but make sure to cancel the previous timeouts so we don't - // have multiple incs running at the same time. - if (autoIncrement) { - $timeout.cancel(incTimeout); - incTimeout = $timeout(function() { - _inc(); - }, 250); - } - } - - /** - * Increments the loading bar by a random amount - * but slows down as it progresses - */ - function _inc() { - if (_status() >= 1) { - return; - } - - var rnd = 0; - - // TODO: do this mathmatically instead of through conditions - - var stat = _status(); - if (stat >= 0 && stat < 0.25) { - // Start out between 3 - 6% increments - rnd = (Math.random() * (5 - 3 + 1) + 3) / 100; - } else if (stat >= 0.25 && stat < 0.65) { - // increment between 0 - 3% - rnd = (Math.random() * 3) / 100; - } else if (stat >= 0.65 && stat < 0.9) { - // increment between 0 - 2% - rnd = (Math.random() * 2) / 100; - } else if (stat >= 0.9 && stat < 0.99) { - // finally, increment it .5 % - rnd = 0.005; - } else { - // after 99%, don't increment: - rnd = 0; - } - - var pct = _status() + rnd; - _set(pct); - } - - function _status() { - return status; - } - - function _completeAnimation() { - status = 0; - started = false; - } - - function _complete() { - if (!$animate) { - $animate = $injector.get('$animate'); - } - - $rootScope.$broadcast('cfpLoadingBar:completed'); - _set(1); - - $timeout.cancel(completeTimeout); - - // Attempt to aggregate any start/complete calls within 500ms: - completeTimeout = $timeout(function() { - var promise = $animate.leave(loadingBarContainer, _completeAnimation); - if (promise && promise.then) { - promise.then(_completeAnimation); - } - $animate.leave(spinner); - }, 500); - } - - return { - start : _start, - set : _set, - status : _status, - inc : _inc, - complete : _complete, - autoIncrement : this.autoIncrement, - includeSpinner : this.includeSpinner, - latencyThreshold : this.latencyThreshold, - parentSelector : this.parentSelector, - startSize : this.startSize - }; - - - }]; // - }); // wtf javascript. srsly -})(); // diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.min.css b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.min.css deleted file mode 100644 index 0f9f106777..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.min.css +++ /dev/null @@ -1 +0,0 @@ -#loading-bar,#loading-bar-spinner{pointer-events:none;-webkit-pointer-events:none;-webkit-transition:350ms linear all;-moz-transition:350ms linear all;-o-transition:350ms linear all;transition:350ms linear all}#loading-bar-spinner.ng-enter,#loading-bar-spinner.ng-leave.ng-leave-active,#loading-bar.ng-enter,#loading-bar.ng-leave.ng-leave-active{opacity:0}#loading-bar-spinner.ng-enter.ng-enter-active,#loading-bar-spinner.ng-leave,#loading-bar.ng-enter.ng-enter-active,#loading-bar.ng-leave{opacity:1}#loading-bar .bar{-webkit-transition:width 350ms;-moz-transition:width 350ms;-o-transition:width 350ms;transition:width 350ms;background:#29d;position:fixed;z-index:10002;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}#loading-bar .peg{position:absolute;width:70px;right:0;top:0;height:2px;opacity:.45;-moz-box-shadow:#29d 1px 0 6px 1px;-ms-box-shadow:#29d 1px 0 6px 1px;-webkit-box-shadow:#29d 1px 0 6px 1px;box-shadow:#29d 1px 0 6px 1px;-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%}#loading-bar-spinner{display:block;position:fixed;z-index:10002;top:10px;left:10px}#loading-bar-spinner .spinner-icon{width:14px;height:14px;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:loading-bar-spinner 400ms linear infinite;-moz-animation:loading-bar-spinner 400ms linear infinite;-ms-animation:loading-bar-spinner 400ms linear infinite;-o-animation:loading-bar-spinner 400ms linear infinite;animation:loading-bar-spinner 400ms linear infinite}@-webkit-keyframes loading-bar-spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes loading-bar-spinner{0%{-moz-transform:rotate(0);transform:rotate(0)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes loading-bar-spinner{0%{-o-transform:rotate(0);transform:rotate(0)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes loading-bar-spinner{0%{-ms-transform:rotate(0);transform:rotate(0)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.min.js deleted file mode 100644 index b6628f4ad0..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * angular-loading-bar v0.9.0 - * https://chieffancypants.github.io/angular-loading-bar - * Copyright (c) 2016 Wes Cruver - * License: MIT - */ -!function(){"use strict";angular.module("angular-loading-bar",["cfp.loadingBarInterceptor"]),angular.module("chieffancypants.loadingBar",["cfp.loadingBarInterceptor"]),angular.module("cfp.loadingBarInterceptor",["cfp.loadingBar"]).config(["$httpProvider",function(a){var b=["$q","$cacheFactory","$timeout","$rootScope","$log","cfpLoadingBar",function(b,c,d,e,f,g){function h(){d.cancel(j),g.complete(),l=0,k=0}function i(b){var d,e=c.get("$http"),f=a.defaults;!b.cache&&!f.cache||b.cache===!1||"GET"!==b.method&&"JSONP"!==b.method||(d=angular.isObject(b.cache)?b.cache:angular.isObject(f.cache)?f.cache:e);var g=void 0!==d?void 0!==d.get(b.url):!1;return void 0!==b.cached&&g!==b.cached?b.cached:(b.cached=g,g)}var j,k=0,l=0,m=g.latencyThreshold;return{request:function(a){return a.ignoreLoadingBar||i(a)||(e.$broadcast("cfpLoadingBar:loading",{url:a.url}),0===k&&(j=d(function(){g.start()},m)),k++,g.set(l/k)),a},response:function(a){return a&&a.config?(a.config.ignoreLoadingBar||i(a.config)||(l++,e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url,result:a}),l>=k?h():g.set(l/k)),a):(f.error("Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),a)},responseError:function(a){return a&&a.config?(a.config.ignoreLoadingBar||i(a.config)||(l++,e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url,result:a}),l>=k?h():g.set(l/k)),b.reject(a)):(f.error("Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),b.reject(a))}}}];a.interceptors.push(b)}]),angular.module("cfp.loadingBar",[]).provider("cfpLoadingBar",function(){this.autoIncrement=!0,this.includeSpinner=!0,this.includeBar=!0,this.latencyThreshold=100,this.startSize=.02,this.parentSelector="body",this.spinnerTemplate='
      ',this.loadingBarTemplate='
      ',this.$get=["$injector","$document","$timeout","$rootScope",function(a,b,c,d){function e(){if(k||(k=a.get("$animate")),c.cancel(m),!r){var e=b[0],g=e.querySelector?e.querySelector(n):b.find(n)[0];g||(g=e.getElementsByTagName("body")[0]);var h=angular.element(g),i=g.lastChild&&angular.element(g.lastChild);d.$broadcast("cfpLoadingBar:started"),r=!0,v&&k.enter(o,h,i),u&&k.enter(q,h,o),f(w)}}function f(a){if(r){var b=100*a+"%";p.css("width",b),s=a,t&&(c.cancel(l),l=c(function(){g()},250))}}function g(){if(!(h()>=1)){var a=0,b=h();a=b>=0&&.25>b?(3*Math.random()+3)/100:b>=.25&&.65>b?3*Math.random()/100:b>=.65&&.9>b?2*Math.random()/100:b>=.9&&.99>b?.005:0;var c=h()+a;f(c)}}function h(){return s}function i(){s=0,r=!1}function j(){k||(k=a.get("$animate")),d.$broadcast("cfpLoadingBar:completed"),f(1),c.cancel(m),m=c(function(){var a=k.leave(o,i);a&&a.then&&a.then(i),k.leave(q)},500)}var k,l,m,n=this.parentSelector,o=angular.element(this.loadingBarTemplate),p=o.find("div").eq(0),q=angular.element(this.spinnerTemplate),r=!1,s=0,t=this.autoIncrement,u=this.includeSpinner,v=this.includeBar,w=this.startSize;return{start:e,set:f,status:h,inc:g,complete:j,autoIncrement:this.autoIncrement,includeSpinner:this.includeSpinner,latencyThreshold:this.latencyThreshold,parentSelector:this.parentSelector,startSize:this.startSize}}]})}(); \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/index.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/index.js deleted file mode 100644 index 411428d860..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/index.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./build/loading-bar'); -module.exports = 'angular-loading-bar'; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/package.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/package.json deleted file mode 100644 index 5f44266c75..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "angular-loading-bar", - "version": "0.9.0", - "description": "An automatic loading bar for AngularJS", - "main": "index.js", - "style": "build/loading-bar.css", - "directories": { - "example": "example", - "test": "test" - }, - "repository": { - "type": "git", - "url": "git://github.com/chieffancypants/angular-loading-bar.git" - }, - "keywords": [ - "angular", - "angularjs", - "loading", - "loadingbar", - "progress", - "progressbar" - ], - "author": "Wes Cruver", - "license": "MIT", - "bugs": { - "url": "https://github.com/chieffancypants/angular-loading-bar/issues" - }, - "homepage": "https://chieffancypants.github.io/angular-loading-bar", - "devDependencies": { - "karma-jasmine": "^0.1.3", - "karma-coffee-preprocessor": "^0.2.0", - "karma-phantomjs-launcher": "^0.1.0", - "karma": "~0.12.0", - "karma-coverage": "^0.1.0", - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.6.4", - "grunt-contrib-uglify": "^0.9.1", - "grunt-contrib-cssmin": "~0.12.0", - "grunt-karma": "~0.11.0", - "grunt-contrib-concat": "^0.5.0" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/src/loading-bar.css b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/src/loading-bar.css deleted file mode 100644 index 3ee06188b7..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/src/loading-bar.css +++ /dev/null @@ -1,104 +0,0 @@ - -/* Make clicks pass-through */ -#loading-bar, -#loading-bar-spinner { - pointer-events: none; - -webkit-pointer-events: none; - -webkit-transition: 350ms linear all; - -moz-transition: 350ms linear all; - -o-transition: 350ms linear all; - transition: 350ms linear all; -} - -#loading-bar.ng-enter, -#loading-bar.ng-leave.ng-leave-active, -#loading-bar-spinner.ng-enter, -#loading-bar-spinner.ng-leave.ng-leave-active { - opacity: 0; -} - -#loading-bar.ng-enter.ng-enter-active, -#loading-bar.ng-leave, -#loading-bar-spinner.ng-enter.ng-enter-active, -#loading-bar-spinner.ng-leave { - opacity: 1; -} - -#loading-bar .bar { - -webkit-transition: width 350ms; - -moz-transition: width 350ms; - -o-transition: width 350ms; - transition: width 350ms; - - background: #29d; - position: fixed; - z-index: 10002; - top: 0; - left: 0; - width: 100%; - height: 2px; - border-bottom-right-radius: 1px; - border-top-right-radius: 1px; -} - -/* Fancy blur effect */ -#loading-bar .peg { - position: absolute; - width: 70px; - right: 0; - top: 0; - height: 2px; - opacity: .45; - -moz-box-shadow: #29d 1px 0 6px 1px; - -ms-box-shadow: #29d 1px 0 6px 1px; - -webkit-box-shadow: #29d 1px 0 6px 1px; - box-shadow: #29d 1px 0 6px 1px; - -moz-border-radius: 100%; - -webkit-border-radius: 100%; - border-radius: 100%; -} - -#loading-bar-spinner { - display: block; - position: fixed; - z-index: 10002; - top: 10px; - left: 10px; -} - -#loading-bar-spinner .spinner-icon { - width: 14px; - height: 14px; - - border: solid 2px transparent; - border-top-color: #29d; - border-left-color: #29d; - border-radius: 50%; - - -webkit-animation: loading-bar-spinner 400ms linear infinite; - -moz-animation: loading-bar-spinner 400ms linear infinite; - -ms-animation: loading-bar-spinner 400ms linear infinite; - -o-animation: loading-bar-spinner 400ms linear infinite; - animation: loading-bar-spinner 400ms linear infinite; -} - -@-webkit-keyframes loading-bar-spinner { - 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } - 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } -} -@-moz-keyframes loading-bar-spinner { - 0% { -moz-transform: rotate(0deg); transform: rotate(0deg); } - 100% { -moz-transform: rotate(360deg); transform: rotate(360deg); } -} -@-o-keyframes loading-bar-spinner { - 0% { -o-transform: rotate(0deg); transform: rotate(0deg); } - 100% { -o-transform: rotate(360deg); transform: rotate(360deg); } -} -@-ms-keyframes loading-bar-spinner { - 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } - 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); } -} -@keyframes loading-bar-spinner { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/src/loading-bar.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/src/loading-bar.js deleted file mode 100644 index dc3fc73ad1..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-loading-bar/src/loading-bar.js +++ /dev/null @@ -1,335 +0,0 @@ -/* - * angular-loading-bar - * - * intercepts XHR requests and creates a loading bar. - * Based on the excellent nprogress work by rstacruz (more info in readme) - * - * (c) 2013 Wes Cruver - * License: MIT - */ - - -(function() { - -'use strict'; - -// Alias the loading bar for various backwards compatibilities since the project has matured: -angular.module('angular-loading-bar', ['cfp.loadingBarInterceptor']); -angular.module('chieffancypants.loadingBar', ['cfp.loadingBarInterceptor']); - - -/** - * loadingBarInterceptor service - * - * Registers itself as an Angular interceptor and listens for XHR requests. - */ -angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar']) - .config(['$httpProvider', function ($httpProvider) { - - var interceptor = ['$q', '$cacheFactory', '$timeout', '$rootScope', '$log', 'cfpLoadingBar', function ($q, $cacheFactory, $timeout, $rootScope, $log, cfpLoadingBar) { - - /** - * The total number of requests made - */ - var reqsTotal = 0; - - /** - * The number of requests completed (either successfully or not) - */ - var reqsCompleted = 0; - - /** - * The amount of time spent fetching before showing the loading bar - */ - var latencyThreshold = cfpLoadingBar.latencyThreshold; - - /** - * $timeout handle for latencyThreshold - */ - var startTimeout; - - - /** - * calls cfpLoadingBar.complete() which removes the - * loading bar from the DOM. - */ - function setComplete() { - $timeout.cancel(startTimeout); - cfpLoadingBar.complete(); - reqsCompleted = 0; - reqsTotal = 0; - } - - /** - * Determine if the response has already been cached - * @param {Object} config the config option from the request - * @return {Boolean} retrns true if cached, otherwise false - */ - function isCached(config) { - var cache; - var defaultCache = $cacheFactory.get('$http'); - var defaults = $httpProvider.defaults; - - // Choose the proper cache source. Borrowed from angular: $http service - if ((config.cache || defaults.cache) && config.cache !== false && - (config.method === 'GET' || config.method === 'JSONP')) { - cache = angular.isObject(config.cache) ? config.cache - : angular.isObject(defaults.cache) ? defaults.cache - : defaultCache; - } - - var cached = cache !== undefined ? - cache.get(config.url) !== undefined : false; - - if (config.cached !== undefined && cached !== config.cached) { - return config.cached; - } - config.cached = cached; - return cached; - } - - - return { - 'request': function(config) { - // Check to make sure this request hasn't already been cached and that - // the requester didn't explicitly ask us to ignore this request: - if (!config.ignoreLoadingBar && !isCached(config)) { - $rootScope.$broadcast('cfpLoadingBar:loading', {url: config.url}); - if (reqsTotal === 0) { - startTimeout = $timeout(function() { - cfpLoadingBar.start(); - }, latencyThreshold); - } - reqsTotal++; - cfpLoadingBar.set(reqsCompleted / reqsTotal); - } - return config; - }, - - 'response': function(response) { - if (!response || !response.config) { - $log.error('Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50'); - return response; - } - - if (!response.config.ignoreLoadingBar && !isCached(response.config)) { - reqsCompleted++; - $rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url, result: response}); - if (reqsCompleted >= reqsTotal) { - setComplete(); - } else { - cfpLoadingBar.set(reqsCompleted / reqsTotal); - } - } - return response; - }, - - 'responseError': function(rejection) { - if (!rejection || !rejection.config) { - $log.error('Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50'); - return $q.reject(rejection); - } - - if (!rejection.config.ignoreLoadingBar && !isCached(rejection.config)) { - reqsCompleted++; - $rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url, result: rejection}); - if (reqsCompleted >= reqsTotal) { - setComplete(); - } else { - cfpLoadingBar.set(reqsCompleted / reqsTotal); - } - } - return $q.reject(rejection); - } - }; - }]; - - $httpProvider.interceptors.push(interceptor); - }]); - - -/** - * Loading Bar - * - * This service handles adding and removing the actual element in the DOM. - * Generally, best practices for DOM manipulation is to take place in a - * directive, but because the element itself is injected in the DOM only upon - * XHR requests, and it's likely needed on every view, the best option is to - * use a service. - */ -angular.module('cfp.loadingBar', []) - .provider('cfpLoadingBar', function() { - - this.autoIncrement = true; - this.includeSpinner = true; - this.includeBar = true; - this.latencyThreshold = 100; - this.startSize = 0.02; - this.parentSelector = 'body'; - this.spinnerTemplate = '
      '; - this.loadingBarTemplate = '
      '; - - this.$get = ['$injector', '$document', '$timeout', '$rootScope', function ($injector, $document, $timeout, $rootScope) { - var $animate; - var $parentSelector = this.parentSelector, - loadingBarContainer = angular.element(this.loadingBarTemplate), - loadingBar = loadingBarContainer.find('div').eq(0), - spinner = angular.element(this.spinnerTemplate); - - var incTimeout, - completeTimeout, - started = false, - status = 0; - - var autoIncrement = this.autoIncrement; - var includeSpinner = this.includeSpinner; - var includeBar = this.includeBar; - var startSize = this.startSize; - - /** - * Inserts the loading bar element into the dom, and sets it to 2% - */ - function _start() { - if (!$animate) { - $animate = $injector.get('$animate'); - } - - $timeout.cancel(completeTimeout); - - // do not continually broadcast the started event: - if (started) { - return; - } - - var document = $document[0]; - var parent = document.querySelector ? - document.querySelector($parentSelector) - : $document.find($parentSelector)[0] - ; - - if (! parent) { - parent = document.getElementsByTagName('body')[0]; - } - - var $parent = angular.element(parent); - var $after = parent.lastChild && angular.element(parent.lastChild); - - $rootScope.$broadcast('cfpLoadingBar:started'); - started = true; - - if (includeBar) { - $animate.enter(loadingBarContainer, $parent, $after); - } - - if (includeSpinner) { - $animate.enter(spinner, $parent, loadingBarContainer); - } - - _set(startSize); - } - - /** - * Set the loading bar's width to a certain percent. - * - * @param n any value between 0 and 1 - */ - function _set(n) { - if (!started) { - return; - } - var pct = (n * 100) + '%'; - loadingBar.css('width', pct); - status = n; - - // increment loadingbar to give the illusion that there is always - // progress but make sure to cancel the previous timeouts so we don't - // have multiple incs running at the same time. - if (autoIncrement) { - $timeout.cancel(incTimeout); - incTimeout = $timeout(function() { - _inc(); - }, 250); - } - } - - /** - * Increments the loading bar by a random amount - * but slows down as it progresses - */ - function _inc() { - if (_status() >= 1) { - return; - } - - var rnd = 0; - - // TODO: do this mathmatically instead of through conditions - - var stat = _status(); - if (stat >= 0 && stat < 0.25) { - // Start out between 3 - 6% increments - rnd = (Math.random() * (5 - 3 + 1) + 3) / 100; - } else if (stat >= 0.25 && stat < 0.65) { - // increment between 0 - 3% - rnd = (Math.random() * 3) / 100; - } else if (stat >= 0.65 && stat < 0.9) { - // increment between 0 - 2% - rnd = (Math.random() * 2) / 100; - } else if (stat >= 0.9 && stat < 0.99) { - // finally, increment it .5 % - rnd = 0.005; - } else { - // after 99%, don't increment: - rnd = 0; - } - - var pct = _status() + rnd; - _set(pct); - } - - function _status() { - return status; - } - - function _completeAnimation() { - status = 0; - started = false; - } - - function _complete() { - if (!$animate) { - $animate = $injector.get('$animate'); - } - - $rootScope.$broadcast('cfpLoadingBar:completed'); - _set(1); - - $timeout.cancel(completeTimeout); - - // Attempt to aggregate any start/complete calls within 500ms: - completeTimeout = $timeout(function() { - var promise = $animate.leave(loadingBarContainer, _completeAnimation); - if (promise && promise.then) { - promise.then(_completeAnimation); - } - $animate.leave(spinner); - }, 500); - } - - return { - start : _start, - set : _set, - status : _status, - inc : _inc, - complete : _complete, - autoIncrement : this.autoIncrement, - includeSpinner : this.includeSpinner, - latencyThreshold : this.latencyThreshold, - parentSelector : this.parentSelector, - startSize : this.startSize - }; - - - }]; // - }); // wtf javascript. srsly -})(); // diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/.bower.json deleted file mode 100644 index 119ddaab59..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/.bower.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "angular-mocks", - "version": "1.5.8", - "license": "MIT", - "main": "./angular-mocks.js", - "ignore": [], - "dependencies": { - "angular": "1.5.8" - }, - "homepage": "https://github.com/angular/bower-angular-mocks", - "_release": "1.5.8", - "_resolution": { - "type": "version", - "tag": "v1.5.8", - "commit": "482eefcf6b03057c5fcddb9750e460f458ee3487" - }, - "_source": "https://github.com/angular/bower-angular-mocks.git", - "_target": "1.5.8", - "_originalSource": "angular-mocks" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/LICENSE.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/LICENSE.md deleted file mode 100644 index 2c395eef1b..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Angular - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/README.md deleted file mode 100644 index 61b9d8c083..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# packaged angular-mocks - -This repo is for distribution on `npm` and `bower`. The source for this module is in the -[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngMock). -Please file issues and pull requests against that repo. - -## Install - -You can install this package either with `npm` or with `bower`. - -### npm - -```shell -npm install angular-mocks -``` - -You can `require` ngMock modules: - -```js -var angular = require('angular'); -angular.module('myMod', [ - require('angular-animate'), - require('angular-mocks/ngMock'), - require('angular-mocks/ngAnimateMock') -]); -``` - -### bower - -```shell -bower install angular-mocks -``` - -The mocks are then available at `bower_components/angular-mocks/angular-mocks.js`. - -## Documentation - -Documentation is available on the -[AngularJS docs site](https://docs.angularjs.org/guide/unit-testing). - -## License - -The MIT License - -Copyright (c) 2010-2015 Google, Inc. http://angularjs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/angular-mocks.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/angular-mocks.js deleted file mode 100644 index 42f19b7aea..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/angular-mocks.js +++ /dev/null @@ -1,3126 +0,0 @@ -/** - * @license AngularJS v1.5.8 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) { - -'use strict'; - -/** - * @ngdoc object - * @name angular.mock - * @description - * - * Namespace from 'angular-mocks.js' which contains testing related code. - * - */ -angular.mock = {}; - -/** - * ! This is a private undocumented service ! - * - * @name $browser - * - * @description - * This service is a mock implementation of {@link ng.$browser}. It provides fake - * implementation for commonly used browser apis that are hard to test, e.g. setTimeout, xhr, - * cookies, etc. - * - * The api of this service is the same as that of the real {@link ng.$browser $browser}, except - * that there are several helper methods available which can be used in tests. - */ -angular.mock.$BrowserProvider = function() { - this.$get = function() { - return new angular.mock.$Browser(); - }; -}; - -angular.mock.$Browser = function() { - var self = this; - - this.isMock = true; - self.$$url = "http://server/"; - self.$$lastUrl = self.$$url; // used by url polling fn - self.pollFns = []; - - // TODO(vojta): remove this temporary api - self.$$completeOutstandingRequest = angular.noop; - self.$$incOutstandingRequestCount = angular.noop; - - - // register url polling fn - - self.onUrlChange = function(listener) { - self.pollFns.push( - function() { - if (self.$$lastUrl !== self.$$url || self.$$state !== self.$$lastState) { - self.$$lastUrl = self.$$url; - self.$$lastState = self.$$state; - listener(self.$$url, self.$$state); - } - } - ); - - return listener; - }; - - self.$$applicationDestroyed = angular.noop; - self.$$checkUrlChange = angular.noop; - - self.deferredFns = []; - self.deferredNextId = 0; - - self.defer = function(fn, delay) { - delay = delay || 0; - self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId}); - self.deferredFns.sort(function(a, b) { return a.time - b.time;}); - return self.deferredNextId++; - }; - - - /** - * @name $browser#defer.now - * - * @description - * Current milliseconds mock time. - */ - self.defer.now = 0; - - - self.defer.cancel = function(deferId) { - var fnIndex; - - angular.forEach(self.deferredFns, function(fn, index) { - if (fn.id === deferId) fnIndex = index; - }); - - if (angular.isDefined(fnIndex)) { - self.deferredFns.splice(fnIndex, 1); - return true; - } - - return false; - }; - - - /** - * @name $browser#defer.flush - * - * @description - * Flushes all pending requests and executes the defer callbacks. - * - * @param {number=} number of milliseconds to flush. See {@link #defer.now} - */ - self.defer.flush = function(delay) { - var nextTime; - - if (angular.isDefined(delay)) { - // A delay was passed so compute the next time - nextTime = self.defer.now + delay; - } else { - if (self.deferredFns.length) { - // No delay was passed so set the next time so that it clears the deferred queue - nextTime = self.deferredFns[self.deferredFns.length - 1].time; - } else { - // No delay passed, but there are no deferred tasks so flush - indicates an error! - throw new Error('No deferred tasks to be flushed'); - } - } - - while (self.deferredFns.length && self.deferredFns[0].time <= nextTime) { - // Increment the time and call the next deferred function - self.defer.now = self.deferredFns[0].time; - self.deferredFns.shift().fn(); - } - - // Ensure that the current time is correct - self.defer.now = nextTime; - }; - - self.$$baseHref = '/'; - self.baseHref = function() { - return this.$$baseHref; - }; -}; -angular.mock.$Browser.prototype = { - - /** - * @name $browser#poll - * - * @description - * run all fns in pollFns - */ - poll: function poll() { - angular.forEach(this.pollFns, function(pollFn) { - pollFn(); - }); - }, - - url: function(url, replace, state) { - if (angular.isUndefined(state)) { - state = null; - } - if (url) { - this.$$url = url; - // Native pushState serializes & copies the object; simulate it. - this.$$state = angular.copy(state); - return this; - } - - return this.$$url; - }, - - state: function() { - return this.$$state; - }, - - notifyWhenNoOutstandingRequests: function(fn) { - fn(); - } -}; - - -/** - * @ngdoc provider - * @name $exceptionHandlerProvider - * - * @description - * Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors - * passed to the `$exceptionHandler`. - */ - -/** - * @ngdoc service - * @name $exceptionHandler - * - * @description - * Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed - * to it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration - * information. - * - * - * ```js - * describe('$exceptionHandlerProvider', function() { - * - * it('should capture log messages and exceptions', function() { - * - * module(function($exceptionHandlerProvider) { - * $exceptionHandlerProvider.mode('log'); - * }); - * - * inject(function($log, $exceptionHandler, $timeout) { - * $timeout(function() { $log.log(1); }); - * $timeout(function() { $log.log(2); throw 'banana peel'; }); - * $timeout(function() { $log.log(3); }); - * expect($exceptionHandler.errors).toEqual([]); - * expect($log.assertEmpty()); - * $timeout.flush(); - * expect($exceptionHandler.errors).toEqual(['banana peel']); - * expect($log.log.logs).toEqual([[1], [2], [3]]); - * }); - * }); - * }); - * ``` - */ - -angular.mock.$ExceptionHandlerProvider = function() { - var handler; - - /** - * @ngdoc method - * @name $exceptionHandlerProvider#mode - * - * @description - * Sets the logging mode. - * - * @param {string} mode Mode of operation, defaults to `rethrow`. - * - * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` - * mode stores an array of errors in `$exceptionHandler.errors`, to allow later assertion of - * them. See {@link ngMock.$log#assertEmpty assertEmpty()} and - * {@link ngMock.$log#reset reset()}. - * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there - * is a bug in the application or test, so this mock will make these tests fail. For any - * implementations that expect exceptions to be thrown, the `rethrow` mode will also maintain - * a log of thrown errors in `$exceptionHandler.errors`. - */ - this.mode = function(mode) { - - switch (mode) { - case 'log': - case 'rethrow': - var errors = []; - handler = function(e) { - if (arguments.length == 1) { - errors.push(e); - } else { - errors.push([].slice.call(arguments, 0)); - } - if (mode === "rethrow") { - throw e; - } - }; - handler.errors = errors; - break; - default: - throw new Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!"); - } - }; - - this.$get = function() { - return handler; - }; - - this.mode('rethrow'); -}; - - -/** - * @ngdoc service - * @name $log - * - * @description - * Mock implementation of {@link ng.$log} that gathers all logged messages in arrays - * (one array per logging level). These arrays are exposed as `logs` property of each of the - * level-specific log function, e.g. for level `error` the array is exposed as `$log.error.logs`. - * - */ -angular.mock.$LogProvider = function() { - var debug = true; - - function concat(array1, array2, index) { - return array1.concat(Array.prototype.slice.call(array2, index)); - } - - this.debugEnabled = function(flag) { - if (angular.isDefined(flag)) { - debug = flag; - return this; - } else { - return debug; - } - }; - - this.$get = function() { - var $log = { - log: function() { $log.log.logs.push(concat([], arguments, 0)); }, - warn: function() { $log.warn.logs.push(concat([], arguments, 0)); }, - info: function() { $log.info.logs.push(concat([], arguments, 0)); }, - error: function() { $log.error.logs.push(concat([], arguments, 0)); }, - debug: function() { - if (debug) { - $log.debug.logs.push(concat([], arguments, 0)); - } - } - }; - - /** - * @ngdoc method - * @name $log#reset - * - * @description - * Reset all of the logging arrays to empty. - */ - $log.reset = function() { - /** - * @ngdoc property - * @name $log#log.logs - * - * @description - * Array of messages logged using {@link ng.$log#log `log()`}. - * - * @example - * ```js - * $log.log('Some Log'); - * var first = $log.log.logs.unshift(); - * ``` - */ - $log.log.logs = []; - /** - * @ngdoc property - * @name $log#info.logs - * - * @description - * Array of messages logged using {@link ng.$log#info `info()`}. - * - * @example - * ```js - * $log.info('Some Info'); - * var first = $log.info.logs.unshift(); - * ``` - */ - $log.info.logs = []; - /** - * @ngdoc property - * @name $log#warn.logs - * - * @description - * Array of messages logged using {@link ng.$log#warn `warn()`}. - * - * @example - * ```js - * $log.warn('Some Warning'); - * var first = $log.warn.logs.unshift(); - * ``` - */ - $log.warn.logs = []; - /** - * @ngdoc property - * @name $log#error.logs - * - * @description - * Array of messages logged using {@link ng.$log#error `error()`}. - * - * @example - * ```js - * $log.error('Some Error'); - * var first = $log.error.logs.unshift(); - * ``` - */ - $log.error.logs = []; - /** - * @ngdoc property - * @name $log#debug.logs - * - * @description - * Array of messages logged using {@link ng.$log#debug `debug()`}. - * - * @example - * ```js - * $log.debug('Some Error'); - * var first = $log.debug.logs.unshift(); - * ``` - */ - $log.debug.logs = []; - }; - - /** - * @ngdoc method - * @name $log#assertEmpty - * - * @description - * Assert that all of the logging methods have no logged messages. If any messages are present, - * an exception is thrown. - */ - $log.assertEmpty = function() { - var errors = []; - angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) { - angular.forEach($log[logLevel].logs, function(log) { - angular.forEach(log, function(logItem) { - errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' + - (logItem.stack || '')); - }); - }); - }); - if (errors.length) { - errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or " + - "an expected log message was not checked and removed:"); - errors.push(''); - throw new Error(errors.join('\n---------\n')); - } - }; - - $log.reset(); - return $log; - }; -}; - - -/** - * @ngdoc service - * @name $interval - * - * @description - * Mock implementation of the $interval service. - * - * Use {@link ngMock.$interval#flush `$interval.flush(millis)`} to - * move forward by `millis` milliseconds and trigger any functions scheduled to run in that - * time. - * - * @param {function()} fn A function that should be called repeatedly. - * @param {number} delay Number of milliseconds between each function call. - * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat - * indefinitely. - * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise - * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. - * @param {...*=} Pass additional parameters to the executed function. - * @returns {promise} A promise which will be notified on each iteration. - */ -angular.mock.$IntervalProvider = function() { - this.$get = ['$browser', '$rootScope', '$q', '$$q', - function($browser, $rootScope, $q, $$q) { - var repeatFns = [], - nextRepeatId = 0, - now = 0; - - var $interval = function(fn, delay, count, invokeApply) { - var hasParams = arguments.length > 4, - args = hasParams ? Array.prototype.slice.call(arguments, 4) : [], - iteration = 0, - skipApply = (angular.isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise; - - count = (angular.isDefined(count)) ? count : 0; - promise.then(null, null, (!hasParams) ? fn : function() { - fn.apply(null, args); - }); - - promise.$$intervalId = nextRepeatId; - - function tick() { - deferred.notify(iteration++); - - if (count > 0 && iteration >= count) { - var fnIndex; - deferred.resolve(iteration); - - angular.forEach(repeatFns, function(fn, index) { - if (fn.id === promise.$$intervalId) fnIndex = index; - }); - - if (angular.isDefined(fnIndex)) { - repeatFns.splice(fnIndex, 1); - } - } - - if (skipApply) { - $browser.defer.flush(); - } else { - $rootScope.$apply(); - } - } - - repeatFns.push({ - nextTime:(now + delay), - delay: delay, - fn: tick, - id: nextRepeatId, - deferred: deferred - }); - repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;}); - - nextRepeatId++; - return promise; - }; - /** - * @ngdoc method - * @name $interval#cancel - * - * @description - * Cancels a task associated with the `promise`. - * - * @param {promise} promise A promise from calling the `$interval` function. - * @returns {boolean} Returns `true` if the task was successfully cancelled. - */ - $interval.cancel = function(promise) { - if (!promise) return false; - var fnIndex; - - angular.forEach(repeatFns, function(fn, index) { - if (fn.id === promise.$$intervalId) fnIndex = index; - }); - - if (angular.isDefined(fnIndex)) { - repeatFns[fnIndex].deferred.reject('canceled'); - repeatFns.splice(fnIndex, 1); - return true; - } - - return false; - }; - - /** - * @ngdoc method - * @name $interval#flush - * @description - * - * Runs interval tasks scheduled to be run in the next `millis` milliseconds. - * - * @param {number=} millis maximum timeout amount to flush up until. - * - * @return {number} The amount of time moved forward. - */ - $interval.flush = function(millis) { - now += millis; - while (repeatFns.length && repeatFns[0].nextTime <= now) { - var task = repeatFns[0]; - task.fn(); - task.nextTime += task.delay; - repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;}); - } - return millis; - }; - - return $interval; - }]; -}; - - -/* jshint -W101 */ -/* The R_ISO8061_STR regex is never going to fit into the 100 char limit! - * This directive should go inside the anonymous function but a bug in JSHint means that it would - * not be enacted early enough to prevent the warning. - */ -var R_ISO8061_STR = /^(-?\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/; - -function jsonStringToDate(string) { - var match; - if (match = string.match(R_ISO8061_STR)) { - var date = new Date(0), - tzHour = 0, - tzMin = 0; - if (match[9]) { - tzHour = toInt(match[9] + match[10]); - tzMin = toInt(match[9] + match[11]); - } - date.setUTCFullYear(toInt(match[1]), toInt(match[2]) - 1, toInt(match[3])); - date.setUTCHours(toInt(match[4] || 0) - tzHour, - toInt(match[5] || 0) - tzMin, - toInt(match[6] || 0), - toInt(match[7] || 0)); - return date; - } - return string; -} - -function toInt(str) { - return parseInt(str, 10); -} - -function padNumberInMock(num, digits, trim) { - var neg = ''; - if (num < 0) { - neg = '-'; - num = -num; - } - num = '' + num; - while (num.length < digits) num = '0' + num; - if (trim) { - num = num.substr(num.length - digits); - } - return neg + num; -} - - -/** - * @ngdoc type - * @name angular.mock.TzDate - * @description - * - * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`. - * - * Mock of the Date type which has its timezone specified via constructor arg. - * - * The main purpose is to create Date-like instances with timezone fixed to the specified timezone - * offset, so that we can test code that depends on local timezone settings without dependency on - * the time zone settings of the machine where the code is running. - * - * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored) - * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC* - * - * @example - * !!!! WARNING !!!!! - * This is not a complete Date object so only methods that were implemented can be called safely. - * To make matters worse, TzDate instances inherit stuff from Date via a prototype. - * - * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is - * incomplete we might be missing some non-standard methods. This can result in errors like: - * "Date.prototype.foo called on incompatible Object". - * - * ```js - * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z'); - * newYearInBratislava.getTimezoneOffset() => -60; - * newYearInBratislava.getFullYear() => 2010; - * newYearInBratislava.getMonth() => 0; - * newYearInBratislava.getDate() => 1; - * newYearInBratislava.getHours() => 0; - * newYearInBratislava.getMinutes() => 0; - * newYearInBratislava.getSeconds() => 0; - * ``` - * - */ -angular.mock.TzDate = function(offset, timestamp) { - var self = new Date(0); - if (angular.isString(timestamp)) { - var tsStr = timestamp; - - self.origDate = jsonStringToDate(timestamp); - - timestamp = self.origDate.getTime(); - if (isNaN(timestamp)) { - throw { - name: "Illegal Argument", - message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string" - }; - } - } else { - self.origDate = new Date(timestamp); - } - - var localOffset = new Date(timestamp).getTimezoneOffset(); - self.offsetDiff = localOffset * 60 * 1000 - offset * 1000 * 60 * 60; - self.date = new Date(timestamp + self.offsetDiff); - - self.getTime = function() { - return self.date.getTime() - self.offsetDiff; - }; - - self.toLocaleDateString = function() { - return self.date.toLocaleDateString(); - }; - - self.getFullYear = function() { - return self.date.getFullYear(); - }; - - self.getMonth = function() { - return self.date.getMonth(); - }; - - self.getDate = function() { - return self.date.getDate(); - }; - - self.getHours = function() { - return self.date.getHours(); - }; - - self.getMinutes = function() { - return self.date.getMinutes(); - }; - - self.getSeconds = function() { - return self.date.getSeconds(); - }; - - self.getMilliseconds = function() { - return self.date.getMilliseconds(); - }; - - self.getTimezoneOffset = function() { - return offset * 60; - }; - - self.getUTCFullYear = function() { - return self.origDate.getUTCFullYear(); - }; - - self.getUTCMonth = function() { - return self.origDate.getUTCMonth(); - }; - - self.getUTCDate = function() { - return self.origDate.getUTCDate(); - }; - - self.getUTCHours = function() { - return self.origDate.getUTCHours(); - }; - - self.getUTCMinutes = function() { - return self.origDate.getUTCMinutes(); - }; - - self.getUTCSeconds = function() { - return self.origDate.getUTCSeconds(); - }; - - self.getUTCMilliseconds = function() { - return self.origDate.getUTCMilliseconds(); - }; - - self.getDay = function() { - return self.date.getDay(); - }; - - // provide this method only on browsers that already have it - if (self.toISOString) { - self.toISOString = function() { - return padNumberInMock(self.origDate.getUTCFullYear(), 4) + '-' + - padNumberInMock(self.origDate.getUTCMonth() + 1, 2) + '-' + - padNumberInMock(self.origDate.getUTCDate(), 2) + 'T' + - padNumberInMock(self.origDate.getUTCHours(), 2) + ':' + - padNumberInMock(self.origDate.getUTCMinutes(), 2) + ':' + - padNumberInMock(self.origDate.getUTCSeconds(), 2) + '.' + - padNumberInMock(self.origDate.getUTCMilliseconds(), 3) + 'Z'; - }; - } - - //hide all methods not implemented in this mock that the Date prototype exposes - var unimplementedMethods = ['getUTCDay', - 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', - 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', - 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', - 'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString', - 'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf']; - - angular.forEach(unimplementedMethods, function(methodName) { - self[methodName] = function() { - throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock"); - }; - }); - - return self; -}; - -//make "tzDateInstance instanceof Date" return true -angular.mock.TzDate.prototype = Date.prototype; -/* jshint +W101 */ - - -/** - * @ngdoc service - * @name $animate - * - * @description - * Mock implementation of the {@link ng.$animate `$animate`} service. Exposes two additional methods - * for testing animations. - * - * You need to require the `ngAnimateMock` module in your test suite for instance `beforeEach(module('ngAnimateMock'))` - */ -angular.mock.animate = angular.module('ngAnimateMock', ['ng']) - - .config(['$provide', function($provide) { - - $provide.factory('$$forceReflow', function() { - function reflowFn() { - reflowFn.totalReflows++; - } - reflowFn.totalReflows = 0; - return reflowFn; - }); - - $provide.factory('$$animateAsyncRun', function() { - var queue = []; - var queueFn = function() { - return function(fn) { - queue.push(fn); - }; - }; - queueFn.flush = function() { - if (queue.length === 0) return false; - - for (var i = 0; i < queue.length; i++) { - queue[i](); - } - queue = []; - - return true; - }; - return queueFn; - }); - - $provide.decorator('$$animateJs', ['$delegate', function($delegate) { - var runners = []; - - var animateJsConstructor = function() { - var animator = $delegate.apply($delegate, arguments); - // If no javascript animation is found, animator is undefined - if (animator) { - runners.push(animator); - } - return animator; - }; - - animateJsConstructor.$closeAndFlush = function() { - runners.forEach(function(runner) { - runner.end(); - }); - runners = []; - }; - - return animateJsConstructor; - }]); - - $provide.decorator('$animateCss', ['$delegate', function($delegate) { - var runners = []; - - var animateCssConstructor = function(element, options) { - var animator = $delegate(element, options); - runners.push(animator); - return animator; - }; - - animateCssConstructor.$closeAndFlush = function() { - runners.forEach(function(runner) { - runner.end(); - }); - runners = []; - }; - - return animateCssConstructor; - }]); - - $provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF', '$animateCss', '$$animateJs', - '$$forceReflow', '$$animateAsyncRun', '$rootScope', - function($delegate, $timeout, $browser, $$rAF, $animateCss, $$animateJs, - $$forceReflow, $$animateAsyncRun, $rootScope) { - var animate = { - queue: [], - cancel: $delegate.cancel, - on: $delegate.on, - off: $delegate.off, - pin: $delegate.pin, - get reflows() { - return $$forceReflow.totalReflows; - }, - enabled: $delegate.enabled, - /** - * @ngdoc method - * @name $animate#closeAndFlush - * @description - * - * This method will close all pending animations (both {@link ngAnimate#javascript-based-animations Javascript} - * and {@link ngAnimate.$animateCss CSS}) and it will also flush any remaining animation frames and/or callbacks. - */ - closeAndFlush: function() { - // we allow the flush command to swallow the errors - // because depending on whether CSS or JS animations are - // used, there may not be a RAF flush. The primary flush - // at the end of this function must throw an exception - // because it will track if there were pending animations - this.flush(true); - $animateCss.$closeAndFlush(); - $$animateJs.$closeAndFlush(); - this.flush(); - }, - /** - * @ngdoc method - * @name $animate#flush - * @description - * - * This method is used to flush the pending callbacks and animation frames to either start - * an animation or conclude an animation. Note that this will not actually close an - * actively running animation (see {@link ngMock.$animate#closeAndFlush `closeAndFlush()`} for that). - */ - flush: function(hideErrors) { - $rootScope.$digest(); - - var doNextRun, somethingFlushed = false; - do { - doNextRun = false; - - if ($$rAF.queue.length) { - $$rAF.flush(); - doNextRun = somethingFlushed = true; - } - - if ($$animateAsyncRun.flush()) { - doNextRun = somethingFlushed = true; - } - } while (doNextRun); - - if (!somethingFlushed && !hideErrors) { - throw new Error('No pending animations ready to be closed or flushed'); - } - - $rootScope.$digest(); - } - }; - - angular.forEach( - ['animate','enter','leave','move','addClass','removeClass','setClass'], function(method) { - animate[method] = function() { - animate.queue.push({ - event: method, - element: arguments[0], - options: arguments[arguments.length - 1], - args: arguments - }); - return $delegate[method].apply($delegate, arguments); - }; - }); - - return animate; - }]); - - }]); - - -/** - * @ngdoc function - * @name angular.mock.dump - * @description - * - * *NOTE*: This is not an injectable instance, just a globally available function. - * - * Method for serializing common angular objects (scope, elements, etc..) into strings. - * It is useful for logging objects to the console when debugging. - * - * @param {*} object - any object to turn into string. - * @return {string} a serialized string of the argument - */ -angular.mock.dump = function(object) { - return serialize(object); - - function serialize(object) { - var out; - - if (angular.isElement(object)) { - object = angular.element(object); - out = angular.element('
      '); - angular.forEach(object, function(element) { - out.append(angular.element(element).clone()); - }); - out = out.html(); - } else if (angular.isArray(object)) { - out = []; - angular.forEach(object, function(o) { - out.push(serialize(o)); - }); - out = '[ ' + out.join(', ') + ' ]'; - } else if (angular.isObject(object)) { - if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) { - out = serializeScope(object); - } else if (object instanceof Error) { - out = object.stack || ('' + object.name + ': ' + object.message); - } else { - // TODO(i): this prevents methods being logged, - // we should have a better way to serialize objects - out = angular.toJson(object, true); - } - } else { - out = String(object); - } - - return out; - } - - function serializeScope(scope, offset) { - offset = offset || ' '; - var log = [offset + 'Scope(' + scope.$id + '): {']; - for (var key in scope) { - if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\$|this)/)) { - log.push(' ' + key + ': ' + angular.toJson(scope[key])); - } - } - var child = scope.$$childHead; - while (child) { - log.push(serializeScope(child, offset + ' ')); - child = child.$$nextSibling; - } - log.push('}'); - return log.join('\n' + offset); - } -}; - -/** - * @ngdoc service - * @name $httpBackend - * @description - * Fake HTTP backend implementation suitable for unit testing applications that use the - * {@link ng.$http $http service}. - * - *
      - * **Note**: For fake HTTP backend implementation suitable for end-to-end testing or backend-less - * development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}. - *
      - * - * During unit testing, we want our unit tests to run quickly and have no external dependencies so - * we don’t want to send [XHR](https://developer.mozilla.org/en/xmlhttprequest) or - * [JSONP](http://en.wikipedia.org/wiki/JSONP) requests to a real server. All we really need is - * to verify whether a certain request has been sent or not, or alternatively just let the - * application make requests, respond with pre-trained responses and assert that the end result is - * what we expect it to be. - * - * This mock implementation can be used to respond with static or dynamic responses via the - * `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc). - * - * When an Angular application needs some data from a server, it calls the $http service, which - * sends the request to a real server using $httpBackend service. With dependency injection, it is - * easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify - * the requests and respond with some testing data without sending a request to a real server. - * - * There are two ways to specify what test data should be returned as http responses by the mock - * backend when the code under test makes http requests: - * - * - `$httpBackend.expect` - specifies a request expectation - * - `$httpBackend.when` - specifies a backend definition - * - * - * ## Request Expectations vs Backend Definitions - * - * Request expectations provide a way to make assertions about requests made by the application and - * to define responses for those requests. The test will fail if the expected requests are not made - * or they are made in the wrong order. - * - * Backend definitions allow you to define a fake backend for your application which doesn't assert - * if a particular request was made or not, it just returns a trained response if a request is made. - * The test will pass whether or not the request gets made during testing. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
      Request expectationsBackend definitions
      Syntax.expect(...).respond(...).when(...).respond(...)
      Typical usagestrict unit testsloose (black-box) unit testing
      Fulfills multiple requestsNOYES
      Order of requests mattersYESNO
      Request requiredYESNO
      Response requiredoptional (see below)YES
      - * - * In cases where both backend definitions and request expectations are specified during unit - * testing, the request expectations are evaluated first. - * - * If a request expectation has no response specified, the algorithm will search your backend - * definitions for an appropriate response. - * - * If a request didn't match any expectation or if the expectation doesn't have the response - * defined, the backend definitions are evaluated in sequential order to see if any of them match - * the request. The response from the first matched definition is returned. - * - * - * ## Flushing HTTP requests - * - * The $httpBackend used in production always responds to requests asynchronously. If we preserved - * this behavior in unit testing, we'd have to create async unit tests, which are hard to write, - * to follow and to maintain. But neither can the testing mock respond synchronously; that would - * change the execution of the code under test. For this reason, the mock $httpBackend has a - * `flush()` method, which allows the test to explicitly flush pending requests. This preserves - * the async api of the backend, while allowing the test to execute synchronously. - * - * - * ## Unit testing with mock $httpBackend - * The following code shows how to setup and use the mock backend when unit testing a controller. - * First we create the controller under test: - * - ```js - // The module code - angular - .module('MyApp', []) - .controller('MyController', MyController); - - // The controller code - function MyController($scope, $http) { - var authToken; - - $http.get('/auth.py').then(function(response) { - authToken = response.headers('A-Token'); - $scope.user = response.data; - }); - - $scope.saveMessage = function(message) { - var headers = { 'Authorization': authToken }; - $scope.status = 'Saving...'; - - $http.post('/add-msg.py', message, { headers: headers } ).then(function(response) { - $scope.status = ''; - }).catch(function() { - $scope.status = 'Failed...'; - }); - }; - } - ``` - * - * Now we setup the mock backend and create the test specs: - * - ```js - // testing controller - describe('MyController', function() { - var $httpBackend, $rootScope, createController, authRequestHandler; - - // Set up the module - beforeEach(module('MyApp')); - - beforeEach(inject(function($injector) { - // Set up the mock http service responses - $httpBackend = $injector.get('$httpBackend'); - // backend definition common for all tests - authRequestHandler = $httpBackend.when('GET', '/auth.py') - .respond({userId: 'userX'}, {'A-Token': 'xxx'}); - - // Get hold of a scope (i.e. the root scope) - $rootScope = $injector.get('$rootScope'); - // The $controller service is used to create instances of controllers - var $controller = $injector.get('$controller'); - - createController = function() { - return $controller('MyController', {'$scope' : $rootScope }); - }; - })); - - - afterEach(function() { - $httpBackend.verifyNoOutstandingExpectation(); - $httpBackend.verifyNoOutstandingRequest(); - }); - - - it('should fetch authentication token', function() { - $httpBackend.expectGET('/auth.py'); - var controller = createController(); - $httpBackend.flush(); - }); - - - it('should fail authentication', function() { - - // Notice how you can change the response even after it was set - authRequestHandler.respond(401, ''); - - $httpBackend.expectGET('/auth.py'); - var controller = createController(); - $httpBackend.flush(); - expect($rootScope.status).toBe('Failed...'); - }); - - - it('should send msg to server', function() { - var controller = createController(); - $httpBackend.flush(); - - // now you don’t care about the authentication, but - // the controller will still send the request and - // $httpBackend will respond without you having to - // specify the expectation and response for this request - - $httpBackend.expectPOST('/add-msg.py', 'message content').respond(201, ''); - $rootScope.saveMessage('message content'); - expect($rootScope.status).toBe('Saving...'); - $httpBackend.flush(); - expect($rootScope.status).toBe(''); - }); - - - it('should send auth header', function() { - var controller = createController(); - $httpBackend.flush(); - - $httpBackend.expectPOST('/add-msg.py', undefined, function(headers) { - // check if the header was sent, if it wasn't the expectation won't - // match the request and the test will fail - return headers['Authorization'] == 'xxx'; - }).respond(201, ''); - - $rootScope.saveMessage('whatever'); - $httpBackend.flush(); - }); - }); - ``` - * - * ## Dynamic responses - * - * You define a response to a request by chaining a call to `respond()` onto a definition or expectation. - * If you provide a **callback** as the first parameter to `respond(callback)` then you can dynamically generate - * a response based on the properties of the request. - * - * The `callback` function should be of the form `function(method, url, data, headers, params)`. - * - * ### Query parameters - * - * By default, query parameters on request URLs are parsed into the `params` object. So a request URL - * of `/list?q=searchstr&orderby=-name` would set `params` to be `{q: 'searchstr', orderby: '-name'}`. - * - * ### Regex parameter matching - * - * If an expectation or definition uses a **regex** to match the URL, you can provide an array of **keys** via a - * `params` argument. The index of each **key** in the array will match the index of a **group** in the - * **regex**. - * - * The `params` object in the **callback** will now have properties with these keys, which hold the value of the - * corresponding **group** in the **regex**. - * - * This also applies to the `when` and `expect` shortcut methods. - * - * - * ```js - * $httpBackend.expect('GET', /\/user\/(.+)/, undefined, undefined, ['id']) - * .respond(function(method, url, data, headers, params) { - * // for requested url of '/user/1234' params is {id: '1234'} - * }); - * - * $httpBackend.whenPATCH(/\/user\/(.+)\/article\/(.+)/, undefined, undefined, ['user', 'article']) - * .respond(function(method, url, data, headers, params) { - * // for url of '/user/1234/article/567' params is {user: '1234', article: '567'} - * }); - * ``` - * - * ## Matching route requests - * - * For extra convenience, `whenRoute` and `expectRoute` shortcuts are available. These methods offer colon - * delimited matching of the url path, ignoring the query string. This allows declarations - * similar to how application routes are configured with `$routeProvider`. Because these methods convert - * the definition url to regex, declaration order is important. Combined with query parameter parsing, - * the following is possible: - * - ```js - $httpBackend.whenRoute('GET', '/users/:id') - .respond(function(method, url, data, headers, params) { - return [200, MockUserList[Number(params.id)]]; - }); - - $httpBackend.whenRoute('GET', '/users') - .respond(function(method, url, data, headers, params) { - var userList = angular.copy(MockUserList), - defaultSort = 'lastName', - count, pages, isPrevious, isNext; - - // paged api response '/v1/users?page=2' - params.page = Number(params.page) || 1; - - // query for last names '/v1/users?q=Archer' - if (params.q) { - userList = $filter('filter')({lastName: params.q}); - } - - pages = Math.ceil(userList.length / pagingLength); - isPrevious = params.page > 1; - isNext = params.page < pages; - - return [200, { - count: userList.length, - previous: isPrevious, - next: isNext, - // sort field -> '/v1/users?sortBy=firstName' - results: $filter('orderBy')(userList, params.sortBy || defaultSort) - .splice((params.page - 1) * pagingLength, pagingLength) - }]; - }); - ``` - */ -angular.mock.$HttpBackendProvider = function() { - this.$get = ['$rootScope', '$timeout', createHttpBackendMock]; -}; - -/** - * General factory function for $httpBackend mock. - * Returns instance for unit testing (when no arguments specified): - * - passing through is disabled - * - auto flushing is disabled - * - * Returns instance for e2e testing (when `$delegate` and `$browser` specified): - * - passing through (delegating request to real backend) is enabled - * - auto flushing is enabled - * - * @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified) - * @param {Object=} $browser Auto-flushing enabled if specified - * @return {Object} Instance of $httpBackend mock - */ -function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) { - var definitions = [], - expectations = [], - responses = [], - responsesPush = angular.bind(responses, responses.push), - copy = angular.copy; - - function createResponse(status, data, headers, statusText) { - if (angular.isFunction(status)) return status; - - return function() { - return angular.isNumber(status) - ? [status, data, headers, statusText] - : [200, status, data, headers]; - }; - } - - // TODO(vojta): change params to: method, url, data, headers, callback - function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) { - - var xhr = new MockXhr(), - expectation = expectations[0], - wasExpected = false; - - xhr.$$events = eventHandlers; - xhr.upload.$$events = uploadEventHandlers; - - function prettyPrint(data) { - return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp) - ? data - : angular.toJson(data); - } - - function wrapResponse(wrapped) { - if (!$browser && timeout) { - timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout); - } - - return handleResponse; - - function handleResponse() { - var response = wrapped.response(method, url, data, headers, wrapped.params(url)); - xhr.$$respHeaders = response[2]; - callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(), - copy(response[3] || '')); - } - - function handleTimeout() { - for (var i = 0, ii = responses.length; i < ii; i++) { - if (responses[i] === handleResponse) { - responses.splice(i, 1); - callback(-1, undefined, ''); - break; - } - } - } - } - - if (expectation && expectation.match(method, url)) { - if (!expectation.matchData(data)) { - throw new Error('Expected ' + expectation + ' with different data\n' + - 'EXPECTED: ' + prettyPrint(expectation.data) + '\nGOT: ' + data); - } - - if (!expectation.matchHeaders(headers)) { - throw new Error('Expected ' + expectation + ' with different headers\n' + - 'EXPECTED: ' + prettyPrint(expectation.headers) + '\nGOT: ' + - prettyPrint(headers)); - } - - expectations.shift(); - - if (expectation.response) { - responses.push(wrapResponse(expectation)); - return; - } - wasExpected = true; - } - - var i = -1, definition; - while ((definition = definitions[++i])) { - if (definition.match(method, url, data, headers || {})) { - if (definition.response) { - // if $browser specified, we do auto flush all requests - ($browser ? $browser.defer : responsesPush)(wrapResponse(definition)); - } else if (definition.passThrough) { - $delegate(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers); - } else throw new Error('No response defined !'); - return; - } - } - throw wasExpected ? - new Error('No response defined !') : - new Error('Unexpected request: ' + method + ' ' + url + '\n' + - (expectation ? 'Expected ' + expectation : 'No more request expected')); - } - - /** - * @ngdoc method - * @name $httpBackend#when - * @description - * Creates a new backend definition. - * - * @param {string} method HTTP method. - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives - * data string and returns true if the data is as expected. - * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header - * object and returns true if the headers match the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - * - * - respond – - * ```js - * {function([status,] data[, headers, statusText]) - * | function(function(method, url, data, headers, params)} - * ``` - * – The respond method takes a set of static data to be returned or a function that can - * return an array containing response status (number), response data (Array|Object|string), - * response headers (Object), and the text for the status (string). The respond method returns - * the `requestHandler` object for possible overrides. - */ - $httpBackend.when = function(method, url, data, headers, keys) { - var definition = new MockHttpExpectation(method, url, data, headers, keys), - chain = { - respond: function(status, data, headers, statusText) { - definition.passThrough = undefined; - definition.response = createResponse(status, data, headers, statusText); - return chain; - } - }; - - if ($browser) { - chain.passThrough = function() { - definition.response = undefined; - definition.passThrough = true; - return chain; - }; - } - - definitions.push(definition); - return chain; - }; - - /** - * @ngdoc method - * @name $httpBackend#whenGET - * @description - * Creates a new backend definition for GET requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenHEAD - * @description - * Creates a new backend definition for HEAD requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenDELETE - * @description - * Creates a new backend definition for DELETE requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenPOST - * @description - * Creates a new backend definition for POST requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives - * data string and returns true if the data is as expected. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenPUT - * @description - * Creates a new backend definition for PUT requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives - * data string and returns true if the data is as expected. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenJSONP - * @description - * Creates a new backend definition for JSONP requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - createShortMethods('when'); - - /** - * @ngdoc method - * @name $httpBackend#whenRoute - * @description - * Creates a new backend definition that compares only with the requested route. - * - * @param {string} method HTTP method. - * @param {string} url HTTP url string that supports colon param matching. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. See #when for more info. - */ - $httpBackend.whenRoute = function(method, url) { - var pathObj = parseRoute(url); - return $httpBackend.when(method, pathObj.regexp, undefined, undefined, pathObj.keys); - }; - - function parseRoute(url) { - var ret = { - regexp: url - }, - keys = ret.keys = []; - - if (!url || !angular.isString(url)) return ret; - - url = url - .replace(/([().])/g, '\\$1') - .replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option) { - var optional = option === '?' ? option : null; - var star = option === '*' ? option : null; - keys.push({ name: key, optional: !!optional }); - slash = slash || ''; - return '' - + (optional ? '' : slash) - + '(?:' - + (optional ? slash : '') - + (star && '(.+?)' || '([^/]+)') - + (optional || '') - + ')' - + (optional || ''); - }) - .replace(/([\/$\*])/g, '\\$1'); - - ret.regexp = new RegExp('^' + url, 'i'); - return ret; - } - - /** - * @ngdoc method - * @name $httpBackend#expect - * @description - * Creates a new request expectation. - * - * @param {string} method HTTP method. - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header - * object and returns true if the headers match the current expectation. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - * - * - respond – - * ``` - * { function([status,] data[, headers, statusText]) - * | function(function(method, url, data, headers, params)} - * ``` - * – The respond method takes a set of static data to be returned or a function that can - * return an array containing response status (number), response data (Array|Object|string), - * response headers (Object), and the text for the status (string). The respond method returns - * the `requestHandler` object for possible overrides. - */ - $httpBackend.expect = function(method, url, data, headers, keys) { - var expectation = new MockHttpExpectation(method, url, data, headers, keys), - chain = { - respond: function(status, data, headers, statusText) { - expectation.response = createResponse(status, data, headers, statusText); - return chain; - } - }; - - expectations.push(expectation); - return chain; - }; - - /** - * @ngdoc method - * @name $httpBackend#expectGET - * @description - * Creates a new request expectation for GET requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. See #expect for more info. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectHEAD - * @description - * Creates a new request expectation for HEAD requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectDELETE - * @description - * Creates a new request expectation for DELETE requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectPOST - * @description - * Creates a new request expectation for POST requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectPUT - * @description - * Creates a new request expectation for PUT requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectPATCH - * @description - * Creates a new request expectation for PATCH requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectJSONP - * @description - * Creates a new request expectation for JSONP requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives an url - * and returns true if the url matches the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - createShortMethods('expect'); - - /** - * @ngdoc method - * @name $httpBackend#expectRoute - * @description - * Creates a new request expectation that compares only with the requested route. - * - * @param {string} method HTTP method. - * @param {string} url HTTP url string that supports colon param matching. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. See #expect for more info. - */ - $httpBackend.expectRoute = function(method, url) { - var pathObj = parseRoute(url); - return $httpBackend.expect(method, pathObj.regexp, undefined, undefined, pathObj.keys); - }; - - - /** - * @ngdoc method - * @name $httpBackend#flush - * @description - * Flushes all pending requests using the trained responses. - * - * @param {number=} count Number of responses to flush (in the order they arrived). If undefined, - * all pending requests will be flushed. If there are no pending requests when the flush method - * is called an exception is thrown (as this typically a sign of programming error). - */ - $httpBackend.flush = function(count, digest) { - if (digest !== false) $rootScope.$digest(); - if (!responses.length) throw new Error('No pending request to flush !'); - - if (angular.isDefined(count) && count !== null) { - while (count--) { - if (!responses.length) throw new Error('No more pending request to flush !'); - responses.shift()(); - } - } else { - while (responses.length) { - responses.shift()(); - } - } - $httpBackend.verifyNoOutstandingExpectation(digest); - }; - - - /** - * @ngdoc method - * @name $httpBackend#verifyNoOutstandingExpectation - * @description - * Verifies that all of the requests defined via the `expect` api were made. If any of the - * requests were not made, verifyNoOutstandingExpectation throws an exception. - * - * Typically, you would call this method following each test case that asserts requests using an - * "afterEach" clause. - * - * ```js - * afterEach($httpBackend.verifyNoOutstandingExpectation); - * ``` - */ - $httpBackend.verifyNoOutstandingExpectation = function(digest) { - if (digest !== false) $rootScope.$digest(); - if (expectations.length) { - throw new Error('Unsatisfied requests: ' + expectations.join(', ')); - } - }; - - - /** - * @ngdoc method - * @name $httpBackend#verifyNoOutstandingRequest - * @description - * Verifies that there are no outstanding requests that need to be flushed. - * - * Typically, you would call this method following each test case that asserts requests using an - * "afterEach" clause. - * - * ```js - * afterEach($httpBackend.verifyNoOutstandingRequest); - * ``` - */ - $httpBackend.verifyNoOutstandingRequest = function() { - if (responses.length) { - throw new Error('Unflushed requests: ' + responses.length); - } - }; - - - /** - * @ngdoc method - * @name $httpBackend#resetExpectations - * @description - * Resets all request expectations, but preserves all backend definitions. Typically, you would - * call resetExpectations during a multiple-phase test when you want to reuse the same instance of - * $httpBackend mock. - */ - $httpBackend.resetExpectations = function() { - expectations.length = 0; - responses.length = 0; - }; - - return $httpBackend; - - - function createShortMethods(prefix) { - angular.forEach(['GET', 'DELETE', 'JSONP', 'HEAD'], function(method) { - $httpBackend[prefix + method] = function(url, headers, keys) { - return $httpBackend[prefix](method, url, undefined, headers, keys); - }; - }); - - angular.forEach(['PUT', 'POST', 'PATCH'], function(method) { - $httpBackend[prefix + method] = function(url, data, headers, keys) { - return $httpBackend[prefix](method, url, data, headers, keys); - }; - }); - } -} - -function MockHttpExpectation(method, url, data, headers, keys) { - - function getUrlParams(u) { - var params = u.slice(u.indexOf('?') + 1).split('&'); - return params.sort(); - } - - function compareUrl(u) { - return (url.slice(0, url.indexOf('?')) == u.slice(0, u.indexOf('?')) && getUrlParams(url).join() == getUrlParams(u).join()); - } - - this.data = data; - this.headers = headers; - - this.match = function(m, u, d, h) { - if (method != m) return false; - if (!this.matchUrl(u)) return false; - if (angular.isDefined(d) && !this.matchData(d)) return false; - if (angular.isDefined(h) && !this.matchHeaders(h)) return false; - return true; - }; - - this.matchUrl = function(u) { - if (!url) return true; - if (angular.isFunction(url.test)) return url.test(u); - if (angular.isFunction(url)) return url(u); - return (url == u || compareUrl(u)); - }; - - this.matchHeaders = function(h) { - if (angular.isUndefined(headers)) return true; - if (angular.isFunction(headers)) return headers(h); - return angular.equals(headers, h); - }; - - this.matchData = function(d) { - if (angular.isUndefined(data)) return true; - if (data && angular.isFunction(data.test)) return data.test(d); - if (data && angular.isFunction(data)) return data(d); - if (data && !angular.isString(data)) { - return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d)); - } - return data == d; - }; - - this.toString = function() { - return method + ' ' + url; - }; - - this.params = function(u) { - return angular.extend(parseQuery(), pathParams()); - - function pathParams() { - var keyObj = {}; - if (!url || !angular.isFunction(url.test) || !keys || keys.length === 0) return keyObj; - - var m = url.exec(u); - if (!m) return keyObj; - for (var i = 1, len = m.length; i < len; ++i) { - var key = keys[i - 1]; - var val = m[i]; - if (key && val) { - keyObj[key.name || key] = val; - } - } - - return keyObj; - } - - function parseQuery() { - var obj = {}, key_value, key, - queryStr = u.indexOf('?') > -1 - ? u.substring(u.indexOf('?') + 1) - : ""; - - angular.forEach(queryStr.split('&'), function(keyValue) { - if (keyValue) { - key_value = keyValue.replace(/\+/g,'%20').split('='); - key = tryDecodeURIComponent(key_value[0]); - if (angular.isDefined(key)) { - var val = angular.isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true; - if (!hasOwnProperty.call(obj, key)) { - obj[key] = val; - } else if (angular.isArray(obj[key])) { - obj[key].push(val); - } else { - obj[key] = [obj[key],val]; - } - } - } - }); - return obj; - } - function tryDecodeURIComponent(value) { - try { - return decodeURIComponent(value); - } catch (e) { - // Ignore any invalid uri component - } - } - }; -} - -function createMockXhr() { - return new MockXhr(); -} - -function MockXhr() { - - // hack for testing $http, $httpBackend - MockXhr.$$lastInstance = this; - - this.open = function(method, url, async) { - this.$$method = method; - this.$$url = url; - this.$$async = async; - this.$$reqHeaders = {}; - this.$$respHeaders = {}; - }; - - this.send = function(data) { - this.$$data = data; - }; - - this.setRequestHeader = function(key, value) { - this.$$reqHeaders[key] = value; - }; - - this.getResponseHeader = function(name) { - // the lookup must be case insensitive, - // that's why we try two quick lookups first and full scan last - var header = this.$$respHeaders[name]; - if (header) return header; - - name = angular.lowercase(name); - header = this.$$respHeaders[name]; - if (header) return header; - - header = undefined; - angular.forEach(this.$$respHeaders, function(headerVal, headerName) { - if (!header && angular.lowercase(headerName) == name) header = headerVal; - }); - return header; - }; - - this.getAllResponseHeaders = function() { - var lines = []; - - angular.forEach(this.$$respHeaders, function(value, key) { - lines.push(key + ': ' + value); - }); - return lines.join('\n'); - }; - - this.abort = angular.noop; - - // This section simulates the events on a real XHR object (and the upload object) - // When we are testing $httpBackend (inside the angular project) we make partial use of this - // but store the events directly ourselves on `$$events`, instead of going through the `addEventListener` - this.$$events = {}; - this.addEventListener = function(name, listener) { - if (angular.isUndefined(this.$$events[name])) this.$$events[name] = []; - this.$$events[name].push(listener); - }; - - this.upload = { - $$events: {}, - addEventListener: this.addEventListener - }; -} - - -/** - * @ngdoc service - * @name $timeout - * @description - * - * This service is just a simple decorator for {@link ng.$timeout $timeout} service - * that adds a "flush" and "verifyNoPendingTasks" methods. - */ - -angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $browser) { - - /** - * @ngdoc method - * @name $timeout#flush - * @description - * - * Flushes the queue of pending tasks. - * - * @param {number=} delay maximum timeout amount to flush up until - */ - $delegate.flush = function(delay) { - $browser.defer.flush(delay); - }; - - /** - * @ngdoc method - * @name $timeout#verifyNoPendingTasks - * @description - * - * Verifies that there are no pending tasks that need to be flushed. - */ - $delegate.verifyNoPendingTasks = function() { - if ($browser.deferredFns.length) { - throw new Error('Deferred tasks to flush (' + $browser.deferredFns.length + '): ' + - formatPendingTasksAsString($browser.deferredFns)); - } - }; - - function formatPendingTasksAsString(tasks) { - var result = []; - angular.forEach(tasks, function(task) { - result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}'); - }); - - return result.join(', '); - } - - return $delegate; -}]; - -angular.mock.$RAFDecorator = ['$delegate', function($delegate) { - var rafFn = function(fn) { - var index = rafFn.queue.length; - rafFn.queue.push(fn); - return function() { - rafFn.queue.splice(index, 1); - }; - }; - - rafFn.queue = []; - rafFn.supported = $delegate.supported; - - rafFn.flush = function() { - if (rafFn.queue.length === 0) { - throw new Error('No rAF callbacks present'); - } - - var length = rafFn.queue.length; - for (var i = 0; i < length; i++) { - rafFn.queue[i](); - } - - rafFn.queue = rafFn.queue.slice(i); - }; - - return rafFn; -}]; - -/** - * - */ -var originalRootElement; -angular.mock.$RootElementProvider = function() { - this.$get = ['$injector', function($injector) { - originalRootElement = angular.element('
      ').data('$injector', $injector); - return originalRootElement; - }]; -}; - -/** - * @ngdoc service - * @name $controller - * @description - * A decorator for {@link ng.$controller} with additional `bindings` parameter, useful when testing - * controllers of directives that use {@link $compile#-bindtocontroller- `bindToController`}. - * - * - * ## Example - * - * ```js - * - * // Directive definition ... - * - * myMod.directive('myDirective', { - * controller: 'MyDirectiveController', - * bindToController: { - * name: '@' - * } - * }); - * - * - * // Controller definition ... - * - * myMod.controller('MyDirectiveController', ['$log', function($log) { - * $log.info(this.name); - * }]); - * - * - * // In a test ... - * - * describe('myDirectiveController', function() { - * it('should write the bound name to the log', inject(function($controller, $log) { - * var ctrl = $controller('MyDirectiveController', { /* no locals */ }, { name: 'Clark Kent' }); - * expect(ctrl.name).toEqual('Clark Kent'); - * expect($log.info.logs).toEqual(['Clark Kent']); - * })); - * }); - * - * ``` - * - * @param {Function|string} constructor If called with a function then it's considered to be the - * controller constructor function. Otherwise it's considered to be a string which is used - * to retrieve the controller constructor using the following steps: - * - * * check if a controller with given name is registered via `$controllerProvider` - * * check if evaluating the string on the current scope returns a constructor - * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global - * `window` object (not recommended) - * - * The string can use the `controller as property` syntax, where the controller instance is published - * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this - * to work correctly. - * - * @param {Object} locals Injection locals for Controller. - * @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used - * to simulate the `bindToController` feature and simplify certain kinds of tests. - * @return {Object} Instance of given controller. - */ -angular.mock.$ControllerDecorator = ['$delegate', function($delegate) { - return function(expression, locals, later, ident) { - if (later && typeof later === 'object') { - var instantiate = $delegate(expression, locals, true, ident); - angular.extend(instantiate.instance, later); - - var instance = instantiate(); - if (instance !== instantiate.instance) { - angular.extend(instance, later); - } - - return instance; - } - return $delegate(expression, locals, later, ident); - }; -}]; - -/** - * @ngdoc service - * @name $componentController - * @description - * A service that can be used to create instances of component controllers. - *
      - * Be aware that the controller will be instantiated and attached to the scope as specified in - * the component definition object. If you do not provide a `$scope` object in the `locals` param - * then the helper will create a new isolated scope as a child of `$rootScope`. - *
      - * @param {string} componentName the name of the component whose controller we want to instantiate - * @param {Object} locals Injection locals for Controller. - * @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used - * to simulate the `bindToController` feature and simplify certain kinds of tests. - * @param {string=} ident Override the property name to use when attaching the controller to the scope. - * @return {Object} Instance of requested controller. - */ -angular.mock.$ComponentControllerProvider = ['$compileProvider', function($compileProvider) { - this.$get = ['$controller','$injector', '$rootScope', function($controller, $injector, $rootScope) { - return function $componentController(componentName, locals, bindings, ident) { - // get all directives associated to the component name - var directives = $injector.get(componentName + 'Directive'); - // look for those directives that are components - var candidateDirectives = directives.filter(function(directiveInfo) { - // components have controller, controllerAs and restrict:'E' - return directiveInfo.controller && directiveInfo.controllerAs && directiveInfo.restrict === 'E'; - }); - // check if valid directives found - if (candidateDirectives.length === 0) { - throw new Error('No component found'); - } - if (candidateDirectives.length > 1) { - throw new Error('Too many components found'); - } - // get the info of the component - var directiveInfo = candidateDirectives[0]; - // create a scope if needed - locals = locals || {}; - locals.$scope = locals.$scope || $rootScope.$new(true); - return $controller(directiveInfo.controller, locals, bindings, ident || directiveInfo.controllerAs); - }; - }]; -}]; - - -/** - * @ngdoc module - * @name ngMock - * @packageName angular-mocks - * @description - * - * # ngMock - * - * The `ngMock` module provides support to inject and mock Angular services into unit tests. - * In addition, ngMock also extends various core ng services such that they can be - * inspected and controlled in a synchronous manner within test code. - * - * - *
      - * - * @installation - * - * First, download the file: - * * [Google CDN](https://developers.google.com/speed/libraries/devguide#angularjs) e.g. - * `"//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-mocks.js"` - * * [NPM](https://www.npmjs.com/) e.g. `npm install angular-mocks@X.Y.Z` - * * [Bower](http://bower.io) e.g. `bower install angular-mocks#X.Y.Z` - * * [code.angularjs.org](https://code.angularjs.org/) (discouraged for production use) e.g. - * `"//code.angularjs.org/X.Y.Z/angular-mocks.js"` - * - * where X.Y.Z is the AngularJS version you are running. - * - * Then, configure your test runner to load `angular-mocks.js` after `angular.js`. - * This example uses Karma: - * - * ``` - * config.set({ - * files: [ - * 'build/angular.js', // and other module files you need - * 'build/angular-mocks.js', - * '', - * '' - * ] - * }); - * ``` - * - * Including the `angular-mocks.js` file automatically adds the `ngMock` module, so your tests - * are ready to go! - */ -angular.module('ngMock', ['ng']).provider({ - $browser: angular.mock.$BrowserProvider, - $exceptionHandler: angular.mock.$ExceptionHandlerProvider, - $log: angular.mock.$LogProvider, - $interval: angular.mock.$IntervalProvider, - $httpBackend: angular.mock.$HttpBackendProvider, - $rootElement: angular.mock.$RootElementProvider, - $componentController: angular.mock.$ComponentControllerProvider -}).config(['$provide', function($provide) { - $provide.decorator('$timeout', angular.mock.$TimeoutDecorator); - $provide.decorator('$$rAF', angular.mock.$RAFDecorator); - $provide.decorator('$rootScope', angular.mock.$RootScopeDecorator); - $provide.decorator('$controller', angular.mock.$ControllerDecorator); -}]); - -/** - * @ngdoc module - * @name ngMockE2E - * @module ngMockE2E - * @packageName angular-mocks - * @description - * - * The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing. - * Currently there is only one mock present in this module - - * the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock. - */ -angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) { - $provide.value('$httpBackend', angular.injector(['ng']).get('$httpBackend')); - $provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator); -}]); - -/** - * @ngdoc service - * @name $httpBackend - * @module ngMockE2E - * @description - * Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of - * applications that use the {@link ng.$http $http service}. - * - *
      - * **Note**: For fake http backend implementation suitable for unit testing please see - * {@link ngMock.$httpBackend unit-testing $httpBackend mock}. - *
      - * - * This implementation can be used to respond with static or dynamic responses via the `when` api - * and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the - * real $httpBackend for specific requests (e.g. to interact with certain remote apis or to fetch - * templates from a webserver). - * - * As opposed to unit-testing, in an end-to-end testing scenario or in scenario when an application - * is being developed with the real backend api replaced with a mock, it is often desirable for - * certain category of requests to bypass the mock and issue a real http request (e.g. to fetch - * templates or static files from the webserver). To configure the backend with this behavior - * use the `passThrough` request handler of `when` instead of `respond`. - * - * Additionally, we don't want to manually have to flush mocked out requests like we do during unit - * testing. For this reason the e2e $httpBackend flushes mocked out requests - * automatically, closely simulating the behavior of the XMLHttpRequest object. - * - * To setup the application to run with this http backend, you have to create a module that depends - * on the `ngMockE2E` and your application modules and defines the fake backend: - * - * ```js - * var myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']); - * myAppDev.run(function($httpBackend) { - * var phones = [{name: 'phone1'}, {name: 'phone2'}]; - * - * // returns the current list of phones - * $httpBackend.whenGET('/phones').respond(phones); - * - * // adds a new phone to the phones array - * $httpBackend.whenPOST('/phones').respond(function(method, url, data) { - * var phone = angular.fromJson(data); - * phones.push(phone); - * return [200, phone, {}]; - * }); - * $httpBackend.whenGET(/^\/templates\//).passThrough(); // Requests for templare are handled by the real server - * //... - * }); - * ``` - * - * Afterwards, bootstrap your app with this new module. - * - * ## Example - * - * - * var myApp = angular.module('myApp', []); - * - * myApp.controller('main', function($http) { - * var ctrl = this; - * - * ctrl.phones = []; - * ctrl.newPhone = { - * name: '' - * }; - * - * ctrl.getPhones = function() { - * $http.get('/phones').then(function(response) { - * ctrl.phones = response.data; - * }); - * }; - * - * ctrl.addPhone = function(phone) { - * $http.post('/phones', phone).then(function() { - * ctrl.newPhone = {name: ''}; - * return ctrl.getPhones(); - * }); - * }; - * - * ctrl.getPhones(); - * }); - * - * - * var myAppDev = angular.module('myAppE2E', ['myApp', 'ngMockE2E']); - * - * myAppDev.run(function($httpBackend) { - * var phones = [{name: 'phone1'}, {name: 'phone2'}]; - * - * // returns the current list of phones - * $httpBackend.whenGET('/phones').respond(phones); - * - * // adds a new phone to the phones array - * $httpBackend.whenPOST('/phones').respond(function(method, url, data) { - * var phone = angular.fromJson(data); - * phones.push(phone); - * return [200, phone, {}]; - * }); - * }); - * - * - *
      - *
      - * - * - *
      - *

      Phones

      - *
        - *
      • {{phone.name}}
      • - *
      - *
      - *
      - *
      - * - * - */ - -/** - * @ngdoc method - * @name $httpBackend#when - * @module ngMockE2E - * @description - * Creates a new backend definition. - * - * @param {string} method HTTP method. - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header - * object and returns true if the headers match the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - * - * - respond – - * ``` - * { function([status,] data[, headers, statusText]) - * | function(function(method, url, data, headers, params)} - * ``` - * – The respond method takes a set of static data to be returned or a function that can return - * an array containing response status (number), response data (Array|Object|string), response - * headers (Object), and the text for the status (string). - * - passThrough – `{function()}` – Any request matching a backend definition with - * `passThrough` handler will be passed through to the real backend (an XHR request will be made - * to the server.) - * - Both methods return the `requestHandler` object for possible overrides. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenGET - * @module ngMockE2E - * @description - * Creates a new backend definition for GET requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenHEAD - * @module ngMockE2E - * @description - * Creates a new backend definition for HEAD requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenDELETE - * @module ngMockE2E - * @description - * Creates a new backend definition for DELETE requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenPOST - * @module ngMockE2E - * @description - * Creates a new backend definition for POST requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenPUT - * @module ngMockE2E - * @description - * Creates a new backend definition for PUT requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenPATCH - * @module ngMockE2E - * @description - * Creates a new backend definition for PATCH requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenJSONP - * @module ngMockE2E - * @description - * Creates a new backend definition for JSONP requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ -/** - * @ngdoc method - * @name $httpBackend#whenRoute - * @module ngMockE2E - * @description - * Creates a new backend definition that compares only with the requested route. - * - * @param {string} method HTTP method. - * @param {string} url HTTP url string that supports colon param matching. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ -angular.mock.e2e = {}; -angular.mock.e2e.$httpBackendDecorator = - ['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock]; - - -/** - * @ngdoc type - * @name $rootScope.Scope - * @module ngMock - * @description - * {@link ng.$rootScope.Scope Scope} type decorated with helper methods useful for testing. These - * methods are automatically available on any {@link ng.$rootScope.Scope Scope} instance when - * `ngMock` module is loaded. - * - * In addition to all the regular `Scope` methods, the following helper methods are available: - */ -angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) { - - var $rootScopePrototype = Object.getPrototypeOf($delegate); - - $rootScopePrototype.$countChildScopes = countChildScopes; - $rootScopePrototype.$countWatchers = countWatchers; - - return $delegate; - - // ------------------------------------------------------------------------------------------ // - - /** - * @ngdoc method - * @name $rootScope.Scope#$countChildScopes - * @module ngMock - * @description - * Counts all the direct and indirect child scopes of the current scope. - * - * The current scope is excluded from the count. The count includes all isolate child scopes. - * - * @returns {number} Total number of child scopes. - */ - function countChildScopes() { - // jshint validthis: true - var count = 0; // exclude the current scope - var pendingChildHeads = [this.$$childHead]; - var currentScope; - - while (pendingChildHeads.length) { - currentScope = pendingChildHeads.shift(); - - while (currentScope) { - count += 1; - pendingChildHeads.push(currentScope.$$childHead); - currentScope = currentScope.$$nextSibling; - } - } - - return count; - } - - - /** - * @ngdoc method - * @name $rootScope.Scope#$countWatchers - * @module ngMock - * @description - * Counts all the watchers of direct and indirect child scopes of the current scope. - * - * The watchers of the current scope are included in the count and so are all the watchers of - * isolate child scopes. - * - * @returns {number} Total number of watchers. - */ - function countWatchers() { - // jshint validthis: true - var count = this.$$watchers ? this.$$watchers.length : 0; // include the current scope - var pendingChildHeads = [this.$$childHead]; - var currentScope; - - while (pendingChildHeads.length) { - currentScope = pendingChildHeads.shift(); - - while (currentScope) { - count += currentScope.$$watchers ? currentScope.$$watchers.length : 0; - pendingChildHeads.push(currentScope.$$childHead); - currentScope = currentScope.$$nextSibling; - } - } - - return count; - } -}]; - - -!(function(jasmineOrMocha) { - - if (!jasmineOrMocha) { - return; - } - - var currentSpec = null, - injectorState = new InjectorState(), - annotatedFunctions = [], - wasInjectorCreated = function() { - return !!currentSpec; - }; - - angular.mock.$$annotate = angular.injector.$$annotate; - angular.injector.$$annotate = function(fn) { - if (typeof fn === 'function' && !fn.$inject) { - annotatedFunctions.push(fn); - } - return angular.mock.$$annotate.apply(this, arguments); - }; - - /** - * @ngdoc function - * @name angular.mock.module - * @description - * - * *NOTE*: This function is also published on window for easy access.
      - * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha - * - * This function registers a module configuration code. It collects the configuration information - * which will be used when the injector is created by {@link angular.mock.inject inject}. - * - * See {@link angular.mock.inject inject} for usage example - * - * @param {...(string|Function|Object)} fns any number of modules which are represented as string - * aliases or as anonymous module initialization functions. The modules are used to - * configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. If an - * object literal is passed each key-value pair will be registered on the module via - * {@link auto.$provide $provide}.value, the key being the string name (or token) to associate - * with the value on the injector. - */ - var module = window.module = angular.mock.module = function() { - var moduleFns = Array.prototype.slice.call(arguments, 0); - return wasInjectorCreated() ? workFn() : workFn; - ///////////////////// - function workFn() { - if (currentSpec.$injector) { - throw new Error('Injector already created, can not register a module!'); - } else { - var fn, modules = currentSpec.$modules || (currentSpec.$modules = []); - angular.forEach(moduleFns, function(module) { - if (angular.isObject(module) && !angular.isArray(module)) { - fn = ['$provide', function($provide) { - angular.forEach(module, function(value, key) { - $provide.value(key, value); - }); - }]; - } else { - fn = module; - } - if (currentSpec.$providerInjector) { - currentSpec.$providerInjector.invoke(fn); - } else { - modules.push(fn); - } - }); - } - } - }; - - module.$$beforeAllHook = (window.before || window.beforeAll); - module.$$afterAllHook = (window.after || window.afterAll); - - // purely for testing ngMock itself - module.$$currentSpec = function(to) { - if (arguments.length === 0) return to; - currentSpec = to; - }; - - /** - * @ngdoc function - * @name angular.mock.module.sharedInjector - * @description - * - * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha - * - * This function ensures a single injector will be used for all tests in a given describe context. - * This contrasts with the default behaviour where a new injector is created per test case. - * - * Use sharedInjector when you want to take advantage of Jasmine's `beforeAll()`, or mocha's - * `before()` methods. Call `module.sharedInjector()` before you setup any other hooks that - * will create (i.e call `module()`) or use (i.e call `inject()`) the injector. - * - * You cannot call `sharedInjector()` from within a context already using `sharedInjector()`. - * - * ## Example - * - * Typically beforeAll is used to make many assertions about a single operation. This can - * cut down test run-time as the test setup doesn't need to be re-run, and enabling focussed - * tests each with a single assertion. - * - * ```js - * describe("Deep Thought", function() { - * - * module.sharedInjector(); - * - * beforeAll(module("UltimateQuestion")); - * - * beforeAll(inject(function(DeepThought) { - * expect(DeepThought.answer).toBeUndefined(); - * DeepThought.generateAnswer(); - * })); - * - * it("has calculated the answer correctly", inject(function(DeepThought) { - * // Because of sharedInjector, we have access to the instance of the DeepThought service - * // that was provided to the beforeAll() hook. Therefore we can test the generated answer - * expect(DeepThought.answer).toBe(42); - * })); - * - * it("has calculated the answer within the expected time", inject(function(DeepThought) { - * expect(DeepThought.runTimeMillennia).toBeLessThan(8000); - * })); - * - * it("has double checked the answer", inject(function(DeepThought) { - * expect(DeepThought.absolutelySureItIsTheRightAnswer).toBe(true); - * })); - * - * }); - * - * ``` - */ - module.sharedInjector = function() { - if (!(module.$$beforeAllHook && module.$$afterAllHook)) { - throw Error("sharedInjector() cannot be used unless your test runner defines beforeAll/afterAll"); - } - - var initialized = false; - - module.$$beforeAllHook(function() { - if (injectorState.shared) { - injectorState.sharedError = Error("sharedInjector() cannot be called inside a context that has already called sharedInjector()"); - throw injectorState.sharedError; - } - initialized = true; - currentSpec = this; - injectorState.shared = true; - }); - - module.$$afterAllHook(function() { - if (initialized) { - injectorState = new InjectorState(); - module.$$cleanup(); - } else { - injectorState.sharedError = null; - } - }); - }; - - module.$$beforeEach = function() { - if (injectorState.shared && currentSpec && currentSpec != this) { - var state = currentSpec; - currentSpec = this; - angular.forEach(["$injector","$modules","$providerInjector", "$injectorStrict"], function(k) { - currentSpec[k] = state[k]; - state[k] = null; - }); - } else { - currentSpec = this; - originalRootElement = null; - annotatedFunctions = []; - } - }; - - module.$$afterEach = function() { - if (injectorState.cleanupAfterEach()) { - module.$$cleanup(); - } - }; - - module.$$cleanup = function() { - var injector = currentSpec.$injector; - - annotatedFunctions.forEach(function(fn) { - delete fn.$inject; - }); - - angular.forEach(currentSpec.$modules, function(module) { - if (module && module.$$hashKey) { - module.$$hashKey = undefined; - } - }); - - currentSpec.$injector = null; - currentSpec.$modules = null; - currentSpec.$providerInjector = null; - currentSpec = null; - - if (injector) { - // Ensure `$rootElement` is instantiated, before checking `originalRootElement` - var $rootElement = injector.get('$rootElement'); - var rootNode = $rootElement && $rootElement[0]; - var cleanUpNodes = !originalRootElement ? [] : [originalRootElement[0]]; - if (rootNode && (!originalRootElement || rootNode !== originalRootElement[0])) { - cleanUpNodes.push(rootNode); - } - angular.element.cleanData(cleanUpNodes); - - // Ensure `$destroy()` is available, before calling it - // (a mocked `$rootScope` might not implement it (or not even be an object at all)) - var $rootScope = injector.get('$rootScope'); - if ($rootScope && $rootScope.$destroy) $rootScope.$destroy(); - } - - // clean up jquery's fragment cache - angular.forEach(angular.element.fragments, function(val, key) { - delete angular.element.fragments[key]; - }); - - MockXhr.$$lastInstance = null; - - angular.forEach(angular.callbacks, function(val, key) { - delete angular.callbacks[key]; - }); - angular.callbacks.$$counter = 0; - }; - - (window.beforeEach || window.setup)(module.$$beforeEach); - (window.afterEach || window.teardown)(module.$$afterEach); - - /** - * @ngdoc function - * @name angular.mock.inject - * @description - * - * *NOTE*: This function is also published on window for easy access.
      - * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha - * - * The inject function wraps a function into an injectable function. The inject() creates new - * instance of {@link auto.$injector $injector} per test, which is then used for - * resolving references. - * - * - * ## Resolving References (Underscore Wrapping) - * Often, we would like to inject a reference once, in a `beforeEach()` block and reuse this - * in multiple `it()` clauses. To be able to do this we must assign the reference to a variable - * that is declared in the scope of the `describe()` block. Since we would, most likely, want - * the variable to have the same name of the reference we have a problem, since the parameter - * to the `inject()` function would hide the outer variable. - * - * To help with this, the injected parameters can, optionally, be enclosed with underscores. - * These are ignored by the injector when the reference name is resolved. - * - * For example, the parameter `_myService_` would be resolved as the reference `myService`. - * Since it is available in the function body as _myService_, we can then assign it to a variable - * defined in an outer scope. - * - * ``` - * // Defined out reference variable outside - * var myService; - * - * // Wrap the parameter in underscores - * beforeEach( inject( function(_myService_){ - * myService = _myService_; - * })); - * - * // Use myService in a series of tests. - * it('makes use of myService', function() { - * myService.doStuff(); - * }); - * - * ``` - * - * See also {@link angular.mock.module angular.mock.module} - * - * ## Example - * Example of what a typical jasmine tests looks like with the inject method. - * ```js - * - * angular.module('myApplicationModule', []) - * .value('mode', 'app') - * .value('version', 'v1.0.1'); - * - * - * describe('MyApp', function() { - * - * // You need to load modules that you want to test, - * // it loads only the "ng" module by default. - * beforeEach(module('myApplicationModule')); - * - * - * // inject() is used to inject arguments of all given functions - * it('should provide a version', inject(function(mode, version) { - * expect(version).toEqual('v1.0.1'); - * expect(mode).toEqual('app'); - * })); - * - * - * // The inject and module method can also be used inside of the it or beforeEach - * it('should override a version and test the new version is injected', function() { - * // module() takes functions or strings (module aliases) - * module(function($provide) { - * $provide.value('version', 'overridden'); // override version here - * }); - * - * inject(function(version) { - * expect(version).toEqual('overridden'); - * }); - * }); - * }); - * - * ``` - * - * @param {...Function} fns any number of functions which will be injected using the injector. - */ - - - - var ErrorAddingDeclarationLocationStack = function(e, errorForStack) { - this.message = e.message; - this.name = e.name; - if (e.line) this.line = e.line; - if (e.sourceId) this.sourceId = e.sourceId; - if (e.stack && errorForStack) - this.stack = e.stack + '\n' + errorForStack.stack; - if (e.stackArray) this.stackArray = e.stackArray; - }; - ErrorAddingDeclarationLocationStack.prototype = Error.prototype; - - window.inject = angular.mock.inject = function() { - var blockFns = Array.prototype.slice.call(arguments, 0); - var errorForStack = new Error('Declaration Location'); - // IE10+ and PhanthomJS do not set stack trace information, until the error is thrown - if (!errorForStack.stack) { - try { - throw errorForStack; - } catch (e) {} - } - return wasInjectorCreated() ? workFn.call(currentSpec) : workFn; - ///////////////////// - function workFn() { - var modules = currentSpec.$modules || []; - var strictDi = !!currentSpec.$injectorStrict; - modules.unshift(['$injector', function($injector) { - currentSpec.$providerInjector = $injector; - }]); - modules.unshift('ngMock'); - modules.unshift('ng'); - var injector = currentSpec.$injector; - if (!injector) { - if (strictDi) { - // If strictDi is enabled, annotate the providerInjector blocks - angular.forEach(modules, function(moduleFn) { - if (typeof moduleFn === "function") { - angular.injector.$$annotate(moduleFn); - } - }); - } - injector = currentSpec.$injector = angular.injector(modules, strictDi); - currentSpec.$injectorStrict = strictDi; - } - for (var i = 0, ii = blockFns.length; i < ii; i++) { - if (currentSpec.$injectorStrict) { - // If the injector is strict / strictDi, and the spec wants to inject using automatic - // annotation, then annotate the function here. - injector.annotate(blockFns[i]); - } - try { - /* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */ - injector.invoke(blockFns[i] || angular.noop, this); - /* jshint +W040 */ - } catch (e) { - if (e.stack && errorForStack) { - throw new ErrorAddingDeclarationLocationStack(e, errorForStack); - } - throw e; - } finally { - errorForStack = null; - } - } - } - }; - - - angular.mock.inject.strictDi = function(value) { - value = arguments.length ? !!value : true; - return wasInjectorCreated() ? workFn() : workFn; - - function workFn() { - if (value !== currentSpec.$injectorStrict) { - if (currentSpec.$injector) { - throw new Error('Injector already created, can not modify strict annotations'); - } else { - currentSpec.$injectorStrict = value; - } - } - } - }; - - function InjectorState() { - this.shared = false; - this.sharedError = null; - - this.cleanupAfterEach = function() { - return !this.shared || this.sharedError; - }; - } -})(window.jasmine || window.mocha); - - -})(window, window.angular); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/bower.json deleted file mode 100644 index 3a3d60a6b0..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/bower.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "angular-mocks", - "version": "1.5.8", - "license": "MIT", - "main": "./angular-mocks.js", - "ignore": [], - "dependencies": { - "angular": "1.5.8" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/ngAnimateMock.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/ngAnimateMock.js deleted file mode 100644 index 6f99e62ef6..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/ngAnimateMock.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./angular-mocks'); -module.exports = 'ngAnimateMock'; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/ngMock.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/ngMock.js deleted file mode 100644 index 7944de7d5b..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/ngMock.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./angular-mocks'); -module.exports = 'ngMock'; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/ngMockE2E.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/ngMockE2E.js deleted file mode 100644 index fc2e539dbd..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/ngMockE2E.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./angular-mocks'); -module.exports = 'ngMockE2E'; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/package.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/package.json deleted file mode 100644 index 631e187985..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-mocks/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "angular-mocks", - "version": "1.5.8", - "description": "AngularJS mocks for testing", - "main": "angular-mocks.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/angular/angular.js.git" - }, - "keywords": [ - "angular", - "framework", - "browser", - "mocks", - "testing", - "client-side" - ], - "author": "Angular Core Team ", - "license": "MIT", - "bugs": { - "url": "https://github.com/angular/angular.js/issues" - }, - "homepage": "http://angularjs.org", - "jspm": { - "shim": { - "angular-mocks": { - "deps": ["angular"] - } - } - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/.bower.json deleted file mode 100644 index 74c6ac5972..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/.bower.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "angular-resource", - "version": "1.5.8", - "license": "MIT", - "main": "./angular-resource.js", - "ignore": [], - "dependencies": { - "angular": "1.5.8" - }, - "homepage": "https://github.com/angular/bower-angular-resource", - "_release": "1.5.8", - "_resolution": { - "type": "version", - "tag": "v1.5.8", - "commit": "26254617a7f9716d80bc2e32117585f33480a4e3" - }, - "_source": "https://github.com/angular/bower-angular-resource.git", - "_target": "1.5.8", - "_originalSource": "angular-resource" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/LICENSE.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/LICENSE.md deleted file mode 100644 index 2c395eef1b..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Angular - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/README.md deleted file mode 100644 index f3bd119ce2..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# packaged angular-resource - -This repo is for distribution on `npm` and `bower`. The source for this module is in the -[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngResource). -Please file issues and pull requests against that repo. - -## Install - -You can install this package either with `npm` or with `bower`. - -### npm - -```shell -npm install angular-resource -``` - -Then add `ngResource` as a dependency for your app: - -```javascript -angular.module('myApp', [require('angular-resource')]); -``` - -### bower - -```shell -bower install angular-resource -``` - -Add a ` -``` - -Then add `ngResource` as a dependency for your app: - -```javascript -angular.module('myApp', ['ngResource']); -``` - -## Documentation - -Documentation is available on the -[AngularJS docs site](http://docs.angularjs.org/api/ngResource). - -## License - -The MIT License - -Copyright (c) 2010-2015 Google, Inc. http://angularjs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/angular-resource.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/angular-resource.js deleted file mode 100644 index e8bb301465..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/angular-resource.js +++ /dev/null @@ -1,863 +0,0 @@ -/** - * @license AngularJS v1.5.8 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -var $resourceMinErr = angular.$$minErr('$resource'); - -// Helper functions and regex to lookup a dotted path on an object -// stopping at undefined/null. The path must be composed of ASCII -// identifiers (just like $parse) -var MEMBER_NAME_REGEX = /^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/; - -function isValidDottedPath(path) { - return (path != null && path !== '' && path !== 'hasOwnProperty' && - MEMBER_NAME_REGEX.test('.' + path)); -} - -function lookupDottedPath(obj, path) { - if (!isValidDottedPath(path)) { - throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path); - } - var keys = path.split('.'); - for (var i = 0, ii = keys.length; i < ii && angular.isDefined(obj); i++) { - var key = keys[i]; - obj = (obj !== null) ? obj[key] : undefined; - } - return obj; -} - -/** - * Create a shallow copy of an object and clear other fields from the destination - */ -function shallowClearAndCopy(src, dst) { - dst = dst || {}; - - angular.forEach(dst, function(value, key) { - delete dst[key]; - }); - - for (var key in src) { - if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) { - dst[key] = src[key]; - } - } - - return dst; -} - -/** - * @ngdoc module - * @name ngResource - * @description - * - * # ngResource - * - * The `ngResource` module provides interaction support with RESTful services - * via the $resource service. - * - * - *
      - * - * See {@link ngResource.$resourceProvider} and {@link ngResource.$resource} for usage. - */ - -/** - * @ngdoc provider - * @name $resourceProvider - * - * @description - * - * Use `$resourceProvider` to change the default behavior of the {@link ngResource.$resource} - * service. - * - * ## Dependencies - * Requires the {@link ngResource } module to be installed. - * - */ - -/** - * @ngdoc service - * @name $resource - * @requires $http - * @requires ng.$log - * @requires $q - * @requires ng.$timeout - * - * @description - * A factory which creates a resource object that lets you interact with - * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources. - * - * The returned resource object has action methods which provide high-level behaviors without - * the need to interact with the low level {@link ng.$http $http} service. - * - * Requires the {@link ngResource `ngResource`} module to be installed. - * - * By default, trailing slashes will be stripped from the calculated URLs, - * which can pose problems with server backends that do not expect that - * behavior. This can be disabled by configuring the `$resourceProvider` like - * this: - * - * ```js - app.config(['$resourceProvider', function($resourceProvider) { - // Don't strip trailing slashes from calculated URLs - $resourceProvider.defaults.stripTrailingSlashes = false; - }]); - * ``` - * - * @param {string} url A parameterized URL template with parameters prefixed by `:` as in - * `/user/:username`. If you are using a URL with a port number (e.g. - * `http://example.com:8080/api`), it will be respected. - * - * If you are using a url with a suffix, just add the suffix, like this: - * `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')` - * or even `$resource('http://example.com/resource/:resource_id.:format')` - * If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be - * collapsed down to a single `.`. If you need this sequence to appear and not collapse then you - * can escape it with `/\.`. - * - * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in - * `actions` methods. If a parameter value is a function, it will be called every time - * a param value needs to be obtained for a request (unless the param was overridden). The function - * will be passed the current data value as an argument. - * - * Each key value in the parameter object is first bound to url template if present and then any - * excess keys are appended to the url search query after the `?`. - * - * Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in - * URL `/path/greet?salutation=Hello`. - * - * If the parameter value is prefixed with `@`, then the value for that parameter will be - * extracted from the corresponding property on the `data` object (provided when calling a - * "non-GET" action method). - * For example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of - * `someParam` will be `data.someProp`. - * Note that the parameter will be ignored, when calling a "GET" action method (i.e. an action - * method that does not accept a request body) - * - * @param {Object.=} actions Hash with declaration of custom actions that should extend - * the default set of resource actions. The declaration should be created in the format of {@link - * ng.$http#usage $http.config}: - * - * {action1: {method:?, params:?, isArray:?, headers:?, ...}, - * action2: {method:?, params:?, isArray:?, headers:?, ...}, - * ...} - * - * Where: - * - * - **`action`** – {string} – The name of action. This name becomes the name of the method on - * your resource object. - * - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`, - * `DELETE`, `JSONP`, etc). - * - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of - * the parameter value is a function, it will be called every time when a param value needs to - * be obtained for a request (unless the param was overridden). The function will be passed the - * current data value as an argument. - * - **`url`** – {string} – action specific `url` override. The url templating is supported just - * like for the resource-level urls. - * - **`isArray`** – {boolean=} – If true then the returned object for this action is an array, - * see `returns` section. - * - **`transformRequest`** – - * `{function(data, headersGetter)|Array.}` – - * transform function or an array of such functions. The transform function takes the http - * request body and headers and returns its transformed (typically serialized) version. - * By default, transformRequest will contain one function that checks if the request data is - * an object and serializes to using `angular.toJson`. To prevent this behavior, set - * `transformRequest` to an empty array: `transformRequest: []` - * - **`transformResponse`** – - * `{function(data, headersGetter)|Array.}` – - * transform function or an array of such functions. The transform function takes the http - * response body and headers and returns its transformed (typically deserialized) version. - * By default, transformResponse will contain one function that checks if the response looks - * like a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, - * set `transformResponse` to an empty array: `transformResponse: []` - * - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the - * GET request, otherwise if a cache instance built with - * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for - * caching. - * - **`timeout`** – `{number}` – timeout in milliseconds.
      - * **Note:** In contrast to {@link ng.$http#usage $http.config}, {@link ng.$q promises} are - * **not** supported in $resource, because the same value would be used for multiple requests. - * If you are looking for a way to cancel requests, you should use the `cancellable` option. - * - **`cancellable`** – `{boolean}` – if set to true, the request made by a "non-instance" call - * will be cancelled (if not already completed) by calling `$cancelRequest()` on the call's - * return value. Calling `$cancelRequest()` for a non-cancellable or an already - * completed/cancelled request will have no effect.
      - * - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the - * XHR object. See - * [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5) - * for more information. - * - **`responseType`** - `{string}` - see - * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType). - * - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods - - * `response` and `responseError`. Both `response` and `responseError` interceptors get called - * with `http response` object. See {@link ng.$http $http interceptors}. - * - * @param {Object} options Hash with custom settings that should extend the - * default `$resourceProvider` behavior. The supported options are: - * - * - **`stripTrailingSlashes`** – {boolean} – If true then the trailing - * slashes from any calculated URL will be stripped. (Defaults to true.) - * - **`cancellable`** – {boolean} – If true, the request made by a "non-instance" call will be - * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return value. - * This can be overwritten per action. (Defaults to false.) - * - * @returns {Object} A resource "class" object with methods for the default set of resource actions - * optionally extended with custom `actions`. The default set contains these actions: - * ```js - * { 'get': {method:'GET'}, - * 'save': {method:'POST'}, - * 'query': {method:'GET', isArray:true}, - * 'remove': {method:'DELETE'}, - * 'delete': {method:'DELETE'} }; - * ``` - * - * Calling these methods invoke an {@link ng.$http} with the specified http method, - * destination and parameters. When the data is returned from the server then the object is an - * instance of the resource class. The actions `save`, `remove` and `delete` are available on it - * as methods with the `$` prefix. This allows you to easily perform CRUD operations (create, - * read, update, delete) on server-side data like this: - * ```js - * var User = $resource('/user/:userId', {userId:'@id'}); - * var user = User.get({userId:123}, function() { - * user.abc = true; - * user.$save(); - * }); - * ``` - * - * It is important to realize that invoking a $resource object method immediately returns an - * empty reference (object or array depending on `isArray`). Once the data is returned from the - * server the existing reference is populated with the actual data. This is a useful trick since - * usually the resource is assigned to a model which is then rendered by the view. Having an empty - * object results in no rendering, once the data arrives from the server then the object is - * populated with the data and the view automatically re-renders itself showing the new data. This - * means that in most cases one never has to write a callback function for the action methods. - * - * The action methods on the class object or instance object can be invoked with the following - * parameters: - * - * - HTTP GET "class" actions: `Resource.action([parameters], [success], [error])` - * - non-GET "class" actions: `Resource.action([parameters], postData, [success], [error])` - * - non-GET instance actions: `instance.$action([parameters], [success], [error])` - * - * - * Success callback is called with (value, responseHeaders) arguments, where the value is - * the populated resource instance or collection object. The error callback is called - * with (httpResponse) argument. - * - * Class actions return empty instance (with additional properties below). - * Instance actions return promise of the action. - * - * The Resource instances and collections have these additional properties: - * - * - `$promise`: the {@link ng.$q promise} of the original server interaction that created this - * instance or collection. - * - * On success, the promise is resolved with the same resource instance or collection object, - * updated with data from server. This makes it easy to use in - * {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view - * rendering until the resource(s) are loaded. - * - * On failure, the promise is rejected with the {@link ng.$http http response} object, without - * the `resource` property. - * - * If an interceptor object was provided, the promise will instead be resolved with the value - * returned by the interceptor. - * - * - `$resolved`: `true` after first server interaction is completed (either with success or - * rejection), `false` before that. Knowing if the Resource has been resolved is useful in - * data-binding. - * - * The Resource instances and collections have these additional methods: - * - * - `$cancelRequest`: If there is a cancellable, pending request related to the instance or - * collection, calling this method will abort the request. - * - * The Resource instances have these additional methods: - * - * - `toJSON`: It returns a simple object without any of the extra properties added as part of - * the Resource API. This object can be serialized through {@link angular.toJson} safely - * without attaching Angular-specific fields. Notice that `JSON.stringify` (and - * `angular.toJson`) automatically use this method when serializing a Resource instance - * (see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON()_behavior)). - * - * @example - * - * # Credit card resource - * - * ```js - // Define CreditCard class - var CreditCard = $resource('/user/:userId/card/:cardId', - {userId:123, cardId:'@id'}, { - charge: {method:'POST', params:{charge:true}} - }); - - // We can retrieve a collection from the server - var cards = CreditCard.query(function() { - // GET: /user/123/card - // server returns: [ {id:456, number:'1234', name:'Smith'} ]; - - var card = cards[0]; - // each item is an instance of CreditCard - expect(card instanceof CreditCard).toEqual(true); - card.name = "J. Smith"; - // non GET methods are mapped onto the instances - card.$save(); - // POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'} - // server returns: {id:456, number:'1234', name: 'J. Smith'}; - - // our custom method is mapped as well. - card.$charge({amount:9.99}); - // POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'} - }); - - // we can create an instance as well - var newCard = new CreditCard({number:'0123'}); - newCard.name = "Mike Smith"; - newCard.$save(); - // POST: /user/123/card {number:'0123', name:'Mike Smith'} - // server returns: {id:789, number:'0123', name: 'Mike Smith'}; - expect(newCard.id).toEqual(789); - * ``` - * - * The object returned from this function execution is a resource "class" which has "static" method - * for each action in the definition. - * - * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and - * `headers`. - * - * @example - * - * # User resource - * - * When the data is returned from the server then the object is an instance of the resource type and - * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD - * operations (create, read, update, delete) on server-side data. - - ```js - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}, function(user) { - user.abc = true; - user.$save(); - }); - ``` - * - * It's worth noting that the success callback for `get`, `query` and other methods gets passed - * in the response that came from the server as well as $http header getter function, so one - * could rewrite the above example and get access to http headers as: - * - ```js - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}, function(user, getResponseHeaders){ - user.abc = true; - user.$save(function(user, putResponseHeaders) { - //user => saved user object - //putResponseHeaders => $http header getter - }); - }); - ``` - * - * You can also access the raw `$http` promise via the `$promise` property on the object returned - * - ``` - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}) - .$promise.then(function(user) { - $scope.user = user; - }); - ``` - * - * @example - * - * # Creating a custom 'PUT' request - * - * In this example we create a custom method on our resource to make a PUT request - * ```js - * var app = angular.module('app', ['ngResource', 'ngRoute']); - * - * // Some APIs expect a PUT request in the format URL/object/ID - * // Here we are creating an 'update' method - * app.factory('Notes', ['$resource', function($resource) { - * return $resource('/notes/:id', null, - * { - * 'update': { method:'PUT' } - * }); - * }]); - * - * // In our controller we get the ID from the URL using ngRoute and $routeParams - * // We pass in $routeParams and our Notes factory along with $scope - * app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes', - function($scope, $routeParams, Notes) { - * // First get a note object from the factory - * var note = Notes.get({ id:$routeParams.id }); - * $id = note.id; - * - * // Now call update passing in the ID first then the object you are updating - * Notes.update({ id:$id }, note); - * - * // This will PUT /notes/ID with the note object in the request payload - * }]); - * ``` - * - * @example - * - * # Cancelling requests - * - * If an action's configuration specifies that it is cancellable, you can cancel the request related - * to an instance or collection (as long as it is a result of a "non-instance" call): - * - ```js - // ...defining the `Hotel` resource... - var Hotel = $resource('/api/hotel/:id', {id: '@id'}, { - // Let's make the `query()` method cancellable - query: {method: 'get', isArray: true, cancellable: true} - }); - - // ...somewhere in the PlanVacationController... - ... - this.onDestinationChanged = function onDestinationChanged(destination) { - // We don't care about any pending request for hotels - // in a different destination any more - this.availableHotels.$cancelRequest(); - - // Let's query for hotels in '' - // (calls: /api/hotel?location=) - this.availableHotels = Hotel.query({location: destination}); - }; - ``` - * - */ -angular.module('ngResource', ['ng']). - provider('$resource', function() { - var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\/\/[^\/]*/; - var provider = this; - - /** - * @ngdoc property - * @name $resourceProvider#defaults - * @description - * Object containing default options used when creating `$resource` instances. - * - * The default values satisfy a wide range of usecases, but you may choose to overwrite any of - * them to further customize your instances. The available properties are: - * - * - **stripTrailingSlashes** – `{boolean}` – If true, then the trailing slashes from any - * calculated URL will be stripped.
      - * (Defaults to true.) - * - **cancellable** – `{boolean}` – If true, the request made by a "non-instance" call will be - * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return - * value. For more details, see {@link ngResource.$resource}. This can be overwritten per - * resource class or action.
      - * (Defaults to false.) - * - **actions** - `{Object.}` - A hash with default actions declarations. Actions are - * high-level methods corresponding to RESTful actions/methods on resources. An action may - * specify what HTTP method to use, what URL to hit, if the return value will be a single - * object or a collection (array) of objects etc. For more details, see - * {@link ngResource.$resource}. The actions can also be enhanced or overwritten per resource - * class.
      - * The default actions are: - * ```js - * { - * get: {method: 'GET'}, - * save: {method: 'POST'}, - * query: {method: 'GET', isArray: true}, - * remove: {method: 'DELETE'}, - * delete: {method: 'DELETE'} - * } - * ``` - * - * #### Example - * - * For example, you can specify a new `update` action that uses the `PUT` HTTP verb: - * - * ```js - * angular. - * module('myApp'). - * config(['resourceProvider', function ($resourceProvider) { - * $resourceProvider.defaults.actions.update = { - * method: 'PUT' - * }; - * }); - * ``` - * - * Or you can even overwrite the whole `actions` list and specify your own: - * - * ```js - * angular. - * module('myApp'). - * config(['resourceProvider', function ($resourceProvider) { - * $resourceProvider.defaults.actions = { - * create: {method: 'POST'} - * get: {method: 'GET'}, - * getAll: {method: 'GET', isArray:true}, - * update: {method: 'PUT'}, - * delete: {method: 'DELETE'} - * }; - * }); - * ``` - * - */ - this.defaults = { - // Strip slashes by default - stripTrailingSlashes: true, - - // Make non-instance requests cancellable (via `$cancelRequest()`) - cancellable: false, - - // Default actions configuration - actions: { - 'get': {method: 'GET'}, - 'save': {method: 'POST'}, - 'query': {method: 'GET', isArray: true}, - 'remove': {method: 'DELETE'}, - 'delete': {method: 'DELETE'} - } - }; - - this.$get = ['$http', '$log', '$q', '$timeout', function($http, $log, $q, $timeout) { - - var noop = angular.noop, - forEach = angular.forEach, - extend = angular.extend, - copy = angular.copy, - isFunction = angular.isFunction; - - /** - * We need our custom method because encodeURIComponent is too aggressive and doesn't follow - * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set - * (pchar) allowed in path segments: - * segment = *pchar - * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - * pct-encoded = "%" HEXDIG HEXDIG - * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=" - */ - function encodeUriSegment(val) { - return encodeUriQuery(val, true). - replace(/%26/gi, '&'). - replace(/%3D/gi, '='). - replace(/%2B/gi, '+'); - } - - - /** - * This method is intended for encoding *key* or *value* parts of query component. We need a - * custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't - * have to be encoded per http://tools.ietf.org/html/rfc3986: - * query = *( pchar / "/" / "?" ) - * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - * pct-encoded = "%" HEXDIG HEXDIG - * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=" - */ - function encodeUriQuery(val, pctEncodeSpaces) { - return encodeURIComponent(val). - replace(/%40/gi, '@'). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); - } - - function Route(template, defaults) { - this.template = template; - this.defaults = extend({}, provider.defaults, defaults); - this.urlParams = {}; - } - - Route.prototype = { - setUrlParams: function(config, params, actionUrl) { - var self = this, - url = actionUrl || self.template, - val, - encodedVal, - protocolAndDomain = ''; - - var urlParams = self.urlParams = {}; - forEach(url.split(/\W/), function(param) { - if (param === 'hasOwnProperty') { - throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name."); - } - if (!(new RegExp("^\\d+$").test(param)) && param && - (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) { - urlParams[param] = { - isQueryParamValue: (new RegExp("\\?.*=:" + param + "(?:\\W|$)")).test(url) - }; - } - }); - url = url.replace(/\\:/g, ':'); - url = url.replace(PROTOCOL_AND_DOMAIN_REGEX, function(match) { - protocolAndDomain = match; - return ''; - }); - - params = params || {}; - forEach(self.urlParams, function(paramInfo, urlParam) { - val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam]; - if (angular.isDefined(val) && val !== null) { - if (paramInfo.isQueryParamValue) { - encodedVal = encodeUriQuery(val, true); - } else { - encodedVal = encodeUriSegment(val); - } - url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) { - return encodedVal + p1; - }); - } else { - url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match, - leadingSlashes, tail) { - if (tail.charAt(0) == '/') { - return tail; - } else { - return leadingSlashes + tail; - } - }); - } - }); - - // strip trailing slashes and set the url (unless this behavior is specifically disabled) - if (self.defaults.stripTrailingSlashes) { - url = url.replace(/\/+$/, '') || '/'; - } - - // then replace collapse `/.` if found in the last URL path segment before the query - // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x` - url = url.replace(/\/\.(?=\w+($|\?))/, '.'); - // replace escaped `/\.` with `/.` - config.url = protocolAndDomain + url.replace(/\/\\\./, '/.'); - - - // set params - delegate param encoding to $http - forEach(params, function(value, key) { - if (!self.urlParams[key]) { - config.params = config.params || {}; - config.params[key] = value; - } - }); - } - }; - - - function resourceFactory(url, paramDefaults, actions, options) { - var route = new Route(url, options); - - actions = extend({}, provider.defaults.actions, actions); - - function extractParams(data, actionParams) { - var ids = {}; - actionParams = extend({}, paramDefaults, actionParams); - forEach(actionParams, function(value, key) { - if (isFunction(value)) { value = value(data); } - ids[key] = value && value.charAt && value.charAt(0) == '@' ? - lookupDottedPath(data, value.substr(1)) : value; - }); - return ids; - } - - function defaultResponseInterceptor(response) { - return response.resource; - } - - function Resource(value) { - shallowClearAndCopy(value || {}, this); - } - - Resource.prototype.toJSON = function() { - var data = extend({}, this); - delete data.$promise; - delete data.$resolved; - return data; - }; - - forEach(actions, function(action, name) { - var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method); - var numericTimeout = action.timeout; - var cancellable = angular.isDefined(action.cancellable) ? action.cancellable : - (options && angular.isDefined(options.cancellable)) ? options.cancellable : - provider.defaults.cancellable; - - if (numericTimeout && !angular.isNumber(numericTimeout)) { - $log.debug('ngResource:\n' + - ' Only numeric values are allowed as `timeout`.\n' + - ' Promises are not supported in $resource, because the same value would ' + - 'be used for multiple requests. If you are looking for a way to cancel ' + - 'requests, you should use the `cancellable` option.'); - delete action.timeout; - numericTimeout = null; - } - - Resource[name] = function(a1, a2, a3, a4) { - var params = {}, data, success, error; - - /* jshint -W086 */ /* (purposefully fall through case statements) */ - switch (arguments.length) { - case 4: - error = a4; - success = a3; - //fallthrough - case 3: - case 2: - if (isFunction(a2)) { - if (isFunction(a1)) { - success = a1; - error = a2; - break; - } - - success = a2; - error = a3; - //fallthrough - } else { - params = a1; - data = a2; - success = a3; - break; - } - case 1: - if (isFunction(a1)) success = a1; - else if (hasBody) data = a1; - else params = a1; - break; - case 0: break; - default: - throw $resourceMinErr('badargs', - "Expected up to 4 arguments [params, data, success, error], got {0} arguments", - arguments.length); - } - /* jshint +W086 */ /* (purposefully fall through case statements) */ - - var isInstanceCall = this instanceof Resource; - var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data)); - var httpConfig = {}; - var responseInterceptor = action.interceptor && action.interceptor.response || - defaultResponseInterceptor; - var responseErrorInterceptor = action.interceptor && action.interceptor.responseError || - undefined; - var timeoutDeferred; - var numericTimeoutPromise; - - forEach(action, function(value, key) { - switch (key) { - default: - httpConfig[key] = copy(value); - break; - case 'params': - case 'isArray': - case 'interceptor': - case 'cancellable': - break; - } - }); - - if (!isInstanceCall && cancellable) { - timeoutDeferred = $q.defer(); - httpConfig.timeout = timeoutDeferred.promise; - - if (numericTimeout) { - numericTimeoutPromise = $timeout(timeoutDeferred.resolve, numericTimeout); - } - } - - if (hasBody) httpConfig.data = data; - route.setUrlParams(httpConfig, - extend({}, extractParams(data, action.params || {}), params), - action.url); - - var promise = $http(httpConfig).then(function(response) { - var data = response.data; - - if (data) { - // Need to convert action.isArray to boolean in case it is undefined - // jshint -W018 - if (angular.isArray(data) !== (!!action.isArray)) { - throw $resourceMinErr('badcfg', - 'Error in resource configuration for action `{0}`. Expected response to ' + - 'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object', - angular.isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url); - } - // jshint +W018 - if (action.isArray) { - value.length = 0; - forEach(data, function(item) { - if (typeof item === "object") { - value.push(new Resource(item)); - } else { - // Valid JSON values may be string literals, and these should not be converted - // into objects. These items will not have access to the Resource prototype - // methods, but unfortunately there - value.push(item); - } - }); - } else { - var promise = value.$promise; // Save the promise - shallowClearAndCopy(data, value); - value.$promise = promise; // Restore the promise - } - } - response.resource = value; - - return response; - }, function(response) { - (error || noop)(response); - return $q.reject(response); - }); - - promise['finally'](function() { - value.$resolved = true; - if (!isInstanceCall && cancellable) { - value.$cancelRequest = angular.noop; - $timeout.cancel(numericTimeoutPromise); - timeoutDeferred = numericTimeoutPromise = httpConfig.timeout = null; - } - }); - - promise = promise.then( - function(response) { - var value = responseInterceptor(response); - (success || noop)(value, response.headers); - return value; - }, - responseErrorInterceptor); - - if (!isInstanceCall) { - // we are creating instance / collection - // - set the initial promise - // - return the instance / collection - value.$promise = promise; - value.$resolved = false; - if (cancellable) value.$cancelRequest = timeoutDeferred.resolve; - - return value; - } - - // instance call - return promise; - }; - - - Resource.prototype['$' + name] = function(params, success, error) { - if (isFunction(params)) { - error = success; success = params; params = {}; - } - var result = Resource[name].call(this, params, this, success, error); - return result.$promise || result; - }; - }); - - Resource.bind = function(additionalParamDefaults) { - return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions); - }; - - return Resource; - } - - return resourceFactory; - }]; - }); - - -})(window, window.angular); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/angular-resource.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/angular-resource.min.js deleted file mode 100644 index 5001f29d76..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-resource/angular-resource.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - AngularJS v1.5.8 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(P,d){'use strict';function G(t,g){g=g||{};d.forEach(g,function(d,q){delete g[q]});for(var q in t)!t.hasOwnProperty(q)||"$"===q.charAt(0)&&"$"===q.charAt(1)||(g[q]=t[q]);return g}var z=d.$$minErr("$resource"),M=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;d.module("ngResource",["ng"]).provider("$resource",function(){var t=/^https?:\/\/[^\/]*/,g=this;this.defaults={stripTrailingSlashes:!0,cancellable:!1,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"}, -"delete":{method:"DELETE"}}};this.$get=["$http","$log","$q","$timeout",function(q,L,H,I){function A(d,h){return encodeURIComponent(d).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,h?"%20":"+")}function B(d,h){this.template=d;this.defaults=v({},g.defaults,h);this.urlParams={}}function J(e,h,n,k){function b(a,c){var b={};c=v({},h,c);u(c,function(c,h){x(c)&&(c=c(a));var f;if(c&&c.charAt&&"@"==c.charAt(0)){f=a;var l=c.substr(1);if(null==l||""===l||"hasOwnProperty"=== -l||!M.test("."+l))throw z("badmember",l);for(var l=l.split("."),m=0,k=l.length;m", - "license": "MIT", - "bugs": { - "url": "https://github.com/angular/angular.js/issues" - }, - "homepage": "http://angularjs.org", - "jspm": { - "shim": { - "angular-resource": { - "deps": ["angular"] - } - } - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/.bower.json deleted file mode 100644 index 996eb29b51..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/.bower.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "angular-sanitize", - "version": "1.5.8", - "license": "MIT", - "main": "./angular-sanitize.js", - "ignore": [], - "dependencies": { - "angular": "1.5.8" - }, - "homepage": "https://github.com/angular/bower-angular-sanitize", - "_release": "1.5.8", - "_resolution": { - "type": "version", - "tag": "v1.5.8", - "commit": "380756a11f0b6b213d0b82c9fdbe56f40d4c0093" - }, - "_source": "https://github.com/angular/bower-angular-sanitize.git", - "_target": "1.5.8", - "_originalSource": "angular-sanitize" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/LICENSE.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/LICENSE.md deleted file mode 100644 index 2c395eef1b..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Angular - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/README.md deleted file mode 100644 index b84aaf6dbf..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# packaged angular-sanitize - -This repo is for distribution on `npm` and `bower`. The source for this module is in the -[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngSanitize). -Please file issues and pull requests against that repo. - -## Install - -You can install this package either with `npm` or with `bower`. - -### npm - -```shell -npm install angular-sanitize -``` - -Then add `ngSanitize` as a dependency for your app: - -```javascript -angular.module('myApp', [require('angular-sanitize')]); -``` - -### bower - -```shell -bower install angular-sanitize -``` - -Add a ` -``` - -Then add `ngSanitize` as a dependency for your app: - -```javascript -angular.module('myApp', ['ngSanitize']); -``` - -## Documentation - -Documentation is available on the -[AngularJS docs site](http://docs.angularjs.org/api/ngSanitize). - -## License - -The MIT License - -Copyright (c) 2010-2015 Google, Inc. http://angularjs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/angular-sanitize.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/angular-sanitize.js deleted file mode 100644 index a283e43bde..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/angular-sanitize.js +++ /dev/null @@ -1,738 +0,0 @@ -/** - * @license AngularJS v1.5.8 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -var $sanitizeMinErr = angular.$$minErr('$sanitize'); -var bind; -var extend; -var forEach; -var isDefined; -var lowercase; -var noop; -var htmlParser; -var htmlSanitizeWriter; - -/** - * @ngdoc module - * @name ngSanitize - * @description - * - * # ngSanitize - * - * The `ngSanitize` module provides functionality to sanitize HTML. - * - * - *
      - * - * See {@link ngSanitize.$sanitize `$sanitize`} for usage. - */ - -/** - * @ngdoc service - * @name $sanitize - * @kind function - * - * @description - * Sanitizes an html string by stripping all potentially dangerous tokens. - * - * The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are - * then serialized back to properly escaped html string. This means that no unsafe input can make - * it into the returned string. - * - * The whitelist for URL sanitization of attribute values is configured using the functions - * `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider - * `$compileProvider`}. - * - * The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}. - * - * @param {string} html HTML input. - * @returns {string} Sanitized HTML. - * - * @example - - - -
      - Snippet: - - - - - - - - - - - - - - - - - - - - - - - - - -
      DirectiveHowSourceRendered
      ng-bind-htmlAutomatically uses $sanitize
      <div ng-bind-html="snippet">
      </div>
      ng-bind-htmlBypass $sanitize by explicitly trusting the dangerous value -
      <div ng-bind-html="deliberatelyTrustDangerousSnippet()">
      -</div>
      -
      ng-bindAutomatically escapes
      <div ng-bind="snippet">
      </div>
      -
      -
      - - it('should sanitize the html snippet by default', function() { - expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()). - toBe('

      an html\nclick here\nsnippet

      '); - }); - - it('should inline raw snippet if bound to a trusted value', function() { - expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()). - toBe("

      an html\n" + - "click here\n" + - "snippet

      "); - }); - - it('should escape snippet without any filter', function() { - expect(element(by.css('#bind-default div')).getInnerHtml()). - toBe("<p style=\"color:blue\">an html\n" + - "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + - "snippet</p>"); - }); - - it('should update', function() { - element(by.model('snippet')).clear(); - element(by.model('snippet')).sendKeys('new text'); - expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()). - toBe('new text'); - expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe( - 'new text'); - expect(element(by.css('#bind-default div')).getInnerHtml()).toBe( - "new <b onclick=\"alert(1)\">text</b>"); - }); -
      -
      - */ - - -/** - * @ngdoc provider - * @name $sanitizeProvider - * - * @description - * Creates and configures {@link $sanitize} instance. - */ -function $SanitizeProvider() { - var svgEnabled = false; - - this.$get = ['$$sanitizeUri', function($$sanitizeUri) { - if (svgEnabled) { - extend(validElements, svgElements); - } - return function(html) { - var buf = []; - htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) { - return !/^unsafe:/.test($$sanitizeUri(uri, isImage)); - })); - return buf.join(''); - }; - }]; - - - /** - * @ngdoc method - * @name $sanitizeProvider#enableSvg - * @kind function - * - * @description - * Enables a subset of svg to be supported by the sanitizer. - * - *
      - *

      By enabling this setting without taking other precautions, you might expose your - * application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned - * outside of the containing element and be rendered over other elements on the page (e.g. a login - * link). Such behavior can then result in phishing incidents.

      - * - *

      To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg - * tags within the sanitized content:

      - * - *
      - * - *
      
      -   *   .rootOfTheIncludedContent svg {
      -   *     overflow: hidden !important;
      -   *   }
      -   *   
      - *
      - * - * @param {boolean=} flag Enable or disable SVG support in the sanitizer. - * @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called - * without an argument or self for chaining otherwise. - */ - this.enableSvg = function(enableSvg) { - if (isDefined(enableSvg)) { - svgEnabled = enableSvg; - return this; - } else { - return svgEnabled; - } - }; - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Private stuff - ////////////////////////////////////////////////////////////////////////////////////////////////// - - bind = angular.bind; - extend = angular.extend; - forEach = angular.forEach; - isDefined = angular.isDefined; - lowercase = angular.lowercase; - noop = angular.noop; - - htmlParser = htmlParserImpl; - htmlSanitizeWriter = htmlSanitizeWriterImpl; - - // Regular Expressions for parsing tags and attributes - var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - // Match everything outside of normal chars and " (quote character) - NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g; - - - // Good source of info about elements and attributes - // http://dev.w3.org/html5/spec/Overview.html#semantics - // http://simon.html5.org/html-elements - - // Safe Void Elements - HTML5 - // http://dev.w3.org/html5/spec/Overview.html#void-elements - var voidElements = toMap("area,br,col,hr,img,wbr"); - - // Elements that you can, intentionally, leave open (and which close themselves) - // http://dev.w3.org/html5/spec/Overview.html#optional-tags - var optionalEndTagBlockElements = toMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"), - optionalEndTagInlineElements = toMap("rp,rt"), - optionalEndTagElements = extend({}, - optionalEndTagInlineElements, - optionalEndTagBlockElements); - - // Safe Block Elements - HTML5 - var blockElements = extend({}, optionalEndTagBlockElements, toMap("address,article," + - "aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," + - "h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")); - - // Inline Elements - HTML5 - var inlineElements = extend({}, optionalEndTagInlineElements, toMap("a,abbr,acronym,b," + - "bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," + - "samp,small,span,strike,strong,sub,sup,time,tt,u,var")); - - // SVG Elements - // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements - // Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted. - // They can potentially allow for arbitrary javascript to be executed. See #11290 - var svgElements = toMap("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph," + - "hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline," + - "radialGradient,rect,stop,svg,switch,text,title,tspan"); - - // Blocked Elements (will be stripped) - var blockedElements = toMap("script,style"); - - var validElements = extend({}, - voidElements, - blockElements, - inlineElements, - optionalEndTagElements); - - //Attributes that have href and hence need to be sanitized - var uriAttrs = toMap("background,cite,href,longdesc,src,xlink:href"); - - var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' + - 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' + - 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' + - 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' + - 'valign,value,vspace,width'); - - // SVG attributes (without "id" and "name" attributes) - // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes - var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' + - 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' + - 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' + - 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' + - 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' + - 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' + - 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' + - 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' + - 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' + - 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' + - 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' + - 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' + - 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' + - 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' + - 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true); - - var validAttrs = extend({}, - uriAttrs, - svgAttrs, - htmlAttrs); - - function toMap(str, lowercaseKeys) { - var obj = {}, items = str.split(','), i; - for (i = 0; i < items.length; i++) { - obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true; - } - return obj; - } - - var inertBodyElement; - (function(window) { - var doc; - if (window.document && window.document.implementation) { - doc = window.document.implementation.createHTMLDocument("inert"); - } else { - throw $sanitizeMinErr('noinert', "Can't create an inert html document"); - } - var docElement = doc.documentElement || doc.getDocumentElement(); - var bodyElements = docElement.getElementsByTagName('body'); - - // usually there should be only one body element in the document, but IE doesn't have any, so we need to create one - if (bodyElements.length === 1) { - inertBodyElement = bodyElements[0]; - } else { - var html = doc.createElement('html'); - inertBodyElement = doc.createElement('body'); - html.appendChild(inertBodyElement); - doc.appendChild(html); - } - })(window); - - /** - * @example - * htmlParser(htmlString, { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * }); - * - * @param {string} html string - * @param {object} handler - */ - function htmlParserImpl(html, handler) { - if (html === null || html === undefined) { - html = ''; - } else if (typeof html !== 'string') { - html = '' + html; - } - inertBodyElement.innerHTML = html; - - //mXSS protection - var mXSSAttempts = 5; - do { - if (mXSSAttempts === 0) { - throw $sanitizeMinErr('uinput', "Failed to sanitize html because the input is unstable"); - } - mXSSAttempts--; - - // strip custom-namespaced attributes on IE<=11 - if (window.document.documentMode) { - stripCustomNsAttrs(inertBodyElement); - } - html = inertBodyElement.innerHTML; //trigger mXSS - inertBodyElement.innerHTML = html; - } while (html !== inertBodyElement.innerHTML); - - var node = inertBodyElement.firstChild; - while (node) { - switch (node.nodeType) { - case 1: // ELEMENT_NODE - handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes)); - break; - case 3: // TEXT NODE - handler.chars(node.textContent); - break; - } - - var nextNode; - if (!(nextNode = node.firstChild)) { - if (node.nodeType == 1) { - handler.end(node.nodeName.toLowerCase()); - } - nextNode = node.nextSibling; - if (!nextNode) { - while (nextNode == null) { - node = node.parentNode; - if (node === inertBodyElement) break; - nextNode = node.nextSibling; - if (node.nodeType == 1) { - handler.end(node.nodeName.toLowerCase()); - } - } - } - } - node = nextNode; - } - - while (node = inertBodyElement.firstChild) { - inertBodyElement.removeChild(node); - } - } - - function attrToMap(attrs) { - var map = {}; - for (var i = 0, ii = attrs.length; i < ii; i++) { - var attr = attrs[i]; - map[attr.name] = attr.value; - } - return map; - } - - - /** - * Escapes all potentially dangerous characters, so that the - * resulting string can be safely inserted into attribute or - * element text. - * @param value - * @returns {string} escaped text - */ - function encodeEntities(value) { - return value. - replace(/&/g, '&'). - replace(SURROGATE_PAIR_REGEXP, function(value) { - var hi = value.charCodeAt(0); - var low = value.charCodeAt(1); - return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'; - }). - replace(NON_ALPHANUMERIC_REGEXP, function(value) { - return '&#' + value.charCodeAt(0) + ';'; - }). - replace(//g, '>'); - } - - /** - * create an HTML/XML writer which writes to buffer - * @param {Array} buf use buf.join('') to get out sanitized html string - * @returns {object} in the form of { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * } - */ - function htmlSanitizeWriterImpl(buf, uriValidator) { - var ignoreCurrentElement = false; - var out = bind(buf, buf.push); - return { - start: function(tag, attrs) { - tag = lowercase(tag); - if (!ignoreCurrentElement && blockedElements[tag]) { - ignoreCurrentElement = tag; - } - if (!ignoreCurrentElement && validElements[tag] === true) { - out('<'); - out(tag); - forEach(attrs, function(value, key) { - var lkey = lowercase(key); - var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background'); - if (validAttrs[lkey] === true && - (uriAttrs[lkey] !== true || uriValidator(value, isImage))) { - out(' '); - out(key); - out('="'); - out(encodeEntities(value)); - out('"'); - } - }); - out('>'); - } - }, - end: function(tag) { - tag = lowercase(tag); - if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) { - out(''); - } - if (tag == ignoreCurrentElement) { - ignoreCurrentElement = false; - } - }, - chars: function(chars) { - if (!ignoreCurrentElement) { - out(encodeEntities(chars)); - } - } - }; - } - - - /** - * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' attribute to declare - * ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo'). This is undesirable since we don't want - * to allow any of these custom attributes. This method strips them all. - * - * @param node Root element to process - */ - function stripCustomNsAttrs(node) { - if (node.nodeType === window.Node.ELEMENT_NODE) { - var attrs = node.attributes; - for (var i = 0, l = attrs.length; i < l; i++) { - var attrNode = attrs[i]; - var attrName = attrNode.name.toLowerCase(); - if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) { - node.removeAttributeNode(attrNode); - i--; - l--; - } - } - } - - var nextNode = node.firstChild; - if (nextNode) { - stripCustomNsAttrs(nextNode); - } - - nextNode = node.nextSibling; - if (nextNode) { - stripCustomNsAttrs(nextNode); - } - } -} - -function sanitizeText(chars) { - var buf = []; - var writer = htmlSanitizeWriter(buf, noop); - writer.chars(chars); - return buf.join(''); -} - - -// define ngSanitize module and register $sanitize service -angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider); - -/** - * @ngdoc filter - * @name linky - * @kind function - * - * @description - * Finds links in text input and turns them into html links. Supports `http/https/ftp/mailto` and - * plain email address links. - * - * Requires the {@link ngSanitize `ngSanitize`} module to be installed. - * - * @param {string} text Input text. - * @param {string} target Window (`_blank|_self|_parent|_top`) or named frame to open links in. - * @param {object|function(url)} [attributes] Add custom attributes to the link element. - * - * Can be one of: - * - * - `object`: A map of attributes - * - `function`: Takes the url as a parameter and returns a map of attributes - * - * If the map of attributes contains a value for `target`, it overrides the value of - * the target parameter. - * - * - * @returns {string} Html-linkified and {@link $sanitize sanitized} text. - * - * @usage - - * - * @example - - -
      - Snippet: - - - - - - - - - - - - - - - - - - - - - - - - - - -
      FilterSourceRendered
      linky filter -
      <div ng-bind-html="snippet | linky">
      </div>
      -
      -
      -
      linky target -
      <div ng-bind-html="snippetWithSingleURL | linky:'_blank'">
      </div>
      -
      -
      -
      linky custom attributes -
      <div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}">
      </div>
      -
      -
      -
      no filter
      <div ng-bind="snippet">
      </div>
      - - - angular.module('linkyExample', ['ngSanitize']) - .controller('ExampleController', ['$scope', function($scope) { - $scope.snippet = - 'Pretty text with some links:\n'+ - 'http://angularjs.org/,\n'+ - 'mailto:us@somewhere.org,\n'+ - 'another@somewhere.org,\n'+ - 'and one more: ftp://127.0.0.1/.'; - $scope.snippetWithSingleURL = 'http://angularjs.org/'; - }]); - - - it('should linkify the snippet with urls', function() { - expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). - toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' + - 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); - expect(element.all(by.css('#linky-filter a')).count()).toEqual(4); - }); - - it('should not linkify snippet without the linky filter', function() { - expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()). - toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' + - 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); - expect(element.all(by.css('#escaped-html a')).count()).toEqual(0); - }); - - it('should update', function() { - element(by.model('snippet')).clear(); - element(by.model('snippet')).sendKeys('new http://link.'); - expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). - toBe('new http://link.'); - expect(element.all(by.css('#linky-filter a')).count()).toEqual(1); - expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()) - .toBe('new http://link.'); - }); - - it('should work with the target property', function() { - expect(element(by.id('linky-target')). - element(by.binding("snippetWithSingleURL | linky:'_blank'")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank'); - }); - - it('should optionally add custom attributes', function() { - expect(element(by.id('linky-custom-attributes')). - element(by.binding("snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow'); - }); - - - */ -angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) { - var LINKY_URL_REGEXP = - /((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, - MAILTO_REGEXP = /^mailto:/i; - - var linkyMinErr = angular.$$minErr('linky'); - var isDefined = angular.isDefined; - var isFunction = angular.isFunction; - var isObject = angular.isObject; - var isString = angular.isString; - - return function(text, target, attributes) { - if (text == null || text === '') return text; - if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text); - - var attributesFn = - isFunction(attributes) ? attributes : - isObject(attributes) ? function getAttributesObject() {return attributes;} : - function getEmptyAttributesObject() {return {};}; - - var match; - var raw = text; - var html = []; - var url; - var i; - while ((match = raw.match(LINKY_URL_REGEXP))) { - // We can not end in these as they are sometimes found at the end of the sentence - url = match[0]; - // if we did not match ftp/http/www/mailto then assume mailto - if (!match[2] && !match[4]) { - url = (match[3] ? 'http://' : 'mailto:') + url; - } - i = match.index; - addText(raw.substr(0, i)); - addLink(url, match[0].replace(MAILTO_REGEXP, '')); - raw = raw.substring(i + match[0].length); - } - addText(raw); - return $sanitize(html.join('')); - - function addText(text) { - if (!text) { - return; - } - html.push(sanitizeText(text)); - } - - function addLink(url, text) { - var key, linkAttributes = attributesFn(url); - html.push(''); - addText(text); - html.push(''); - } - }; -}]); - - -})(window, window.angular); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/angular-sanitize.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/angular-sanitize.min.js deleted file mode 100644 index ca82fd27e0..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/angular-sanitize.min.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - AngularJS v1.5.8 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(s,g){'use strict';function H(g){var l=[];t(l,A).chars(g);return l.join("")}var B=g.$$minErr("$sanitize"),C,l,D,E,q,A,F,t;g.module("ngSanitize",[]).provider("$sanitize",function(){function k(a,e){var b={},c=a.split(","),h;for(h=0;h/g,">")}function u(a){if(a.nodeType===s.Node.ELEMENT_NODE)for(var e=a.attributes,b=0,c=e.length;b"))},end:function(a){a= -q(a);b||!0!==w[a]||!0===y[a]||(c(""));a==b&&(b=!1)},chars:function(a){b||c(G(a))}}};var J=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,K=/([^\#-~ |!])/g,y=k("area,br,col,hr,img,wbr"),d=k("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),r=k("rp,rt"),p=l({},r,d),d=l({},d,k("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),r=l({},r,k("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")), -x=k("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),z=k("script,style"),w=l({},y,d,r,p),n=k("background,cite,href,longdesc,src,xlink:href"),p=k("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"), -r=k("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan", -!0),m=l({},n,r,p),f;(function(a){if(a.document&&a.document.implementation)a=a.document.implementation.createHTMLDocument("inert");else throw B("noinert");var e=(a.documentElement||a.getDocumentElement()).getElementsByTagName("body");1===e.length?f=e[0]:(e=a.createElement("html"),f=a.createElement("body"),e.appendChild(f),a.appendChild(e))})(s)});g.module("ngSanitize").filter("linky",["$sanitize",function(k){var l=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, -q=/^mailto:/i,u=g.$$minErr("linky"),v=g.isDefined,s=g.isFunction,t=g.isObject,y=g.isString;return function(d,g,p){function x(a){a&&m.push(H(a))}function z(a,b){var c,d=w(a);m.push("');x(b);m.push("")}if(null==d||""===d)return d;if(!y(d))throw u("notstring",d);for(var w=s(p)?p:t(p)?function(){return p}:function(){return{}},n=d,m=[],f,a;d=n.match(l);)f=d[0],d[2]|| -d[4]||(f=(d[3]?"http://":"mailto:")+f),a=d.index,x(n.substr(0,a)),z(f,d[0].replace(q,"")),n=n.substring(a+d[0].length);x(n);return k(m.join(""))}}])})(window,window.angular); -//# sourceMappingURL=angular-sanitize.min.js.map diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/angular-sanitize.min.js.map b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/angular-sanitize.min.js.map deleted file mode 100644 index 8d2a1a981e..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/angular-sanitize.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular-sanitize.min.js", -"lineCount":15, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CA4gB3BC,QAASA,EAAY,CAACC,CAAD,CAAQ,CAC3B,IAAIC,EAAM,EACGC,EAAAC,CAAmBF,CAAnBE,CAAwBC,CAAxBD,CACbH,MAAA,CAAaA,CAAb,CACA,OAAOC,EAAAI,KAAA,CAAS,EAAT,CAJoB,CA/f7B,IAAIC,EAAkBR,CAAAS,SAAA,CAAiB,WAAjB,CAAtB,CACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAMIR,CANJ,CAOIS,CAPJ,CAQIX,CAggBJJ,EAAAgB,OAAA,CAAe,YAAf,CAA6B,EAA7B,CAAAC,SAAA,CAA0C,WAA1C,CAhYAC,QAA0B,EAAG,CAuJ3B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CAASrE,CAAT,CAAA,CAAuB8E,QAA4B,EAAG,CAAC,MAAO9E,EAAR,CAAtD,CACA+E,QAAiC,EAAG,CAAC,MAAO,EAAR,CAHtC,CAMIC,EAAMT,CANV,CAOIxD,EAAO,EAPX,CAQI4D,CARJ,CASIhG,CACJ,CAAQsG,CAAR,CAAgBD,CAAAC,MAAA,CAAUhB,CAAV,CAAhB,CAAA,CAEEU,CAQA,CARMM,CAAA,CAAM,CAAN,CAQN,CANKA,CAAA,CAAM,CAAN,CAML;AANkBA,CAAA,CAAM,CAAN,CAMlB,GALEN,CAKF,EALSM,CAAA,CAAM,CAAN,CAAA,CAAW,SAAX,CAAuB,SAKhC,EAL6CN,CAK7C,EAHAhG,CAGA,CAHIsG,CAAAC,MAGJ,CAFAT,CAAA,CAAQO,CAAAG,OAAA,CAAW,CAAX,CAAcxG,CAAd,CAAR,CAEA,CADA+F,CAAA,CAAQC,CAAR,CAAaM,CAAA,CAAM,CAAN,CAAA5F,QAAA,CAAiB6E,CAAjB,CAAgC,EAAhC,CAAb,CACA,CAAAc,CAAA,CAAMA,CAAAI,UAAA,CAAczG,CAAd,CAAkBsG,CAAA,CAAM,CAAN,CAAArG,OAAlB,CAER6F,EAAA,CAAQO,CAAR,CACA,OAAOhB,EAAA,CAAUjD,CAAAtD,KAAA,CAAU,EAAV,CAAV,CA3BiC,CAXmC,CAAlC,CAA7C,CAtpB2B,CAA1B,CAAD,CA4tBGR,MA5tBH,CA4tBWA,MAAAC,QA5tBX;", -"sources":["angular-sanitize.js"], -"names":["window","angular","sanitizeText","chars","buf","htmlSanitizeWriter","writer","noop","join","$sanitizeMinErr","$$minErr","bind","extend","forEach","isDefined","lowercase","htmlParser","module","provider","$SanitizeProvider","toMap","str","lowercaseKeys","obj","items","split","i","length","attrToMap","attrs","map","ii","attr","name","value","encodeEntities","replace","SURROGATE_PAIR_REGEXP","hi","charCodeAt","low","NON_ALPHANUMERIC_REGEXP","stripCustomNsAttrs","node","nodeType","Node","ELEMENT_NODE","attributes","l","attrNode","attrName","toLowerCase","lastIndexOf","removeAttributeNode","nextNode","firstChild","nextSibling","svgEnabled","$get","$$sanitizeUri","validElements","svgElements","html","uri","isImage","test","enableSvg","this.enableSvg","htmlParserImpl","handler","undefined","inertBodyElement","innerHTML","mXSSAttempts","document","documentMode","start","nodeName","textContent","end","parentNode","removeChild","htmlSanitizeWriterImpl","uriValidator","ignoreCurrentElement","out","push","tag","blockedElements","key","lkey","validAttrs","uriAttrs","voidElements","optionalEndTagBlockElements","optionalEndTagInlineElements","optionalEndTagElements","blockElements","inlineElements","htmlAttrs","svgAttrs","implementation","doc","createHTMLDocument","bodyElements","getElementsByTagName","documentElement","getDocumentElement","createElement","appendChild","filter","$sanitize","LINKY_URL_REGEXP","MAILTO_REGEXP","linkyMinErr","isFunction","isObject","isString","text","target","addText","addLink","url","linkAttributes","attributesFn","getAttributesObject","getEmptyAttributesObject","raw","match","index","substr","substring"] -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/bower.json deleted file mode 100644 index 1981022932..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/bower.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "angular-sanitize", - "version": "1.5.8", - "license": "MIT", - "main": "./angular-sanitize.js", - "ignore": [], - "dependencies": { - "angular": "1.5.8" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/index.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/index.js deleted file mode 100644 index dd5d22e4a5..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/index.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./angular-sanitize'); -module.exports = 'ngSanitize'; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/package.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/package.json deleted file mode 100644 index a49308ecf6..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-sanitize/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "angular-sanitize", - "version": "1.5.8", - "description": "AngularJS module for sanitizing HTML", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/angular/angular.js.git" - }, - "keywords": [ - "angular", - "framework", - "browser", - "html", - "client-side" - ], - "author": "Angular Core Team ", - "license": "MIT", - "bugs": { - "url": "https://github.com/angular/angular.js/issues" - }, - "homepage": "http://angularjs.org", - "jspm": { - "shim": { - "angular-sanitize": { - "deps": ["angular"] - } - } - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/.bower.json deleted file mode 100644 index cb6ce9be76..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/.bower.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "angular-ui-router", - "version": "0.3.1", - "license": "MIT", - "main": "./release/angular-ui-router.js", - "dependencies": { - "angular": "^1.0.8" - }, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "component.json", - "package.json", - "lib", - "config", - "sample", - "test", - "tests", - "ngdoc_assets", - "Gruntfile.js", - "files.js" - ], - "homepage": "https://github.com/angular-ui/angular-ui-router-bower", - "_release": "0.3.1", - "_resolution": { - "type": "version", - "tag": "0.3.1", - "commit": "6ac1c61991121f5324f99089003314bba3bc6a95" - }, - "_source": "https://github.com/angular-ui/angular-ui-router-bower.git", - "_target": "0.3.1", - "_originalSource": "angular-ui-router" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/CHANGELOG.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/CHANGELOG.md deleted file mode 100644 index fbf4ee0d14..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/CHANGELOG.md +++ /dev/null @@ -1,363 +0,0 @@ - -### 0.3.1 (2016-06-03) - -# obscure BC-BREAK - -If you're using `element.data('$uiView').$animEnter`, switch to `element.data('$uiViewAnim').$animEnter` -This was necessary in order to fix #2763 - -#### Bug Fixes - -* **state:** - * fire $stateChangeError if onEnter/onExit throws. closes #2772 ([a5756c38](https://github.com/angular-ui/ui-router/commit/a5756c38a282bd2556ed5faaf870d6e493722d1b)) - * fail transition on exceptions in transition handler ([8222fb0e](https://github.com/angular-ui/ui-router/commit/8222fb0e7fd5eaaf6382f36db9ee9077a7bdbc6d)) -* **uiView:** separate $uiView and $uiViewAnim element.data() ([d3502f3c](https://github.com/angular-ui/ui-router/commit/d3502f3c0cb6a63f4b80aac91428f748b6460396), closes [#2763](https://github.com/angular-ui/ui-router/issues/2763)) - * Fixes this error: `Cannot read property 'name' of undefined at getUiViewName` - - - -## 0.3.0 (2016-05-14) - -This is a release of the `legacy` branch, primarily to fix the $scope destroy ordering issues introduced in 0.2.16. - -We recommend all users to try the 1.0.0 alpha and report any issues it causes with your application. Read the [known breaking changes](https://github.com/angular-ui/ui-router/issues/2219) between the legacy and 1.0 branches. - -# BC-BREAK - -In 0.2.16 we delayed the ui-view $scope destroy() until after all animations were completed. This was a mistake, and we're reverting it in 0.3.0. - -The original issue that we tried to address: https://github.com/angular-ui/ui-router/issues/1643 - -We are switching back to 0.2.15 behavior. The scope is now destroyed as soon as the view is swapped out. This allows cleanup to happen in response -to the $destroy event. If you need to do things after the animation, we've put the promise on the `element.data('$uiView')` in #2562 - -#### Bug Fixes - -* **state:** Inject $state at runtime to force initialization ([de3a04a7](https://github.com/angular-ui/ui-router/commit/de3a04a7c676e05b5b868de4f65d03d9c588773c), closes [#2574](https://github.com/angular-ui/ui-router/issues/2574)) -* **ui-sref:** update ui-sref-active/eq info when params change When ui-state dynamicly changes ([9698ec4d](https://github.com/angular-ui/ui-router/commit/9698ec4d2fbceb463cf11e43b7e74e385eda4beb), closes [#2554](https://github.com/angular-ui/ui-router/issues/2554)) -* **ui-state:** update ui-sref-active/eq info when ui-state dynamicly changes watchers, make sur ([abb3deba](https://github.com/angular-ui/ui-router/commit/abb3debacb87e1a6c398a13f2d64c53e8b08a233), closes [#2488](https://github.com/angular-ui/ui-router/issues/2488)) - - -#### Features - -* **uiView:** - * Fire the $onInit hook ([b090ca03](https://github.com/angular-ui/ui-router/commit/b090ca0352eabc13662a8702a2b227b7db606362), closes [#2559](https://github.com/angular-ui/ui-router/issues/2559)) - * Put $animate promises on element.data('$uiView') closes #2562 closes #2579 ([fde64e18](https://github.com/angular-ui/ui-router/commit/fde64e1897041e59cbc9f8d07b269dcd487abb9c)) - - - -### 0.2.18 (2016-02-07) - -This is a maintenance release which fixes a few known bugs introduced in 0.2.16. - -#### Bug Fixes - -* **$urlRouter:** revert BC: resolve clashing of routes This reverts commit b5c57c8ec2e14e17e75104 ([2f1ebefc](https://github.com/angular-ui/ui-router/commit/2f1ebefc242ff48960e0bf63da359296a38f6852), closes [#2501](https://github.com/angular-ui/ui-router/issues/2501)) -* **uiState:** Corrected typo for 'ref' variable (#2488, #2508) ([b8f3c144](https://github.com/angular-ui/ui-router/commit/b8f3c144b913e620f177b78f3b4f52afa61d41a6)) -* **$urlMatcherFactory:** Fix to make the YUI Javascript compressor work ([ad9c41d2](https://github.com/angular-ui/ui-router/commit/ad9c41d2e723d50e30dd3452fbd274b7057dc3d9)) -* **stateBuilder:** fix non-url params on a state without a url. The parameters are now applied when ([d6d8c332](https://github.com/angular-ui/ui-router/commit/d6d8c3322c4dde8bb5b8dde25f9fcda49e9c4c81), closes [#2025](https://github.com/angular-ui/ui-router/issues/2025)) -* **ui-view:** (ui-view) use static renderer when no animation is present for a ui-view ([2523bbdb](https://github.com/angular-ui/ui-router/commit/2523bbdb5542483a489c22804f1751b8b9f71703), closes [#2485](https://github.com/angular-ui/ui-router/issues/2485)). This allows a ui-view scope to be destroyed when switching states, before the next view is initialized. - - -#### Features - -* **ui-view:** Add noanimation attribute to specify static renderer. ([2523bbdb](https://github.com/angular-ui/ui-router/commit/2523bbdb5542483a489c22804f1751b8b9f71703), closes [#2485](https://github.com/angular-ui/ui-router/issues/2485)). This allows a ui-view scope to be destroyed before the next ui-view is initialized, when ui-view animation is not present. - - - -### 0.2.17 (2016-01-25) - - -#### Bug Fixes - -* **uiSrefActive:** allow multiple classes ([a89114a0](https://github.com/angular-ui/ui-router/commit/a89114a083813c1a7280c48fc18e626caa5a31f4), closes [#2481](https://github.com/angular-ui/ui-router/issues/2481), [#2482](https://github.com/angular-ui/ui-router/issues/2482)) - - - -### 0.2.16 (2016-01-24) - - -#### Bug Fixes - -* **$state:** - * statechangeCancel: Avoid infinite digest in .otherwise/redirect case. Don't clobber url if a new transition has started. Closes #222 ([e00aa695](https://github.com/angular-ui/ui-router/commit/e00aa695e41ddc5ebd5d2b226aa0917a751b11aa), closes [#2238](https://github.com/angular-ui/ui-router/issues/2238)) - * transitionTo: Allow hash (#) value to be read as toParams['#'] in events. Re-add the saved hash before broadcasting $stateChangeStart event. ([8c1bf30d](https://github.com/angular-ui/ui-router/commit/8c1bf30d2a3b78ba40b330f12d854c885d6cc117)) -* **$stateParams:** Fix for testing: reset service instance between tests ([2aeb0c4b](https://github.com/angular-ui/ui-router/commit/2aeb0c4b205baf6cfa2ef25bb986bb160dc13bf9)) -* **$urlRouter:** - * Sort URL rules by specificity. Potential minor BC if apps were relying on rule registration order. ([b5c57c8e](https://github.com/angular-ui/ui-router/commit/b5c57c8ec2e14e17e75104c1424654f126ea4011)) - * Use $sniffer for pushstate compat check ([c219e801](https://github.com/angular-ui/ui-router/commit/c219e801797f340ef9c5c919ab890ef003a7a042)) -* **UrlMatcher:** - * Properly encode/decode slashes in parameters Closes #2172 Closes #2250 Closes #1 ([02e98660](https://github.com/angular-ui/ui-router/commit/02e98660a80dfd1ca4b113dd24ee304af91e9f8c), closes [#2339](https://github.com/angular-ui/ui-router/issues/2339)) - * Array types: Fix default value for array query parameters. Pass empty arrays through in handler. ([20d6e243](https://github.com/angular-ui/ui-router/commit/20d6e243f1745ddbf257217245a1dc22eabe13da), closes [#2222](https://github.com/angular-ui/ui-router/issues/2222)) - * Remove trailing slash, if parameter is optional and was squashed from URL ([77fa11bf](https://github.com/angular-ui/ui-router/commit/77fa11bf0787d0f6da97ab0003ab29afb7411391), closes [#1902](https://github.com/angular-ui/ui-router/issues/1902)) - * Allow a parameter declaration to configure the parameter type by name. closes #2294 ([e4010249](https://github.com/angular-ui/ui-router/commit/e40102492d40fe1cf6ba14d955fcc9f345c16458)) - * include the slash when recognizing squashed params in url ([b5130bb1](https://github.com/angular-ui/ui-router/commit/b5130bb1215e15f832ea6daa670410b9a950c0d4), closes [#2064](https://github.com/angular-ui/ui-router/issues/2064)) - * Allow url query param names to contain periods ([d31b3337](https://github.com/angular-ui/ui-router/commit/d31b3337cc2ce71d87c92fdded629e46558d0b49)) -* **reloadOnSearch:** Update `locals.globals.$stateParams` when reloadOnSearch=false ([350d3e87](https://github.com/angular-ui/ui-router/commit/350d3e87783a2263fd7d23913da34f1268c3300b), closes [#2356](https://github.com/angular-ui/ui-router/issues/2356)) -* **ui-view:** - * fix $animate usage for ng 1.4+ ([9b6d9a2d](https://github.com/angular-ui/ui-router/commit/9b6d9a2d0ce4ae08384165cb517bddea59b67892)) - * change $viewContentLoading to pair with $viewContentLoaded ([f9b43d66](https://github.com/angular-ui/ui-router/commit/f9b43d66833f0e17de41fd8d1cc3b491e3ba4a0e), closes [#685](https://github.com/angular-ui/ui-router/issues/685)) - * $destroy event is triggered before animation ends ([1be13795](https://github.com/angular-ui/ui-router/commit/1be13795686ab78abb2d5094bc8addcacb928975)) -* **uiSref:** - * Ensure URL once param checks pass ([9dc31c54](https://github.com/angular-ui/ui-router/commit/9dc31c5465328e5666468b0c2319ce205f4b72f8), closes [#2091](https://github.com/angular-ui/ui-router/issues/2091)) - * uiSrefActive: update the active classes after linking directive ([7c914030](https://github.com/angular-ui/ui-router/commit/7c914030f13e05e45a941c1b723cb785db729890)) - - -#### Features - -* **$IncludedByStateFilter:** add parameters to $IncludedByStateFilter ([963f6e71](https://github.com/angular-ui/ui-router/commit/963f6e71633b9c3a266f3991d79089b7d14786b4), closes [#1735](https://github.com/angular-ui/ui-router/issues/1735)) -* **isStateFilter:** Include optional state params. ([71d74699](https://github.com/angular-ui/ui-router/commit/71d7469987ee9ca86a41c8c6393ccd5d8913c3d6)) -* **$state:** make state data inheritance prototypical ([c4fec8c7](https://github.com/angular-ui/ui-router/commit/c4fec8c7998113902af4152d716c42dada6eb465)) -* **$stateChangeStart:** Add options to event ([a1f07559](https://github.com/angular-ui/ui-router/commit/a1f07559ec74e10ff80bc4be81f287e3772b8fcb)) -* **UrlMatcher:** Add param only type names ([6a371f9b](https://github.com/angular-ui/ui-router/commit/6a371f9b70e37a82eb324122879e4473c3f6d526)) -* **uiSrefActive:** - * provide a ng-{class,style} like interface ([a9ff6feb](https://github.com/angular-ui/ui-router/commit/a9ff6febb469e0d5cd49054216c4472df7a6259d)) - * allow active & active-eq on same element ([d9a676ba](https://github.com/angular-ui/ui-router/commit/d9a676ba2c4d9e954be224c60496bcb38f6074e3)) -* **uiState:** add ui-state directive ([3831af1d](https://github.com/angular-ui/ui-router/commit/3831af1dc71b601351e6694af0665a77297f8f7f), closes [#395](https://github.com/angular-ui/ui-router/issues/395), [#900](https://github.com/angular-ui/ui-router/issues/900), [#1932](https://github.com/angular-ui/ui-router/issues/1932)) -* **urlMatcher:** add support for optional spaces in params ([4b7f3046](https://github.com/angular-ui/ui-router/commit/4b7f304617f0b3590b532103b5c2fb526c98a9e4)) - - - -### 0.2.15 (2015-05-19) - - -#### Bug Fixes - -* **$state:** reloadOnSearch should not affect non-search param changes. ([6ca0d770](https://github.com/angular-ui/ui-router/commit/6ca0d7704cf7de9c6e6b7bb64df2f9c68fe081cc), closes [#1079](https://github.com/angular-ui/ui-router/issues/1079)) -* **urlMatcherFactory:** Revert to 0.2.13 behavior where all string parameters are considered optional fi ([495a02c3](https://github.com/angular-ui/ui-router/commit/495a02c3cbde501c1c149bce137806669209bc29), closes [#1963](https://github.com/angular-ui/ui-router/issues/1963)) -* **urlRouter:** allow .when() to redirect, even after a successful $state.go() - This partially ([48aeaff6](https://github.com/angular-ui/ui-router/commit/48aeaff645baf3f42f5a8940ebd97563791ad9f8), closes [#1584](https://github.com/angular-ui/ui-router/issues/1584)) - - -#### Features - -* **$state:** Inject templateProvider with resolved values ([afa20f22](https://github.com/angular-ui/ui-router/commit/afa20f22373b7176b26daa7e1099750c4254a354)) - - - -### 0.2.14 (2015-04-23) - - -#### Bug Fixes - -* **$StateRefDirective:** resolve missing support for svg anchor elements #1667 ([0149a7bb](https://github.com/angular-ui/ui-router/commit/0149a7bb38b7af99388a1ad7cc9909a7b7c4439d)) -* **$urlMatcherFactory:** - * regex params should respect case-sensitivity ([1e10519f](https://github.com/angular-ui/ui-router/commit/1e10519f3be6bbf0cefdcce623cd2ade06e649e5), closes [#1671](https://github.com/angular-ui/ui-router/issues/1671)) - * unquote all dashes from array params ([06664d33](https://github.com/angular-ui/ui-router/commit/06664d330f882390655dcfa83e10276110d0d0fa)) - * add Type.$normalize function ([b0c6aa23](https://github.com/angular-ui/ui-router/commit/b0c6aa2350fdd3ce8483144774adc12f5a72b7e9)) - * make optional params regex grouping optional ([06f73794](https://github.com/angular-ui/ui-router/commit/06f737945e83e668d09cfc3bcffd04a500ff1963), closes [#1576](https://github.com/angular-ui/ui-router/issues/1576)) -* **$state:** allow about.*.** glob patterns ([e39b27a2](https://github.com/angular-ui/ui-router/commit/e39b27a2cb7d88525c446a041f9fbf1553202010)) -* **uiSref:** - * use Object's toString instead of Window's toString ([2aa7f4d1](https://github.com/angular-ui/ui-router/commit/2aa7f4d139dbd5b9fcc4afdcf2ab6642c87f5671)) - * add absolute to allowed transition options ([ae1b3c4e](https://github.com/angular-ui/ui-router/commit/ae1b3c4eedc37983400d830895afb50457c63af4)) -* **uiSrefActive:** Apply active classes on lazy loaded states ([f0ddbe7b](https://github.com/angular-ui/ui-router/commit/f0ddbe7b4a91daf279c3b7d0cee732bb1f3be5b4)) -* **uiView:** add `$element` to locals for view controller ([db68914c](https://github.com/angular-ui/ui-router/commit/db68914cd6c821e7dec8155bd33142a3a97f5453)) - - -#### Features - -* **$state:** - * support URLs with #fragments ([3da0a170](https://github.com/angular-ui/ui-router/commit/3da0a17069e27598c0f9d9164e104dd5ce05cdc6)) - * inject resolve params into controllerProvider ([b380c223](https://github.com/angular-ui/ui-router/commit/b380c223fe12e2fde7582c0d6b1ed7b15a23579b), closes [#1131](https://github.com/angular-ui/ui-router/issues/1131)) - * added 'state' to state reload method (feat no.1612) - modiefied options.reload ([b8f04575](https://github.com/angular-ui/ui-router/commit/b8f04575a8557035c1858c4d5c8dbde3e1855aaa)) - * broadcast $stateChangeCancel event when event.preventDefault() is called in $sta ([ecefb758](https://github.com/angular-ui/ui-router/commit/ecefb758cb445e41620b62a272aafa3638613d7a)) -* **$uiViewScroll:** change function to return promise ([c2a9a311](https://github.com/angular-ui/ui-router/commit/c2a9a311388bb212e5a2e820536d1d739f829ccd), closes [#1702](https://github.com/angular-ui/ui-router/issues/1702)) -* **uiSrefActive:** Added support for multiple nested uiSref directives ([b1844948](https://github.com/angular-ui/ui-router/commit/b18449481d152b50705abfce2493a444eb059fa5)) - - - -### 0.2.13 (2014-11-20) - -This release primarily fixes issues reported against 0.2.12 - -#### Bug Fixes - -* **$state:** fix $state.includes/.is to apply param types before comparisions fix(uiSref): ma ([19715d15](https://github.com/angular-ui/ui-router/commit/19715d15e3cbfff724519e9febedd05b49c75baa), closes [#1513](https://github.com/angular-ui/ui-router/issues/1513)) - * Avoid re-synchronizing from url after .transitionTo ([b267ecd3](https://github.com/angular-ui/ui-router/commit/b267ecd348e5c415233573ef95ebdbd051875f52), closes [#1573](https://github.com/angular-ui/ui-router/issues/1573)) -* **$urlMatcherFactory:** - * Built-in date type uses local time zone ([d726bedc](https://github.com/angular-ui/ui-router/commit/d726bedcbb5f70a5660addf43fd52ec730790293)) - * make date type fn check .is before running ([aa94ce3b](https://github.com/angular-ui/ui-router/commit/aa94ce3b86632ad05301530a2213099da73a3dc0), closes [#1564](https://github.com/angular-ui/ui-router/issues/1564)) - * early binding of array handler bypasses type resolution ([ada4bc27](https://github.com/angular-ui/ui-router/commit/ada4bc27df5eff3ba3ab0de94a09bd91b0f7a28c)) - * add 'any' Type for non-encoding non-url params ([3bfd75ab](https://github.com/angular-ui/ui-router/commit/3bfd75ab445ee2f1dd55275465059ed116b10b27), closes [#1562](https://github.com/angular-ui/ui-router/issues/1562)) - * fix encoding slashes in params ([0c983a08](https://github.com/angular-ui/ui-router/commit/0c983a08e2947f999683571477debd73038e95cf), closes [#1119](https://github.com/angular-ui/ui-router/issues/1119)) - * fix mixed path/query params ordering problem ([a479fbd0](https://github.com/angular-ui/ui-router/commit/a479fbd0b8eb393a94320973e5b9a62d83912ee2), closes [#1543](https://github.com/angular-ui/ui-router/issues/1543)) -* **ArrayType:** - * specify empty array mapping corner case ([74aa6091](https://github.com/angular-ui/ui-router/commit/74aa60917e996b0b4e27bbb4eb88c3c03832021d), closes [#1511](https://github.com/angular-ui/ui-router/issues/1511)) - * fix .equals for array types ([5e6783b7](https://github.com/angular-ui/ui-router/commit/5e6783b77af9a90ddff154f990b43dbb17eeda6e), closes [#1538](https://github.com/angular-ui/ui-router/issues/1538)) -* **Param:** fix default value shorthand declaration ([831d812a](https://github.com/angular-ui/ui-router/commit/831d812a524524c71f0ee1c9afaf0487a5a66230), closes [#1554](https://github.com/angular-ui/ui-router/issues/1554)) -* **common:** fixed the _.filter clone to not create sparse arrays ([750f5cf5](https://github.com/angular-ui/ui-router/commit/750f5cf5fd91f9ada96f39e50d39aceb2caf22b6), closes [#1563](https://github.com/angular-ui/ui-router/issues/1563)) -* **ie8:** fix calls to indexOf and filter ([dcb31b84](https://github.com/angular-ui/ui-router/commit/dcb31b843391b3e61dee4de13f368c109541813e), closes [#1556](https://github.com/angular-ui/ui-router/issues/1556)) - - -#### Features - -* add json parameter Type ([027f1fcf](https://github.com/angular-ui/ui-router/commit/027f1fcf9c0916cea651e88981345da6f9ff214a)) - - - -### 0.2.12 (2014-11-13) - -#### Bug Fixes - -* **$resolve:** use resolve fn result, not parent resolved value of same name ([67f5e00c](https://github.com/angular-ui/ui-router/commit/67f5e00cc9aa006ce3fe6cde9dff261c28eab70a), closes [#1317], [#1353]) -* **$state:** - * populate default params in .transitionTo. ([3f60fbe6](https://github.com/angular-ui/ui-router/commit/3f60fbe6d65ebeca8d97952c05aa1d269f1b7ba1), closes [#1396]) - * reload() now reinvokes controllers ([73443420](https://github.com/angular-ui/ui-router/commit/7344342018847902594dc1fc62d30a5c30f01763), closes [#582]) - * do not emit $viewContentLoading if notify: false ([74255feb](https://github.com/angular-ui/ui-router/commit/74255febdf48ae082a02ca1e735165f2c369a463), closes [#1387](https://github.com/angular-ui/ui-router/issues/1387)) - * register states at config-time ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a)) - * handle parent.name when parent is obj ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a)) -* **$urlMatcherFactory:** - * register types at config ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a), closes [#1476]) - * made path params default value "" for backwards compat ([8f998e71](https://github.com/angular-ui/ui-router/commit/8f998e71e43a0b31293331c981f5db0f0097b8ba)) - * Pre-replace certain param values for better mapping ([6374a3e2](https://github.com/angular-ui/ui-router/commit/6374a3e29ab932014a7c77d2e1ab884cc841a2e3)) - * fixed ParamSet.$$keys() ordering ([9136fecb](https://github.com/angular-ui/ui-router/commit/9136fecbc2bfd4fda748a9914f0225a46c933860)) - * empty string policy now respected in Param.value() ([db12c85c](https://github.com/angular-ui/ui-router/commit/db12c85c16f2d105415f9bbbdeb11863f64728e0)) - * "string" type now encodes/decodes slashes ([3045e415](https://github.com/angular-ui/ui-router/commit/3045e41577a8b8b8afc6039f42adddf5f3c061ec), closes [#1119]) - * allow arrays in both path and query params ([fdd2f2c1](https://github.com/angular-ui/ui-router/commit/fdd2f2c191c4a67c874fdb9ec9a34f8dde9ad180), closes [#1073], [#1045], [#1486], [#1394]) - * typed params in search ([8d4cab69](https://github.com/angular-ui/ui-router/commit/8d4cab69dd67058e1a716892cc37b7d80a57037f), closes [#1488](https://github.com/angular-ui/ui-router/issues/1488)) - * no longer generate unroutable urls ([cb9fd9d8](https://github.com/angular-ui/ui-router/commit/cb9fd9d8943cb26c7223f6990db29c82ae8740f8), closes [#1487](https://github.com/angular-ui/ui-router/issues/1487)) - * handle optional parameter followed by required parameter in url format. ([efc72106](https://github.com/angular-ui/ui-router/commit/efc72106ddcc4774b48ea176a505ef9e95193b41)) - * default to parameter string coersion. ([13a468a7](https://github.com/angular-ui/ui-router/commit/13a468a7d54c2fb0751b94c0c1841d580b71e6dc), closes [#1414](https://github.com/angular-ui/ui-router/issues/1414)) - * concat respects strictMode/caseInsensitive ([dd72e103](https://github.com/angular-ui/ui-router/commit/dd72e103edb342d9cf802816fe127e1bbd68fd5f), closes [#1395]) -* **ui-sref:** - * Allow sref state options to take a scope object ([b5f7b596](https://github.com/angular-ui/ui-router/commit/b5f7b59692ce4933e2d63eb5df3f50a4ba68ccc0)) - * replace raw href modification with attrs. ([08c96782](https://github.com/angular-ui/ui-router/commit/08c96782faf881b0c7ab00afc233ee6729548fa0)) - * nagivate to state when url is "" fix($state.href): generate href for state with ([656b5aab](https://github.com/angular-ui/ui-router/commit/656b5aab906e5749db9b5a080c6a83b95f50fd91), closes [#1363](https://github.com/angular-ui/ui-router/issues/1363)) - * Check that state is defined in isMatch() ([92aebc75](https://github.com/angular-ui/ui-router/commit/92aebc7520f88babdc6e266536086e07263514c3), closes [#1314](https://github.com/angular-ui/ui-router/issues/1314), [#1332](https://github.com/angular-ui/ui-router/issues/1332)) -* **uiView:** - * allow inteprolated ui-view names ([81f6a19a](https://github.com/angular-ui/ui-router/commit/81f6a19a432dac9198fd33243855bfd3b4fea8c0), closes [#1324](https://github.com/angular-ui/ui-router/issues/1324)) - * Made anim work with angular 1.3 ([c3bb7ad9](https://github.com/angular-ui/ui-router/commit/c3bb7ad903da1e1f3c91019cfd255be8489ff4ef), closes [#1367](https://github.com/angular-ui/ui-router/issues/1367), [#1345](https://github.com/angular-ui/ui-router/issues/1345)) -* **urlRouter:** html5Mode accepts an object from angular v1.3.0-rc.3 ([7fea1e9d](https://github.com/angular-ui/ui-router/commit/7fea1e9d0d8c6e09cc6c895ecb93d4221e9adf48)) -* **stateFilters:** mark state filters as stateful. ([a00b353e](https://github.com/angular-ui/ui-router/commit/a00b353e3036f64a81245c4e7898646ba218f833), closes [#1479]) -* **ui-router:** re-add IE8 compatibility for map/filter/keys ([8ce69d9f](https://github.com/angular-ui/ui-router/commit/8ce69d9f7c886888ab53eca7e53536f36b428aae), closes [#1518], [#1383]) -* **package:** point 'main' to a valid filename ([ac903350](https://github.com/angular-ui/ui-router/commit/ac9033501debb63364539d91fbf3a0cba4579f8e)) -* **travis:** make CI build faster ([0531de05](https://github.com/angular-ui/ui-router/commit/0531de052e414a8d839fbb4e7635e923e94865b3)) - - -#### Features - -##### Default and Typed params - -This release includes a lot of bug fixes around default/optional and typed parameters. As such, 0.2.12 is the first release where we recommend those features be used. - -* **$state:** - * add state params validation ([b1379e6a](https://github.com/angular-ui/ui-router/commit/b1379e6a4d38f7ed7436e05873932d7c279af578), closes [#1433](https://github.com/angular-ui/ui-router/issues/1433)) - * is/includes/get work on relative stateOrName ([232e94b3](https://github.com/angular-ui/ui-router/commit/232e94b3c2ca2c764bb9510046e4b61690c87852)) - * .reload() returns state transition promise ([639e0565](https://github.com/angular-ui/ui-router/commit/639e0565dece9d5544cc93b3eee6e11c99bd7373)) -* **$templateFactory:** request templateURL as text/html ([ccd60769](https://github.com/angular-ui/ui-router/commit/ccd6076904a4b801d77b47f6e2de4c06ce9962f8), closes [#1287]) -* **$urlMatcherFactory:** Made a Params and ParamSet class ([0cc1e6cc](https://github.com/angular-ui/ui-router/commit/0cc1e6cc461a4640618e2bb594566551c54834e2)) - - - - -### 0.2.11 (2014-08-26) - - -#### Bug Fixes - -* **$resolve:** Resolves only inherit from immediate parent fixes #702 ([df34e20c](https://github.com/angular-ui/ui-router/commit/df34e20c576299e7a3c8bd4ebc68d42341c0ace9)) -* **$state:** - * change $state.href default options.inherit to true ([deea695f](https://github.com/angular-ui/ui-router/commit/deea695f5cacc55de351ab985144fd233c02a769)) - * sanity-check state lookups ([456fd5ae](https://github.com/angular-ui/ui-router/commit/456fd5aec9ea507518927bfabd62b4afad4cf714), closes [#980](https://github.com/angular-ui/ui-router/issues/980)) - * didn't comply to inherit parameter ([09836781](https://github.com/angular-ui/ui-router/commit/09836781f126c1c485b06551eb9cfd4fa0f45c35)) - * allow view content loading broadcast ([7b78edee](https://github.com/angular-ui/ui-router/commit/7b78edeeb52a74abf4d3f00f79534033d5a08d1a)) -* **$urlMatcherFactory:** - * detect injected functions ([91f75ae6](https://github.com/angular-ui/ui-router/commit/91f75ae66c4d129f6f69e53bd547594e9661f5d5)) - * syntax ([1ebed370](https://github.com/angular-ui/ui-router/commit/1ebed37069bae8614d41541d56521f5c45f703f3)) -* **UrlMatcher:** - * query param function defaults ([f9c20530](https://github.com/angular-ui/ui-router/commit/f9c205304f10d8a4ebe7efe9025e642016479a51)) - * don't decode default values ([63607bdb](https://github.com/angular-ui/ui-router/commit/63607bdbbcb432d3fb37856a1cb3da0cd496804e)) -* **travis:** update Node version to fix build ([d6b95ef2](https://github.com/angular-ui/ui-router/commit/d6b95ef23d9dacb4eba08897f5190a0bcddb3a48)) -* **uiSref:** - * Generate an href for states with a blank url. closes #1293 ([691745b1](https://github.com/angular-ui/ui-router/commit/691745b12fa05d3700dd28f0c8d25f8a105074ad)) - * should inherit params by default ([b973dad1](https://github.com/angular-ui/ui-router/commit/b973dad155ad09a7975e1476bd096f7b2c758eeb)) - * cancel transition if preventDefault() has been called ([2e6d9167](https://github.com/angular-ui/ui-router/commit/2e6d9167d3afbfbca6427e53e012f94fb5fb8022)) -* **uiView:** Fixed infinite loop when is called .go() from a controller. ([e13988b8](https://github.com/angular-ui/ui-router/commit/e13988b8cd6231d75c78876ee9d012cc87f4a8d9), closes [#1194](https://github.com/angular-ui/ui-router/issues/1194)) -* **docs:** - * Fixed link to milestones ([6c0ae500](https://github.com/angular-ui/ui-router/commit/6c0ae500cc238ea9fc95adcc15415c55fc9e1f33)) - * fix bug in decorator example ([4bd00af5](https://github.com/angular-ui/ui-router/commit/4bd00af50b8b88a49d1545a76290731cb8e0feb1)) - * Removed an incorrect semi-colon ([af97cef8](https://github.com/angular-ui/ui-router/commit/af97cef8b967f2e32177e539ef41450dca131a7d)) - * Explain return value of rule as function ([5e887890](https://github.com/angular-ui/ui-router/commit/5e8878900a6ffe59a81aed531a3925e34a297377)) - - -#### Features - -* **$state:** - * allow parameters to pass unharmed ([8939d057](https://github.com/angular-ui/ui-router/commit/8939d0572ab1316e458ef016317ecff53131a822)) - * **BREAKING CHANGE**: state parameters are no longer automatically coerced to strings, and unspecified parameter values are now set to undefined rather than null. - * allow prevent syncUrl on failure ([753060b9](https://github.com/angular-ui/ui-router/commit/753060b910d5d2da600a6fa0757976e401c33172)) -* **typescript:** Add typescript definitions for component builds ([521ceb3f](https://github.com/angular-ui/ui-router/commit/521ceb3fd7850646422f411921e21ce5e7d82e0f)) -* **uiSref:** extend syntax for ui-sref ([71cad3d6](https://github.com/angular-ui/ui-router/commit/71cad3d636508b5a9fe004775ad1f1adc0c80c3e)) -* **uiSrefActive:** - * Also activate for child states. ([bf163ad6](https://github.com/angular-ui/ui-router/commit/bf163ad6ce176ce28792696c8302d7cdf5c05a01), closes [#818](https://github.com/angular-ui/ui-router/issues/818)) - * **BREAKING CHANGE** Since ui-sref-active now activates even when child states are active you may need to swap out your ui-sref-active with ui-sref-active-eq, thought typically we think devs want the auto inheritance. - - * uiSrefActiveEq: new directive with old ui-sref-active behavior -* **$urlRouter:** - * defer URL change interception ([c72d8ce1](https://github.com/angular-ui/ui-router/commit/c72d8ce11916d0ac22c81b409c9e61d7048554d7)) - * force URLs to have valid params ([d48505cd](https://github.com/angular-ui/ui-router/commit/d48505cd328d83e39d5706e085ba319715f999a6)) - * abstract $location handling ([08b4636b](https://github.com/angular-ui/ui-router/commit/08b4636b294611f08db35f00641eb5211686fb50)) -* **$urlMatcherFactory:** - * fail on bad parameters ([d8f124c1](https://github.com/angular-ui/ui-router/commit/d8f124c10d00c7e5dde88c602d966db261aea221)) - * date type support ([b7f074ff](https://github.com/angular-ui/ui-router/commit/b7f074ff65ca150a3cdbda4d5ad6cb17107300eb)) - * implement type support ([450b1f0e](https://github.com/angular-ui/ui-router/commit/450b1f0e8e03c738174ff967f688b9a6373290f4)) -* **UrlMatcher:** - * handle query string arrays ([9cf764ef](https://github.com/angular-ui/ui-router/commit/9cf764efab45fa9309368688d535ddf6e96d6449), closes [#373](https://github.com/angular-ui/ui-router/issues/373)) - * injectable functions as defaults ([00966ecd](https://github.com/angular-ui/ui-router/commit/00966ecd91fb745846039160cab707bfca8b3bec)) - * default values & type decoding for query params ([a472b301](https://github.com/angular-ui/ui-router/commit/a472b301389fbe84d1c1fa9f24852b492a569d11)) - * allow shorthand definitions ([5b724304](https://github.com/angular-ui/ui-router/commit/5b7243049793505e44b6608ea09878c37c95b1f5)) - * validates whole interface ([32b27db1](https://github.com/angular-ui/ui-router/commit/32b27db173722e9194ef1d5c0ea7d93f25a98d11)) - * implement non-strict matching ([a3e21366](https://github.com/angular-ui/ui-router/commit/a3e21366bee0475c9795a1ec76f70eec41c5b4e3)) - * add per-param config support ([07b3029f](https://github.com/angular-ui/ui-router/commit/07b3029f4d409cf955780113df92e36401b47580)) - * **BREAKING CHANGE**: the `params` option in state configurations must now be an object keyed by parameter name. - -### 0.2.10 (2014-03-12) - - -#### Bug Fixes - -* **$state:** use $browser.baseHref() when generating urls with .href() ([cbcc8488](https://github.com/angular-ui/ui-router/commit/cbcc84887d6b6d35258adabb97c714cd9c1e272d)) -* **bower.json:** JS files should not be ignored ([ccdab193](https://github.com/angular-ui/ui-router/commit/ccdab193315f304eb3be5f5b97c47a926c79263e)) -* **dev:** karma:background task is missing, can't run grunt:dev. ([d9f7b898](https://github.com/angular-ui/ui-router/commit/d9f7b898e8e3abb8c846b0faa16a382913d7b22b)) -* **sample:** Contacts menu button not staying active when navigating to detail states. Need t ([2fcb8443](https://github.com/angular-ui/ui-router/commit/2fcb84437cb43ade12682a92b764f13cac77dfe7)) -* **uiSref:** support mock-clicks/events with no data ([717d3ff7](https://github.com/angular-ui/ui-router/commit/717d3ff7d0ba72d239892dee562b401cdf90e418)) -* **uiView:** - * Do NOT autoscroll when autoscroll attr is missing ([affe5bd7](https://github.com/angular-ui/ui-router/commit/affe5bd785cdc3f02b7a9f64a52e3900386ec3a0), closes [#807](https://github.com/angular-ui/ui-router/issues/807)) - * Refactoring uiView directive to copy ngView logic ([548fab6a](https://github.com/angular-ui/ui-router/commit/548fab6ab9debc9904c5865c8bc68b4fc3271dd0), closes [#857](https://github.com/angular-ui/ui-router/issues/857), [#552](https://github.com/angular-ui/ui-router/issues/552)) - - -#### Features - -* **$state:** includes() allows glob patterns for state matching. ([2d5f6b37](https://github.com/angular-ui/ui-router/commit/2d5f6b37191a3135f4a6d9e8f344c54edcdc065b)) -* **UrlMatcher:** Add support for case insensitive url matching ([642d5247](https://github.com/angular-ui/ui-router/commit/642d524799f604811e680331002feec7199a1fb5)) -* **uiSref:** add support for transition options ([2ed7a728](https://github.com/angular-ui/ui-router/commit/2ed7a728cee6854b38501fbc1df6139d3de5b28a)) -* **uiView:** add controllerAs config with function ([1ee7334a](https://github.com/angular-ui/ui-router/commit/1ee7334a73efeccc9b95340e315cdfd59944762d)) - - -### 0.2.9 (2014-01-17) - - -This release is identical to 0.2.8. 0.2.8 was re-tagged in git to fix a problem with bower. - - -### 0.2.8 (2014-01-16) - - -#### Bug Fixes - -* **$state:** allow null to be passed as 'params' param ([094dc30e](https://github.com/angular-ui/ui-router/commit/094dc30e883e1bd14e50a475553bafeaade3b178)) -* **$state.go:** param inheritance shouldn't inherit from siblings ([aea872e0](https://github.com/angular-ui/ui-router/commit/aea872e0b983cb433436ce5875df10c838fccedb)) -* **bower.json:** fixes bower.json ([eed3cc4d](https://github.com/angular-ui/ui-router/commit/eed3cc4d4dfef1d3ef84b9fd063127538ebf59d3)) -* **uiSrefActive:** annotate controller injection ([85921422](https://github.com/angular-ui/ui-router/commit/85921422ff7fb0effed358136426d616cce3d583), closes [#671](https://github.com/angular-ui/ui-router/issues/671)) -* **uiView:** - * autoscroll tests pass on 1.2.4 & 1.1.5 ([86eacac0](https://github.com/angular-ui/ui-router/commit/86eacac09ca5e9000bd3b9c7ba6e2cc95d883a3a)) - * don't animate initial load ([83b6634d](https://github.com/angular-ui/ui-router/commit/83b6634d27942ca74766b2b1244a7fc52c5643d9)) - * test pass against 1.0.8 and 1.2.4 ([a402415a](https://github.com/angular-ui/ui-router/commit/a402415a2a28b360c43b9fe8f4f54c540f6c33de)) - * it should autoscroll when expr is missing. ([8bb9e27a](https://github.com/angular-ui/ui-router/commit/8bb9e27a2986725f45daf44c4c9f846385095aff)) - - -#### Features - -* **uiSref:** add target attribute behaviour ([c12bf9a5](https://github.com/angular-ui/ui-router/commit/c12bf9a520d30d70294e3d82de7661900f8e394e)) -* **uiView:** - * merge autoscroll expression test. ([b89e0f87](https://github.com/angular-ui/ui-router/commit/b89e0f871d5cc35c10925ede986c10684d5c9252)) - * cache and test autoscroll expression ([ee262282](https://github.com/angular-ui/ui-router/commit/ee2622828c2ce83807f006a459ac4e11406d9258)) diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/CONTRIBUTING.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/CONTRIBUTING.md deleted file mode 100644 index 7e4fcb8328..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/CONTRIBUTING.md +++ /dev/null @@ -1,65 +0,0 @@ - -# Report an Issue - -Help us make UI-Router better! If you think you might have found a bug, or some other weirdness, start by making sure -it hasn't already been reported. You can [search through existing issues](https://github.com/angular-ui/ui-router/search?q=wat%3F&type=Issues) -to see if someone's reported one similar to yours. - -If not, then [create a plunkr](http://bit.ly/UIR-Plunk) that demonstrates the problem (try to use as little code -as possible: the more minimalist, the faster we can debug it). - -Next, [create a new issue](https://github.com/angular-ui/ui-router/issues/new) that briefly explains the problem, -and provides a bit of background as to the circumstances that triggered it. Don't forget to include the link to -that plunkr you created! - -**Note**: If you're unsure how a feature is used, or are encountering some unexpected behavior that you aren't sure -is a bug, it's best to talk it out on -[StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) before reporting it. This -keeps development streamlined, and helps us focus on building great software. - - -Issues only! | --------------| -Please keep in mind that the issue tracker is for *issues*. Please do *not* post an issue if you need help or support. Instead, see one of the above-mentioned forums or [IRC](irc://irc.freenode.net/#angularjs). | - -####Purple Labels -A purple label means that **you** need to take some further action. - - ![Not Actionable - Need Info](ngdoc_assets/incomplete.png): Your issue is not specific enough, or there is no clear action that we can take. Please clarify and refine your issue. - - ![Plunkr Please](ngdoc_assets/example.png): Please [create a plunkr](http://bit.ly/UIR-Plunk) - - ![StackOverflow](ngdoc_assets/so.png): We suspect your issue is really a help request, or could be answered by the community. Please ask your question on [StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router). If you determine that is an actual issue, please explain why. - -If your issue gets labeled with purple label, no further action will be taken until you respond to the label appropriately. - -# Contribute - -**(1)** See the **[Developing](#developing)** section below, to get the development version of UI-Router up and running on your local machine. - -**(2)** Check out the [roadmap](https://github.com/angular-ui/ui-router/milestones) to see where the project is headed, and if your feature idea fits with where we're headed. - -**(3)** If you're not sure, [open an RFC](https://github.com/angular-ui/ui-router/issues/new?title=RFC:%20My%20idea) to get some feedback on your idea. - -**(4)** Finally, commit some code and open a pull request. Code & commits should abide by the following rules: - -- *Always* have test coverage for new features (or regression tests for bug fixes), and *never* break existing tests -- Commits should represent one logical change each; if a feature goes through multiple iterations, squash your commits down to one -- Make sure to follow the [Angular commit message format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) so your change will appear in the changelog of the next release. -- Changes should always respect the coding style of the project - - - -# Developing - -UI-Router uses grunt >= 0.4.x. Make sure to upgrade your environment and read the -[Migration Guide](http://gruntjs.com/upgrading-from-0.3-to-0.4). - -Dependencies for building from source and running tests: - -* [grunt-cli](https://github.com/gruntjs/grunt-cli) - run: `$ npm install -g grunt-cli` -* Then, install the development dependencies by running `$ npm install` from the project directory - -There are a number of targets in the gruntfile that are used to generating different builds: - -* `grunt`: Perform a normal build, runs jshint and karma tests -* `grunt build`: Perform a normal build -* `grunt dist`: Perform a clean build and generate documentation -* `grunt dev`: Run dev server (sample app) and watch for changes, builds and runs karma tests on changes. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/LICENSE b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/LICENSE deleted file mode 100644 index 6413b092d7..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2013-2015 The AngularUI Team, Karsten Sperling - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/README.md deleted file mode 100644 index 4cac80ce20..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/README.md +++ /dev/null @@ -1,252 +0,0 @@ -# AngularUI Router  [![Build Status](https://travis-ci.org/angular-ui/ui-router.svg?branch=master)](https://travis-ci.org/angular-ui/ui-router) - -#### The de-facto solution to flexible routing with nested views ---- -**[Download 0.2.18](https://cdn.rawgit.com/angular-ui/ui-router/0.2.18/release/angular-ui-router.js)** (or **[Minified](https://cdn.rawgit.com/angular-ui/ui-router/0.2.18/release/angular-ui-router.min.js)**) **|** -**[Guide](https://github.com/angular-ui/ui-router/wiki) |** -**[API](http://angular-ui.github.io/ui-router/site) |** -**[Sample](http://angular-ui.github.com/ui-router/sample/) ([Src](https://github.com/angular-ui/ui-router/tree/gh-pages/sample)) |** -**[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) |** -**[Resources](#resources) |** -**[Report an Issue](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#report-an-issue) |** -**[Contribute](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#contribute) |** -**[Help!](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) |** -**[Discuss](https://groups.google.com/forum/#!categories/angular-ui/router)** - ---- - -*_Please help us out by testing the 1.0 alpha release!_* - -[1.0.0alpha0 Announcement](https://github.com/angular-ui/ui-router/releases/tag/1.0.0alpha0) ([Source Code](https://github.com/angular-ui/ui-router/tree/master)) | [Sample App](http://ui-router.github.io/sample-app/) ([Source Code](https://github.com/ui-router/sample-app)) | [Known Issues](https://github.com/angular-ui/ui-router/issues?q=is%3Aissue+is%3Aopen+label%3A1.0) - - ---- - -AngularUI Router is a routing framework for [AngularJS](http://angularjs.org), which allows you to organize the -parts of your interface into a [*state machine*](https://en.wikipedia.org/wiki/Finite-state_machine). Unlike the -[`$route` service](http://docs.angularjs.org/api/ngRoute.$route) in the Angular ngRoute module, which is organized around URL -routes, UI-Router is organized around [*states*](https://github.com/angular-ui/ui-router/wiki), -which may optionally have routes, as well as other behavior, attached. - -States are bound to *named*, *nested* and *parallel views*, allowing you to powerfully manage your application's interface. - -Check out the sample app: http://angular-ui.github.io/ui-router/sample/ - -- -**Note:** *UI-Router is under active development. As such, while this library is well-tested, the API may change. Consider using it in production applications only if you're comfortable following a changelog and updating your usage accordingly.* - - -## Get Started - -**(1)** Get UI-Router in one of the following ways: - - clone & [build](CONTRIBUTING.md#developing) this repository - - [download the release](http://angular-ui.github.io/ui-router/release/angular-ui-router.js) (or [minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)) - - [link to cdn](http://cdnjs.com/libraries/angular-ui-router) - - via **[jspm](http://jspm.io/)**: by running `$ jspm install angular-ui-router` from your console - - or via **[npm](https://www.npmjs.org/)**: by running `$ npm install angular-ui-router` from your console - - or via **[Bower](http://bower.io/)**: by running `$ bower install angular-ui-router` from your console - - or via **[Component](https://github.com/component/component)**: by running `$ component install angular-ui/ui-router` from your console - -**(2)** Include `angular-ui-router.js` (or `angular-ui-router.min.js`) in your `index.html`, after including Angular itself (For Component users: ignore this step) - -**(3)** Add `'ui.router'` to your main module's list of dependencies (For Component users: replace `'ui.router'` with `require('angular-ui-router')`) - -When you're done, your setup should look similar to the following: - -> -```html - - - - - - - ... - - - ... - - -``` - -### [Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview) - -The majority of UI-Router's power is in its ability to nest states & views. - -**(1)** First, follow the [setup](#get-started) instructions detailed above. - -**(2)** Then, add a [`ui-view` directive](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view) to the `` of your app. - -> -```html - - -
      - - State 1 - State 2 - -``` - -**(3)** You'll notice we also added some links with [`ui-sref` directives](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref). In addition to managing state transitions, this directive auto-generates the `href` attribute of the `` element it's attached to, if the corresponding state has a URL. Next we'll add some templates. These will plug into the `ui-view` within `index.html`. Notice that they have their own `ui-view` as well! That is the key to nesting states and views. - -> -```html - -

      State 1

      -
      -
      Show List -
      -``` -```html - -

      State 2

      -
      -Show List -
      -``` - -**(4)** Next, we'll add some child templates. *These* will get plugged into the `ui-view` of their parent state templates. - -> -```html - -

      List of State 1 Items

      -
        -
      • {{ item }}
      • -
      -``` - -> -```html - -

      List of State 2 Things

      -
        -
      • {{ thing }}
      • -
      -``` - -**(5)** Finally, we'll wire it all up with `$stateProvider`. Set up your states in the module config, as in the following: - - -> -```javascript -myApp.config(function($stateProvider, $urlRouterProvider) { - // - // For any unmatched url, redirect to /state1 - $urlRouterProvider.otherwise("/state1"); - // - // Now set up the states - $stateProvider - .state('state1', { - url: "/state1", - templateUrl: "partials/state1.html" - }) - .state('state1.list', { - url: "/list", - templateUrl: "partials/state1.list.html", - controller: function($scope) { - $scope.items = ["A", "List", "Of", "Items"]; - } - }) - .state('state2', { - url: "/state2", - templateUrl: "partials/state2.html" - }) - .state('state2.list', { - url: "/list", - templateUrl: "partials/state2.list.html", - controller: function($scope) { - $scope.things = ["A", "Set", "Of", "Things"]; - } - }); -}); -``` - -**(6)** See this quick start example in action. ->**[Go to Quick Start Plunker for Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview)** - -**(7)** This only scratches the surface ->**[Dive Deeper!](https://github.com/angular-ui/ui-router/wiki)** - - -### [Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview) - -Another great feature is the ability to have multiple `ui-view`s view per template. - -**Pro Tip:** *While multiple parallel views are a powerful feature, you'll often be able to manage your -interfaces more effectively by nesting your views, and pairing those views with nested states.* - -**(1)** Follow the [setup](#get-started) instructions detailed above. - -**(2)** Add one or more `ui-view` to your app, give them names. -> -```html - - -
      -
      - - Route 1 - Route 2 - -``` - -**(3)** Set up your states in the module config: -> -```javascript -myApp.config(function($stateProvider) { - $stateProvider - .state('index', { - url: "", - views: { - "viewA": { template: "index.viewA" }, - "viewB": { template: "index.viewB" } - } - }) - .state('route1', { - url: "/route1", - views: { - "viewA": { template: "route1.viewA" }, - "viewB": { template: "route1.viewB" } - } - }) - .state('route2', { - url: "/route2", - views: { - "viewA": { template: "route2.viewA" }, - "viewB": { template: "route2.viewB" } - } - }) -}); -``` - -**(4)** See this quick start example in action. ->**[Go to Quick Start Plunker for Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview)** - - -## Resources - -* [In-Depth Guide](https://github.com/angular-ui/ui-router/wiki) -* [API Reference](http://angular-ui.github.io/ui-router/site) -* [Sample App](http://angular-ui.github.com/ui-router/sample/) ([Source](https://github.com/angular-ui/ui-router/tree/gh-pages/sample)) -* [FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) -* [Slides comparing ngRoute to ui-router](http://slid.es/timkindberg/ui-router#/) -* [UI-Router Extras / Addons](http://christopherthielen.github.io/ui-router-extras/#/home) (@christopherthielen) - -### Videos - -* [Introduction Video](https://egghead.io/lessons/angularjs-introduction-ui-router) (egghead.io) -* [Tim Kindberg on Angular UI-Router](https://www.youtube.com/watch?v=lBqiZSemrqg) -* [Activating States](https://egghead.io/lessons/angularjs-ui-router-activating-states) (egghead.io) -* [Learn Angular.js using UI-Router](http://youtu.be/QETUuZ27N0w) (LearnCode.academy) - - - -## Reporting issues and Contributing - -Please read our [Contributor guidelines](CONTRIBUTING.md) before reporting an issue or creating a pull request. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/bower.json deleted file mode 100644 index a67886dd47..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/bower.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "angular-ui-router", - "version": "0.3.1", - "license" : "MIT", - "main": "./release/angular-ui-router.js", - "dependencies": { - "angular": "^1.0.8" - }, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "component.json", - "package.json", - "lib", - "config", - "sample", - "test", - "tests", - "ngdoc_assets", - "Gruntfile.js", - "files.js" - ] -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/release/angular-ui-router.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/release/angular-ui-router.js deleted file mode 100644 index b6797e87b4..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/release/angular-ui-router.js +++ /dev/null @@ -1,4576 +0,0 @@ -/** - * State-based routing for AngularJS - * @version v0.3.1 - * @link http://angular-ui.github.com/ - * @license MIT License, http://www.opensource.org/licenses/MIT - */ - -/* commonjs package manager support (eg componentjs) */ -if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){ - module.exports = 'ui.router'; -} - -(function (window, angular, undefined) { -/*jshint globalstrict:true*/ -/*global angular:false*/ -'use strict'; - -var isDefined = angular.isDefined, - isFunction = angular.isFunction, - isString = angular.isString, - isObject = angular.isObject, - isArray = angular.isArray, - forEach = angular.forEach, - extend = angular.extend, - copy = angular.copy, - toJson = angular.toJson; - -function inherit(parent, extra) { - return extend(new (extend(function() {}, { prototype: parent }))(), extra); -} - -function merge(dst) { - forEach(arguments, function(obj) { - if (obj !== dst) { - forEach(obj, function(value, key) { - if (!dst.hasOwnProperty(key)) dst[key] = value; - }); - } - }); - return dst; -} - -/** - * Finds the common ancestor path between two states. - * - * @param {Object} first The first state. - * @param {Object} second The second state. - * @return {Array} Returns an array of state names in descending order, not including the root. - */ -function ancestors(first, second) { - var path = []; - - for (var n in first.path) { - if (first.path[n] !== second.path[n]) break; - path.push(first.path[n]); - } - return path; -} - -/** - * IE8-safe wrapper for `Object.keys()`. - * - * @param {Object} object A JavaScript object. - * @return {Array} Returns the keys of the object as an array. - */ -function objectKeys(object) { - if (Object.keys) { - return Object.keys(object); - } - var result = []; - - forEach(object, function(val, key) { - result.push(key); - }); - return result; -} - -/** - * IE8-safe wrapper for `Array.prototype.indexOf()`. - * - * @param {Array} array A JavaScript array. - * @param {*} value A value to search the array for. - * @return {Number} Returns the array index value of `value`, or `-1` if not present. - */ -function indexOf(array, value) { - if (Array.prototype.indexOf) { - return array.indexOf(value, Number(arguments[2]) || 0); - } - var len = array.length >>> 0, from = Number(arguments[2]) || 0; - from = (from < 0) ? Math.ceil(from) : Math.floor(from); - - if (from < 0) from += len; - - for (; from < len; from++) { - if (from in array && array[from] === value) return from; - } - return -1; -} - -/** - * Merges a set of parameters with all parameters inherited between the common parents of the - * current state and a given destination state. - * - * @param {Object} currentParams The value of the current state parameters ($stateParams). - * @param {Object} newParams The set of parameters which will be composited with inherited params. - * @param {Object} $current Internal definition of object representing the current state. - * @param {Object} $to Internal definition of object representing state to transition to. - */ -function inheritParams(currentParams, newParams, $current, $to) { - var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = []; - - for (var i in parents) { - if (!parents[i] || !parents[i].params) continue; - parentParams = objectKeys(parents[i].params); - if (!parentParams.length) continue; - - for (var j in parentParams) { - if (indexOf(inheritList, parentParams[j]) >= 0) continue; - inheritList.push(parentParams[j]); - inherited[parentParams[j]] = currentParams[parentParams[j]]; - } - } - return extend({}, inherited, newParams); -} - -/** - * Performs a non-strict comparison of the subset of two objects, defined by a list of keys. - * - * @param {Object} a The first object. - * @param {Object} b The second object. - * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified, - * it defaults to the list of keys in `a`. - * @return {Boolean} Returns `true` if the keys match, otherwise `false`. - */ -function equalForKeys(a, b, keys) { - if (!keys) { - keys = []; - for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility - } - - for (var i=0; i - * - * - * - * - * - * - * - * - * - * - * - * - */ -angular.module('ui.router', ['ui.router.state']); - -angular.module('ui.router.compat', ['ui.router']); - -/** - * @ngdoc object - * @name ui.router.util.$resolve - * - * @requires $q - * @requires $injector - * - * @description - * Manages resolution of (acyclic) graphs of promises. - */ -$Resolve.$inject = ['$q', '$injector']; -function $Resolve( $q, $injector) { - - var VISIT_IN_PROGRESS = 1, - VISIT_DONE = 2, - NOTHING = {}, - NO_DEPENDENCIES = [], - NO_LOCALS = NOTHING, - NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING }); - - - /** - * @ngdoc function - * @name ui.router.util.$resolve#study - * @methodOf ui.router.util.$resolve - * - * @description - * Studies a set of invocables that are likely to be used multiple times. - *
      -   * $resolve.study(invocables)(locals, parent, self)
      -   * 
      - * is equivalent to - *
      -   * $resolve.resolve(invocables, locals, parent, self)
      -   * 
      - * but the former is more efficient (in fact `resolve` just calls `study` - * internally). - * - * @param {object} invocables Invocable objects - * @return {function} a function to pass in locals, parent and self - */ - this.study = function (invocables) { - if (!isObject(invocables)) throw new Error("'invocables' must be an object"); - var invocableKeys = objectKeys(invocables || {}); - - // Perform a topological sort of invocables to build an ordered plan - var plan = [], cycle = [], visited = {}; - function visit(value, key) { - if (visited[key] === VISIT_DONE) return; - - cycle.push(key); - if (visited[key] === VISIT_IN_PROGRESS) { - cycle.splice(0, indexOf(cycle, key)); - throw new Error("Cyclic dependency: " + cycle.join(" -> ")); - } - visited[key] = VISIT_IN_PROGRESS; - - if (isString(value)) { - plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES); - } else { - var params = $injector.annotate(value); - forEach(params, function (param) { - if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param); - }); - plan.push(key, value, params); - } - - cycle.pop(); - visited[key] = VISIT_DONE; - } - forEach(invocables, visit); - invocables = cycle = visited = null; // plan is all that's required - - function isResolve(value) { - return isObject(value) && value.then && value.$$promises; - } - - return function (locals, parent, self) { - if (isResolve(locals) && self === undefined) { - self = parent; parent = locals; locals = null; - } - if (!locals) locals = NO_LOCALS; - else if (!isObject(locals)) { - throw new Error("'locals' must be an object"); - } - if (!parent) parent = NO_PARENT; - else if (!isResolve(parent)) { - throw new Error("'parent' must be a promise returned by $resolve.resolve()"); - } - - // To complete the overall resolution, we have to wait for the parent - // promise and for the promise for each invokable in our plan. - var resolution = $q.defer(), - result = resolution.promise, - promises = result.$$promises = {}, - values = extend({}, locals), - wait = 1 + plan.length/3, - merged = false; - - function done() { - // Merge parent values we haven't got yet and publish our own $$values - if (!--wait) { - if (!merged) merge(values, parent.$$values); - result.$$values = values; - result.$$promises = result.$$promises || true; // keep for isResolve() - delete result.$$inheritedValues; - resolution.resolve(values); - } - } - - function fail(reason) { - result.$$failure = reason; - resolution.reject(reason); - } - - // Short-circuit if parent has already failed - if (isDefined(parent.$$failure)) { - fail(parent.$$failure); - return result; - } - - if (parent.$$inheritedValues) { - merge(values, omit(parent.$$inheritedValues, invocableKeys)); - } - - // Merge parent values if the parent has already resolved, or merge - // parent promises and wait if the parent resolve is still in progress. - extend(promises, parent.$$promises); - if (parent.$$values) { - merged = merge(values, omit(parent.$$values, invocableKeys)); - result.$$inheritedValues = omit(parent.$$values, invocableKeys); - done(); - } else { - if (parent.$$inheritedValues) { - result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys); - } - parent.then(done, fail); - } - - // Process each invocable in the plan, but ignore any where a local of the same name exists. - for (var i=0, ii=plan.length; i} The template html as a string, or a promise - * for that string. - */ - this.fromUrl = function (url, params) { - if (isFunction(url)) url = url(params); - if (url == null) return null; - else return $http - .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }}) - .then(function(response) { return response.data; }); - }; - - /** - * @ngdoc function - * @name ui.router.util.$templateFactory#fromProvider - * @methodOf ui.router.util.$templateFactory - * - * @description - * Creates a template by invoking an injectable provider function. - * - * @param {Function} provider Function to invoke via `$injector.invoke` - * @param {Object} params Parameters for the template. - * @param {Object} locals Locals to pass to `invoke`. Defaults to - * `{ params: params }`. - * @return {string|Promise.} The template html as a string, or a promise - * for that string. - */ - this.fromProvider = function (provider, params, locals) { - return $injector.invoke(provider, null, locals || { params: params }); - }; -} - -angular.module('ui.router.util').service('$templateFactory', $TemplateFactory); - -var $$UMFP; // reference to $UrlMatcherFactoryProvider - -/** - * @ngdoc object - * @name ui.router.util.type:UrlMatcher - * - * @description - * Matches URLs against patterns and extracts named parameters from the path or the search - * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list - * of search parameters. Multiple search parameter names are separated by '&'. Search parameters - * do not influence whether or not a URL is matched, but their values are passed through into - * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}. - * - * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace - * syntax, which optionally allows a regular expression for the parameter to be specified: - * - * * `':'` name - colon placeholder - * * `'*'` name - catch-all placeholder - * * `'{' name '}'` - curly placeholder - * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the - * regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash. - * - * Parameter names may contain only word characters (latin letters, digits, and underscore) and - * must be unique within the pattern (across both path and search parameters). For colon - * placeholders or curly placeholders without an explicit regexp, a path parameter matches any - * number of characters other than '/'. For catch-all placeholders the path parameter matches - * any number of characters. - * - * Examples: - * - * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for - * trailing slashes, and patterns have to match the entire path, not just a prefix. - * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or - * '/user/bob/details'. The second path segment will be captured as the parameter 'id'. - * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax. - * * `'/user/{id:[^/]*}'` - Same as the previous example. - * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id - * parameter consists of 1 to 8 hex digits. - * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the - * path into the parameter 'path'. - * * `'/files/*path'` - ditto. - * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined - * in the built-in `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start - * - * @param {string} pattern The pattern to compile into a matcher. - * @param {Object} config A configuration object hash: - * @param {Object=} parentMatcher Used to concatenate the pattern/config onto - * an existing UrlMatcher - * - * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`. - * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`. - * - * @property {string} prefix A static prefix of this pattern. The matcher guarantees that any - * URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns - * non-null) will start with this prefix. - * - * @property {string} source The pattern that was passed into the constructor - * - * @property {string} sourcePath The path portion of the source property - * - * @property {string} sourceSearch The search portion of the source property - * - * @property {string} regex The constructed regex that will be used to match against the url when - * it is time to determine which url will match. - * - * @returns {Object} New `UrlMatcher` object - */ -function UrlMatcher(pattern, config, parentMatcher) { - config = extend({ params: {} }, isObject(config) ? config : {}); - - // Find all placeholders and create a compiled pattern, using either classic or curly syntax: - // '*' name - // ':' name - // '{' name '}' - // '{' name ':' regexp '}' - // The regular expression is somewhat complicated due to the need to allow curly braces - // inside the regular expression. The placeholder regexp breaks down as follows: - // ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case) - // \{([\w\[\]]+)(?:\:\s*( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case - // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either - // [^{}\\]+ - anything other than curly braces or backslash - // \\. - a backslash escape - // \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms - var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, - searchPlaceholder = /([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, - compiled = '^', last = 0, m, - segments = this.segments = [], - parentParams = parentMatcher ? parentMatcher.params : {}, - params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(), - paramNames = []; - - function addParameter(id, type, config, location) { - paramNames.push(id); - if (parentParams[id]) return parentParams[id]; - if (!/^\w+([-.]+\w+)*(?:\[\])?$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'"); - if (params[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'"); - params[id] = new $$UMFP.Param(id, type, config, location); - return params[id]; - } - - function quoteRegExp(string, pattern, squash, optional) { - var surroundPattern = ['',''], result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&"); - if (!pattern) return result; - switch(squash) { - case false: surroundPattern = ['(', ')' + (optional ? "?" : "")]; break; - case true: - result = result.replace(/\/$/, ''); - surroundPattern = ['(?:\/(', ')|\/)?']; - break; - default: surroundPattern = ['(' + squash + "|", ')?']; break; - } - return result + surroundPattern[0] + pattern + surroundPattern[1]; - } - - this.source = pattern; - - // Split into static segments separated by path parameter placeholders. - // The number of segments is always 1 more than the number of parameters. - function matchDetails(m, isSearch) { - var id, regexp, segment, type, cfg, arrayMode; - id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null - cfg = config.params[id]; - segment = pattern.substring(last, m.index); - regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null); - - if (regexp) { - type = $$UMFP.type(regexp) || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) }); - } - - return { - id: id, regexp: regexp, segment: segment, type: type, cfg: cfg - }; - } - - var p, param, segment; - while ((m = placeholder.exec(pattern))) { - p = matchDetails(m, false); - if (p.segment.indexOf('?') >= 0) break; // we're into the search part - - param = addParameter(p.id, p.type, p.cfg, "path"); - compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash, param.isOptional); - segments.push(p.segment); - last = placeholder.lastIndex; - } - segment = pattern.substring(last); - - // Find any search parameter names and remove them from the last segment - var i = segment.indexOf('?'); - - if (i >= 0) { - var search = this.sourceSearch = segment.substring(i); - segment = segment.substring(0, i); - this.sourcePath = pattern.substring(0, last + i); - - if (search.length > 0) { - last = 0; - while ((m = searchPlaceholder.exec(search))) { - p = matchDetails(m, true); - param = addParameter(p.id, p.type, p.cfg, "search"); - last = placeholder.lastIndex; - // check if ?& - } - } - } else { - this.sourcePath = pattern; - this.sourceSearch = ''; - } - - compiled += quoteRegExp(segment) + (config.strict === false ? '\/?' : '') + '$'; - segments.push(segment); - - this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined); - this.prefix = segments[0]; - this.$$paramNames = paramNames; -} - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#concat - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Returns a new matcher for a pattern constructed by appending the path part and adding the - * search parameters of the specified pattern to this pattern. The current pattern is not - * modified. This can be understood as creating a pattern for URLs that are relative to (or - * suffixes of) the current pattern. - * - * @example - * The following two matchers are equivalent: - *
      - * new UrlMatcher('/user/{id}?q').concat('/details?date');
      - * new UrlMatcher('/user/{id}/details?q&date');
      - * 
      - * - * @param {string} pattern The pattern to append. - * @param {Object} config An object hash of the configuration for the matcher. - * @returns {UrlMatcher} A matcher for the concatenated pattern. - */ -UrlMatcher.prototype.concat = function (pattern, config) { - // Because order of search parameters is irrelevant, we can add our own search - // parameters to the end of the new pattern. Parse the new pattern by itself - // and then join the bits together, but it's much easier to do this on a string level. - var defaultConfig = { - caseInsensitive: $$UMFP.caseInsensitive(), - strict: $$UMFP.strictMode(), - squash: $$UMFP.defaultSquashPolicy() - }; - return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this); -}; - -UrlMatcher.prototype.toString = function () { - return this.source; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#exec - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Tests the specified path against this matcher, and returns an object containing the captured - * parameter values, or null if the path does not match. The returned object contains the values - * of any search parameters that are mentioned in the pattern, but their value may be null if - * they are not present in `searchParams`. This means that search parameters are always treated - * as optional. - * - * @example - *
      - * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
      - *   x: '1', q: 'hello'
      - * });
      - * // returns { id: 'bob', q: 'hello', r: null }
      - * 
      - * - * @param {string} path The URL path to match, e.g. `$location.path()`. - * @param {Object} searchParams URL search parameters, e.g. `$location.search()`. - * @returns {Object} The captured parameter values. - */ -UrlMatcher.prototype.exec = function (path, searchParams) { - var m = this.regexp.exec(path); - if (!m) return null; - searchParams = searchParams || {}; - - var paramNames = this.parameters(), nTotal = paramNames.length, - nPath = this.segments.length - 1, - values = {}, i, j, cfg, paramName; - - if (nPath !== m.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'"); - - function decodePathArray(string) { - function reverseString(str) { return str.split("").reverse().join(""); } - function unquoteDashes(str) { return str.replace(/\\-/g, "-"); } - - var split = reverseString(string).split(/-(?!\\)/); - var allReversed = map(split, reverseString); - return map(allReversed, unquoteDashes).reverse(); - } - - var param, paramVal; - for (i = 0; i < nPath; i++) { - paramName = paramNames[i]; - param = this.params[paramName]; - paramVal = m[i+1]; - // if the param value matches a pre-replace pair, replace the value before decoding. - for (j = 0; j < param.replace.length; j++) { - if (param.replace[j].from === paramVal) paramVal = param.replace[j].to; - } - if (paramVal && param.array === true) paramVal = decodePathArray(paramVal); - if (isDefined(paramVal)) paramVal = param.type.decode(paramVal); - values[paramName] = param.value(paramVal); - } - for (/**/; i < nTotal; i++) { - paramName = paramNames[i]; - values[paramName] = this.params[paramName].value(searchParams[paramName]); - param = this.params[paramName]; - paramVal = searchParams[paramName]; - for (j = 0; j < param.replace.length; j++) { - if (param.replace[j].from === paramVal) paramVal = param.replace[j].to; - } - if (isDefined(paramVal)) paramVal = param.type.decode(paramVal); - values[paramName] = param.value(paramVal); - } - - return values; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#parameters - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Returns the names of all path and search parameters of this pattern in an unspecified order. - * - * @returns {Array.} An array of parameter names. Must be treated as read-only. If the - * pattern has no parameters, an empty array is returned. - */ -UrlMatcher.prototype.parameters = function (param) { - if (!isDefined(param)) return this.$$paramNames; - return this.params[param] || null; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#validates - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Checks an object hash of parameters to validate their correctness according to the parameter - * types of this `UrlMatcher`. - * - * @param {Object} params The object hash of parameters to validate. - * @returns {boolean} Returns `true` if `params` validates, otherwise `false`. - */ -UrlMatcher.prototype.validates = function (params) { - return this.params.$$validates(params); -}; - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#format - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Creates a URL that matches this pattern by substituting the specified values - * for the path and search parameters. Null values for path parameters are - * treated as empty strings. - * - * @example - *
      - * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
      - * // returns '/user/bob?q=yes'
      - * 
      - * - * @param {Object} values the values to substitute for the parameters in this pattern. - * @returns {string} the formatted URL (path and optionally search part). - */ -UrlMatcher.prototype.format = function (values) { - values = values || {}; - var segments = this.segments, params = this.parameters(), paramset = this.params; - if (!this.validates(values)) return null; - - var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0]; - - function encodeDashes(str) { // Replace dashes with encoded "\-" - return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); }); - } - - for (i = 0; i < nTotal; i++) { - var isPathParam = i < nPath; - var name = params[i], param = paramset[name], value = param.value(values[name]); - var isDefaultValue = param.isOptional && param.type.equals(param.value(), value); - var squash = isDefaultValue ? param.squash : false; - var encoded = param.type.encode(value); - - if (isPathParam) { - var nextSegment = segments[i + 1]; - var isFinalPathParam = i + 1 === nPath; - - if (squash === false) { - if (encoded != null) { - if (isArray(encoded)) { - result += map(encoded, encodeDashes).join("-"); - } else { - result += encodeURIComponent(encoded); - } - } - result += nextSegment; - } else if (squash === true) { - var capture = result.match(/\/$/) ? /\/?(.*)/ : /(.*)/; - result += nextSegment.match(capture)[1]; - } else if (isString(squash)) { - result += squash + nextSegment; - } - - if (isFinalPathParam && param.squash === true && result.slice(-1) === '/') result = result.slice(0, -1); - } else { - if (encoded == null || (isDefaultValue && squash !== false)) continue; - if (!isArray(encoded)) encoded = [ encoded ]; - if (encoded.length === 0) continue; - encoded = map(encoded, encodeURIComponent).join('&' + name + '='); - result += (search ? '&' : '?') + (name + '=' + encoded); - search = true; - } - } - - return result; -}; - -/** - * @ngdoc object - * @name ui.router.util.type:Type - * - * @description - * Implements an interface to define custom parameter types that can be decoded from and encoded to - * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`} - * objects when matching or formatting URLs, or comparing or validating parameter values. - * - * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more - * information on registering custom types. - * - * @param {Object} config A configuration object which contains the custom type definition. The object's - * properties will override the default methods and/or pattern in `Type`'s public interface. - * @example - *
      - * {
      - *   decode: function(val) { return parseInt(val, 10); },
      - *   encode: function(val) { return val && val.toString(); },
      - *   equals: function(a, b) { return this.is(a) && a === b; },
      - *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },
      - *   pattern: /\d+/
      - * }
      - * 
      - * - * @property {RegExp} pattern The regular expression pattern used to match values of this type when - * coming from a substring of a URL. - * - * @returns {Object} Returns a new `Type` object. - */ -function Type(config) { - extend(this, config); -} - -/** - * @ngdoc function - * @name ui.router.util.type:Type#is - * @methodOf ui.router.util.type:Type - * - * @description - * Detects whether a value is of a particular type. Accepts a native (decoded) value - * and determines whether it matches the current `Type` object. - * - * @param {*} val The value to check. - * @param {string} key Optional. If the type check is happening in the context of a specific - * {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the - * parameter in which `val` is stored. Can be used for meta-programming of `Type` objects. - * @returns {Boolean} Returns `true` if the value matches the type, otherwise `false`. - */ -Type.prototype.is = function(val, key) { - return true; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:Type#encode - * @methodOf ui.router.util.type:Type - * - * @description - * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the - * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it - * only needs to be a representation of `val` that has been coerced to a string. - * - * @param {*} val The value to encode. - * @param {string} key The name of the parameter in which `val` is stored. Can be used for - * meta-programming of `Type` objects. - * @returns {string} Returns a string representation of `val` that can be encoded in a URL. - */ -Type.prototype.encode = function(val, key) { - return val; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:Type#decode - * @methodOf ui.router.util.type:Type - * - * @description - * Converts a parameter value (from URL string or transition param) to a custom/native value. - * - * @param {string} val The URL parameter value to decode. - * @param {string} key The name of the parameter in which `val` is stored. Can be used for - * meta-programming of `Type` objects. - * @returns {*} Returns a custom representation of the URL parameter value. - */ -Type.prototype.decode = function(val, key) { - return val; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:Type#equals - * @methodOf ui.router.util.type:Type - * - * @description - * Determines whether two decoded values are equivalent. - * - * @param {*} a A value to compare against. - * @param {*} b A value to compare against. - * @returns {Boolean} Returns `true` if the values are equivalent/equal, otherwise `false`. - */ -Type.prototype.equals = function(a, b) { - return a == b; -}; - -Type.prototype.$subPattern = function() { - var sub = this.pattern.toString(); - return sub.substr(1, sub.length - 2); -}; - -Type.prototype.pattern = /.*/; - -Type.prototype.toString = function() { return "{Type:" + this.name + "}"; }; - -/** Given an encoded string, or a decoded object, returns a decoded object */ -Type.prototype.$normalize = function(val) { - return this.is(val) ? val : this.decode(val); -}; - -/* - * Wraps an existing custom Type as an array of Type, depending on 'mode'. - * e.g.: - * - urlmatcher pattern "/path?{queryParam[]:int}" - * - url: "/path?queryParam=1&queryParam=2 - * - $stateParams.queryParam will be [1, 2] - * if `mode` is "auto", then - * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1 - * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2] - */ -Type.prototype.$asArray = function(mode, isSearch) { - if (!mode) return this; - if (mode === "auto" && !isSearch) throw new Error("'auto' array mode is for query parameters only"); - - function ArrayType(type, mode) { - function bindTo(type, callbackName) { - return function() { - return type[callbackName].apply(type, arguments); - }; - } - - // Wrap non-array value as array - function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); } - // Unwrap array value for "auto" mode. Return undefined for empty array. - function arrayUnwrap(val) { - switch(val.length) { - case 0: return undefined; - case 1: return mode === "auto" ? val[0] : val; - default: return val; - } - } - function falsey(val) { return !val; } - - // Wraps type (.is/.encode/.decode) functions to operate on each value of an array - function arrayHandler(callback, allTruthyMode) { - return function handleArray(val) { - if (isArray(val) && val.length === 0) return val; - val = arrayWrap(val); - var result = map(val, callback); - if (allTruthyMode === true) - return filter(result, falsey).length === 0; - return arrayUnwrap(result); - }; - } - - // Wraps type (.equals) functions to operate on each value of an array - function arrayEqualsHandler(callback) { - return function handleArray(val1, val2) { - var left = arrayWrap(val1), right = arrayWrap(val2); - if (left.length !== right.length) return false; - for (var i = 0; i < left.length; i++) { - if (!callback(left[i], right[i])) return false; - } - return true; - }; - } - - this.encode = arrayHandler(bindTo(type, 'encode')); - this.decode = arrayHandler(bindTo(type, 'decode')); - this.is = arrayHandler(bindTo(type, 'is'), true); - this.equals = arrayEqualsHandler(bindTo(type, 'equals')); - this.pattern = type.pattern; - this.$normalize = arrayHandler(bindTo(type, '$normalize')); - this.name = type.name; - this.$arrayMode = mode; - } - - return new ArrayType(this, mode); -}; - - - -/** - * @ngdoc object - * @name ui.router.util.$urlMatcherFactory - * - * @description - * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory - * is also available to providers under the name `$urlMatcherFactoryProvider`. - */ -function $UrlMatcherFactory() { - $$UMFP = this; - - var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false; - - // Use tildes to pre-encode slashes. - // If the slashes are simply URLEncoded, the browser can choose to pre-decode them, - // and bidirectional encoding/decoding fails. - // Tilde was chosen because it's not a RFC 3986 section 2.2 Reserved Character - function valToString(val) { return val != null ? val.toString().replace(/~/g, "~~").replace(/\//g, "~2F") : val; } - function valFromString(val) { return val != null ? val.toString().replace(/~2F/g, "/").replace(/~~/g, "~") : val; } - - var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = { - "string": { - encode: valToString, - decode: valFromString, - // TODO: in 1.0, make string .is() return false if value is undefined/null by default. - // In 0.2.x, string params are optional by default for backwards compat - is: function(val) { return val == null || !isDefined(val) || typeof val === "string"; }, - pattern: /[^/]*/ - }, - "int": { - encode: valToString, - decode: function(val) { return parseInt(val, 10); }, - is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; }, - pattern: /\d+/ - }, - "bool": { - encode: function(val) { return val ? 1 : 0; }, - decode: function(val) { return parseInt(val, 10) !== 0; }, - is: function(val) { return val === true || val === false; }, - pattern: /0|1/ - }, - "date": { - encode: function (val) { - if (!this.is(val)) - return undefined; - return [ val.getFullYear(), - ('0' + (val.getMonth() + 1)).slice(-2), - ('0' + val.getDate()).slice(-2) - ].join("-"); - }, - decode: function (val) { - if (this.is(val)) return val; - var match = this.capture.exec(val); - return match ? new Date(match[1], match[2] - 1, match[3]) : undefined; - }, - is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); }, - equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); }, - pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/, - capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/ - }, - "json": { - encode: angular.toJson, - decode: angular.fromJson, - is: angular.isObject, - equals: angular.equals, - pattern: /[^/]*/ - }, - "any": { // does not encode/decode - encode: angular.identity, - decode: angular.identity, - equals: angular.equals, - pattern: /.*/ - } - }; - - function getDefaultConfig() { - return { - strict: isStrictMode, - caseInsensitive: isCaseInsensitive - }; - } - - function isInjectable(value) { - return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1]))); - } - - /** - * [Internal] Get the default value of a parameter, which may be an injectable function. - */ - $UrlMatcherFactory.$$getDefaultValue = function(config) { - if (!isInjectable(config.value)) return config.value; - if (!injector) throw new Error("Injectable functions cannot be called at configuration time"); - return injector.invoke(config.value); - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#caseInsensitive - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Defines whether URL matching should be case sensitive (the default behavior), or not. - * - * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`; - * @returns {boolean} the current value of caseInsensitive - */ - this.caseInsensitive = function(value) { - if (isDefined(value)) - isCaseInsensitive = value; - return isCaseInsensitive; - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#strictMode - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Defines whether URLs should match trailing slashes, or not (the default behavior). - * - * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`. - * @returns {boolean} the current value of strictMode - */ - this.strictMode = function(value) { - if (isDefined(value)) - isStrictMode = value; - return isStrictMode; - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Sets the default behavior when generating or matching URLs with default parameter values. - * - * @param {string} value A string that defines the default parameter URL squashing behavior. - * `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL - * `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the - * parameter is surrounded by slashes, squash (remove) one slash from the URL - * any other string, e.g. "~": When generating an href with a default parameter value, squash (remove) - * the parameter value from the URL and replace it with this string. - */ - this.defaultSquashPolicy = function(value) { - if (!isDefined(value)) return defaultSquashPolicy; - if (value !== true && value !== false && !isString(value)) - throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string"); - defaultSquashPolicy = value; - return value; - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#compile - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern. - * - * @param {string} pattern The URL pattern. - * @param {Object} config The config object hash. - * @returns {UrlMatcher} The UrlMatcher. - */ - this.compile = function (pattern, config) { - return new UrlMatcher(pattern, extend(getDefaultConfig(), config)); - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#isMatcher - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Returns true if the specified object is a `UrlMatcher`, or false otherwise. - * - * @param {Object} object The object to perform the type check against. - * @returns {Boolean} Returns `true` if the object matches the `UrlMatcher` interface, by - * implementing all the same methods. - */ - this.isMatcher = function (o) { - if (!isObject(o)) return false; - var result = true; - - forEach(UrlMatcher.prototype, function(val, name) { - if (isFunction(val)) { - result = result && (isDefined(o[name]) && isFunction(o[name])); - } - }); - return result; - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#type - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to - * generate URLs with typed parameters. - * - * @param {string} name The type name. - * @param {Object|Function} definition The type definition. See - * {@link ui.router.util.type:Type `Type`} for information on the values accepted. - * @param {Object|Function} definitionFn (optional) A function that is injected before the app - * runtime starts. The result of this function is merged into the existing `definition`. - * See {@link ui.router.util.type:Type `Type`} for information on the values accepted. - * - * @returns {Object} Returns `$urlMatcherFactoryProvider`. - * - * @example - * This is a simple example of a custom type that encodes and decodes items from an - * array, using the array index as the URL-encoded value: - * - *
      -   * var list = ['John', 'Paul', 'George', 'Ringo'];
      -   *
      -   * $urlMatcherFactoryProvider.type('listItem', {
      -   *   encode: function(item) {
      -   *     // Represent the list item in the URL using its corresponding index
      -   *     return list.indexOf(item);
      -   *   },
      -   *   decode: function(item) {
      -   *     // Look up the list item by index
      -   *     return list[parseInt(item, 10)];
      -   *   },
      -   *   is: function(item) {
      -   *     // Ensure the item is valid by checking to see that it appears
      -   *     // in the list
      -   *     return list.indexOf(item) > -1;
      -   *   }
      -   * });
      -   *
      -   * $stateProvider.state('list', {
      -   *   url: "/list/{item:listItem}",
      -   *   controller: function($scope, $stateParams) {
      -   *     console.log($stateParams.item);
      -   *   }
      -   * });
      -   *
      -   * // ...
      -   *
      -   * // Changes URL to '/list/3', logs "Ringo" to the console
      -   * $state.go('list', { item: "Ringo" });
      -   * 
      - * - * This is a more complex example of a type that relies on dependency injection to - * interact with services, and uses the parameter name from the URL to infer how to - * handle encoding and decoding parameter values: - * - *
      -   * // Defines a custom type that gets a value from a service,
      -   * // where each service gets different types of values from
      -   * // a backend API:
      -   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {
      -   *
      -   *   // Matches up services to URL parameter names
      -   *   var services = {
      -   *     user: Users,
      -   *     post: Posts
      -   *   };
      -   *
      -   *   return {
      -   *     encode: function(object) {
      -   *       // Represent the object in the URL using its unique ID
      -   *       return object.id;
      -   *     },
      -   *     decode: function(value, key) {
      -   *       // Look up the object by ID, using the parameter
      -   *       // name (key) to call the correct service
      -   *       return services[key].findById(value);
      -   *     },
      -   *     is: function(object, key) {
      -   *       // Check that object is a valid dbObject
      -   *       return angular.isObject(object) && object.id && services[key];
      -   *     }
      -   *     equals: function(a, b) {
      -   *       // Check the equality of decoded objects by comparing
      -   *       // their unique IDs
      -   *       return a.id === b.id;
      -   *     }
      -   *   };
      -   * });
      -   *
      -   * // In a config() block, you can then attach URLs with
      -   * // type-annotated parameters:
      -   * $stateProvider.state('users', {
      -   *   url: "/users",
      -   *   // ...
      -   * }).state('users.item', {
      -   *   url: "/{user:dbObject}",
      -   *   controller: function($scope, $stateParams) {
      -   *     // $stateParams.user will now be an object returned from
      -   *     // the Users service
      -   *   },
      -   *   // ...
      -   * });
      -   * 
      - */ - this.type = function (name, definition, definitionFn) { - if (!isDefined(definition)) return $types[name]; - if ($types.hasOwnProperty(name)) throw new Error("A type named '" + name + "' has already been defined."); - - $types[name] = new Type(extend({ name: name }, definition)); - if (definitionFn) { - typeQueue.push({ name: name, def: definitionFn }); - if (!enqueue) flushTypeQueue(); - } - return this; - }; - - // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s - function flushTypeQueue() { - while(typeQueue.length) { - var type = typeQueue.shift(); - if (type.pattern) throw new Error("You cannot override a type's .pattern at runtime."); - angular.extend($types[type.name], injector.invoke(type.def)); - } - } - - // Register default types. Store them in the prototype of $types. - forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); }); - $types = inherit($types, {}); - - /* No need to document $get, since it returns this */ - this.$get = ['$injector', function ($injector) { - injector = $injector; - enqueue = false; - flushTypeQueue(); - - forEach(defaultTypes, function(type, name) { - if (!$types[name]) $types[name] = new Type(type); - }); - return this; - }]; - - this.Param = function Param(id, type, config, location) { - var self = this; - config = unwrapShorthand(config); - type = getType(config, type, location); - var arrayMode = getArrayMode(); - type = arrayMode ? type.$asArray(arrayMode, location === "search") : type; - if (type.name === "string" && !arrayMode && location === "path" && config.value === undefined) - config.value = ""; // for 0.2.x; in 0.3.0+ do not automatically default to "" - var isOptional = config.value !== undefined; - var squash = getSquashPolicy(config, isOptional); - var replace = getReplace(config, arrayMode, isOptional, squash); - - function unwrapShorthand(config) { - var keys = isObject(config) ? objectKeys(config) : []; - var isShorthand = indexOf(keys, "value") === -1 && indexOf(keys, "type") === -1 && - indexOf(keys, "squash") === -1 && indexOf(keys, "array") === -1; - if (isShorthand) config = { value: config }; - config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; }; - return config; - } - - function getType(config, urlType, location) { - if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations."); - if (urlType) return urlType; - if (!config.type) return (location === "config" ? $types.any : $types.string); - - if (angular.isString(config.type)) - return $types[config.type]; - if (config.type instanceof Type) - return config.type; - return new Type(config.type); - } - - // array config: param name (param[]) overrides default settings. explicit config overrides param name. - function getArrayMode() { - var arrayDefaults = { array: (location === "search" ? "auto" : false) }; - var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {}; - return extend(arrayDefaults, arrayParamNomenclature, config).array; - } - - /** - * returns false, true, or the squash value to indicate the "default parameter url squash policy". - */ - function getSquashPolicy(config, isOptional) { - var squash = config.squash; - if (!isOptional || squash === false) return false; - if (!isDefined(squash) || squash == null) return defaultSquashPolicy; - if (squash === true || isString(squash)) return squash; - throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string"); - } - - function getReplace(config, arrayMode, isOptional, squash) { - var replace, configuredKeys, defaultPolicy = [ - { from: "", to: (isOptional || arrayMode ? undefined : "") }, - { from: null, to: (isOptional || arrayMode ? undefined : "") } - ]; - replace = isArray(config.replace) ? config.replace : []; - if (isString(squash)) - replace.push({ from: squash, to: undefined }); - configuredKeys = map(replace, function(item) { return item.from; } ); - return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace); - } - - /** - * [Internal] Get the default value of a parameter, which may be an injectable function. - */ - function $$getDefaultValue() { - if (!injector) throw new Error("Injectable functions cannot be called at configuration time"); - var defaultValue = injector.invoke(config.$$fn); - if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue)) - throw new Error("Default value (" + defaultValue + ") for parameter '" + self.id + "' is not an instance of Type (" + self.type.name + ")"); - return defaultValue; - } - - /** - * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the - * default value, which may be the result of an injectable function. - */ - function $value(value) { - function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; } - function $replace(value) { - var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; }); - return replacement.length ? replacement[0] : value; - } - value = $replace(value); - return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value); - } - - function toString() { return "{Param:" + id + " " + type + " squash: '" + squash + "' optional: " + isOptional + "}"; } - - extend(this, { - id: id, - type: type, - location: location, - array: arrayMode, - squash: squash, - replace: replace, - isOptional: isOptional, - value: $value, - dynamic: undefined, - config: config, - toString: toString - }); - }; - - function ParamSet(params) { - extend(this, params || {}); - } - - ParamSet.prototype = { - $$new: function() { - return inherit(this, extend(new ParamSet(), { $$parent: this})); - }, - $$keys: function () { - var keys = [], chain = [], parent = this, - ignore = objectKeys(ParamSet.prototype); - while (parent) { chain.push(parent); parent = parent.$$parent; } - chain.reverse(); - forEach(chain, function(paramset) { - forEach(objectKeys(paramset), function(key) { - if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key); - }); - }); - return keys; - }, - $$values: function(paramValues) { - var values = {}, self = this; - forEach(self.$$keys(), function(key) { - values[key] = self[key].value(paramValues && paramValues[key]); - }); - return values; - }, - $$equals: function(paramValues1, paramValues2) { - var equal = true, self = this; - forEach(self.$$keys(), function(key) { - var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key]; - if (!self[key].type.equals(left, right)) equal = false; - }); - return equal; - }, - $$validates: function $$validate(paramValues) { - var keys = this.$$keys(), i, param, rawVal, normalized, encoded; - for (i = 0; i < keys.length; i++) { - param = this[keys[i]]; - rawVal = paramValues[keys[i]]; - if ((rawVal === undefined || rawVal === null) && param.isOptional) - break; // There was no parameter value, but the param is optional - normalized = param.type.$normalize(rawVal); - if (!param.type.is(normalized)) - return false; // The value was not of the correct Type, and could not be decoded to the correct Type - encoded = param.type.encode(normalized); - if (angular.isString(encoded) && !param.type.pattern.exec(encoded)) - return false; // The value was of the correct type, but when encoded, did not match the Type's regexp - } - return true; - }, - $$parent: undefined - }; - - this.ParamSet = ParamSet; -} - -// Register as a provider so it's available to other providers -angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory); -angular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]); - -/** - * @ngdoc object - * @name ui.router.router.$urlRouterProvider - * - * @requires ui.router.util.$urlMatcherFactoryProvider - * @requires $locationProvider - * - * @description - * `$urlRouterProvider` has the responsibility of watching `$location`. - * When `$location` changes it runs through a list of rules one by one until a - * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify - * a url in a state configuration. All urls are compiled into a UrlMatcher object. - * - * There are several methods on `$urlRouterProvider` that make it useful to use directly - * in your module config. - */ -$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider']; -function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { - var rules = [], otherwise = null, interceptDeferred = false, listener; - - // Returns a string that is a prefix of all strings matching the RegExp - function regExpPrefix(re) { - var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source); - return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : ''; - } - - // Interpolates matched values into a String.replace()-style pattern - function interpolate(pattern, match) { - return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) { - return match[what === '$' ? 0 : Number(what)]; - }); - } - - /** - * @ngdoc function - * @name ui.router.router.$urlRouterProvider#rule - * @methodOf ui.router.router.$urlRouterProvider - * - * @description - * Defines rules that are used by `$urlRouterProvider` to find matches for - * specific URLs. - * - * @example - *
      -   * var app = angular.module('app', ['ui.router.router']);
      -   *
      -   * app.config(function ($urlRouterProvider) {
      -   *   // Here's an example of how you might allow case insensitive urls
      -   *   $urlRouterProvider.rule(function ($injector, $location) {
      -   *     var path = $location.path(),
      -   *         normalized = path.toLowerCase();
      -   *
      -   *     if (path !== normalized) {
      -   *       return normalized;
      -   *     }
      -   *   });
      -   * });
      -   * 
      - * - * @param {function} rule Handler function that takes `$injector` and `$location` - * services as arguments. You can use them to return a valid path as a string. - * - * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance - */ - this.rule = function (rule) { - if (!isFunction(rule)) throw new Error("'rule' must be a function"); - rules.push(rule); - return this; - }; - - /** - * @ngdoc object - * @name ui.router.router.$urlRouterProvider#otherwise - * @methodOf ui.router.router.$urlRouterProvider - * - * @description - * Defines a path that is used when an invalid route is requested. - * - * @example - *
      -   * var app = angular.module('app', ['ui.router.router']);
      -   *
      -   * app.config(function ($urlRouterProvider) {
      -   *   // if the path doesn't match any of the urls you configured
      -   *   // otherwise will take care of routing the user to the
      -   *   // specified url
      -   *   $urlRouterProvider.otherwise('/index');
      -   *
      -   *   // Example of using function rule as param
      -   *   $urlRouterProvider.otherwise(function ($injector, $location) {
      -   *     return '/a/valid/url';
      -   *   });
      -   * });
      -   * 
      - * - * @param {string|function} rule The url path you want to redirect to or a function - * rule that returns the url path. The function version is passed two params: - * `$injector` and `$location` services, and must return a url string. - * - * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance - */ - this.otherwise = function (rule) { - if (isString(rule)) { - var redirect = rule; - rule = function () { return redirect; }; - } - else if (!isFunction(rule)) throw new Error("'rule' must be a function"); - otherwise = rule; - return this; - }; - - - function handleIfMatch($injector, handler, match) { - if (!match) return false; - var result = $injector.invoke(handler, handler, { $match: match }); - return isDefined(result) ? result : true; - } - - /** - * @ngdoc function - * @name ui.router.router.$urlRouterProvider#when - * @methodOf ui.router.router.$urlRouterProvider - * - * @description - * Registers a handler for a given url matching. - * - * If the handler is a string, it is - * treated as a redirect, and is interpolated according to the syntax of match - * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). - * - * If the handler is a function, it is injectable. It gets invoked if `$location` - * matches. You have the option of inject the match object as `$match`. - * - * The handler can return - * - * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` - * will continue trying to find another one that matches. - * - **string** which is treated as a redirect and passed to `$location.url()` - * - **void** or any **truthy** value tells `$urlRouter` that the url was handled. - * - * @example - *
      -   * var app = angular.module('app', ['ui.router.router']);
      -   *
      -   * app.config(function ($urlRouterProvider) {
      -   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {
      -   *     if ($state.$current.navigable !== state ||
      -   *         !equalForKeys($match, $stateParams) {
      -   *      $state.transitionTo(state, $match, false);
      -   *     }
      -   *   });
      -   * });
      -   * 
      - * - * @param {string|object} what The incoming path that you want to redirect. - * @param {string|function} handler The path you want to redirect your user to. - */ - this.when = function (what, handler) { - var redirect, handlerIsString = isString(handler); - if (isString(what)) what = $urlMatcherFactory.compile(what); - - if (!handlerIsString && !isFunction(handler) && !isArray(handler)) - throw new Error("invalid 'handler' in when()"); - - var strategies = { - matcher: function (what, handler) { - if (handlerIsString) { - redirect = $urlMatcherFactory.compile(handler); - handler = ['$match', function ($match) { return redirect.format($match); }]; - } - return extend(function ($injector, $location) { - return handleIfMatch($injector, handler, what.exec($location.path(), $location.search())); - }, { - prefix: isString(what.prefix) ? what.prefix : '' - }); - }, - regex: function (what, handler) { - if (what.global || what.sticky) throw new Error("when() RegExp must not be global or sticky"); - - if (handlerIsString) { - redirect = handler; - handler = ['$match', function ($match) { return interpolate(redirect, $match); }]; - } - return extend(function ($injector, $location) { - return handleIfMatch($injector, handler, what.exec($location.path())); - }, { - prefix: regExpPrefix(what) - }); - } - }; - - var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp }; - - for (var n in check) { - if (check[n]) return this.rule(strategies[n](what, handler)); - } - - throw new Error("invalid 'what' in when()"); - }; - - /** - * @ngdoc function - * @name ui.router.router.$urlRouterProvider#deferIntercept - * @methodOf ui.router.router.$urlRouterProvider - * - * @description - * Disables (or enables) deferring location change interception. - * - * If you wish to customize the behavior of syncing the URL (for example, if you wish to - * defer a transition but maintain the current URL), call this method at configuration time. - * Then, at run time, call `$urlRouter.listen()` after you have configured your own - * `$locationChangeSuccess` event handler. - * - * @example - *
      -   * var app = angular.module('app', ['ui.router.router']);
      -   *
      -   * app.config(function ($urlRouterProvider) {
      -   *
      -   *   // Prevent $urlRouter from automatically intercepting URL changes;
      -   *   // this allows you to configure custom behavior in between
      -   *   // location changes and route synchronization:
      -   *   $urlRouterProvider.deferIntercept();
      -   *
      -   * }).run(function ($rootScope, $urlRouter, UserService) {
      -   *
      -   *   $rootScope.$on('$locationChangeSuccess', function(e) {
      -   *     // UserService is an example service for managing user state
      -   *     if (UserService.isLoggedIn()) return;
      -   *
      -   *     // Prevent $urlRouter's default handler from firing
      -   *     e.preventDefault();
      -   *
      -   *     UserService.handleLogin().then(function() {
      -   *       // Once the user has logged in, sync the current URL
      -   *       // to the router:
      -   *       $urlRouter.sync();
      -   *     });
      -   *   });
      -   *
      -   *   // Configures $urlRouter's listener *after* your custom listener
      -   *   $urlRouter.listen();
      -   * });
      -   * 
      - * - * @param {boolean} defer Indicates whether to defer location change interception. Passing - no parameter is equivalent to `true`. - */ - this.deferIntercept = function (defer) { - if (defer === undefined) defer = true; - interceptDeferred = defer; - }; - - /** - * @ngdoc object - * @name ui.router.router.$urlRouter - * - * @requires $location - * @requires $rootScope - * @requires $injector - * @requires $browser - * - * @description - * - */ - this.$get = $get; - $get.$inject = ['$location', '$rootScope', '$injector', '$browser', '$sniffer']; - function $get( $location, $rootScope, $injector, $browser, $sniffer) { - - var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl; - - function appendBasePath(url, isHtml5, absolute) { - if (baseHref === '/') return url; - if (isHtml5) return baseHref.slice(0, -1) + url; - if (absolute) return baseHref.slice(1) + url; - return url; - } - - // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree - function update(evt) { - if (evt && evt.defaultPrevented) return; - var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl; - lastPushedUrl = undefined; - // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573 - //if (ignoreUpdate) return true; - - function check(rule) { - var handled = rule($injector, $location); - - if (!handled) return false; - if (isString(handled)) $location.replace().url(handled); - return true; - } - var n = rules.length, i; - - for (i = 0; i < n; i++) { - if (check(rules[i])) return; - } - // always check otherwise last to allow dynamic updates to the set of rules - if (otherwise) check(otherwise); - } - - function listen() { - listener = listener || $rootScope.$on('$locationChangeSuccess', update); - return listener; - } - - if (!interceptDeferred) listen(); - - return { - /** - * @ngdoc function - * @name ui.router.router.$urlRouter#sync - * @methodOf ui.router.router.$urlRouter - * - * @description - * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`. - * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event, - * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed - * with the transition by calling `$urlRouter.sync()`. - * - * @example - *
      -       * angular.module('app', ['ui.router'])
      -       *   .run(function($rootScope, $urlRouter) {
      -       *     $rootScope.$on('$locationChangeSuccess', function(evt) {
      -       *       // Halt state change from even starting
      -       *       evt.preventDefault();
      -       *       // Perform custom logic
      -       *       var meetsRequirement = ...
      -       *       // Continue with the update and state transition if logic allows
      -       *       if (meetsRequirement) $urlRouter.sync();
      -       *     });
      -       * });
      -       * 
      - */ - sync: function() { - update(); - }, - - listen: function() { - return listen(); - }, - - update: function(read) { - if (read) { - location = $location.url(); - return; - } - if ($location.url() === location) return; - - $location.url(location); - $location.replace(); - }, - - push: function(urlMatcher, params, options) { - var url = urlMatcher.format(params || {}); - - // Handle the special hash param, if needed - if (url !== null && params && params['#']) { - url += '#' + params['#']; - } - - $location.url(url); - lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined; - if (options && options.replace) $location.replace(); - }, - - /** - * @ngdoc function - * @name ui.router.router.$urlRouter#href - * @methodOf ui.router.router.$urlRouter - * - * @description - * A URL generation method that returns the compiled URL for a given - * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters. - * - * @example - *
      -       * $bob = $urlRouter.href(new UrlMatcher("/about/:person"), {
      -       *   person: "bob"
      -       * });
      -       * // $bob == "/about/bob";
      -       * 
      - * - * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate. - * @param {object=} params An object of parameter values to fill the matcher's required parameters. - * @param {object=} options Options object. The options are: - * - * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". - * - * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher` - */ - href: function(urlMatcher, params, options) { - if (!urlMatcher.validates(params)) return null; - - var isHtml5 = $locationProvider.html5Mode(); - if (angular.isObject(isHtml5)) { - isHtml5 = isHtml5.enabled; - } - - isHtml5 = isHtml5 && $sniffer.history; - - var url = urlMatcher.format(params); - options = options || {}; - - if (!isHtml5 && url !== null) { - url = "#" + $locationProvider.hashPrefix() + url; - } - - // Handle special hash param, if needed - if (url !== null && params && params['#']) { - url += '#' + params['#']; - } - - url = appendBasePath(url, isHtml5, options.absolute); - - if (!options.absolute || !url) { - return url; - } - - var slash = (!isHtml5 && url ? '/' : ''), port = $location.port(); - port = (port === 80 || port === 443 ? '' : ':' + port); - - return [$location.protocol(), '://', $location.host(), port, slash, url].join(''); - } - }; - } -} - -angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider); - -/** - * @ngdoc object - * @name ui.router.state.$stateProvider - * - * @requires ui.router.router.$urlRouterProvider - * @requires ui.router.util.$urlMatcherFactoryProvider - * - * @description - * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely - * on state. - * - * A state corresponds to a "place" in the application in terms of the overall UI and - * navigation. A state describes (via the controller / template / view properties) what - * the UI looks like and does at that place. - * - * States often have things in common, and the primary way of factoring out these - * commonalities in this model is via the state hierarchy, i.e. parent/child states aka - * nested states. - * - * The `$stateProvider` provides interfaces to declare these states for your app. - */ -$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider']; -function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { - - var root, states = {}, $state, queue = {}, abstractKey = 'abstract'; - - // Builds state properties from definition passed to registerState() - var stateBuilder = { - - // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined. - // state.children = []; - // if (parent) parent.children.push(state); - parent: function(state) { - if (isDefined(state.parent) && state.parent) return findState(state.parent); - // regex matches any valid composite state name - // would match "contact.list" but not "contacts" - var compositeName = /^(.+)\.[^.]+$/.exec(state.name); - return compositeName ? findState(compositeName[1]) : root; - }, - - // inherit 'data' from parent and override by own values (if any) - data: function(state) { - if (state.parent && state.parent.data) { - state.data = state.self.data = inherit(state.parent.data, state.data); - } - return state.data; - }, - - // Build a URLMatcher if necessary, either via a relative or absolute URL - url: function(state) { - var url = state.url, config = { params: state.params || {} }; - - if (isString(url)) { - if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config); - return (state.parent.navigable || root).url.concat(url, config); - } - - if (!url || $urlMatcherFactory.isMatcher(url)) return url; - throw new Error("Invalid url '" + url + "' in state '" + state + "'"); - }, - - // Keep track of the closest ancestor state that has a URL (i.e. is navigable) - navigable: function(state) { - return state.url ? state : (state.parent ? state.parent.navigable : null); - }, - - // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params - ownParams: function(state) { - var params = state.url && state.url.params || new $$UMFP.ParamSet(); - forEach(state.params || {}, function(config, id) { - if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, "config"); - }); - return params; - }, - - // Derive parameters for this state and ensure they're a super-set of parent's parameters - params: function(state) { - var ownParams = pick(state.ownParams, state.ownParams.$$keys()); - return state.parent && state.parent.params ? extend(state.parent.params.$$new(), ownParams) : new $$UMFP.ParamSet(); - }, - - // If there is no explicit multi-view configuration, make one up so we don't have - // to handle both cases in the view directive later. Note that having an explicit - // 'views' property will mean the default unnamed view properties are ignored. This - // is also a good time to resolve view names to absolute names, so everything is a - // straight lookup at link time. - views: function(state) { - var views = {}; - - forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) { - if (name.indexOf('@') < 0) name += '@' + state.parent.name; - view.resolveAs = view.resolveAs || state.resolveAs || '$resolve'; - views[name] = view; - }); - return views; - }, - - // Keep a full path from the root down to this state as this is needed for state activation. - path: function(state) { - return state.parent ? state.parent.path.concat(state) : []; // exclude root from path - }, - - // Speed up $state.contains() as it's used a lot - includes: function(state) { - var includes = state.parent ? extend({}, state.parent.includes) : {}; - includes[state.name] = true; - return includes; - }, - - $delegates: {} - }; - - function isRelative(stateName) { - return stateName.indexOf(".") === 0 || stateName.indexOf("^") === 0; - } - - function findState(stateOrName, base) { - if (!stateOrName) return undefined; - - var isStr = isString(stateOrName), - name = isStr ? stateOrName : stateOrName.name, - path = isRelative(name); - - if (path) { - if (!base) throw new Error("No reference point given for path '" + name + "'"); - base = findState(base); - - var rel = name.split("."), i = 0, pathLength = rel.length, current = base; - - for (; i < pathLength; i++) { - if (rel[i] === "" && i === 0) { - current = base; - continue; - } - if (rel[i] === "^") { - if (!current.parent) throw new Error("Path '" + name + "' not valid for state '" + base.name + "'"); - current = current.parent; - continue; - } - break; - } - rel = rel.slice(i).join("."); - name = current.name + (current.name && rel ? "." : "") + rel; - } - var state = states[name]; - - if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) { - return state; - } - return undefined; - } - - function queueState(parentName, state) { - if (!queue[parentName]) { - queue[parentName] = []; - } - queue[parentName].push(state); - } - - function flushQueuedChildren(parentName) { - var queued = queue[parentName] || []; - while(queued.length) { - registerState(queued.shift()); - } - } - - function registerState(state) { - // Wrap a new object around the state so we can store our private details easily. - state = inherit(state, { - self: state, - resolve: state.resolve || {}, - toString: function() { return this.name; } - }); - - var name = state.name; - if (!isString(name) || name.indexOf('@') >= 0) throw new Error("State must have a valid name"); - if (states.hasOwnProperty(name)) throw new Error("State '" + name + "' is already defined"); - - // Get parent name - var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.')) - : (isString(state.parent)) ? state.parent - : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name - : ''; - - // If parent is not registered yet, add state to queue and register later - if (parentName && !states[parentName]) { - return queueState(parentName, state.self); - } - - for (var key in stateBuilder) { - if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]); - } - states[name] = state; - - // Register the state in the global state list and with $urlRouter if necessary. - if (!state[abstractKey] && state.url) { - $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) { - if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) { - $state.transitionTo(state, $match, { inherit: true, location: false }); - } - }]); - } - - // Register any queued children - flushQueuedChildren(name); - - return state; - } - - // Checks text to see if it looks like a glob. - function isGlob (text) { - return text.indexOf('*') > -1; - } - - // Returns true if glob matches current $state name. - function doesStateMatchGlob (glob) { - var globSegments = glob.split('.'), - segments = $state.$current.name.split('.'); - - //match single stars - for (var i = 0, l = globSegments.length; i < l; i++) { - if (globSegments[i] === '*') { - segments[i] = '*'; - } - } - - //match greedy starts - if (globSegments[0] === '**') { - segments = segments.slice(indexOf(segments, globSegments[1])); - segments.unshift('**'); - } - //match greedy ends - if (globSegments[globSegments.length - 1] === '**') { - segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE); - segments.push('**'); - } - - if (globSegments.length != segments.length) { - return false; - } - - return segments.join('') === globSegments.join(''); - } - - - // Implicit root state that is always active - root = registerState({ - name: '', - url: '^', - views: null, - 'abstract': true - }); - root.navigable = null; - - - /** - * @ngdoc function - * @name ui.router.state.$stateProvider#decorator - * @methodOf ui.router.state.$stateProvider - * - * @description - * Allows you to extend (carefully) or override (at your own peril) the - * `stateBuilder` object used internally by `$stateProvider`. This can be used - * to add custom functionality to ui-router, for example inferring templateUrl - * based on the state name. - * - * When passing only a name, it returns the current (original or decorated) builder - * function that matches `name`. - * - * The builder functions that can be decorated are listed below. Though not all - * necessarily have a good use case for decoration, that is up to you to decide. - * - * In addition, users can attach custom decorators, which will generate new - * properties within the state's internal definition. There is currently no clear - * use-case for this beyond accessing internal states (i.e. $state.$current), - * however, expect this to become increasingly relevant as we introduce additional - * meta-programming features. - * - * **Warning**: Decorators should not be interdependent because the order of - * execution of the builder functions in non-deterministic. Builder functions - * should only be dependent on the state definition object and super function. - * - * - * Existing builder functions and current return values: - * - * - **parent** `{object}` - returns the parent state object. - * - **data** `{object}` - returns state data, including any inherited data that is not - * overridden by own values (if any). - * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher} - * or `null`. - * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is - * navigable). - * - **params** `{object}` - returns an array of state params that are ensured to - * be a super-set of parent's params. - * - **views** `{object}` - returns a views object where each key is an absolute view - * name (i.e. "viewName@stateName") and each value is the config object - * (template, controller) for the view. Even when you don't use the views object - * explicitly on a state config, one is still created for you internally. - * So by decorating this builder function you have access to decorating template - * and controller properties. - * - **ownParams** `{object}` - returns an array of params that belong to the state, - * not including any params defined by ancestor states. - * - **path** `{string}` - returns the full path from the root down to this state. - * Needed for state activation. - * - **includes** `{object}` - returns an object that includes every state that - * would pass a `$state.includes()` test. - * - * @example - *
      -   * // Override the internal 'views' builder with a function that takes the state
      -   * // definition, and a reference to the internal function being overridden:
      -   * $stateProvider.decorator('views', function (state, parent) {
      -   *   var result = {},
      -   *       views = parent(state);
      -   *
      -   *   angular.forEach(views, function (config, name) {
      -   *     var autoName = (state.name + '.' + name).replace('.', '/');
      -   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
      -   *     result[name] = config;
      -   *   });
      -   *   return result;
      -   * });
      -   *
      -   * $stateProvider.state('home', {
      -   *   views: {
      -   *     'contact.list': { controller: 'ListController' },
      -   *     'contact.item': { controller: 'ItemController' }
      -   *   }
      -   * });
      -   *
      -   * // ...
      -   *
      -   * $state.go('home');
      -   * // Auto-populates list and item views with /partials/home/contact/list.html,
      -   * // and /partials/home/contact/item.html, respectively.
      -   * 
      - * - * @param {string} name The name of the builder function to decorate. - * @param {object} func A function that is responsible for decorating the original - * builder function. The function receives two parameters: - * - * - `{object}` - state - The state config object. - * - `{object}` - super - The original builder function. - * - * @return {object} $stateProvider - $stateProvider instance - */ - this.decorator = decorator; - function decorator(name, func) { - /*jshint validthis: true */ - if (isString(name) && !isDefined(func)) { - return stateBuilder[name]; - } - if (!isFunction(func) || !isString(name)) { - return this; - } - if (stateBuilder[name] && !stateBuilder.$delegates[name]) { - stateBuilder.$delegates[name] = stateBuilder[name]; - } - stateBuilder[name] = func; - return this; - } - - /** - * @ngdoc function - * @name ui.router.state.$stateProvider#state - * @methodOf ui.router.state.$stateProvider - * - * @description - * Registers a state configuration under a given state name. The stateConfig object - * has the following acceptable properties. - * - * @param {string} name A unique state name, e.g. "home", "about", "contacts". - * To create a parent/child state use a dot, e.g. "about.sales", "home.newest". - * @param {object} stateConfig State configuration object. - * @param {string|function=} stateConfig.template - * - * html template as a string or a function that returns - * an html template as a string which should be used by the uiView directives. This property - * takes precedence over templateUrl. - * - * If `template` is a function, it will be called with the following parameters: - * - * - {array.<object>} - state parameters extracted from the current $location.path() by - * applying the current state - * - *
      template:
      -   *   "

      inline template definition

      " + - * "
      "
      - *
      template: function(params) {
      -   *       return "

      generated template

      "; }
      - *
      - * - * @param {string|function=} stateConfig.templateUrl - * - * - * path or function that returns a path to an html - * template that should be used by uiView. - * - * If `templateUrl` is a function, it will be called with the following parameters: - * - * - {array.<object>} - state parameters extracted from the current $location.path() by - * applying the current state - * - *
      templateUrl: "home.html"
      - *
      templateUrl: function(params) {
      -   *     return myTemplates[params.pageId]; }
      - * - * @param {function=} stateConfig.templateProvider - * - * Provider function that returns HTML content string. - *
       templateProvider:
      -   *       function(MyTemplateService, params) {
      -   *         return MyTemplateService.getTemplate(params.pageId);
      -   *       }
      - * - * @param {string|function=} stateConfig.controller - * - * - * Controller fn that should be associated with newly - * related scope or the name of a registered controller if passed as a string. - * Optionally, the ControllerAs may be declared here. - *
      controller: "MyRegisteredController"
      - *
      controller:
      -   *     "MyRegisteredController as fooCtrl"}
      - *
      controller: function($scope, MyService) {
      -   *     $scope.data = MyService.getData(); }
      - * - * @param {function=} stateConfig.controllerProvider - * - * - * Injectable provider function that returns the actual controller or string. - *
      controllerProvider:
      -   *   function(MyResolveData) {
      -   *     if (MyResolveData.foo)
      -   *       return "FooCtrl"
      -   *     else if (MyResolveData.bar)
      -   *       return "BarCtrl";
      -   *     else return function($scope) {
      -   *       $scope.baz = "Qux";
      -   *     }
      -   *   }
      - * - * @param {string=} stateConfig.controllerAs - * - * - * A controller alias name. If present the controller will be - * published to scope under the controllerAs name. - *
      controllerAs: "myCtrl"
      - * - * @param {string|object=} stateConfig.parent - * - * Optionally specifies the parent state of this state. - * - *
      parent: 'parentState'
      - *
      parent: parentState // JS variable
      - * - * @param {object=} stateConfig.resolve - * - * - * An optional map<string, function> of dependencies which - * should be injected into the controller. If any of these dependencies are promises, - * the router will wait for them all to be resolved before the controller is instantiated. - * If all the promises are resolved successfully, the $stateChangeSuccess event is fired - * and the values of the resolved promises are injected into any controllers that reference them. - * If any of the promises are rejected the $stateChangeError event is fired. - * - * The map object is: - * - * - key - {string}: name of dependency to be injected into controller - * - factory - {string|function}: If string then it is alias for service. Otherwise if function, - * it is injected and return value it treated as dependency. If result is a promise, it is - * resolved before its value is injected into controller. - * - *
      resolve: {
      -   *     myResolve1:
      -   *       function($http, $stateParams) {
      -   *         return $http.get("/api/foos/"+stateParams.fooID);
      -   *       }
      -   *     }
      - * - * @param {string=} stateConfig.url - * - * - * A url fragment with optional parameters. When a state is navigated or - * transitioned to, the `$stateParams` service will be populated with any - * parameters that were passed. - * - * (See {@link ui.router.util.type:UrlMatcher UrlMatcher} `UrlMatcher`} for - * more details on acceptable patterns ) - * - * examples: - *
      url: "/home"
      -   * url: "/users/:userid"
      -   * url: "/books/{bookid:[a-zA-Z_-]}"
      -   * url: "/books/{categoryid:int}"
      -   * url: "/books/{publishername:string}/{categoryid:int}"
      -   * url: "/messages?before&after"
      -   * url: "/messages?{before:date}&{after:date}"
      -   * url: "/messages/:mailboxid?{before:date}&{after:date}"
      -   * 
      - * - * @param {object=} stateConfig.views - * - * an optional map<string, object> which defined multiple views, or targets views - * manually/explicitly. - * - * Examples: - * - * Targets three named `ui-view`s in the parent state's template - *
      views: {
      -   *     header: {
      -   *       controller: "headerCtrl",
      -   *       templateUrl: "header.html"
      -   *     }, body: {
      -   *       controller: "bodyCtrl",
      -   *       templateUrl: "body.html"
      -   *     }, footer: {
      -   *       controller: "footCtrl",
      -   *       templateUrl: "footer.html"
      -   *     }
      -   *   }
      - * - * Targets named `ui-view="header"` from grandparent state 'top''s template, and named `ui-view="body" from parent state's template. - *
      views: {
      -   *     'header@top': {
      -   *       controller: "msgHeaderCtrl",
      -   *       templateUrl: "msgHeader.html"
      -   *     }, 'body': {
      -   *       controller: "messagesCtrl",
      -   *       templateUrl: "messages.html"
      -   *     }
      -   *   }
      - * - * @param {boolean=} [stateConfig.abstract=false] - * - * An abstract state will never be directly activated, - * but can provide inherited properties to its common children states. - *
      abstract: true
      - * - * @param {function=} stateConfig.onEnter - * - * - * Callback function for when a state is entered. Good way - * to trigger an action or dispatch an event, such as opening a dialog. - * If minifying your scripts, make sure to explicitly annotate this function, - * because it won't be automatically annotated by your build tools. - * - *
      onEnter: function(MyService, $stateParams) {
      -   *     MyService.foo($stateParams.myParam);
      -   * }
      - * - * @param {function=} stateConfig.onExit - * - * - * Callback function for when a state is exited. Good way to - * trigger an action or dispatch an event, such as opening a dialog. - * If minifying your scripts, make sure to explicitly annotate this function, - * because it won't be automatically annotated by your build tools. - * - *
      onExit: function(MyService, $stateParams) {
      -   *     MyService.cleanup($stateParams.myParam);
      -   * }
      - * - * @param {boolean=} [stateConfig.reloadOnSearch=true] - * - * - * If `false`, will not retrigger the same state - * just because a search/query parameter has changed (via $location.search() or $location.hash()). - * Useful for when you'd like to modify $location.search() without triggering a reload. - *
      reloadOnSearch: false
      - * - * @param {object=} stateConfig.data - * - * - * Arbitrary data object, useful for custom configuration. The parent state's `data` is - * prototypally inherited. In other words, adding a data property to a state adds it to - * the entire subtree via prototypal inheritance. - * - *
      data: {
      -   *     requiredRole: 'foo'
      -   * } 
      - * - * @param {object=} stateConfig.params - * - * - * A map which optionally configures parameters declared in the `url`, or - * defines additional non-url parameters. For each parameter being - * configured, add a configuration object keyed to the name of the parameter. - * - * Each parameter configuration object may contain the following properties: - * - * - ** value ** - {object|function=}: specifies the default value for this - * parameter. This implicitly sets this parameter as optional. - * - * When UI-Router routes to a state and no value is - * specified for this parameter in the URL or transition, the - * default value will be used instead. If `value` is a function, - * it will be injected and invoked, and the return value used. - * - * *Note*: `undefined` is treated as "no default value" while `null` - * is treated as "the default value is `null`". - * - * *Shorthand*: If you only need to configure the default value of the - * parameter, you may use a shorthand syntax. In the **`params`** - * map, instead mapping the param name to a full parameter configuration - * object, simply set map it to the default parameter value, e.g.: - * - *
      // define a parameter's default value
      -   * params: {
      -   *     param1: { value: "defaultValue" }
      -   * }
      -   * // shorthand default values
      -   * params: {
      -   *     param1: "defaultValue",
      -   *     param2: "param2Default"
      -   * }
      - * - * - ** array ** - {boolean=}: *(default: false)* If true, the param value will be - * treated as an array of values. If you specified a Type, the value will be - * treated as an array of the specified Type. Note: query parameter values - * default to a special `"auto"` mode. - * - * For query parameters in `"auto"` mode, if multiple values for a single parameter - * are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values - * are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`). However, if - * only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single - * value (e.g.: `{ foo: '1' }`). - * - *
      params: {
      -   *     param1: { array: true }
      -   * }
      - * - * - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when - * the current parameter value is the same as the default value. If `squash` is not set, it uses the - * configured default squash policy. - * (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`}) - * - * There are three squash settings: - * - * - false: The parameter's default value is not squashed. It is encoded and included in the URL - * - true: The parameter's default value is omitted from the URL. If the parameter is preceeded and followed - * by slashes in the state's `url` declaration, then one of those slashes are omitted. - * This can allow for cleaner looking URLs. - * - `""`: The parameter's default value is replaced with an arbitrary placeholder of your choice. - * - *
      params: {
      -   *     param1: {
      -   *       value: "defaultId",
      -   *       squash: true
      -   * } }
      -   * // squash "defaultValue" to "~"
      -   * params: {
      -   *     param1: {
      -   *       value: "defaultValue",
      -   *       squash: "~"
      -   * } }
      -   * 
      - * - * - * @example - *
      -   * // Some state name examples
      -   *
      -   * // stateName can be a single top-level name (must be unique).
      -   * $stateProvider.state("home", {});
      -   *
      -   * // Or it can be a nested state name. This state is a child of the
      -   * // above "home" state.
      -   * $stateProvider.state("home.newest", {});
      -   *
      -   * // Nest states as deeply as needed.
      -   * $stateProvider.state("home.newest.abc.xyz.inception", {});
      -   *
      -   * // state() returns $stateProvider, so you can chain state declarations.
      -   * $stateProvider
      -   *   .state("home", {})
      -   *   .state("about", {})
      -   *   .state("contacts", {});
      -   * 
      - * - */ - this.state = state; - function state(name, definition) { - /*jshint validthis: true */ - if (isObject(name)) definition = name; - else definition.name = name; - registerState(definition); - return this; - } - - /** - * @ngdoc object - * @name ui.router.state.$state - * - * @requires $rootScope - * @requires $q - * @requires ui.router.state.$view - * @requires $injector - * @requires ui.router.util.$resolve - * @requires ui.router.state.$stateParams - * @requires ui.router.router.$urlRouter - * - * @property {object} params A param object, e.g. {sectionId: section.id)}, that - * you'd like to test against the current active state. - * @property {object} current A reference to the state's config object. However - * you passed it in. Useful for accessing custom data. - * @property {object} transition Currently pending transition. A promise that'll - * resolve or reject. - * - * @description - * `$state` service is responsible for representing states as well as transitioning - * between them. It also provides interfaces to ask for current state or even states - * you're coming from. - */ - this.$get = $get; - $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory']; - function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter, $location, $urlMatcherFactory) { - - var TransitionSuperseded = $q.reject(new Error('transition superseded')); - var TransitionPrevented = $q.reject(new Error('transition prevented')); - var TransitionAborted = $q.reject(new Error('transition aborted')); - var TransitionFailed = $q.reject(new Error('transition failed')); - - // Handles the case where a state which is the target of a transition is not found, and the user - // can optionally retry or defer the transition - function handleRedirect(redirect, state, params, options) { - /** - * @ngdoc event - * @name ui.router.state.$state#$stateNotFound - * @eventOf ui.router.state.$state - * @eventType broadcast on root scope - * @description - * Fired when a requested state **cannot be found** using the provided state name during transition. - * The event is broadcast allowing any handlers a single chance to deal with the error (usually by - * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler, - * you can see its three properties in the example. You can use `event.preventDefault()` to abort the - * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value. - * - * @param {Object} event Event object. - * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties. - * @param {State} fromState Current state object. - * @param {Object} fromParams Current state params. - * - * @example - * - *
      -       * // somewhere, assume lazy.state has not been defined
      -       * $state.go("lazy.state", {a:1, b:2}, {inherit:false});
      -       *
      -       * // somewhere else
      -       * $scope.$on('$stateNotFound',
      -       * function(event, unfoundState, fromState, fromParams){
      -       *     console.log(unfoundState.to); // "lazy.state"
      -       *     console.log(unfoundState.toParams); // {a:1, b:2}
      -       *     console.log(unfoundState.options); // {inherit:false} + default options
      -       * })
      -       * 
      - */ - var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params); - - if (evt.defaultPrevented) { - $urlRouter.update(); - return TransitionAborted; - } - - if (!evt.retry) { - return null; - } - - // Allow the handler to return a promise to defer state lookup retry - if (options.$retry) { - $urlRouter.update(); - return TransitionFailed; - } - var retryTransition = $state.transition = $q.when(evt.retry); - - retryTransition.then(function() { - if (retryTransition !== $state.transition) return TransitionSuperseded; - redirect.options.$retry = true; - return $state.transitionTo(redirect.to, redirect.toParams, redirect.options); - }, function() { - return TransitionAborted; - }); - $urlRouter.update(); - - return retryTransition; - } - - root.locals = { resolve: null, globals: { $stateParams: {} } }; - - $state = { - params: {}, - current: root.self, - $current: root, - transition: null - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#reload - * @methodOf ui.router.state.$state - * - * @description - * A method that force reloads the current state. All resolves are re-resolved, - * controllers reinstantiated, and events re-fired. - * - * @example - *
      -     * var app angular.module('app', ['ui.router']);
      -     *
      -     * app.controller('ctrl', function ($scope, $state) {
      -     *   $scope.reload = function(){
      -     *     $state.reload();
      -     *   }
      -     * });
      -     * 
      - * - * `reload()` is just an alias for: - *
      -     * $state.transitionTo($state.current, $stateParams, { 
      -     *   reload: true, inherit: false, notify: true
      -     * });
      -     * 
      - * - * @param {string=|object=} state - A state name or a state object, which is the root of the resolves to be re-resolved. - * @example - *
      -     * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' 
      -     * //and current state is 'contacts.detail.item'
      -     * var app angular.module('app', ['ui.router']);
      -     *
      -     * app.controller('ctrl', function ($scope, $state) {
      -     *   $scope.reload = function(){
      -     *     //will reload 'contact.detail' and 'contact.detail.item' states
      -     *     $state.reload('contact.detail');
      -     *   }
      -     * });
      -     * 
      - * - * `reload()` is just an alias for: - *
      -     * $state.transitionTo($state.current, $stateParams, { 
      -     *   reload: true, inherit: false, notify: true
      -     * });
      -     * 
      - - * @returns {promise} A promise representing the state of the new transition. See - * {@link ui.router.state.$state#methods_go $state.go}. - */ - $state.reload = function reload(state) { - return $state.transitionTo($state.current, $stateParams, { reload: state || true, inherit: false, notify: true}); - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#go - * @methodOf ui.router.state.$state - * - * @description - * Convenience method for transitioning to a new state. `$state.go` calls - * `$state.transitionTo` internally but automatically sets options to - * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. - * This allows you to easily use an absolute or relative to path and specify - * only the parameters you'd like to update (while letting unspecified parameters - * inherit from the currently active ancestor states). - * - * @example - *
      -     * var app = angular.module('app', ['ui.router']);
      -     *
      -     * app.controller('ctrl', function ($scope, $state) {
      -     *   $scope.changeState = function () {
      -     *     $state.go('contact.detail');
      -     *   };
      -     * });
      -     * 
      - * - * - * @param {string} to Absolute state name or relative state path. Some examples: - * - * - `$state.go('contact.detail')` - will go to the `contact.detail` state - * - `$state.go('^')` - will go to a parent state - * - `$state.go('^.sibling')` - will go to a sibling state - * - `$state.go('.child.grandchild')` - will go to grandchild state - * - * @param {object=} params A map of the parameters that will be sent to the state, - * will populate $stateParams. Any parameters that are not specified will be inherited from currently - * defined parameters. Only parameters specified in the state definition can be overridden, new - * parameters will be ignored. This allows, for example, going to a sibling state that shares parameters - * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e. - * transitioning to a sibling will get you the parameters for all parents, transitioning to a child - * will get you all current parameters, etc. - * @param {object=} options Options object. The options are: - * - * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false` - * will not. If string, must be `"replace"`, which will update url and also replace last history record. - * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url. - * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), - * defines which state to be relative from. - * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events. - * - **`reload`** (v0.2.5) - {boolean=false|string|object}, If `true` will force transition even if no state or params - * have changed. It will reload the resolves and views of the current state and parent states. - * If `reload` is a string (or state object), the state object is fetched (by name, or object reference); and \ - * the transition reloads the resolves and views for that matched state, and all its children states. - * - * @returns {promise} A promise representing the state of the new transition. - * - * Possible success values: - * - * - $state.current - * - *
      Possible rejection values: - * - * - 'transition superseded' - when a newer transition has been started after this one - * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener - * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or - * when a `$stateNotFound` `event.retry` promise errors. - * - 'transition failed' - when a state has been unsuccessfully found after 2 tries. - * - *resolve error* - when an error has occurred with a `resolve` - * - */ - $state.go = function go(to, params, options) { - return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options)); - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#transitionTo - * @methodOf ui.router.state.$state - * - * @description - * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go} - * uses `transitionTo` internally. `$state.go` is recommended in most situations. - * - * @example - *
      -     * var app = angular.module('app', ['ui.router']);
      -     *
      -     * app.controller('ctrl', function ($scope, $state) {
      -     *   $scope.changeState = function () {
      -     *     $state.transitionTo('contact.detail');
      -     *   };
      -     * });
      -     * 
      - * - * @param {string} to State name. - * @param {object=} toParams A map of the parameters that will be sent to the state, - * will populate $stateParams. - * @param {object=} options Options object. The options are: - * - * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false` - * will not. If string, must be `"replace"`, which will update url and also replace last history record. - * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url. - * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), - * defines which state to be relative from. - * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events. - * - **`reload`** (v0.2.5) - {boolean=false|string=|object=}, If `true` will force transition even if the state or params - * have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd - * use this when you want to force a reload when *everything* is the same, including search params. - * if String, then will reload the state with the name given in reload, and any children. - * if Object, then a stateObj is expected, will reload the state found in stateObj, and any children. - * - * @returns {promise} A promise representing the state of the new transition. See - * {@link ui.router.state.$state#methods_go $state.go}. - */ - $state.transitionTo = function transitionTo(to, toParams, options) { - toParams = toParams || {}; - options = extend({ - location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false - }, options || {}); - - var from = $state.$current, fromParams = $state.params, fromPath = from.path; - var evt, toState = findState(to, options.relative); - - // Store the hash param for later (since it will be stripped out by various methods) - var hash = toParams['#']; - - if (!isDefined(toState)) { - var redirect = { to: to, toParams: toParams, options: options }; - var redirectResult = handleRedirect(redirect, from.self, fromParams, options); - - if (redirectResult) { - return redirectResult; - } - - // Always retry once if the $stateNotFound was not prevented - // (handles either redirect changed or state lazy-definition) - to = redirect.to; - toParams = redirect.toParams; - options = redirect.options; - toState = findState(to, options.relative); - - if (!isDefined(toState)) { - if (!options.relative) throw new Error("No such state '" + to + "'"); - throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'"); - } - } - if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'"); - if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState); - if (!toState.params.$$validates(toParams)) return TransitionFailed; - - toParams = toState.params.$$values(toParams); - to = toState; - - var toPath = to.path; - - // Starting from the root of the path, keep all levels that haven't changed - var keep = 0, state = toPath[keep], locals = root.locals, toLocals = []; - - if (!options.reload) { - while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) { - locals = toLocals[keep] = state.locals; - keep++; - state = toPath[keep]; - } - } else if (isString(options.reload) || isObject(options.reload)) { - if (isObject(options.reload) && !options.reload.name) { - throw new Error('Invalid reload state object'); - } - - var reloadState = options.reload === true ? fromPath[0] : findState(options.reload); - if (options.reload && !reloadState) { - throw new Error("No such reload state '" + (isString(options.reload) ? options.reload : options.reload.name) + "'"); - } - - while (state && state === fromPath[keep] && state !== reloadState) { - locals = toLocals[keep] = state.locals; - keep++; - state = toPath[keep]; - } - } - - // If we're going to the same state and all locals are kept, we've got nothing to do. - // But clear 'transition', as we still want to cancel any other pending transitions. - // TODO: We may not want to bump 'transition' if we're called from a location change - // that we've initiated ourselves, because we might accidentally abort a legitimate - // transition initiated from code? - if (shouldSkipReload(to, toParams, from, fromParams, locals, options)) { - if (hash) toParams['#'] = hash; - $state.params = toParams; - copy($state.params, $stateParams); - copy(filterByKeys(to.params.$$keys(), $stateParams), to.locals.globals.$stateParams); - if (options.location && to.navigable && to.navigable.url) { - $urlRouter.push(to.navigable.url, toParams, { - $$avoidResync: true, replace: options.location === 'replace' - }); - $urlRouter.update(true); - } - $state.transition = null; - return $q.when($state.current); - } - - // Filter parameters before we pass them to event handlers etc. - toParams = filterByKeys(to.params.$$keys(), toParams || {}); - - // Re-add the saved hash before we start returning things or broadcasting $stateChangeStart - if (hash) toParams['#'] = hash; - - // Broadcast start event and cancel the transition if requested - if (options.notify) { - /** - * @ngdoc event - * @name ui.router.state.$state#$stateChangeStart - * @eventOf ui.router.state.$state - * @eventType broadcast on root scope - * @description - * Fired when the state transition **begins**. You can use `event.preventDefault()` - * to prevent the transition from happening and then the transition promise will be - * rejected with a `'transition prevented'` value. - * - * @param {Object} event Event object. - * @param {State} toState The state being transitioned to. - * @param {Object} toParams The params supplied to the `toState`. - * @param {State} fromState The current state, pre-transition. - * @param {Object} fromParams The params supplied to the `fromState`. - * - * @example - * - *
      -         * $rootScope.$on('$stateChangeStart',
      -         * function(event, toState, toParams, fromState, fromParams){
      -         *     event.preventDefault();
      -         *     // transitionTo() promise will be rejected with
      -         *     // a 'transition prevented' error
      -         * })
      -         * 
      - */ - if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams, options).defaultPrevented) { - $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams); - //Don't update and resync url if there's been a new transition started. see issue #2238, #600 - if ($state.transition == null) $urlRouter.update(); - return TransitionPrevented; - } - } - - // Resolve locals for the remaining states, but don't update any global state just - // yet -- if anything fails to resolve the current state needs to remain untouched. - // We also set up an inheritance chain for the locals here. This allows the view directive - // to quickly look up the correct definition for each view in the current state. Even - // though we create the locals object itself outside resolveState(), it is initially - // empty and gets filled asynchronously. We need to keep track of the promise for the - // (fully resolved) current locals, and pass this down the chain. - var resolved = $q.when(locals); - - for (var l = keep; l < toPath.length; l++, state = toPath[l]) { - locals = toLocals[l] = inherit(locals); - resolved = resolveState(state, toParams, state === to, resolved, locals, options); - } - - // Once everything is resolved, we are ready to perform the actual transition - // and return a promise for the new state. We also keep track of what the - // current promise is, so that we can detect overlapping transitions and - // keep only the outcome of the last transition. - var transition = $state.transition = resolved.then(function () { - var l, entering, exiting; - - if ($state.transition !== transition) return TransitionSuperseded; - - // Exit 'from' states not kept - for (l = fromPath.length - 1; l >= keep; l--) { - exiting = fromPath[l]; - if (exiting.self.onExit) { - $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals); - } - exiting.locals = null; - } - - // Enter 'to' states not kept - for (l = keep; l < toPath.length; l++) { - entering = toPath[l]; - entering.locals = toLocals[l]; - if (entering.self.onEnter) { - $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals); - } - } - - // Run it again, to catch any transitions in callbacks - if ($state.transition !== transition) return TransitionSuperseded; - - // Update globals in $state - $state.$current = to; - $state.current = to.self; - $state.params = toParams; - copy($state.params, $stateParams); - $state.transition = null; - - if (options.location && to.navigable) { - $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, { - $$avoidResync: true, replace: options.location === 'replace' - }); - } - - if (options.notify) { - /** - * @ngdoc event - * @name ui.router.state.$state#$stateChangeSuccess - * @eventOf ui.router.state.$state - * @eventType broadcast on root scope - * @description - * Fired once the state transition is **complete**. - * - * @param {Object} event Event object. - * @param {State} toState The state being transitioned to. - * @param {Object} toParams The params supplied to the `toState`. - * @param {State} fromState The current state, pre-transition. - * @param {Object} fromParams The params supplied to the `fromState`. - */ - $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams); - } - $urlRouter.update(true); - - return $state.current; - }).then(null, function (error) { - if ($state.transition !== transition) return TransitionSuperseded; - - $state.transition = null; - /** - * @ngdoc event - * @name ui.router.state.$state#$stateChangeError - * @eventOf ui.router.state.$state - * @eventType broadcast on root scope - * @description - * Fired when an **error occurs** during transition. It's important to note that if you - * have any errors in your resolve functions (javascript errors, non-existent services, etc) - * they will not throw traditionally. You must listen for this $stateChangeError event to - * catch **ALL** errors. - * - * @param {Object} event Event object. - * @param {State} toState The state being transitioned to. - * @param {Object} toParams The params supplied to the `toState`. - * @param {State} fromState The current state, pre-transition. - * @param {Object} fromParams The params supplied to the `fromState`. - * @param {Error} error The resolve error object. - */ - evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error); - - if (!evt.defaultPrevented) { - $urlRouter.update(); - } - - return $q.reject(error); - }); - - return transition; - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#is - * @methodOf ui.router.state.$state - * - * @description - * Similar to {@link ui.router.state.$state#methods_includes $state.includes}, - * but only checks for the full state name. If params is supplied then it will be - * tested for strict equality against the current active params object, so all params - * must match with none missing and no extras. - * - * @example - *
      -     * $state.$current.name = 'contacts.details.item';
      -     *
      -     * // absolute name
      -     * $state.is('contact.details.item'); // returns true
      -     * $state.is(contactDetailItemStateObject); // returns true
      -     *
      -     * // relative name (. and ^), typically from a template
      -     * // E.g. from the 'contacts.details' template
      -     * 
      Item
      - *
      - * - * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check. - * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like - * to test against the current active state. - * @param {object=} options An options object. The options are: - * - * - **`relative`** - {string|object} - If `stateOrName` is a relative state name and `options.relative` is set, .is will - * test relative to `options.relative` state (or name). - * - * @returns {boolean} Returns true if it is the state. - */ - $state.is = function is(stateOrName, params, options) { - options = extend({ relative: $state.$current }, options || {}); - var state = findState(stateOrName, options.relative); - - if (!isDefined(state)) { return undefined; } - if ($state.$current !== state) { return false; } - return params ? equalForKeys(state.params.$$values(params), $stateParams) : true; - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#includes - * @methodOf ui.router.state.$state - * - * @description - * A method to determine if the current active state is equal to or is the child of the - * state stateName. If any params are passed then they will be tested for a match as well. - * Not all the parameters need to be passed, just the ones you'd like to test for equality. - * - * @example - * Partial and relative names - *
      -     * $state.$current.name = 'contacts.details.item';
      -     *
      -     * // Using partial names
      -     * $state.includes("contacts"); // returns true
      -     * $state.includes("contacts.details"); // returns true
      -     * $state.includes("contacts.details.item"); // returns true
      -     * $state.includes("contacts.list"); // returns false
      -     * $state.includes("about"); // returns false
      -     *
      -     * // Using relative names (. and ^), typically from a template
      -     * // E.g. from the 'contacts.details' template
      -     * 
      Item
      - *
      - * - * Basic globbing patterns - *
      -     * $state.$current.name = 'contacts.details.item.url';
      -     *
      -     * $state.includes("*.details.*.*"); // returns true
      -     * $state.includes("*.details.**"); // returns true
      -     * $state.includes("**.item.**"); // returns true
      -     * $state.includes("*.details.item.url"); // returns true
      -     * $state.includes("*.details.*.url"); // returns true
      -     * $state.includes("*.details.*"); // returns false
      -     * $state.includes("item.**"); // returns false
      -     * 
      - * - * @param {string} stateOrName A partial name, relative name, or glob pattern - * to be searched for within the current state name. - * @param {object=} params A param object, e.g. `{sectionId: section.id}`, - * that you'd like to test against the current active state. - * @param {object=} options An options object. The options are: - * - * - **`relative`** - {string|object=} - If `stateOrName` is a relative state reference and `options.relative` is set, - * .includes will test relative to `options.relative` state (or name). - * - * @returns {boolean} Returns true if it does include the state - */ - $state.includes = function includes(stateOrName, params, options) { - options = extend({ relative: $state.$current }, options || {}); - if (isString(stateOrName) && isGlob(stateOrName)) { - if (!doesStateMatchGlob(stateOrName)) { - return false; - } - stateOrName = $state.$current.name; - } - - var state = findState(stateOrName, options.relative); - if (!isDefined(state)) { return undefined; } - if (!isDefined($state.$current.includes[state.name])) { return false; } - return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true; - }; - - - /** - * @ngdoc function - * @name ui.router.state.$state#href - * @methodOf ui.router.state.$state - * - * @description - * A url generation method that returns the compiled url for the given state populated with the given params. - * - * @example - *
      -     * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
      -     * 
      - * - * @param {string|object} stateOrName The state name or state object you'd like to generate a url from. - * @param {object=} params An object of parameter values to fill the state's required parameters. - * @param {object=} options Options object. The options are: - * - * - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the - * first parameter, then the constructed href url will be built from the first navigable ancestor (aka - * ancestor with a valid url). - * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url. - * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), - * defines which state to be relative from. - * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". - * - * @returns {string} compiled state url - */ - $state.href = function href(stateOrName, params, options) { - options = extend({ - lossy: true, - inherit: true, - absolute: false, - relative: $state.$current - }, options || {}); - - var state = findState(stateOrName, options.relative); - - if (!isDefined(state)) return null; - if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state); - - var nav = (state && options.lossy) ? state.navigable : state; - - if (!nav || nav.url === undefined || nav.url === null) { - return null; - } - return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys().concat('#'), params || {}), { - absolute: options.absolute - }); - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#get - * @methodOf ui.router.state.$state - * - * @description - * Returns the state configuration object for any specific state or all states. - * - * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for - * the requested state. If not provided, returns an array of ALL state configs. - * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context. - * @returns {Object|Array} State configuration object or array of all objects. - */ - $state.get = function (stateOrName, context) { - if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; }); - var state = findState(stateOrName, context || $state.$current); - return (state && state.self) ? state.self : null; - }; - - function resolveState(state, params, paramsAreFiltered, inherited, dst, options) { - // Make a restricted $stateParams with only the parameters that apply to this state if - // necessary. In addition to being available to the controller and onEnter/onExit callbacks, - // we also need $stateParams to be available for any $injector calls we make during the - // dependency resolution process. - var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params); - var locals = { $stateParams: $stateParams }; - - // Resolve 'global' dependencies for the state, i.e. those not specific to a view. - // We're also including $stateParams in this; that way the parameters are restricted - // to the set that should be visible to the state, and are independent of when we update - // the global $state and $stateParams values. - dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state); - var promises = [dst.resolve.then(function (globals) { - dst.globals = globals; - })]; - if (inherited) promises.push(inherited); - - function resolveViews() { - var viewsPromises = []; - - // Resolve template and dependencies for all views. - forEach(state.views, function (view, name) { - var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {}); - injectables.$template = [ function () { - return $view.load(name, { view: view, locals: dst.globals, params: $stateParams, notify: options.notify }) || ''; - }]; - - viewsPromises.push($resolve.resolve(injectables, dst.globals, dst.resolve, state).then(function (result) { - // References to the controller (only instantiated at link time) - if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) { - var injectLocals = angular.extend({}, injectables, dst.globals); - result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals); - } else { - result.$$controller = view.controller; - } - // Provide access to the state itself for internal use - result.$$state = state; - result.$$controllerAs = view.controllerAs; - result.$$resolveAs = view.resolveAs; - dst[name] = result; - })); - }); - - return $q.all(viewsPromises).then(function(){ - return dst.globals; - }); - } - - // Wait for all the promises and then return the activation object - return $q.all(promises).then(resolveViews).then(function (values) { - return dst; - }); - } - - return $state; - } - - function shouldSkipReload(to, toParams, from, fromParams, locals, options) { - // Return true if there are no differences in non-search (path/object) params, false if there are differences - function nonSearchParamsEqual(fromAndToState, fromParams, toParams) { - // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params. - function notSearchParam(key) { - return fromAndToState.params[key].location != "search"; - } - var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam); - var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys)); - var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams); - return nonQueryParamSet.$$equals(fromParams, toParams); - } - - // If reload was not explicitly requested - // and we're transitioning to the same state we're already in - // and the locals didn't change - // or they changed in a way that doesn't merit reloading - // (reloadOnParams:false, or reloadOnSearch.false and only search params changed) - // Then return true. - if (!options.reload && to === from && - (locals === from.locals || (to.self.reloadOnSearch === false && nonSearchParamsEqual(from, fromParams, toParams)))) { - return true; - } - } -} - -angular.module('ui.router.state') - .factory('$stateParams', function () { return {}; }) - .constant("$state.runtime", { autoinject: true }) - .provider('$state', $StateProvider) - // Inject $state to initialize when entering runtime. #2574 - .run(['$injector', function ($injector) { - // Allow tests (stateSpec.js) to turn this off by defining this constant - if ($injector.get("$state.runtime").autoinject) { - $injector.get('$state'); - } - }]); - - -$ViewProvider.$inject = []; -function $ViewProvider() { - - this.$get = $get; - /** - * @ngdoc object - * @name ui.router.state.$view - * - * @requires ui.router.util.$templateFactory - * @requires $rootScope - * - * @description - * - */ - $get.$inject = ['$rootScope', '$templateFactory']; - function $get( $rootScope, $templateFactory) { - return { - // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... }) - /** - * @ngdoc function - * @name ui.router.state.$view#load - * @methodOf ui.router.state.$view - * - * @description - * - * @param {string} name name - * @param {object} options option object. - */ - load: function load(name, options) { - var result, defaults = { - template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {} - }; - options = extend(defaults, options); - - if (options.view) { - result = $templateFactory.fromConfig(options.view, options.params, options.locals); - } - return result; - } - }; - } -} - -angular.module('ui.router.state').provider('$view', $ViewProvider); - -/** - * @ngdoc object - * @name ui.router.state.$uiViewScrollProvider - * - * @description - * Provider that returns the {@link ui.router.state.$uiViewScroll} service function. - */ -function $ViewScrollProvider() { - - var useAnchorScroll = false; - - /** - * @ngdoc function - * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll - * @methodOf ui.router.state.$uiViewScrollProvider - * - * @description - * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for - * scrolling based on the url anchor. - */ - this.useAnchorScroll = function () { - useAnchorScroll = true; - }; - - /** - * @ngdoc object - * @name ui.router.state.$uiViewScroll - * - * @requires $anchorScroll - * @requires $timeout - * - * @description - * When called with a jqLite element, it scrolls the element into view (after a - * `$timeout` so the DOM has time to refresh). - * - * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor, - * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}. - */ - this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) { - if (useAnchorScroll) { - return $anchorScroll; - } - - return function ($element) { - return $timeout(function () { - $element[0].scrollIntoView(); - }, 0, false); - }; - }]; -} - -angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider); - -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-view - * - * @requires ui.router.state.$state - * @requires $compile - * @requires $controller - * @requires $injector - * @requires ui.router.state.$uiViewScroll - * @requires $document - * - * @restrict ECA - * - * @description - * The ui-view directive tells $state where to place your templates. - * - * @param {string=} name A view name. The name should be unique amongst the other views in the - * same state. You can have views of the same name that live in different states. - * - * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window - * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll - * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you - * scroll ui-view elements into view when they are populated during a state activation. - * - * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) - * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.* - * - * @param {string=} onload Expression to evaluate whenever the view updates. - * - * @example - * A view can be unnamed or named. - *
      - * 
      - * 
      - * - * - *
      - *
      - * - * You can only have one unnamed view within any template (or root html). If you are only using a - * single view and it is unnamed then you can populate it like so: - *
      - * 
      - * $stateProvider.state("home", { - * template: "

      HELLO!

      " - * }) - *
      - * - * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#methods_state `views`} - * config property, by name, in this case an empty name: - *
      - * $stateProvider.state("home", {
      - *   views: {
      - *     "": {
      - *       template: "

      HELLO!

      " - * } - * } - * }) - *
      - * - * But typically you'll only use the views property if you name your view or have more than one view - * in the same template. There's not really a compelling reason to name a view if its the only one, - * but you could if you wanted, like so: - *
      - * 
      - *
      - *
      - * $stateProvider.state("home", {
      - *   views: {
      - *     "main": {
      - *       template: "

      HELLO!

      " - * } - * } - * }) - *
      - * - * Really though, you'll use views to set up multiple views: - *
      - * 
      - *
      - *
      - *
      - * - *
      - * $stateProvider.state("home", {
      - *   views: {
      - *     "": {
      - *       template: "

      HELLO!

      " - * }, - * "chart": { - * template: "" - * }, - * "data": { - * template: "" - * } - * } - * }) - *
      - * - * Examples for `autoscroll`: - * - *
      - * 
      - * 
      - *
      - * 
      - * 
      - * 
      - * 
      - * 
      - * - * Resolve data: - * - * The resolved data from the state's `resolve` block is placed on the scope as `$resolve` (this - * can be customized using [[ViewDeclaration.resolveAs]]). This can be then accessed from the template. - * - * Note that when `controllerAs` is being used, `$resolve` is set on the controller instance *after* the - * controller is instantiated. The `$onInit()` hook can be used to perform initialization code which - * depends on `$resolve` data. - * - * Example usage of $resolve in a view template - *
      - * $stateProvider.state('home', {
      - *   template: '',
      - *   resolve: {
      - *     user: function(UserService) { return UserService.fetchUser(); }
      - *   }
      - * });
      - * 
      - */ -$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate', '$q']; -function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate, $q) { - - function getService() { - return ($injector.has) ? function(service) { - return $injector.has(service) ? $injector.get(service) : null; - } : function(service) { - try { - return $injector.get(service); - } catch (e) { - return null; - } - }; - } - - var service = getService(), - $animator = service('$animator'), - $animate = service('$animate'); - - // Returns a set of DOM manipulation functions based on which Angular version - // it should use - function getRenderer(attrs, scope) { - var statics = function() { - return { - enter: function (element, target, cb) { target.after(element); cb(); }, - leave: function (element, cb) { element.remove(); cb(); } - }; - }; - - if ($animate) { - return { - enter: function(element, target, cb) { - if (angular.version.minor > 2) { - $animate.enter(element, null, target).then(cb); - } else { - $animate.enter(element, null, target, cb); - } - }, - leave: function(element, cb) { - if (angular.version.minor > 2) { - $animate.leave(element).then(cb); - } else { - $animate.leave(element, cb); - } - } - }; - } - - if ($animator) { - var animate = $animator && $animator(scope, attrs); - - return { - enter: function(element, target, cb) {animate.enter(element, null, target); cb(); }, - leave: function(element, cb) { animate.leave(element); cb(); } - }; - } - - return statics(); - } - - var directive = { - restrict: 'ECA', - terminal: true, - priority: 400, - transclude: 'element', - compile: function (tElement, tAttrs, $transclude) { - return function (scope, $element, attrs) { - var previousEl, currentEl, currentScope, latestLocals, - onloadExp = attrs.onload || '', - autoScrollExp = attrs.autoscroll, - renderer = getRenderer(attrs, scope), - inherited = $element.inheritedData('$uiView'); - - scope.$on('$stateChangeSuccess', function() { - updateView(false); - }); - - updateView(true); - - function cleanupLastView() { - if (previousEl) { - previousEl.remove(); - previousEl = null; - } - - if (currentScope) { - currentScope.$destroy(); - currentScope = null; - } - - if (currentEl) { - var $uiViewData = currentEl.data('$uiViewAnim'); - renderer.leave(currentEl, function() { - $uiViewData.$$animLeave.resolve(); - previousEl = null; - }); - - previousEl = currentEl; - currentEl = null; - } - } - - function updateView(firstTime) { - var newScope, - name = getUiViewName(scope, attrs, $element, $interpolate), - previousLocals = name && $state.$current && $state.$current.locals[name]; - - if (!firstTime && previousLocals === latestLocals) return; // nothing to do - newScope = scope.$new(); - latestLocals = $state.$current.locals[name]; - - /** - * @ngdoc event - * @name ui.router.state.directive:ui-view#$viewContentLoading - * @eventOf ui.router.state.directive:ui-view - * @eventType emits on ui-view directive scope - * @description - * - * Fired once the view **begins loading**, *before* the DOM is rendered. - * - * @param {Object} event Event object. - * @param {string} viewName Name of the view. - */ - newScope.$emit('$viewContentLoading', name); - - var clone = $transclude(newScope, function(clone) { - var animEnter = $q.defer(), animLeave = $q.defer(); - var viewAnimData = { - $animEnter: animEnter.promise, - $animLeave: animLeave.promise, - $$animLeave: animLeave - }; - - clone.data('$uiViewAnim', viewAnimData); - renderer.enter(clone, $element, function onUiViewEnter() { - animEnter.resolve(); - if(currentScope) { - currentScope.$emit('$viewContentAnimationEnded'); - } - - if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) { - $uiViewScroll(clone); - } - }); - cleanupLastView(); - }); - - currentEl = clone; - currentScope = newScope; - /** - * @ngdoc event - * @name ui.router.state.directive:ui-view#$viewContentLoaded - * @eventOf ui.router.state.directive:ui-view - * @eventType emits on ui-view directive scope - * @description - * Fired once the view is **loaded**, *after* the DOM is rendered. - * - * @param {Object} event Event object. - * @param {string} viewName Name of the view. - */ - currentScope.$emit('$viewContentLoaded', name); - currentScope.$eval(onloadExp); - } - }; - } - }; - - return directive; -} - -$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate']; -function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) { - return { - restrict: 'ECA', - priority: -400, - compile: function (tElement) { - var initial = tElement.html(); - return function (scope, $element, attrs) { - var current = $state.$current, - name = getUiViewName(scope, attrs, $element, $interpolate), - locals = current && current.locals[name]; - - if (! locals) { - return; - } - - $element.data('$uiView', { name: name, state: locals.$$state }); - $element.html(locals.$template ? locals.$template : initial); - - var resolveData = angular.extend({}, locals); - scope[locals.$$resolveAs] = resolveData; - - var link = $compile($element.contents()); - - if (locals.$$controller) { - locals.$scope = scope; - locals.$element = $element; - var controller = $controller(locals.$$controller, locals); - if (locals.$$controllerAs) { - scope[locals.$$controllerAs] = controller; - scope[locals.$$controllerAs][locals.$$resolveAs] = resolveData; - } - if (isFunction(controller.$onInit)) controller.$onInit(); - $element.data('$ngControllerController', controller); - $element.children().data('$ngControllerController', controller); - } - - link(scope); - }; - } - }; -} - -/** - * Shared ui-view code for both directives: - * Given scope, element, and its attributes, return the view's name - */ -function getUiViewName(scope, attrs, element, $interpolate) { - var name = $interpolate(attrs.uiView || attrs.name || '')(scope); - var uiViewCreatedBy = element.inheritedData('$uiView'); - return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : '')); -} - -angular.module('ui.router.state').directive('uiView', $ViewDirective); -angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill); - -function parseStateRef(ref, current) { - var preparsed = ref.match(/^\s*({[^}]*})\s*$/), parsed; - if (preparsed) ref = current + '(' + preparsed[1] + ')'; - parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/); - if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'"); - return { state: parsed[1], paramExpr: parsed[3] || null }; -} - -function stateContext(el) { - var stateData = el.parent().inheritedData('$uiView'); - - if (stateData && stateData.state && stateData.state.name) { - return stateData.state; - } -} - -function getTypeInfo(el) { - // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. - var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]'; - var isForm = el[0].nodeName === "FORM"; - - return { - attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'), - isAnchor: el.prop("tagName").toUpperCase() === "A", - clickable: !isForm - }; -} - -function clickHook(el, $state, $timeout, type, current) { - return function(e) { - var button = e.which || e.button, target = current(); - - if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) { - // HACK: This is to allow ng-clicks to be processed before the transition is initiated: - var transition = $timeout(function() { - $state.go(target.state, target.params, target.options); - }); - e.preventDefault(); - - // if the state has no URL, ignore one preventDefault from the directive. - var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1: 0; - - e.preventDefault = function() { - if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition); - }; - } - }; -} - -function defaultOpts(el, $state) { - return { relative: stateContext(el) || $state.$current, inherit: true }; -} - -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-sref - * - * @requires ui.router.state.$state - * @requires $timeout - * - * @restrict A - * - * @description - * A directive that binds a link (`` tag) to a state. If the state has an associated - * URL, the directive will automatically generate & update the `href` attribute via - * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking - * the link will trigger a state transition with optional parameters. - * - * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be - * handled natively by the browser. - * - * You can also use relative state paths within ui-sref, just like the relative - * paths passed to `$state.go()`. You just need to be aware that the path is relative - * to the state that the link lives in, in other words the state that loaded the - * template containing the link. - * - * You can specify options to pass to {@link ui.router.state.$state#methods_go $state.go()} - * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`, - * and `reload`. - * - * @example - * Here's an example of how you'd use ui-sref and how it would compile. If you have the - * following template: - *
      - * Home | About | Next page
      - *
      - * 
      - * 
      - * - * Then the compiled html would be (assuming Html5Mode is off and current state is contacts): - *
      - * Home | About | Next page
      - *
      - * 
        - *
      • - * Joe - *
      • - *
      • - * Alice - *
      • - *
      • - * Bob - *
      • - *
      - * - * Home - *
      - * - * @param {string} ui-sref 'stateName' can be any valid absolute or relative state - * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#methods_go $state.go()} - */ -$StateRefDirective.$inject = ['$state', '$timeout']; -function $StateRefDirective($state, $timeout) { - return { - restrict: 'A', - require: ['?^uiSrefActive', '?^uiSrefActiveEq'], - link: function(scope, element, attrs, uiSrefActive) { - var ref = parseStateRef(attrs.uiSref, $state.current.name); - var def = { state: ref.state, href: null, params: null }; - var type = getTypeInfo(element); - var active = uiSrefActive[1] || uiSrefActive[0]; - var unlinkInfoFn = null; - var hookFn; - - def.options = extend(defaultOpts(element, $state), attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {}); - - var update = function(val) { - if (val) def.params = angular.copy(val); - def.href = $state.href(ref.state, def.params, def.options); - - if (unlinkInfoFn) unlinkInfoFn(); - if (active) unlinkInfoFn = active.$$addStateInfo(ref.state, def.params); - if (def.href !== null) attrs.$set(type.attr, def.href); - }; - - if (ref.paramExpr) { - scope.$watch(ref.paramExpr, function(val) { if (val !== def.params) update(val); }, true); - def.params = angular.copy(scope.$eval(ref.paramExpr)); - } - update(); - - if (!type.clickable) return; - hookFn = clickHook(element, $state, $timeout, type, function() { return def; }); - element.bind("click", hookFn); - scope.$on('$destroy', function() { - element.unbind("click", hookFn); - }); - } - }; -} - -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-state - * - * @requires ui.router.state.uiSref - * - * @restrict A - * - * @description - * Much like ui-sref, but will accept named $scope properties to evaluate for a state definition, - * params and override options. - * - * @param {string} ui-state 'stateName' can be any valid absolute or relative state - * @param {Object} ui-state-params params to pass to {@link ui.router.state.$state#methods_href $state.href()} - * @param {Object} ui-state-opts options to pass to {@link ui.router.state.$state#methods_go $state.go()} - */ -$StateRefDynamicDirective.$inject = ['$state', '$timeout']; -function $StateRefDynamicDirective($state, $timeout) { - return { - restrict: 'A', - require: ['?^uiSrefActive', '?^uiSrefActiveEq'], - link: function(scope, element, attrs, uiSrefActive) { - var type = getTypeInfo(element); - var active = uiSrefActive[1] || uiSrefActive[0]; - var group = [attrs.uiState, attrs.uiStateParams || null, attrs.uiStateOpts || null]; - var watch = '[' + group.map(function(val) { return val || 'null'; }).join(', ') + ']'; - var def = { state: null, params: null, options: null, href: null }; - var unlinkInfoFn = null; - var hookFn; - - function runStateRefLink (group) { - def.state = group[0]; def.params = group[1]; def.options = group[2]; - def.href = $state.href(def.state, def.params, def.options); - - if (unlinkInfoFn) unlinkInfoFn(); - if (active) unlinkInfoFn = active.$$addStateInfo(def.state, def.params); - if (def.href) attrs.$set(type.attr, def.href); - } - - scope.$watch(watch, runStateRefLink, true); - runStateRefLink(scope.$eval(watch)); - - if (!type.clickable) return; - hookFn = clickHook(element, $state, $timeout, type, function() { return def; }); - element.bind("click", hookFn); - scope.$on('$destroy', function() { - element.unbind("click", hookFn); - }); - } - }; -} - - -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-sref-active - * - * @requires ui.router.state.$state - * @requires ui.router.state.$stateParams - * @requires $interpolate - * - * @restrict A - * - * @description - * A directive working alongside ui-sref to add classes to an element when the - * related ui-sref directive's state is active, and removing them when it is inactive. - * The primary use-case is to simplify the special appearance of navigation menus - * relying on `ui-sref`, by having the "active" state's menu button appear different, - * distinguishing it from the inactive menu items. - * - * ui-sref-active can live on the same element as ui-sref or on a parent element. The first - * ui-sref-active found at the same level or above the ui-sref will be used. - * - * Will activate when the ui-sref's target state or any child state is active. If you - * need to activate only when the ui-sref target state is active and *not* any of - * it's children, then you will use - * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq} - * - * @example - * Given the following template: - *
      - * 
      - * 
      - * - * - * When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins", - * the resulting HTML will appear as (note the 'active' class): - *
      - * 
      - * 
      - * - * The class name is interpolated **once** during the directives link time (any further changes to the - * interpolated value are ignored). - * - * Multiple classes may be specified in a space-separated format: - *
      - * 
        - *
      • - * link - *
      • - *
      - *
      - * - * It is also possible to pass ui-sref-active an expression that evaluates - * to an object hash, whose keys represent active class names and whose - * values represent the respective state names/globs. - * ui-sref-active will match if the current active state **includes** any of - * the specified state names/globs, even the abstract ones. - * - * @Example - * Given the following template, with "admin" being an abstract state: - *
      - * 
      - * Roles - *
      - *
      - * - * When the current state is "admin.roles" the "active" class will be applied - * to both the
      and elements. It is important to note that the state - * names/globs passed to ui-sref-active shadow the state provided by ui-sref. - */ - -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-sref-active-eq - * - * @requires ui.router.state.$state - * @requires ui.router.state.$stateParams - * @requires $interpolate - * - * @restrict A - * - * @description - * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate - * when the exact target state used in the `ui-sref` is active; no child states. - * - */ -$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate']; -function $StateRefActiveDirective($state, $stateParams, $interpolate) { - return { - restrict: "A", - controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) { - var states = [], activeClasses = {}, activeEqClass, uiSrefActive; - - // There probably isn't much point in $observing this - // uiSrefActive and uiSrefActiveEq share the same directive object with some - // slight difference in logic routing - activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope); - - try { - uiSrefActive = $scope.$eval($attrs.uiSrefActive); - } catch (e) { - // Do nothing. uiSrefActive is not a valid expression. - // Fall back to using $interpolate below - } - uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope); - if (isObject(uiSrefActive)) { - forEach(uiSrefActive, function(stateOrName, activeClass) { - if (isString(stateOrName)) { - var ref = parseStateRef(stateOrName, $state.current.name); - addState(ref.state, $scope.$eval(ref.paramExpr), activeClass); - } - }); - } - - // Allow uiSref to communicate with uiSrefActive[Equals] - this.$$addStateInfo = function (newState, newParams) { - // we already got an explicit state provided by ui-sref-active, so we - // shadow the one that comes from ui-sref - if (isObject(uiSrefActive) && states.length > 0) { - return; - } - var deregister = addState(newState, newParams, uiSrefActive); - update(); - return deregister; - }; - - $scope.$on('$stateChangeSuccess', update); - - function addState(stateName, stateParams, activeClass) { - var state = $state.get(stateName, stateContext($element)); - var stateHash = createStateHash(stateName, stateParams); - - var stateInfo = { - state: state || { name: stateName }, - params: stateParams, - hash: stateHash - }; - - states.push(stateInfo); - activeClasses[stateHash] = activeClass; - - return function removeState() { - var idx = states.indexOf(stateInfo); - if (idx !== -1) states.splice(idx, 1); - }; - } - - /** - * @param {string} state - * @param {Object|string} [params] - * @return {string} - */ - function createStateHash(state, params) { - if (!isString(state)) { - throw new Error('state should be a string'); - } - if (isObject(params)) { - return state + toJson(params); - } - params = $scope.$eval(params); - if (isObject(params)) { - return state + toJson(params); - } - return state; - } - - // Update route state - function update() { - for (var i = 0; i < states.length; i++) { - if (anyMatch(states[i].state, states[i].params)) { - addClass($element, activeClasses[states[i].hash]); - } else { - removeClass($element, activeClasses[states[i].hash]); - } - - if (exactMatch(states[i].state, states[i].params)) { - addClass($element, activeEqClass); - } else { - removeClass($element, activeEqClass); - } - } - } - - function addClass(el, className) { $timeout(function () { el.addClass(className); }); } - function removeClass(el, className) { el.removeClass(className); } - function anyMatch(state, params) { return $state.includes(state.name, params); } - function exactMatch(state, params) { return $state.is(state.name, params); } - - update(); - }] - }; -} - -angular.module('ui.router.state') - .directive('uiSref', $StateRefDirective) - .directive('uiSrefActive', $StateRefActiveDirective) - .directive('uiSrefActiveEq', $StateRefActiveDirective) - .directive('uiState', $StateRefDynamicDirective); - -/** - * @ngdoc filter - * @name ui.router.state.filter:isState - * - * @requires ui.router.state.$state - * - * @description - * Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}. - */ -$IsStateFilter.$inject = ['$state']; -function $IsStateFilter($state) { - var isFilter = function (state, params) { - return $state.is(state, params); - }; - isFilter.$stateful = true; - return isFilter; -} - -/** - * @ngdoc filter - * @name ui.router.state.filter:includedByState - * - * @requires ui.router.state.$state - * - * @description - * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}. - */ -$IncludedByStateFilter.$inject = ['$state']; -function $IncludedByStateFilter($state) { - var includesFilter = function (state, params, options) { - return $state.includes(state, params, options); - }; - includesFilter.$stateful = true; - return includesFilter; -} - -angular.module('ui.router.state') - .filter('isState', $IsStateFilter) - .filter('includedByState', $IncludedByStateFilter); -})(window, window.angular); \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/release/angular-ui-router.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/release/angular-ui-router.min.js deleted file mode 100644 index ef1e08e291..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/release/angular-ui-router.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * State-based routing for AngularJS - * @version v0.3.1 - * @link http://angular-ui.github.com/ - * @license MIT License, http://www.opensource.org/licenses/MIT - */ -"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return R(new(R(function(){},{prototype:a})),b)}function e(a){return Q(arguments,function(b){b!==a&&Q(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return Q(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l]&&i[l].params&&(e=g(i[l].params),e.length))for(var m in e)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return R({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(s[c]=d,N(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);Q(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return O(a)&&a.then&&a.$$promises}if(!O(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return Q(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!L(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;Q(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!O(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=R({},d),u=1+q.length/3,v=!1;if(L(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),R(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;x>w;w+=3)d.hasOwnProperty(q[w])?h():j(q[w],q[w+1],q[w+2]);return r}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function q(a,b,c){this.fromConfig=function(a,b,c){return L(a.template)?this.fromString(a.template,b):L(a.templateUrl)?this.fromUrl(a.templateUrl,b):L(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return M(a)?a(b):a},this.fromUrl=function(c,d){return M(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b,headers:{Accept:"text/html"}}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function r(a,b,e){function f(b,c,d,e){if(q.push(b),o[b])return o[b];if(!/^\w+([-.]+\w+)*(?:\[\])?$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");return p[b]=new U.Param(b,c,d,e),p[b]}function g(a,b,c,d){var e=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)return f;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:f=f.replace(/\/$/,""),e=["(?:/(",")|/)?"];break;default:e=["("+c+"|",")?"]}return f+e[0]+b+e[1]}function h(e,f){var g,h,i,j,k;return g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),h&&(j=U.type(h)||d(U.type("string"),{pattern:new RegExp(h,b.caseInsensitive?"i":c)})),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=R({params:{}},O(b)?b:{});var i,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():new U.ParamSet,q=[];this.source=a;for(var r,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function s(a){R(this,a)}function t(){function a(a){return null!=a?a.toString().replace(/~/g,"~~").replace(/\//g,"~2F"):a}function e(a){return null!=a?a.toString().replace(/~2F/g,"/").replace(/~~/g,"~"):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return M(a)||P(a)&&M(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(u[a.name],l.invoke(a.def))}}function k(a){R(this,a||{})}U=this;var l,m=!1,p=!0,q=!1,u={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!L(a)||"string"==typeof a},pattern:/[^\/]*/},"int":{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return L(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};t.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return L(a)&&(m=a),m},this.strictMode=function(a){return L(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!L(a))return q;if(a!==!0&&a!==!1&&!N(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new r(a,R(f(),b))},this.isMatcher=function(a){if(!O(a))return!1;var b=!0;return Q(r.prototype,function(c,d){M(c)&&(b=b&&L(a[d])&&M(a[d]))}),b},this.type=function(a,b,c){if(!L(b))return u[a];if(u.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return u[a]=new s(R({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},Q(x,function(a,b){u[b]=new s(R({name:b},a))}),u=d(u,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),Q(x,function(a,b){u[b]||(u[b]=new s(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=O(a)?g(a):[],c=-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array");return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d?d:c.type?b.isString(c.type)?u[c.type]:c.type instanceof s?c.type:new s(c.type):"config"===e?u.any:u.string}function m(){var b={array:"search"===f?"auto":!1},c=a.match(/\[\]$/)?{array:!0}:{};return R(b,c,e).array}function p(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!L(c)||null==c)return q;if(c===!0||N(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function r(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=P(a.replace)?a.replace:[],N(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}function t(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),L(a)?x.type.$normalize(a):t()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=r(e,y,z,A);R(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,R(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),Q(b,function(b){Q(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return Q(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return Q(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;de;e++)if(b(j[e]))return;k&&b(k)}}function o(){return i=i||e.$on("$locationChangeSuccess",n)}var p,q=g.baseHref(),r=d.url();return l||o(),{sync:function(){n()},listen:function(){return o()},update:function(a){return a?void(r=d.url()):void(d.url()!==r&&(d.url(r),d.replace()))},push:function(a,b,e){var f=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),p=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))return null;var g=a.html5Mode();b.isObject(g)&&(g=g.enabled),g=g&&h.history;var i=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=m(i,g,f.absolute),!f.absolute||!i)return i;var j=!g&&i?"/":"",k=d.port();return k=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}var i,j=[],k=null,l=!1;this.rule=function(a){if(!M(a))throw new Error("'rule' must be a function");return j.push(a),this},this.otherwise=function(a){if(N(a)){var b=a;a=function(){return b}}else if(!M(a))throw new Error("'rule' must be a function");return k=a,this},this.when=function(a,b){var c,h=N(b);if(N(a)&&(a=d.compile(a)),!h&&!M(b)&&!P(b))throw new Error("invalid 'handler' in when()");var i={matcher:function(a,b){return h&&(c=d.compile(b),b=["$match",function(a){return c.format(a)}]),R(function(c,d){return g(c,b,a.exec(d.path(),d.search()))},{prefix:N(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(c=b,b=["$match",function(a){return f(c,a)}]),R(function(c,d){return g(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:a instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](a,b));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser","$sniffer"]}function v(a,e){function f(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function m(a,b){if(!a)return c;var d=N(a),e=d?a:a.name,g=f(e);if(g){if(!b)throw new Error("No reference point given for path '"+e+"'");b=m(b);for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=z[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function n(a,b){A[a]||(A[a]=[]),A[a].push(b)}function p(a){for(var b=A[a]||[];b.length;)q(b.shift())}function q(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!N(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(z.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):N(b.parent)?b.parent:O(b.parent)&&N(b.parent.name)?b.parent.name:"";if(e&&!z[e])return n(e,b.self);for(var f in C)M(C[f])&&(b[f]=C[f](b,C.$delegates[f]));return z[c]=b,!b[B]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){y.$current.navigable==b&&j(a,c)||y.transitionTo(b,a,{inherit:!0,location:!1})}]),p(c),b}function r(a){return a.indexOf("*")>-1}function s(a){for(var b=a.split("."),c=y.$current.name.split("."),d=0,e=b.length;e>d;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length!=c.length?!1:c.join("")===b.join("")}function t(a,b){return N(a)&&!L(b)?C[a]:M(b)&&N(a)?(C[a]&&!C.$delegates[a]&&(C.$delegates[a]=C[a]),C[a]=b,this):this}function u(a,b){return O(a)?b=a:b.name=a,q(b),this}function v(a,e,f,h,l,n,p,q,t){function u(b,c,d,f){var g=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)return p.update(),D;if(!g.retry)return null;if(f.$retry)return p.update(),E;var h=y.transition=e.when(g.retry);return h.then(function(){return h!==y.transition?A:(b.options.$retry=!0,y.transitionTo(b.to,b.toParams,b.options))},function(){return D}),p.update(),h}function v(a,c,d,g,i,j){function m(){var c=[];return Q(a.views,function(d,e){var g=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){return f.load(e,{view:d,locals:i.globals,params:n,notify:j.notify})||""}],c.push(l.resolve(g,i.globals,i.resolve,a).then(function(c){if(M(d.controllerProvider)||P(d.controllerProvider)){var f=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}else c.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,c.$$resolveAs=d.resolveAs,i[e]=c}))}),e.all(c).then(function(){return i.globals})}var n=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=l.resolve(a.resolve,o,i.resolve,a);var p=[i.resolve.then(function(a){i.globals=a})];return g&&p.push(g),e.all(p).then(m).then(function(a){return i})}var A=e.reject(new Error("transition superseded")),C=e.reject(new Error("transition prevented")),D=e.reject(new Error("transition aborted")),E=e.reject(new Error("transition failed"));return x.locals={resolve:null,globals:{$stateParams:{}}},y={params:{},current:x.self,$current:x,transition:null},y.reload=function(a){return y.transitionTo(y.current,n,{reload:a||!0,inherit:!1,notify:!0})},y.go=function(a,b,c){return y.transitionTo(a,b,R({inherit:!0,relative:y.$current},c))},y.transitionTo=function(b,c,f){c=c||{},f=R({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,j=y.$current,l=y.params,o=j.path,q=m(b,f.relative),r=c["#"];if(!L(q)){var s={to:b,toParams:c,options:f},t=u(s,j.self,l,f);if(t)return t;if(b=s.to,c=s.toParams,f=s.options,q=m(b,f.relative),!L(q)){if(!f.relative)throw new Error("No such state '"+b+"'");throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(q[B])throw new Error("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(n,c||{},y.$current,q)),!q.params.$$validates(c))return E;c=q.params.$$values(c),b=q;var z=b.path,D=0,F=z[D],G=x.locals,H=[];if(f.reload){if(N(f.reload)||O(f.reload)){if(O(f.reload)&&!f.reload.name)throw new Error("Invalid reload state object");var I=f.reload===!0?o[0]:m(f.reload);if(f.reload&&!I)throw new Error("No such reload state '"+(N(f.reload)?f.reload:f.reload.name)+"'");for(;F&&F===o[D]&&F!==I;)G=H[D]=F.locals,D++,F=z[D]}}else for(;F&&F===o[D]&&F.ownParams.$$equals(c,l);)G=H[D]=F.locals,D++,F=z[D];if(w(b,c,j,l,G,f))return r&&(c["#"]=r),y.params=c,S(y.params,n),S(k(b.params.$$keys(),n),b.locals.globals.$stateParams),f.location&&b.navigable&&b.navigable.url&&(p.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),p.update(!0)),y.transition=null,e.when(y.current);if(c=k(b.params.$$keys(),c||{}),r&&(c["#"]=r),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,l,f).defaultPrevented)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,l),null==y.transition&&p.update(),C;for(var J=e.when(G),K=D;K=D;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=D;d2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate"),l={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=A(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}};return l}function z(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return function(f,h,i){var j=d.$current,k=A(f,i,h,e),l=j&&j.locals[k];if(l){h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),M(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}}function A(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function B(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function C(a){var b=a.parent().inheritedData("$uiView");return b&&b.state&&b.state.name?b.state:void 0}function D(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function E(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function F(a,b){return{relative:C(a)||b.$current,inherit:!0}}function G(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=B(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=D(e),l=g[1]||g[0],m=null;j.options=R(F(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=E(e,a,c,k,function(){return j}),e.bind("click",h),d.$on("$destroy",function(){e.unbind("click",h)}))}}}function H(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=D(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=E(d,a,b,i,function(){return m}),d.bind("click",h),c.$on("$destroy",function(){d.unbind("click",h)}))}}}function I(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,C(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);-1!==a&&p.splice(a,1)}}function h(a,c){if(!N(a))throw new Error("state should be a string");return O(c)?a+T(c):(c=b.$eval(c),O(c)?a+T(c):a)}function i(){for(var a=0;a0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function J(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function K(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var L=b.isDefined,M=b.isFunction,N=b.isString,O=b.isObject,P=b.isArray,Q=b.forEach,R=b.extend,S=b.copy,T=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),p.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",p),q.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",q);var U;r.prototype.concat=function(a,b){var c={caseInsensitive:U.caseInsensitive(),strict:U.strictMode(),squash:U.defaultSquashPolicy()};return new r(this.sourcePath+a+this.sourceSearch,R(c,b),this)},r.prototype.toString=function(){return this.source},r.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;j>e;e++){for(g=h[e],l=this.params[g],m=d[e+1],f=0;fe;e++){for(g=h[e],k[g]=this.params[g].value(b[g]),l=this.params[g],m=b[g],f=0;ff;f++){var k=h>f,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=p?m.squash:!1,r=m.type.encode(n);if(k){var s=c[f+1],t=f+1===h;if(q===!1)null!=r&&(j+=P(r)?o(r,b).join("-"):encodeURIComponent(r)),j+=s;else if(q===!0){var u=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(u)[1]}else N(q)&&(j+=q+s);t&&m.squash===!0&&"/"===j.slice(-1)&&(j=j.slice(0,-1))}else{if(null==r||p&&q!==!1)continue;if(P(r)||(r=[r]),0===r.length)continue;r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+(l+"="+r),g=!0}}return j},s.prototype.is=function(a,b){return!0},s.prototype.encode=function(a,b){return a},s.prototype.decode=function(a,b){return a},s.prototype.equals=function(a,b){return a==b},s.prototype.$subPattern=function(){var a=this.pattern.toString();return a.substr(1,a.length-2)},s.prototype.pattern=/.*/,s.prototype.toString=function(){return"{Type:"+this.name+"}"},s.prototype.$normalize=function(a){return this.is(a)?a:this.decode(a)},s.prototype.$asArray=function(a,b){function d(a,b){function d(a,b){return function(){return a[b].apply(a,arguments)}}function e(a){return P(a)?a:L(a)?[a]:[]}function f(a){switch(a.length){case 0:return c;case 1:return"auto"===b?a[0]:a;default:return a}}function g(a){return!a}function h(a,b){return function(c){if(P(c)&&0===c.length)return c;c=e(c);var d=o(c,a);return b===!0?0===n(d,g).length:f(d)}}function i(a){return function(b,c){var d=e(b),f=e(c);if(d.length!==f.length)return!1;for(var g=0;g>> 0, from = Number(arguments[2]) || 0; - from = (from < 0) ? Math.ceil(from) : Math.floor(from); - - if (from < 0) from += len; - - for (; from < len; from++) { - if (from in array && array[from] === value) return from; - } - return -1; -} - -/** - * Merges a set of parameters with all parameters inherited between the common parents of the - * current state and a given destination state. - * - * @param {Object} currentParams The value of the current state parameters ($stateParams). - * @param {Object} newParams The set of parameters which will be composited with inherited params. - * @param {Object} $current Internal definition of object representing the current state. - * @param {Object} $to Internal definition of object representing state to transition to. - */ -function inheritParams(currentParams, newParams, $current, $to) { - var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = []; - - for (var i in parents) { - if (!parents[i] || !parents[i].params) continue; - parentParams = objectKeys(parents[i].params); - if (!parentParams.length) continue; - - for (var j in parentParams) { - if (indexOf(inheritList, parentParams[j]) >= 0) continue; - inheritList.push(parentParams[j]); - inherited[parentParams[j]] = currentParams[parentParams[j]]; - } - } - return extend({}, inherited, newParams); -} - -/** - * Performs a non-strict comparison of the subset of two objects, defined by a list of keys. - * - * @param {Object} a The first object. - * @param {Object} b The second object. - * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified, - * it defaults to the list of keys in `a`. - * @return {Boolean} Returns `true` if the keys match, otherwise `false`. - */ -function equalForKeys(a, b, keys) { - if (!keys) { - keys = []; - for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility - } - - for (var i=0; i - * - * - * - * - * - * - * - * - * - * - * - * - */ -angular.module('ui.router', ['ui.router.state']); - -angular.module('ui.router.compat', ['ui.router']); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/resolve.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/resolve.js deleted file mode 100644 index 019338dd94..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/resolve.js +++ /dev/null @@ -1,252 +0,0 @@ -/** - * @ngdoc object - * @name ui.router.util.$resolve - * - * @requires $q - * @requires $injector - * - * @description - * Manages resolution of (acyclic) graphs of promises. - */ -$Resolve.$inject = ['$q', '$injector']; -function $Resolve( $q, $injector) { - - var VISIT_IN_PROGRESS = 1, - VISIT_DONE = 2, - NOTHING = {}, - NO_DEPENDENCIES = [], - NO_LOCALS = NOTHING, - NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING }); - - - /** - * @ngdoc function - * @name ui.router.util.$resolve#study - * @methodOf ui.router.util.$resolve - * - * @description - * Studies a set of invocables that are likely to be used multiple times. - *
      -   * $resolve.study(invocables)(locals, parent, self)
      -   * 
      - * is equivalent to - *
      -   * $resolve.resolve(invocables, locals, parent, self)
      -   * 
      - * but the former is more efficient (in fact `resolve` just calls `study` - * internally). - * - * @param {object} invocables Invocable objects - * @return {function} a function to pass in locals, parent and self - */ - this.study = function (invocables) { - if (!isObject(invocables)) throw new Error("'invocables' must be an object"); - var invocableKeys = objectKeys(invocables || {}); - - // Perform a topological sort of invocables to build an ordered plan - var plan = [], cycle = [], visited = {}; - function visit(value, key) { - if (visited[key] === VISIT_DONE) return; - - cycle.push(key); - if (visited[key] === VISIT_IN_PROGRESS) { - cycle.splice(0, indexOf(cycle, key)); - throw new Error("Cyclic dependency: " + cycle.join(" -> ")); - } - visited[key] = VISIT_IN_PROGRESS; - - if (isString(value)) { - plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES); - } else { - var params = $injector.annotate(value); - forEach(params, function (param) { - if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param); - }); - plan.push(key, value, params); - } - - cycle.pop(); - visited[key] = VISIT_DONE; - } - forEach(invocables, visit); - invocables = cycle = visited = null; // plan is all that's required - - function isResolve(value) { - return isObject(value) && value.then && value.$$promises; - } - - return function (locals, parent, self) { - if (isResolve(locals) && self === undefined) { - self = parent; parent = locals; locals = null; - } - if (!locals) locals = NO_LOCALS; - else if (!isObject(locals)) { - throw new Error("'locals' must be an object"); - } - if (!parent) parent = NO_PARENT; - else if (!isResolve(parent)) { - throw new Error("'parent' must be a promise returned by $resolve.resolve()"); - } - - // To complete the overall resolution, we have to wait for the parent - // promise and for the promise for each invokable in our plan. - var resolution = $q.defer(), - result = resolution.promise, - promises = result.$$promises = {}, - values = extend({}, locals), - wait = 1 + plan.length/3, - merged = false; - - function done() { - // Merge parent values we haven't got yet and publish our own $$values - if (!--wait) { - if (!merged) merge(values, parent.$$values); - result.$$values = values; - result.$$promises = result.$$promises || true; // keep for isResolve() - delete result.$$inheritedValues; - resolution.resolve(values); - } - } - - function fail(reason) { - result.$$failure = reason; - resolution.reject(reason); - } - - // Short-circuit if parent has already failed - if (isDefined(parent.$$failure)) { - fail(parent.$$failure); - return result; - } - - if (parent.$$inheritedValues) { - merge(values, omit(parent.$$inheritedValues, invocableKeys)); - } - - // Merge parent values if the parent has already resolved, or merge - // parent promises and wait if the parent resolve is still in progress. - extend(promises, parent.$$promises); - if (parent.$$values) { - merged = merge(values, omit(parent.$$values, invocableKeys)); - result.$$inheritedValues = omit(parent.$$values, invocableKeys); - done(); - } else { - if (parent.$$inheritedValues) { - result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys); - } - parent.then(done, fail); - } - - // Process each invocable in the plan, but ignore any where a local of the same name exists. - for (var i=0, ii=plan.length; i= 0) throw new Error("State must have a valid name"); - if (states.hasOwnProperty(name)) throw new Error("State '" + name + "' is already defined"); - - // Get parent name - var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.')) - : (isString(state.parent)) ? state.parent - : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name - : ''; - - // If parent is not registered yet, add state to queue and register later - if (parentName && !states[parentName]) { - return queueState(parentName, state.self); - } - - for (var key in stateBuilder) { - if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]); - } - states[name] = state; - - // Register the state in the global state list and with $urlRouter if necessary. - if (!state[abstractKey] && state.url) { - $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) { - if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) { - $state.transitionTo(state, $match, { inherit: true, location: false }); - } - }]); - } - - // Register any queued children - flushQueuedChildren(name); - - return state; - } - - // Checks text to see if it looks like a glob. - function isGlob (text) { - return text.indexOf('*') > -1; - } - - // Returns true if glob matches current $state name. - function doesStateMatchGlob (glob) { - var globSegments = glob.split('.'), - segments = $state.$current.name.split('.'); - - //match single stars - for (var i = 0, l = globSegments.length; i < l; i++) { - if (globSegments[i] === '*') { - segments[i] = '*'; - } - } - - //match greedy starts - if (globSegments[0] === '**') { - segments = segments.slice(indexOf(segments, globSegments[1])); - segments.unshift('**'); - } - //match greedy ends - if (globSegments[globSegments.length - 1] === '**') { - segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE); - segments.push('**'); - } - - if (globSegments.length != segments.length) { - return false; - } - - return segments.join('') === globSegments.join(''); - } - - - // Implicit root state that is always active - root = registerState({ - name: '', - url: '^', - views: null, - 'abstract': true - }); - root.navigable = null; - - - /** - * @ngdoc function - * @name ui.router.state.$stateProvider#decorator - * @methodOf ui.router.state.$stateProvider - * - * @description - * Allows you to extend (carefully) or override (at your own peril) the - * `stateBuilder` object used internally by `$stateProvider`. This can be used - * to add custom functionality to ui-router, for example inferring templateUrl - * based on the state name. - * - * When passing only a name, it returns the current (original or decorated) builder - * function that matches `name`. - * - * The builder functions that can be decorated are listed below. Though not all - * necessarily have a good use case for decoration, that is up to you to decide. - * - * In addition, users can attach custom decorators, which will generate new - * properties within the state's internal definition. There is currently no clear - * use-case for this beyond accessing internal states (i.e. $state.$current), - * however, expect this to become increasingly relevant as we introduce additional - * meta-programming features. - * - * **Warning**: Decorators should not be interdependent because the order of - * execution of the builder functions in non-deterministic. Builder functions - * should only be dependent on the state definition object and super function. - * - * - * Existing builder functions and current return values: - * - * - **parent** `{object}` - returns the parent state object. - * - **data** `{object}` - returns state data, including any inherited data that is not - * overridden by own values (if any). - * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher} - * or `null`. - * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is - * navigable). - * - **params** `{object}` - returns an array of state params that are ensured to - * be a super-set of parent's params. - * - **views** `{object}` - returns a views object where each key is an absolute view - * name (i.e. "viewName@stateName") and each value is the config object - * (template, controller) for the view. Even when you don't use the views object - * explicitly on a state config, one is still created for you internally. - * So by decorating this builder function you have access to decorating template - * and controller properties. - * - **ownParams** `{object}` - returns an array of params that belong to the state, - * not including any params defined by ancestor states. - * - **path** `{string}` - returns the full path from the root down to this state. - * Needed for state activation. - * - **includes** `{object}` - returns an object that includes every state that - * would pass a `$state.includes()` test. - * - * @example - *
      -   * // Override the internal 'views' builder with a function that takes the state
      -   * // definition, and a reference to the internal function being overridden:
      -   * $stateProvider.decorator('views', function (state, parent) {
      -   *   var result = {},
      -   *       views = parent(state);
      -   *
      -   *   angular.forEach(views, function (config, name) {
      -   *     var autoName = (state.name + '.' + name).replace('.', '/');
      -   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
      -   *     result[name] = config;
      -   *   });
      -   *   return result;
      -   * });
      -   *
      -   * $stateProvider.state('home', {
      -   *   views: {
      -   *     'contact.list': { controller: 'ListController' },
      -   *     'contact.item': { controller: 'ItemController' }
      -   *   }
      -   * });
      -   *
      -   * // ...
      -   *
      -   * $state.go('home');
      -   * // Auto-populates list and item views with /partials/home/contact/list.html,
      -   * // and /partials/home/contact/item.html, respectively.
      -   * 
      - * - * @param {string} name The name of the builder function to decorate. - * @param {object} func A function that is responsible for decorating the original - * builder function. The function receives two parameters: - * - * - `{object}` - state - The state config object. - * - `{object}` - super - The original builder function. - * - * @return {object} $stateProvider - $stateProvider instance - */ - this.decorator = decorator; - function decorator(name, func) { - /*jshint validthis: true */ - if (isString(name) && !isDefined(func)) { - return stateBuilder[name]; - } - if (!isFunction(func) || !isString(name)) { - return this; - } - if (stateBuilder[name] && !stateBuilder.$delegates[name]) { - stateBuilder.$delegates[name] = stateBuilder[name]; - } - stateBuilder[name] = func; - return this; - } - - /** - * @ngdoc function - * @name ui.router.state.$stateProvider#state - * @methodOf ui.router.state.$stateProvider - * - * @description - * Registers a state configuration under a given state name. The stateConfig object - * has the following acceptable properties. - * - * @param {string} name A unique state name, e.g. "home", "about", "contacts". - * To create a parent/child state use a dot, e.g. "about.sales", "home.newest". - * @param {object} stateConfig State configuration object. - * @param {string|function=} stateConfig.template - *
      - * html template as a string or a function that returns - * an html template as a string which should be used by the uiView directives. This property - * takes precedence over templateUrl. - * - * If `template` is a function, it will be called with the following parameters: - * - * - {array.<object>} - state parameters extracted from the current $location.path() by - * applying the current state - * - *
      template:
      -   *   "

      inline template definition

      " + - * "
      "
      - *
      template: function(params) {
      -   *       return "

      generated template

      "; }
      - *
      - * - * @param {string|function=} stateConfig.templateUrl - * - * - * path or function that returns a path to an html - * template that should be used by uiView. - * - * If `templateUrl` is a function, it will be called with the following parameters: - * - * - {array.<object>} - state parameters extracted from the current $location.path() by - * applying the current state - * - *
      templateUrl: "home.html"
      - *
      templateUrl: function(params) {
      -   *     return myTemplates[params.pageId]; }
      - * - * @param {function=} stateConfig.templateProvider - * - * Provider function that returns HTML content string. - *
       templateProvider:
      -   *       function(MyTemplateService, params) {
      -   *         return MyTemplateService.getTemplate(params.pageId);
      -   *       }
      - * - * @param {string|function=} stateConfig.controller - * - * - * Controller fn that should be associated with newly - * related scope or the name of a registered controller if passed as a string. - * Optionally, the ControllerAs may be declared here. - *
      controller: "MyRegisteredController"
      - *
      controller:
      -   *     "MyRegisteredController as fooCtrl"}
      - *
      controller: function($scope, MyService) {
      -   *     $scope.data = MyService.getData(); }
      - * - * @param {function=} stateConfig.controllerProvider - * - * - * Injectable provider function that returns the actual controller or string. - *
      controllerProvider:
      -   *   function(MyResolveData) {
      -   *     if (MyResolveData.foo)
      -   *       return "FooCtrl"
      -   *     else if (MyResolveData.bar)
      -   *       return "BarCtrl";
      -   *     else return function($scope) {
      -   *       $scope.baz = "Qux";
      -   *     }
      -   *   }
      - * - * @param {string=} stateConfig.controllerAs - * - * - * A controller alias name. If present the controller will be - * published to scope under the controllerAs name. - *
      controllerAs: "myCtrl"
      - * - * @param {string|object=} stateConfig.parent - * - * Optionally specifies the parent state of this state. - * - *
      parent: 'parentState'
      - *
      parent: parentState // JS variable
      - * - * @param {object=} stateConfig.resolve - * - * - * An optional map<string, function> of dependencies which - * should be injected into the controller. If any of these dependencies are promises, - * the router will wait for them all to be resolved before the controller is instantiated. - * If all the promises are resolved successfully, the $stateChangeSuccess event is fired - * and the values of the resolved promises are injected into any controllers that reference them. - * If any of the promises are rejected the $stateChangeError event is fired. - * - * The map object is: - * - * - key - {string}: name of dependency to be injected into controller - * - factory - {string|function}: If string then it is alias for service. Otherwise if function, - * it is injected and return value it treated as dependency. If result is a promise, it is - * resolved before its value is injected into controller. - * - *
      resolve: {
      -   *     myResolve1:
      -   *       function($http, $stateParams) {
      -   *         return $http.get("/api/foos/"+stateParams.fooID);
      -   *       }
      -   *     }
      - * - * @param {string=} stateConfig.url - * - * - * A url fragment with optional parameters. When a state is navigated or - * transitioned to, the `$stateParams` service will be populated with any - * parameters that were passed. - * - * (See {@link ui.router.util.type:UrlMatcher UrlMatcher} `UrlMatcher`} for - * more details on acceptable patterns ) - * - * examples: - *
      url: "/home"
      -   * url: "/users/:userid"
      -   * url: "/books/{bookid:[a-zA-Z_-]}"
      -   * url: "/books/{categoryid:int}"
      -   * url: "/books/{publishername:string}/{categoryid:int}"
      -   * url: "/messages?before&after"
      -   * url: "/messages?{before:date}&{after:date}"
      -   * url: "/messages/:mailboxid?{before:date}&{after:date}"
      -   * 
      - * - * @param {object=} stateConfig.views - * - * an optional map<string, object> which defined multiple views, or targets views - * manually/explicitly. - * - * Examples: - * - * Targets three named `ui-view`s in the parent state's template - *
      views: {
      -   *     header: {
      -   *       controller: "headerCtrl",
      -   *       templateUrl: "header.html"
      -   *     }, body: {
      -   *       controller: "bodyCtrl",
      -   *       templateUrl: "body.html"
      -   *     }, footer: {
      -   *       controller: "footCtrl",
      -   *       templateUrl: "footer.html"
      -   *     }
      -   *   }
      - * - * Targets named `ui-view="header"` from grandparent state 'top''s template, and named `ui-view="body" from parent state's template. - *
      views: {
      -   *     'header@top': {
      -   *       controller: "msgHeaderCtrl",
      -   *       templateUrl: "msgHeader.html"
      -   *     }, 'body': {
      -   *       controller: "messagesCtrl",
      -   *       templateUrl: "messages.html"
      -   *     }
      -   *   }
      - * - * @param {boolean=} [stateConfig.abstract=false] - * - * An abstract state will never be directly activated, - * but can provide inherited properties to its common children states. - *
      abstract: true
      - * - * @param {function=} stateConfig.onEnter - * - * - * Callback function for when a state is entered. Good way - * to trigger an action or dispatch an event, such as opening a dialog. - * If minifying your scripts, make sure to explicitly annotate this function, - * because it won't be automatically annotated by your build tools. - * - *
      onEnter: function(MyService, $stateParams) {
      -   *     MyService.foo($stateParams.myParam);
      -   * }
      - * - * @param {function=} stateConfig.onExit - * - * - * Callback function for when a state is exited. Good way to - * trigger an action or dispatch an event, such as opening a dialog. - * If minifying your scripts, make sure to explicitly annotate this function, - * because it won't be automatically annotated by your build tools. - * - *
      onExit: function(MyService, $stateParams) {
      -   *     MyService.cleanup($stateParams.myParam);
      -   * }
      - * - * @param {boolean=} [stateConfig.reloadOnSearch=true] - * - * - * If `false`, will not retrigger the same state - * just because a search/query parameter has changed (via $location.search() or $location.hash()). - * Useful for when you'd like to modify $location.search() without triggering a reload. - *
      reloadOnSearch: false
      - * - * @param {object=} stateConfig.data - * - * - * Arbitrary data object, useful for custom configuration. The parent state's `data` is - * prototypally inherited. In other words, adding a data property to a state adds it to - * the entire subtree via prototypal inheritance. - * - *
      data: {
      -   *     requiredRole: 'foo'
      -   * } 
      - * - * @param {object=} stateConfig.params - * - * - * A map which optionally configures parameters declared in the `url`, or - * defines additional non-url parameters. For each parameter being - * configured, add a configuration object keyed to the name of the parameter. - * - * Each parameter configuration object may contain the following properties: - * - * - ** value ** - {object|function=}: specifies the default value for this - * parameter. This implicitly sets this parameter as optional. - * - * When UI-Router routes to a state and no value is - * specified for this parameter in the URL or transition, the - * default value will be used instead. If `value` is a function, - * it will be injected and invoked, and the return value used. - * - * *Note*: `undefined` is treated as "no default value" while `null` - * is treated as "the default value is `null`". - * - * *Shorthand*: If you only need to configure the default value of the - * parameter, you may use a shorthand syntax. In the **`params`** - * map, instead mapping the param name to a full parameter configuration - * object, simply set map it to the default parameter value, e.g.: - * - *
      // define a parameter's default value
      -   * params: {
      -   *     param1: { value: "defaultValue" }
      -   * }
      -   * // shorthand default values
      -   * params: {
      -   *     param1: "defaultValue",
      -   *     param2: "param2Default"
      -   * }
      - * - * - ** array ** - {boolean=}: *(default: false)* If true, the param value will be - * treated as an array of values. If you specified a Type, the value will be - * treated as an array of the specified Type. Note: query parameter values - * default to a special `"auto"` mode. - * - * For query parameters in `"auto"` mode, if multiple values for a single parameter - * are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values - * are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`). However, if - * only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single - * value (e.g.: `{ foo: '1' }`). - * - *
      params: {
      -   *     param1: { array: true }
      -   * }
      - * - * - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when - * the current parameter value is the same as the default value. If `squash` is not set, it uses the - * configured default squash policy. - * (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`}) - * - * There are three squash settings: - * - * - false: The parameter's default value is not squashed. It is encoded and included in the URL - * - true: The parameter's default value is omitted from the URL. If the parameter is preceeded and followed - * by slashes in the state's `url` declaration, then one of those slashes are omitted. - * This can allow for cleaner looking URLs. - * - `""`: The parameter's default value is replaced with an arbitrary placeholder of your choice. - * - *
      params: {
      -   *     param1: {
      -   *       value: "defaultId",
      -   *       squash: true
      -   * } }
      -   * // squash "defaultValue" to "~"
      -   * params: {
      -   *     param1: {
      -   *       value: "defaultValue",
      -   *       squash: "~"
      -   * } }
      -   * 
      - * - * - * @example - *
      -   * // Some state name examples
      -   *
      -   * // stateName can be a single top-level name (must be unique).
      -   * $stateProvider.state("home", {});
      -   *
      -   * // Or it can be a nested state name. This state is a child of the
      -   * // above "home" state.
      -   * $stateProvider.state("home.newest", {});
      -   *
      -   * // Nest states as deeply as needed.
      -   * $stateProvider.state("home.newest.abc.xyz.inception", {});
      -   *
      -   * // state() returns $stateProvider, so you can chain state declarations.
      -   * $stateProvider
      -   *   .state("home", {})
      -   *   .state("about", {})
      -   *   .state("contacts", {});
      -   * 
      - * - */ - this.state = state; - function state(name, definition) { - /*jshint validthis: true */ - if (isObject(name)) definition = name; - else definition.name = name; - registerState(definition); - return this; - } - - /** - * @ngdoc object - * @name ui.router.state.$state - * - * @requires $rootScope - * @requires $q - * @requires ui.router.state.$view - * @requires $injector - * @requires ui.router.util.$resolve - * @requires ui.router.state.$stateParams - * @requires ui.router.router.$urlRouter - * - * @property {object} params A param object, e.g. {sectionId: section.id)}, that - * you'd like to test against the current active state. - * @property {object} current A reference to the state's config object. However - * you passed it in. Useful for accessing custom data. - * @property {object} transition Currently pending transition. A promise that'll - * resolve or reject. - * - * @description - * `$state` service is responsible for representing states as well as transitioning - * between them. It also provides interfaces to ask for current state or even states - * you're coming from. - */ - this.$get = $get; - $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory']; - function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter, $location, $urlMatcherFactory) { - - var TransitionSuperseded = $q.reject(new Error('transition superseded')); - var TransitionPrevented = $q.reject(new Error('transition prevented')); - var TransitionAborted = $q.reject(new Error('transition aborted')); - var TransitionFailed = $q.reject(new Error('transition failed')); - - // Handles the case where a state which is the target of a transition is not found, and the user - // can optionally retry or defer the transition - function handleRedirect(redirect, state, params, options) { - /** - * @ngdoc event - * @name ui.router.state.$state#$stateNotFound - * @eventOf ui.router.state.$state - * @eventType broadcast on root scope - * @description - * Fired when a requested state **cannot be found** using the provided state name during transition. - * The event is broadcast allowing any handlers a single chance to deal with the error (usually by - * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler, - * you can see its three properties in the example. You can use `event.preventDefault()` to abort the - * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value. - * - * @param {Object} event Event object. - * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties. - * @param {State} fromState Current state object. - * @param {Object} fromParams Current state params. - * - * @example - * - *
      -       * // somewhere, assume lazy.state has not been defined
      -       * $state.go("lazy.state", {a:1, b:2}, {inherit:false});
      -       *
      -       * // somewhere else
      -       * $scope.$on('$stateNotFound',
      -       * function(event, unfoundState, fromState, fromParams){
      -       *     console.log(unfoundState.to); // "lazy.state"
      -       *     console.log(unfoundState.toParams); // {a:1, b:2}
      -       *     console.log(unfoundState.options); // {inherit:false} + default options
      -       * })
      -       * 
      - */ - var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params); - - if (evt.defaultPrevented) { - $urlRouter.update(); - return TransitionAborted; - } - - if (!evt.retry) { - return null; - } - - // Allow the handler to return a promise to defer state lookup retry - if (options.$retry) { - $urlRouter.update(); - return TransitionFailed; - } - var retryTransition = $state.transition = $q.when(evt.retry); - - retryTransition.then(function() { - if (retryTransition !== $state.transition) return TransitionSuperseded; - redirect.options.$retry = true; - return $state.transitionTo(redirect.to, redirect.toParams, redirect.options); - }, function() { - return TransitionAborted; - }); - $urlRouter.update(); - - return retryTransition; - } - - root.locals = { resolve: null, globals: { $stateParams: {} } }; - - $state = { - params: {}, - current: root.self, - $current: root, - transition: null - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#reload - * @methodOf ui.router.state.$state - * - * @description - * A method that force reloads the current state. All resolves are re-resolved, - * controllers reinstantiated, and events re-fired. - * - * @example - *
      -     * var app angular.module('app', ['ui.router']);
      -     *
      -     * app.controller('ctrl', function ($scope, $state) {
      -     *   $scope.reload = function(){
      -     *     $state.reload();
      -     *   }
      -     * });
      -     * 
      - * - * `reload()` is just an alias for: - *
      -     * $state.transitionTo($state.current, $stateParams, { 
      -     *   reload: true, inherit: false, notify: true
      -     * });
      -     * 
      - * - * @param {string=|object=} state - A state name or a state object, which is the root of the resolves to be re-resolved. - * @example - *
      -     * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' 
      -     * //and current state is 'contacts.detail.item'
      -     * var app angular.module('app', ['ui.router']);
      -     *
      -     * app.controller('ctrl', function ($scope, $state) {
      -     *   $scope.reload = function(){
      -     *     //will reload 'contact.detail' and 'contact.detail.item' states
      -     *     $state.reload('contact.detail');
      -     *   }
      -     * });
      -     * 
      - * - * `reload()` is just an alias for: - *
      -     * $state.transitionTo($state.current, $stateParams, { 
      -     *   reload: true, inherit: false, notify: true
      -     * });
      -     * 
      - - * @returns {promise} A promise representing the state of the new transition. See - * {@link ui.router.state.$state#methods_go $state.go}. - */ - $state.reload = function reload(state) { - return $state.transitionTo($state.current, $stateParams, { reload: state || true, inherit: false, notify: true}); - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#go - * @methodOf ui.router.state.$state - * - * @description - * Convenience method for transitioning to a new state. `$state.go` calls - * `$state.transitionTo` internally but automatically sets options to - * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. - * This allows you to easily use an absolute or relative to path and specify - * only the parameters you'd like to update (while letting unspecified parameters - * inherit from the currently active ancestor states). - * - * @example - *
      -     * var app = angular.module('app', ['ui.router']);
      -     *
      -     * app.controller('ctrl', function ($scope, $state) {
      -     *   $scope.changeState = function () {
      -     *     $state.go('contact.detail');
      -     *   };
      -     * });
      -     * 
      - * - * - * @param {string} to Absolute state name or relative state path. Some examples: - * - * - `$state.go('contact.detail')` - will go to the `contact.detail` state - * - `$state.go('^')` - will go to a parent state - * - `$state.go('^.sibling')` - will go to a sibling state - * - `$state.go('.child.grandchild')` - will go to grandchild state - * - * @param {object=} params A map of the parameters that will be sent to the state, - * will populate $stateParams. Any parameters that are not specified will be inherited from currently - * defined parameters. Only parameters specified in the state definition can be overridden, new - * parameters will be ignored. This allows, for example, going to a sibling state that shares parameters - * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e. - * transitioning to a sibling will get you the parameters for all parents, transitioning to a child - * will get you all current parameters, etc. - * @param {object=} options Options object. The options are: - * - * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false` - * will not. If string, must be `"replace"`, which will update url and also replace last history record. - * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url. - * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), - * defines which state to be relative from. - * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events. - * - **`reload`** (v0.2.5) - {boolean=false|string|object}, If `true` will force transition even if no state or params - * have changed. It will reload the resolves and views of the current state and parent states. - * If `reload` is a string (or state object), the state object is fetched (by name, or object reference); and \ - * the transition reloads the resolves and views for that matched state, and all its children states. - * - * @returns {promise} A promise representing the state of the new transition. - * - * Possible success values: - * - * - $state.current - * - *
      Possible rejection values: - * - * - 'transition superseded' - when a newer transition has been started after this one - * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener - * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or - * when a `$stateNotFound` `event.retry` promise errors. - * - 'transition failed' - when a state has been unsuccessfully found after 2 tries. - * - *resolve error* - when an error has occurred with a `resolve` - * - */ - $state.go = function go(to, params, options) { - return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options)); - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#transitionTo - * @methodOf ui.router.state.$state - * - * @description - * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go} - * uses `transitionTo` internally. `$state.go` is recommended in most situations. - * - * @example - *
      -     * var app = angular.module('app', ['ui.router']);
      -     *
      -     * app.controller('ctrl', function ($scope, $state) {
      -     *   $scope.changeState = function () {
      -     *     $state.transitionTo('contact.detail');
      -     *   };
      -     * });
      -     * 
      - * - * @param {string} to State name. - * @param {object=} toParams A map of the parameters that will be sent to the state, - * will populate $stateParams. - * @param {object=} options Options object. The options are: - * - * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false` - * will not. If string, must be `"replace"`, which will update url and also replace last history record. - * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url. - * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), - * defines which state to be relative from. - * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events. - * - **`reload`** (v0.2.5) - {boolean=false|string=|object=}, If `true` will force transition even if the state or params - * have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd - * use this when you want to force a reload when *everything* is the same, including search params. - * if String, then will reload the state with the name given in reload, and any children. - * if Object, then a stateObj is expected, will reload the state found in stateObj, and any children. - * - * @returns {promise} A promise representing the state of the new transition. See - * {@link ui.router.state.$state#methods_go $state.go}. - */ - $state.transitionTo = function transitionTo(to, toParams, options) { - toParams = toParams || {}; - options = extend({ - location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false - }, options || {}); - - var from = $state.$current, fromParams = $state.params, fromPath = from.path; - var evt, toState = findState(to, options.relative); - - // Store the hash param for later (since it will be stripped out by various methods) - var hash = toParams['#']; - - if (!isDefined(toState)) { - var redirect = { to: to, toParams: toParams, options: options }; - var redirectResult = handleRedirect(redirect, from.self, fromParams, options); - - if (redirectResult) { - return redirectResult; - } - - // Always retry once if the $stateNotFound was not prevented - // (handles either redirect changed or state lazy-definition) - to = redirect.to; - toParams = redirect.toParams; - options = redirect.options; - toState = findState(to, options.relative); - - if (!isDefined(toState)) { - if (!options.relative) throw new Error("No such state '" + to + "'"); - throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'"); - } - } - if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'"); - if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState); - if (!toState.params.$$validates(toParams)) return TransitionFailed; - - toParams = toState.params.$$values(toParams); - to = toState; - - var toPath = to.path; - - // Starting from the root of the path, keep all levels that haven't changed - var keep = 0, state = toPath[keep], locals = root.locals, toLocals = []; - - if (!options.reload) { - while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) { - locals = toLocals[keep] = state.locals; - keep++; - state = toPath[keep]; - } - } else if (isString(options.reload) || isObject(options.reload)) { - if (isObject(options.reload) && !options.reload.name) { - throw new Error('Invalid reload state object'); - } - - var reloadState = options.reload === true ? fromPath[0] : findState(options.reload); - if (options.reload && !reloadState) { - throw new Error("No such reload state '" + (isString(options.reload) ? options.reload : options.reload.name) + "'"); - } - - while (state && state === fromPath[keep] && state !== reloadState) { - locals = toLocals[keep] = state.locals; - keep++; - state = toPath[keep]; - } - } - - // If we're going to the same state and all locals are kept, we've got nothing to do. - // But clear 'transition', as we still want to cancel any other pending transitions. - // TODO: We may not want to bump 'transition' if we're called from a location change - // that we've initiated ourselves, because we might accidentally abort a legitimate - // transition initiated from code? - if (shouldSkipReload(to, toParams, from, fromParams, locals, options)) { - if (hash) toParams['#'] = hash; - $state.params = toParams; - copy($state.params, $stateParams); - copy(filterByKeys(to.params.$$keys(), $stateParams), to.locals.globals.$stateParams); - if (options.location && to.navigable && to.navigable.url) { - $urlRouter.push(to.navigable.url, toParams, { - $$avoidResync: true, replace: options.location === 'replace' - }); - $urlRouter.update(true); - } - $state.transition = null; - return $q.when($state.current); - } - - // Filter parameters before we pass them to event handlers etc. - toParams = filterByKeys(to.params.$$keys(), toParams || {}); - - // Re-add the saved hash before we start returning things or broadcasting $stateChangeStart - if (hash) toParams['#'] = hash; - - // Broadcast start event and cancel the transition if requested - if (options.notify) { - /** - * @ngdoc event - * @name ui.router.state.$state#$stateChangeStart - * @eventOf ui.router.state.$state - * @eventType broadcast on root scope - * @description - * Fired when the state transition **begins**. You can use `event.preventDefault()` - * to prevent the transition from happening and then the transition promise will be - * rejected with a `'transition prevented'` value. - * - * @param {Object} event Event object. - * @param {State} toState The state being transitioned to. - * @param {Object} toParams The params supplied to the `toState`. - * @param {State} fromState The current state, pre-transition. - * @param {Object} fromParams The params supplied to the `fromState`. - * - * @example - * - *
      -         * $rootScope.$on('$stateChangeStart',
      -         * function(event, toState, toParams, fromState, fromParams){
      -         *     event.preventDefault();
      -         *     // transitionTo() promise will be rejected with
      -         *     // a 'transition prevented' error
      -         * })
      -         * 
      - */ - if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams, options).defaultPrevented) { - $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams); - //Don't update and resync url if there's been a new transition started. see issue #2238, #600 - if ($state.transition == null) $urlRouter.update(); - return TransitionPrevented; - } - } - - // Resolve locals for the remaining states, but don't update any global state just - // yet -- if anything fails to resolve the current state needs to remain untouched. - // We also set up an inheritance chain for the locals here. This allows the view directive - // to quickly look up the correct definition for each view in the current state. Even - // though we create the locals object itself outside resolveState(), it is initially - // empty and gets filled asynchronously. We need to keep track of the promise for the - // (fully resolved) current locals, and pass this down the chain. - var resolved = $q.when(locals); - - for (var l = keep; l < toPath.length; l++, state = toPath[l]) { - locals = toLocals[l] = inherit(locals); - resolved = resolveState(state, toParams, state === to, resolved, locals, options); - } - - // Once everything is resolved, we are ready to perform the actual transition - // and return a promise for the new state. We also keep track of what the - // current promise is, so that we can detect overlapping transitions and - // keep only the outcome of the last transition. - var transition = $state.transition = resolved.then(function () { - var l, entering, exiting; - - if ($state.transition !== transition) return TransitionSuperseded; - - // Exit 'from' states not kept - for (l = fromPath.length - 1; l >= keep; l--) { - exiting = fromPath[l]; - if (exiting.self.onExit) { - $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals); - } - exiting.locals = null; - } - - // Enter 'to' states not kept - for (l = keep; l < toPath.length; l++) { - entering = toPath[l]; - entering.locals = toLocals[l]; - if (entering.self.onEnter) { - $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals); - } - } - - // Run it again, to catch any transitions in callbacks - if ($state.transition !== transition) return TransitionSuperseded; - - // Update globals in $state - $state.$current = to; - $state.current = to.self; - $state.params = toParams; - copy($state.params, $stateParams); - $state.transition = null; - - if (options.location && to.navigable) { - $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, { - $$avoidResync: true, replace: options.location === 'replace' - }); - } - - if (options.notify) { - /** - * @ngdoc event - * @name ui.router.state.$state#$stateChangeSuccess - * @eventOf ui.router.state.$state - * @eventType broadcast on root scope - * @description - * Fired once the state transition is **complete**. - * - * @param {Object} event Event object. - * @param {State} toState The state being transitioned to. - * @param {Object} toParams The params supplied to the `toState`. - * @param {State} fromState The current state, pre-transition. - * @param {Object} fromParams The params supplied to the `fromState`. - */ - $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams); - } - $urlRouter.update(true); - - return $state.current; - }).then(null, function (error) { - if ($state.transition !== transition) return TransitionSuperseded; - - $state.transition = null; - /** - * @ngdoc event - * @name ui.router.state.$state#$stateChangeError - * @eventOf ui.router.state.$state - * @eventType broadcast on root scope - * @description - * Fired when an **error occurs** during transition. It's important to note that if you - * have any errors in your resolve functions (javascript errors, non-existent services, etc) - * they will not throw traditionally. You must listen for this $stateChangeError event to - * catch **ALL** errors. - * - * @param {Object} event Event object. - * @param {State} toState The state being transitioned to. - * @param {Object} toParams The params supplied to the `toState`. - * @param {State} fromState The current state, pre-transition. - * @param {Object} fromParams The params supplied to the `fromState`. - * @param {Error} error The resolve error object. - */ - evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error); - - if (!evt.defaultPrevented) { - $urlRouter.update(); - } - - return $q.reject(error); - }); - - return transition; - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#is - * @methodOf ui.router.state.$state - * - * @description - * Similar to {@link ui.router.state.$state#methods_includes $state.includes}, - * but only checks for the full state name. If params is supplied then it will be - * tested for strict equality against the current active params object, so all params - * must match with none missing and no extras. - * - * @example - *
      -     * $state.$current.name = 'contacts.details.item';
      -     *
      -     * // absolute name
      -     * $state.is('contact.details.item'); // returns true
      -     * $state.is(contactDetailItemStateObject); // returns true
      -     *
      -     * // relative name (. and ^), typically from a template
      -     * // E.g. from the 'contacts.details' template
      -     * 
      Item
      - *
      - * - * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check. - * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like - * to test against the current active state. - * @param {object=} options An options object. The options are: - * - * - **`relative`** - {string|object} - If `stateOrName` is a relative state name and `options.relative` is set, .is will - * test relative to `options.relative` state (or name). - * - * @returns {boolean} Returns true if it is the state. - */ - $state.is = function is(stateOrName, params, options) { - options = extend({ relative: $state.$current }, options || {}); - var state = findState(stateOrName, options.relative); - - if (!isDefined(state)) { return undefined; } - if ($state.$current !== state) { return false; } - return params ? equalForKeys(state.params.$$values(params), $stateParams) : true; - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#includes - * @methodOf ui.router.state.$state - * - * @description - * A method to determine if the current active state is equal to or is the child of the - * state stateName. If any params are passed then they will be tested for a match as well. - * Not all the parameters need to be passed, just the ones you'd like to test for equality. - * - * @example - * Partial and relative names - *
      -     * $state.$current.name = 'contacts.details.item';
      -     *
      -     * // Using partial names
      -     * $state.includes("contacts"); // returns true
      -     * $state.includes("contacts.details"); // returns true
      -     * $state.includes("contacts.details.item"); // returns true
      -     * $state.includes("contacts.list"); // returns false
      -     * $state.includes("about"); // returns false
      -     *
      -     * // Using relative names (. and ^), typically from a template
      -     * // E.g. from the 'contacts.details' template
      -     * 
      Item
      - *
      - * - * Basic globbing patterns - *
      -     * $state.$current.name = 'contacts.details.item.url';
      -     *
      -     * $state.includes("*.details.*.*"); // returns true
      -     * $state.includes("*.details.**"); // returns true
      -     * $state.includes("**.item.**"); // returns true
      -     * $state.includes("*.details.item.url"); // returns true
      -     * $state.includes("*.details.*.url"); // returns true
      -     * $state.includes("*.details.*"); // returns false
      -     * $state.includes("item.**"); // returns false
      -     * 
      - * - * @param {string} stateOrName A partial name, relative name, or glob pattern - * to be searched for within the current state name. - * @param {object=} params A param object, e.g. `{sectionId: section.id}`, - * that you'd like to test against the current active state. - * @param {object=} options An options object. The options are: - * - * - **`relative`** - {string|object=} - If `stateOrName` is a relative state reference and `options.relative` is set, - * .includes will test relative to `options.relative` state (or name). - * - * @returns {boolean} Returns true if it does include the state - */ - $state.includes = function includes(stateOrName, params, options) { - options = extend({ relative: $state.$current }, options || {}); - if (isString(stateOrName) && isGlob(stateOrName)) { - if (!doesStateMatchGlob(stateOrName)) { - return false; - } - stateOrName = $state.$current.name; - } - - var state = findState(stateOrName, options.relative); - if (!isDefined(state)) { return undefined; } - if (!isDefined($state.$current.includes[state.name])) { return false; } - return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true; - }; - - - /** - * @ngdoc function - * @name ui.router.state.$state#href - * @methodOf ui.router.state.$state - * - * @description - * A url generation method that returns the compiled url for the given state populated with the given params. - * - * @example - *
      -     * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
      -     * 
      - * - * @param {string|object} stateOrName The state name or state object you'd like to generate a url from. - * @param {object=} params An object of parameter values to fill the state's required parameters. - * @param {object=} options Options object. The options are: - * - * - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the - * first parameter, then the constructed href url will be built from the first navigable ancestor (aka - * ancestor with a valid url). - * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url. - * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), - * defines which state to be relative from. - * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". - * - * @returns {string} compiled state url - */ - $state.href = function href(stateOrName, params, options) { - options = extend({ - lossy: true, - inherit: true, - absolute: false, - relative: $state.$current - }, options || {}); - - var state = findState(stateOrName, options.relative); - - if (!isDefined(state)) return null; - if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state); - - var nav = (state && options.lossy) ? state.navigable : state; - - if (!nav || nav.url === undefined || nav.url === null) { - return null; - } - return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys().concat('#'), params || {}), { - absolute: options.absolute - }); - }; - - /** - * @ngdoc function - * @name ui.router.state.$state#get - * @methodOf ui.router.state.$state - * - * @description - * Returns the state configuration object for any specific state or all states. - * - * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for - * the requested state. If not provided, returns an array of ALL state configs. - * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context. - * @returns {Object|Array} State configuration object or array of all objects. - */ - $state.get = function (stateOrName, context) { - if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; }); - var state = findState(stateOrName, context || $state.$current); - return (state && state.self) ? state.self : null; - }; - - function resolveState(state, params, paramsAreFiltered, inherited, dst, options) { - // Make a restricted $stateParams with only the parameters that apply to this state if - // necessary. In addition to being available to the controller and onEnter/onExit callbacks, - // we also need $stateParams to be available for any $injector calls we make during the - // dependency resolution process. - var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params); - var locals = { $stateParams: $stateParams }; - - // Resolve 'global' dependencies for the state, i.e. those not specific to a view. - // We're also including $stateParams in this; that way the parameters are restricted - // to the set that should be visible to the state, and are independent of when we update - // the global $state and $stateParams values. - dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state); - var promises = [dst.resolve.then(function (globals) { - dst.globals = globals; - })]; - if (inherited) promises.push(inherited); - - function resolveViews() { - var viewsPromises = []; - - // Resolve template and dependencies for all views. - forEach(state.views, function (view, name) { - var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {}); - injectables.$template = [ function () { - return $view.load(name, { view: view, locals: dst.globals, params: $stateParams, notify: options.notify }) || ''; - }]; - - viewsPromises.push($resolve.resolve(injectables, dst.globals, dst.resolve, state).then(function (result) { - // References to the controller (only instantiated at link time) - if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) { - var injectLocals = angular.extend({}, injectables, dst.globals); - result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals); - } else { - result.$$controller = view.controller; - } - // Provide access to the state itself for internal use - result.$$state = state; - result.$$controllerAs = view.controllerAs; - result.$$resolveAs = view.resolveAs; - dst[name] = result; - })); - }); - - return $q.all(viewsPromises).then(function(){ - return dst.globals; - }); - } - - // Wait for all the promises and then return the activation object - return $q.all(promises).then(resolveViews).then(function (values) { - return dst; - }); - } - - return $state; - } - - function shouldSkipReload(to, toParams, from, fromParams, locals, options) { - // Return true if there are no differences in non-search (path/object) params, false if there are differences - function nonSearchParamsEqual(fromAndToState, fromParams, toParams) { - // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params. - function notSearchParam(key) { - return fromAndToState.params[key].location != "search"; - } - var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam); - var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys)); - var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams); - return nonQueryParamSet.$$equals(fromParams, toParams); - } - - // If reload was not explicitly requested - // and we're transitioning to the same state we're already in - // and the locals didn't change - // or they changed in a way that doesn't merit reloading - // (reloadOnParams:false, or reloadOnSearch.false and only search params changed) - // Then return true. - if (!options.reload && to === from && - (locals === from.locals || (to.self.reloadOnSearch === false && nonSearchParamsEqual(from, fromParams, toParams)))) { - return true; - } - } -} - -angular.module('ui.router.state') - .factory('$stateParams', function () { return {}; }) - .constant("$state.runtime", { autoinject: true }) - .provider('$state', $StateProvider) - // Inject $state to initialize when entering runtime. #2574 - .run(['$injector', function ($injector) { - // Allow tests (stateSpec.js) to turn this off by defining this constant - if ($injector.get("$state.runtime").autoinject) { - $injector.get('$state'); - } - }]); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/stateDirectives.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/stateDirectives.js deleted file mode 100644 index e97da32b47..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/stateDirectives.js +++ /dev/null @@ -1,412 +0,0 @@ -function parseStateRef(ref, current) { - var preparsed = ref.match(/^\s*({[^}]*})\s*$/), parsed; - if (preparsed) ref = current + '(' + preparsed[1] + ')'; - parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/); - if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'"); - return { state: parsed[1], paramExpr: parsed[3] || null }; -} - -function stateContext(el) { - var stateData = el.parent().inheritedData('$uiView'); - - if (stateData && stateData.state && stateData.state.name) { - return stateData.state; - } -} - -function getTypeInfo(el) { - // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. - var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]'; - var isForm = el[0].nodeName === "FORM"; - - return { - attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'), - isAnchor: el.prop("tagName").toUpperCase() === "A", - clickable: !isForm - }; -} - -function clickHook(el, $state, $timeout, type, current) { - return function(e) { - var button = e.which || e.button, target = current(); - - if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) { - // HACK: This is to allow ng-clicks to be processed before the transition is initiated: - var transition = $timeout(function() { - $state.go(target.state, target.params, target.options); - }); - e.preventDefault(); - - // if the state has no URL, ignore one preventDefault from the directive. - var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1: 0; - - e.preventDefault = function() { - if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition); - }; - } - }; -} - -function defaultOpts(el, $state) { - return { relative: stateContext(el) || $state.$current, inherit: true }; -} - -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-sref - * - * @requires ui.router.state.$state - * @requires $timeout - * - * @restrict A - * - * @description - * A directive that binds a link (`` tag) to a state. If the state has an associated - * URL, the directive will automatically generate & update the `href` attribute via - * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking - * the link will trigger a state transition with optional parameters. - * - * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be - * handled natively by the browser. - * - * You can also use relative state paths within ui-sref, just like the relative - * paths passed to `$state.go()`. You just need to be aware that the path is relative - * to the state that the link lives in, in other words the state that loaded the - * template containing the link. - * - * You can specify options to pass to {@link ui.router.state.$state#methods_go $state.go()} - * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`, - * and `reload`. - * - * @example - * Here's an example of how you'd use ui-sref and how it would compile. If you have the - * following template: - *
      - * Home | About | Next page
      - *
      - * 
      - * 
      - * - * Then the compiled html would be (assuming Html5Mode is off and current state is contacts): - *
      - * Home | About | Next page
      - *
      - * 
        - *
      • - * Joe - *
      • - *
      • - * Alice - *
      • - *
      • - * Bob - *
      • - *
      - * - * Home - *
      - * - * @param {string} ui-sref 'stateName' can be any valid absolute or relative state - * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#methods_go $state.go()} - */ -$StateRefDirective.$inject = ['$state', '$timeout']; -function $StateRefDirective($state, $timeout) { - return { - restrict: 'A', - require: ['?^uiSrefActive', '?^uiSrefActiveEq'], - link: function(scope, element, attrs, uiSrefActive) { - var ref = parseStateRef(attrs.uiSref, $state.current.name); - var def = { state: ref.state, href: null, params: null }; - var type = getTypeInfo(element); - var active = uiSrefActive[1] || uiSrefActive[0]; - var unlinkInfoFn = null; - var hookFn; - - def.options = extend(defaultOpts(element, $state), attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {}); - - var update = function(val) { - if (val) def.params = angular.copy(val); - def.href = $state.href(ref.state, def.params, def.options); - - if (unlinkInfoFn) unlinkInfoFn(); - if (active) unlinkInfoFn = active.$$addStateInfo(ref.state, def.params); - if (def.href !== null) attrs.$set(type.attr, def.href); - }; - - if (ref.paramExpr) { - scope.$watch(ref.paramExpr, function(val) { if (val !== def.params) update(val); }, true); - def.params = angular.copy(scope.$eval(ref.paramExpr)); - } - update(); - - if (!type.clickable) return; - hookFn = clickHook(element, $state, $timeout, type, function() { return def; }); - element.bind("click", hookFn); - scope.$on('$destroy', function() { - element.unbind("click", hookFn); - }); - } - }; -} - -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-state - * - * @requires ui.router.state.uiSref - * - * @restrict A - * - * @description - * Much like ui-sref, but will accept named $scope properties to evaluate for a state definition, - * params and override options. - * - * @param {string} ui-state 'stateName' can be any valid absolute or relative state - * @param {Object} ui-state-params params to pass to {@link ui.router.state.$state#methods_href $state.href()} - * @param {Object} ui-state-opts options to pass to {@link ui.router.state.$state#methods_go $state.go()} - */ -$StateRefDynamicDirective.$inject = ['$state', '$timeout']; -function $StateRefDynamicDirective($state, $timeout) { - return { - restrict: 'A', - require: ['?^uiSrefActive', '?^uiSrefActiveEq'], - link: function(scope, element, attrs, uiSrefActive) { - var type = getTypeInfo(element); - var active = uiSrefActive[1] || uiSrefActive[0]; - var group = [attrs.uiState, attrs.uiStateParams || null, attrs.uiStateOpts || null]; - var watch = '[' + group.map(function(val) { return val || 'null'; }).join(', ') + ']'; - var def = { state: null, params: null, options: null, href: null }; - var unlinkInfoFn = null; - var hookFn; - - function runStateRefLink (group) { - def.state = group[0]; def.params = group[1]; def.options = group[2]; - def.href = $state.href(def.state, def.params, def.options); - - if (unlinkInfoFn) unlinkInfoFn(); - if (active) unlinkInfoFn = active.$$addStateInfo(def.state, def.params); - if (def.href) attrs.$set(type.attr, def.href); - } - - scope.$watch(watch, runStateRefLink, true); - runStateRefLink(scope.$eval(watch)); - - if (!type.clickable) return; - hookFn = clickHook(element, $state, $timeout, type, function() { return def; }); - element.bind("click", hookFn); - scope.$on('$destroy', function() { - element.unbind("click", hookFn); - }); - } - }; -} - - -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-sref-active - * - * @requires ui.router.state.$state - * @requires ui.router.state.$stateParams - * @requires $interpolate - * - * @restrict A - * - * @description - * A directive working alongside ui-sref to add classes to an element when the - * related ui-sref directive's state is active, and removing them when it is inactive. - * The primary use-case is to simplify the special appearance of navigation menus - * relying on `ui-sref`, by having the "active" state's menu button appear different, - * distinguishing it from the inactive menu items. - * - * ui-sref-active can live on the same element as ui-sref or on a parent element. The first - * ui-sref-active found at the same level or above the ui-sref will be used. - * - * Will activate when the ui-sref's target state or any child state is active. If you - * need to activate only when the ui-sref target state is active and *not* any of - * it's children, then you will use - * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq} - * - * @example - * Given the following template: - *
      - * 
      - * 
      - * - * - * When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins", - * the resulting HTML will appear as (note the 'active' class): - *
      - * 
      - * 
      - * - * The class name is interpolated **once** during the directives link time (any further changes to the - * interpolated value are ignored). - * - * Multiple classes may be specified in a space-separated format: - *
      - * 
        - *
      • - * link - *
      • - *
      - *
      - * - * It is also possible to pass ui-sref-active an expression that evaluates - * to an object hash, whose keys represent active class names and whose - * values represent the respective state names/globs. - * ui-sref-active will match if the current active state **includes** any of - * the specified state names/globs, even the abstract ones. - * - * @Example - * Given the following template, with "admin" being an abstract state: - *
      - * 
      - * Roles - *
      - *
      - * - * When the current state is "admin.roles" the "active" class will be applied - * to both the
      and elements. It is important to note that the state - * names/globs passed to ui-sref-active shadow the state provided by ui-sref. - */ - -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-sref-active-eq - * - * @requires ui.router.state.$state - * @requires ui.router.state.$stateParams - * @requires $interpolate - * - * @restrict A - * - * @description - * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate - * when the exact target state used in the `ui-sref` is active; no child states. - * - */ -$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate']; -function $StateRefActiveDirective($state, $stateParams, $interpolate) { - return { - restrict: "A", - controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) { - var states = [], activeClasses = {}, activeEqClass, uiSrefActive; - - // There probably isn't much point in $observing this - // uiSrefActive and uiSrefActiveEq share the same directive object with some - // slight difference in logic routing - activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope); - - try { - uiSrefActive = $scope.$eval($attrs.uiSrefActive); - } catch (e) { - // Do nothing. uiSrefActive is not a valid expression. - // Fall back to using $interpolate below - } - uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope); - if (isObject(uiSrefActive)) { - forEach(uiSrefActive, function(stateOrName, activeClass) { - if (isString(stateOrName)) { - var ref = parseStateRef(stateOrName, $state.current.name); - addState(ref.state, $scope.$eval(ref.paramExpr), activeClass); - } - }); - } - - // Allow uiSref to communicate with uiSrefActive[Equals] - this.$$addStateInfo = function (newState, newParams) { - // we already got an explicit state provided by ui-sref-active, so we - // shadow the one that comes from ui-sref - if (isObject(uiSrefActive) && states.length > 0) { - return; - } - var deregister = addState(newState, newParams, uiSrefActive); - update(); - return deregister; - }; - - $scope.$on('$stateChangeSuccess', update); - - function addState(stateName, stateParams, activeClass) { - var state = $state.get(stateName, stateContext($element)); - var stateHash = createStateHash(stateName, stateParams); - - var stateInfo = { - state: state || { name: stateName }, - params: stateParams, - hash: stateHash - }; - - states.push(stateInfo); - activeClasses[stateHash] = activeClass; - - return function removeState() { - var idx = states.indexOf(stateInfo); - if (idx !== -1) states.splice(idx, 1); - }; - } - - /** - * @param {string} state - * @param {Object|string} [params] - * @return {string} - */ - function createStateHash(state, params) { - if (!isString(state)) { - throw new Error('state should be a string'); - } - if (isObject(params)) { - return state + toJson(params); - } - params = $scope.$eval(params); - if (isObject(params)) { - return state + toJson(params); - } - return state; - } - - // Update route state - function update() { - for (var i = 0; i < states.length; i++) { - if (anyMatch(states[i].state, states[i].params)) { - addClass($element, activeClasses[states[i].hash]); - } else { - removeClass($element, activeClasses[states[i].hash]); - } - - if (exactMatch(states[i].state, states[i].params)) { - addClass($element, activeEqClass); - } else { - removeClass($element, activeEqClass); - } - } - } - - function addClass(el, className) { $timeout(function () { el.addClass(className); }); } - function removeClass(el, className) { el.removeClass(className); } - function anyMatch(state, params) { return $state.includes(state.name, params); } - function exactMatch(state, params) { return $state.is(state.name, params); } - - update(); - }] - }; -} - -angular.module('ui.router.state') - .directive('uiSref', $StateRefDirective) - .directive('uiSrefActive', $StateRefActiveDirective) - .directive('uiSrefActiveEq', $StateRefActiveDirective) - .directive('uiState', $StateRefDynamicDirective); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/stateFilters.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/stateFilters.js deleted file mode 100644 index 4ef014a912..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/stateFilters.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @ngdoc filter - * @name ui.router.state.filter:isState - * - * @requires ui.router.state.$state - * - * @description - * Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}. - */ -$IsStateFilter.$inject = ['$state']; -function $IsStateFilter($state) { - var isFilter = function (state, params) { - return $state.is(state, params); - }; - isFilter.$stateful = true; - return isFilter; -} - -/** - * @ngdoc filter - * @name ui.router.state.filter:includedByState - * - * @requires ui.router.state.$state - * - * @description - * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}. - */ -$IncludedByStateFilter.$inject = ['$state']; -function $IncludedByStateFilter($state) { - var includesFilter = function (state, params, options) { - return $state.includes(state, params, options); - }; - includesFilter.$stateful = true; - return includesFilter; -} - -angular.module('ui.router.state') - .filter('isState', $IsStateFilter) - .filter('includedByState', $IncludedByStateFilter); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/templateFactory.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/templateFactory.js deleted file mode 100644 index ca491a987c..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/templateFactory.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @ngdoc object - * @name ui.router.util.$templateFactory - * - * @requires $http - * @requires $templateCache - * @requires $injector - * - * @description - * Service. Manages loading of templates. - */ -$TemplateFactory.$inject = ['$http', '$templateCache', '$injector']; -function $TemplateFactory( $http, $templateCache, $injector) { - - /** - * @ngdoc function - * @name ui.router.util.$templateFactory#fromConfig - * @methodOf ui.router.util.$templateFactory - * - * @description - * Creates a template from a configuration object. - * - * @param {object} config Configuration object for which to load a template. - * The following properties are search in the specified order, and the first one - * that is defined is used to create the template: - * - * @param {string|object} config.template html string template or function to - * load via {@link ui.router.util.$templateFactory#fromString fromString}. - * @param {string|object} config.templateUrl url to load or a function returning - * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}. - * @param {Function} config.templateProvider function to invoke via - * {@link ui.router.util.$templateFactory#fromProvider fromProvider}. - * @param {object} params Parameters to pass to the template function. - * @param {object} locals Locals to pass to `invoke` if the template is loaded - * via a `templateProvider`. Defaults to `{ params: params }`. - * - * @return {string|object} The template html as a string, or a promise for - * that string,or `null` if no template is configured. - */ - this.fromConfig = function (config, params, locals) { - return ( - isDefined(config.template) ? this.fromString(config.template, params) : - isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) : - isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) : - null - ); - }; - - /** - * @ngdoc function - * @name ui.router.util.$templateFactory#fromString - * @methodOf ui.router.util.$templateFactory - * - * @description - * Creates a template from a string or a function returning a string. - * - * @param {string|object} template html template as a string or function that - * returns an html template as a string. - * @param {object} params Parameters to pass to the template function. - * - * @return {string|object} The template html as a string, or a promise for that - * string. - */ - this.fromString = function (template, params) { - return isFunction(template) ? template(params) : template; - }; - - /** - * @ngdoc function - * @name ui.router.util.$templateFactory#fromUrl - * @methodOf ui.router.util.$templateFactory - * - * @description - * Loads a template from the a URL via `$http` and `$templateCache`. - * - * @param {string|Function} url url of the template to load, or a function - * that returns a url. - * @param {Object} params Parameters to pass to the url function. - * @return {string|Promise.} The template html as a string, or a promise - * for that string. - */ - this.fromUrl = function (url, params) { - if (isFunction(url)) url = url(params); - if (url == null) return null; - else return $http - .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }}) - .then(function(response) { return response.data; }); - }; - - /** - * @ngdoc function - * @name ui.router.util.$templateFactory#fromProvider - * @methodOf ui.router.util.$templateFactory - * - * @description - * Creates a template by invoking an injectable provider function. - * - * @param {Function} provider Function to invoke via `$injector.invoke` - * @param {Object} params Parameters for the template. - * @param {Object} locals Locals to pass to `invoke`. Defaults to - * `{ params: params }`. - * @return {string|Promise.} The template html as a string, or a promise - * for that string. - */ - this.fromProvider = function (provider, params, locals) { - return $injector.invoke(provider, null, locals || { params: params }); - }; -} - -angular.module('ui.router.util').service('$templateFactory', $TemplateFactory); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/urlMatcherFactory.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/urlMatcherFactory.js deleted file mode 100644 index bc4e1eb4e7..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/urlMatcherFactory.js +++ /dev/null @@ -1,1081 +0,0 @@ -var $$UMFP; // reference to $UrlMatcherFactoryProvider - -/** - * @ngdoc object - * @name ui.router.util.type:UrlMatcher - * - * @description - * Matches URLs against patterns and extracts named parameters from the path or the search - * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list - * of search parameters. Multiple search parameter names are separated by '&'. Search parameters - * do not influence whether or not a URL is matched, but their values are passed through into - * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}. - * - * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace - * syntax, which optionally allows a regular expression for the parameter to be specified: - * - * * `':'` name - colon placeholder - * * `'*'` name - catch-all placeholder - * * `'{' name '}'` - curly placeholder - * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the - * regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash. - * - * Parameter names may contain only word characters (latin letters, digits, and underscore) and - * must be unique within the pattern (across both path and search parameters). For colon - * placeholders or curly placeholders without an explicit regexp, a path parameter matches any - * number of characters other than '/'. For catch-all placeholders the path parameter matches - * any number of characters. - * - * Examples: - * - * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for - * trailing slashes, and patterns have to match the entire path, not just a prefix. - * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or - * '/user/bob/details'. The second path segment will be captured as the parameter 'id'. - * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax. - * * `'/user/{id:[^/]*}'` - Same as the previous example. - * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id - * parameter consists of 1 to 8 hex digits. - * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the - * path into the parameter 'path'. - * * `'/files/*path'` - ditto. - * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined - * in the built-in `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start - * - * @param {string} pattern The pattern to compile into a matcher. - * @param {Object} config A configuration object hash: - * @param {Object=} parentMatcher Used to concatenate the pattern/config onto - * an existing UrlMatcher - * - * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`. - * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`. - * - * @property {string} prefix A static prefix of this pattern. The matcher guarantees that any - * URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns - * non-null) will start with this prefix. - * - * @property {string} source The pattern that was passed into the constructor - * - * @property {string} sourcePath The path portion of the source property - * - * @property {string} sourceSearch The search portion of the source property - * - * @property {string} regex The constructed regex that will be used to match against the url when - * it is time to determine which url will match. - * - * @returns {Object} New `UrlMatcher` object - */ -function UrlMatcher(pattern, config, parentMatcher) { - config = extend({ params: {} }, isObject(config) ? config : {}); - - // Find all placeholders and create a compiled pattern, using either classic or curly syntax: - // '*' name - // ':' name - // '{' name '}' - // '{' name ':' regexp '}' - // The regular expression is somewhat complicated due to the need to allow curly braces - // inside the regular expression. The placeholder regexp breaks down as follows: - // ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case) - // \{([\w\[\]]+)(?:\:\s*( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case - // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either - // [^{}\\]+ - anything other than curly braces or backslash - // \\. - a backslash escape - // \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms - var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, - searchPlaceholder = /([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, - compiled = '^', last = 0, m, - segments = this.segments = [], - parentParams = parentMatcher ? parentMatcher.params : {}, - params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(), - paramNames = []; - - function addParameter(id, type, config, location) { - paramNames.push(id); - if (parentParams[id]) return parentParams[id]; - if (!/^\w+([-.]+\w+)*(?:\[\])?$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'"); - if (params[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'"); - params[id] = new $$UMFP.Param(id, type, config, location); - return params[id]; - } - - function quoteRegExp(string, pattern, squash, optional) { - var surroundPattern = ['',''], result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&"); - if (!pattern) return result; - switch(squash) { - case false: surroundPattern = ['(', ')' + (optional ? "?" : "")]; break; - case true: - result = result.replace(/\/$/, ''); - surroundPattern = ['(?:\/(', ')|\/)?']; - break; - default: surroundPattern = ['(' + squash + "|", ')?']; break; - } - return result + surroundPattern[0] + pattern + surroundPattern[1]; - } - - this.source = pattern; - - // Split into static segments separated by path parameter placeholders. - // The number of segments is always 1 more than the number of parameters. - function matchDetails(m, isSearch) { - var id, regexp, segment, type, cfg, arrayMode; - id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null - cfg = config.params[id]; - segment = pattern.substring(last, m.index); - regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null); - - if (regexp) { - type = $$UMFP.type(regexp) || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) }); - } - - return { - id: id, regexp: regexp, segment: segment, type: type, cfg: cfg - }; - } - - var p, param, segment; - while ((m = placeholder.exec(pattern))) { - p = matchDetails(m, false); - if (p.segment.indexOf('?') >= 0) break; // we're into the search part - - param = addParameter(p.id, p.type, p.cfg, "path"); - compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash, param.isOptional); - segments.push(p.segment); - last = placeholder.lastIndex; - } - segment = pattern.substring(last); - - // Find any search parameter names and remove them from the last segment - var i = segment.indexOf('?'); - - if (i >= 0) { - var search = this.sourceSearch = segment.substring(i); - segment = segment.substring(0, i); - this.sourcePath = pattern.substring(0, last + i); - - if (search.length > 0) { - last = 0; - while ((m = searchPlaceholder.exec(search))) { - p = matchDetails(m, true); - param = addParameter(p.id, p.type, p.cfg, "search"); - last = placeholder.lastIndex; - // check if ?& - } - } - } else { - this.sourcePath = pattern; - this.sourceSearch = ''; - } - - compiled += quoteRegExp(segment) + (config.strict === false ? '\/?' : '') + '$'; - segments.push(segment); - - this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined); - this.prefix = segments[0]; - this.$$paramNames = paramNames; -} - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#concat - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Returns a new matcher for a pattern constructed by appending the path part and adding the - * search parameters of the specified pattern to this pattern. The current pattern is not - * modified. This can be understood as creating a pattern for URLs that are relative to (or - * suffixes of) the current pattern. - * - * @example - * The following two matchers are equivalent: - *
      - * new UrlMatcher('/user/{id}?q').concat('/details?date');
      - * new UrlMatcher('/user/{id}/details?q&date');
      - * 
      - * - * @param {string} pattern The pattern to append. - * @param {Object} config An object hash of the configuration for the matcher. - * @returns {UrlMatcher} A matcher for the concatenated pattern. - */ -UrlMatcher.prototype.concat = function (pattern, config) { - // Because order of search parameters is irrelevant, we can add our own search - // parameters to the end of the new pattern. Parse the new pattern by itself - // and then join the bits together, but it's much easier to do this on a string level. - var defaultConfig = { - caseInsensitive: $$UMFP.caseInsensitive(), - strict: $$UMFP.strictMode(), - squash: $$UMFP.defaultSquashPolicy() - }; - return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this); -}; - -UrlMatcher.prototype.toString = function () { - return this.source; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#exec - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Tests the specified path against this matcher, and returns an object containing the captured - * parameter values, or null if the path does not match. The returned object contains the values - * of any search parameters that are mentioned in the pattern, but their value may be null if - * they are not present in `searchParams`. This means that search parameters are always treated - * as optional. - * - * @example - *
      - * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
      - *   x: '1', q: 'hello'
      - * });
      - * // returns { id: 'bob', q: 'hello', r: null }
      - * 
      - * - * @param {string} path The URL path to match, e.g. `$location.path()`. - * @param {Object} searchParams URL search parameters, e.g. `$location.search()`. - * @returns {Object} The captured parameter values. - */ -UrlMatcher.prototype.exec = function (path, searchParams) { - var m = this.regexp.exec(path); - if (!m) return null; - searchParams = searchParams || {}; - - var paramNames = this.parameters(), nTotal = paramNames.length, - nPath = this.segments.length - 1, - values = {}, i, j, cfg, paramName; - - if (nPath !== m.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'"); - - function decodePathArray(string) { - function reverseString(str) { return str.split("").reverse().join(""); } - function unquoteDashes(str) { return str.replace(/\\-/g, "-"); } - - var split = reverseString(string).split(/-(?!\\)/); - var allReversed = map(split, reverseString); - return map(allReversed, unquoteDashes).reverse(); - } - - var param, paramVal; - for (i = 0; i < nPath; i++) { - paramName = paramNames[i]; - param = this.params[paramName]; - paramVal = m[i+1]; - // if the param value matches a pre-replace pair, replace the value before decoding. - for (j = 0; j < param.replace.length; j++) { - if (param.replace[j].from === paramVal) paramVal = param.replace[j].to; - } - if (paramVal && param.array === true) paramVal = decodePathArray(paramVal); - if (isDefined(paramVal)) paramVal = param.type.decode(paramVal); - values[paramName] = param.value(paramVal); - } - for (/**/; i < nTotal; i++) { - paramName = paramNames[i]; - values[paramName] = this.params[paramName].value(searchParams[paramName]); - param = this.params[paramName]; - paramVal = searchParams[paramName]; - for (j = 0; j < param.replace.length; j++) { - if (param.replace[j].from === paramVal) paramVal = param.replace[j].to; - } - if (isDefined(paramVal)) paramVal = param.type.decode(paramVal); - values[paramName] = param.value(paramVal); - } - - return values; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#parameters - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Returns the names of all path and search parameters of this pattern in an unspecified order. - * - * @returns {Array.} An array of parameter names. Must be treated as read-only. If the - * pattern has no parameters, an empty array is returned. - */ -UrlMatcher.prototype.parameters = function (param) { - if (!isDefined(param)) return this.$$paramNames; - return this.params[param] || null; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#validates - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Checks an object hash of parameters to validate their correctness according to the parameter - * types of this `UrlMatcher`. - * - * @param {Object} params The object hash of parameters to validate. - * @returns {boolean} Returns `true` if `params` validates, otherwise `false`. - */ -UrlMatcher.prototype.validates = function (params) { - return this.params.$$validates(params); -}; - -/** - * @ngdoc function - * @name ui.router.util.type:UrlMatcher#format - * @methodOf ui.router.util.type:UrlMatcher - * - * @description - * Creates a URL that matches this pattern by substituting the specified values - * for the path and search parameters. Null values for path parameters are - * treated as empty strings. - * - * @example - *
      - * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
      - * // returns '/user/bob?q=yes'
      - * 
      - * - * @param {Object} values the values to substitute for the parameters in this pattern. - * @returns {string} the formatted URL (path and optionally search part). - */ -UrlMatcher.prototype.format = function (values) { - values = values || {}; - var segments = this.segments, params = this.parameters(), paramset = this.params; - if (!this.validates(values)) return null; - - var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0]; - - function encodeDashes(str) { // Replace dashes with encoded "\-" - return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); }); - } - - for (i = 0; i < nTotal; i++) { - var isPathParam = i < nPath; - var name = params[i], param = paramset[name], value = param.value(values[name]); - var isDefaultValue = param.isOptional && param.type.equals(param.value(), value); - var squash = isDefaultValue ? param.squash : false; - var encoded = param.type.encode(value); - - if (isPathParam) { - var nextSegment = segments[i + 1]; - var isFinalPathParam = i + 1 === nPath; - - if (squash === false) { - if (encoded != null) { - if (isArray(encoded)) { - result += map(encoded, encodeDashes).join("-"); - } else { - result += encodeURIComponent(encoded); - } - } - result += nextSegment; - } else if (squash === true) { - var capture = result.match(/\/$/) ? /\/?(.*)/ : /(.*)/; - result += nextSegment.match(capture)[1]; - } else if (isString(squash)) { - result += squash + nextSegment; - } - - if (isFinalPathParam && param.squash === true && result.slice(-1) === '/') result = result.slice(0, -1); - } else { - if (encoded == null || (isDefaultValue && squash !== false)) continue; - if (!isArray(encoded)) encoded = [ encoded ]; - if (encoded.length === 0) continue; - encoded = map(encoded, encodeURIComponent).join('&' + name + '='); - result += (search ? '&' : '?') + (name + '=' + encoded); - search = true; - } - } - - return result; -}; - -/** - * @ngdoc object - * @name ui.router.util.type:Type - * - * @description - * Implements an interface to define custom parameter types that can be decoded from and encoded to - * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`} - * objects when matching or formatting URLs, or comparing or validating parameter values. - * - * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more - * information on registering custom types. - * - * @param {Object} config A configuration object which contains the custom type definition. The object's - * properties will override the default methods and/or pattern in `Type`'s public interface. - * @example - *
      - * {
      - *   decode: function(val) { return parseInt(val, 10); },
      - *   encode: function(val) { return val && val.toString(); },
      - *   equals: function(a, b) { return this.is(a) && a === b; },
      - *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },
      - *   pattern: /\d+/
      - * }
      - * 
      - * - * @property {RegExp} pattern The regular expression pattern used to match values of this type when - * coming from a substring of a URL. - * - * @returns {Object} Returns a new `Type` object. - */ -function Type(config) { - extend(this, config); -} - -/** - * @ngdoc function - * @name ui.router.util.type:Type#is - * @methodOf ui.router.util.type:Type - * - * @description - * Detects whether a value is of a particular type. Accepts a native (decoded) value - * and determines whether it matches the current `Type` object. - * - * @param {*} val The value to check. - * @param {string} key Optional. If the type check is happening in the context of a specific - * {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the - * parameter in which `val` is stored. Can be used for meta-programming of `Type` objects. - * @returns {Boolean} Returns `true` if the value matches the type, otherwise `false`. - */ -Type.prototype.is = function(val, key) { - return true; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:Type#encode - * @methodOf ui.router.util.type:Type - * - * @description - * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the - * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it - * only needs to be a representation of `val` that has been coerced to a string. - * - * @param {*} val The value to encode. - * @param {string} key The name of the parameter in which `val` is stored. Can be used for - * meta-programming of `Type` objects. - * @returns {string} Returns a string representation of `val` that can be encoded in a URL. - */ -Type.prototype.encode = function(val, key) { - return val; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:Type#decode - * @methodOf ui.router.util.type:Type - * - * @description - * Converts a parameter value (from URL string or transition param) to a custom/native value. - * - * @param {string} val The URL parameter value to decode. - * @param {string} key The name of the parameter in which `val` is stored. Can be used for - * meta-programming of `Type` objects. - * @returns {*} Returns a custom representation of the URL parameter value. - */ -Type.prototype.decode = function(val, key) { - return val; -}; - -/** - * @ngdoc function - * @name ui.router.util.type:Type#equals - * @methodOf ui.router.util.type:Type - * - * @description - * Determines whether two decoded values are equivalent. - * - * @param {*} a A value to compare against. - * @param {*} b A value to compare against. - * @returns {Boolean} Returns `true` if the values are equivalent/equal, otherwise `false`. - */ -Type.prototype.equals = function(a, b) { - return a == b; -}; - -Type.prototype.$subPattern = function() { - var sub = this.pattern.toString(); - return sub.substr(1, sub.length - 2); -}; - -Type.prototype.pattern = /.*/; - -Type.prototype.toString = function() { return "{Type:" + this.name + "}"; }; - -/** Given an encoded string, or a decoded object, returns a decoded object */ -Type.prototype.$normalize = function(val) { - return this.is(val) ? val : this.decode(val); -}; - -/* - * Wraps an existing custom Type as an array of Type, depending on 'mode'. - * e.g.: - * - urlmatcher pattern "/path?{queryParam[]:int}" - * - url: "/path?queryParam=1&queryParam=2 - * - $stateParams.queryParam will be [1, 2] - * if `mode` is "auto", then - * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1 - * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2] - */ -Type.prototype.$asArray = function(mode, isSearch) { - if (!mode) return this; - if (mode === "auto" && !isSearch) throw new Error("'auto' array mode is for query parameters only"); - - function ArrayType(type, mode) { - function bindTo(type, callbackName) { - return function() { - return type[callbackName].apply(type, arguments); - }; - } - - // Wrap non-array value as array - function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); } - // Unwrap array value for "auto" mode. Return undefined for empty array. - function arrayUnwrap(val) { - switch(val.length) { - case 0: return undefined; - case 1: return mode === "auto" ? val[0] : val; - default: return val; - } - } - function falsey(val) { return !val; } - - // Wraps type (.is/.encode/.decode) functions to operate on each value of an array - function arrayHandler(callback, allTruthyMode) { - return function handleArray(val) { - if (isArray(val) && val.length === 0) return val; - val = arrayWrap(val); - var result = map(val, callback); - if (allTruthyMode === true) - return filter(result, falsey).length === 0; - return arrayUnwrap(result); - }; - } - - // Wraps type (.equals) functions to operate on each value of an array - function arrayEqualsHandler(callback) { - return function handleArray(val1, val2) { - var left = arrayWrap(val1), right = arrayWrap(val2); - if (left.length !== right.length) return false; - for (var i = 0; i < left.length; i++) { - if (!callback(left[i], right[i])) return false; - } - return true; - }; - } - - this.encode = arrayHandler(bindTo(type, 'encode')); - this.decode = arrayHandler(bindTo(type, 'decode')); - this.is = arrayHandler(bindTo(type, 'is'), true); - this.equals = arrayEqualsHandler(bindTo(type, 'equals')); - this.pattern = type.pattern; - this.$normalize = arrayHandler(bindTo(type, '$normalize')); - this.name = type.name; - this.$arrayMode = mode; - } - - return new ArrayType(this, mode); -}; - - - -/** - * @ngdoc object - * @name ui.router.util.$urlMatcherFactory - * - * @description - * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory - * is also available to providers under the name `$urlMatcherFactoryProvider`. - */ -function $UrlMatcherFactory() { - $$UMFP = this; - - var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false; - - // Use tildes to pre-encode slashes. - // If the slashes are simply URLEncoded, the browser can choose to pre-decode them, - // and bidirectional encoding/decoding fails. - // Tilde was chosen because it's not a RFC 3986 section 2.2 Reserved Character - function valToString(val) { return val != null ? val.toString().replace(/~/g, "~~").replace(/\//g, "~2F") : val; } - function valFromString(val) { return val != null ? val.toString().replace(/~2F/g, "/").replace(/~~/g, "~") : val; } - - var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = { - "string": { - encode: valToString, - decode: valFromString, - // TODO: in 1.0, make string .is() return false if value is undefined/null by default. - // In 0.2.x, string params are optional by default for backwards compat - is: function(val) { return val == null || !isDefined(val) || typeof val === "string"; }, - pattern: /[^/]*/ - }, - "int": { - encode: valToString, - decode: function(val) { return parseInt(val, 10); }, - is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; }, - pattern: /\d+/ - }, - "bool": { - encode: function(val) { return val ? 1 : 0; }, - decode: function(val) { return parseInt(val, 10) !== 0; }, - is: function(val) { return val === true || val === false; }, - pattern: /0|1/ - }, - "date": { - encode: function (val) { - if (!this.is(val)) - return undefined; - return [ val.getFullYear(), - ('0' + (val.getMonth() + 1)).slice(-2), - ('0' + val.getDate()).slice(-2) - ].join("-"); - }, - decode: function (val) { - if (this.is(val)) return val; - var match = this.capture.exec(val); - return match ? new Date(match[1], match[2] - 1, match[3]) : undefined; - }, - is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); }, - equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); }, - pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/, - capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/ - }, - "json": { - encode: angular.toJson, - decode: angular.fromJson, - is: angular.isObject, - equals: angular.equals, - pattern: /[^/]*/ - }, - "any": { // does not encode/decode - encode: angular.identity, - decode: angular.identity, - equals: angular.equals, - pattern: /.*/ - } - }; - - function getDefaultConfig() { - return { - strict: isStrictMode, - caseInsensitive: isCaseInsensitive - }; - } - - function isInjectable(value) { - return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1]))); - } - - /** - * [Internal] Get the default value of a parameter, which may be an injectable function. - */ - $UrlMatcherFactory.$$getDefaultValue = function(config) { - if (!isInjectable(config.value)) return config.value; - if (!injector) throw new Error("Injectable functions cannot be called at configuration time"); - return injector.invoke(config.value); - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#caseInsensitive - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Defines whether URL matching should be case sensitive (the default behavior), or not. - * - * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`; - * @returns {boolean} the current value of caseInsensitive - */ - this.caseInsensitive = function(value) { - if (isDefined(value)) - isCaseInsensitive = value; - return isCaseInsensitive; - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#strictMode - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Defines whether URLs should match trailing slashes, or not (the default behavior). - * - * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`. - * @returns {boolean} the current value of strictMode - */ - this.strictMode = function(value) { - if (isDefined(value)) - isStrictMode = value; - return isStrictMode; - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Sets the default behavior when generating or matching URLs with default parameter values. - * - * @param {string} value A string that defines the default parameter URL squashing behavior. - * `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL - * `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the - * parameter is surrounded by slashes, squash (remove) one slash from the URL - * any other string, e.g. "~": When generating an href with a default parameter value, squash (remove) - * the parameter value from the URL and replace it with this string. - */ - this.defaultSquashPolicy = function(value) { - if (!isDefined(value)) return defaultSquashPolicy; - if (value !== true && value !== false && !isString(value)) - throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string"); - defaultSquashPolicy = value; - return value; - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#compile - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern. - * - * @param {string} pattern The URL pattern. - * @param {Object} config The config object hash. - * @returns {UrlMatcher} The UrlMatcher. - */ - this.compile = function (pattern, config) { - return new UrlMatcher(pattern, extend(getDefaultConfig(), config)); - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#isMatcher - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Returns true if the specified object is a `UrlMatcher`, or false otherwise. - * - * @param {Object} object The object to perform the type check against. - * @returns {Boolean} Returns `true` if the object matches the `UrlMatcher` interface, by - * implementing all the same methods. - */ - this.isMatcher = function (o) { - if (!isObject(o)) return false; - var result = true; - - forEach(UrlMatcher.prototype, function(val, name) { - if (isFunction(val)) { - result = result && (isDefined(o[name]) && isFunction(o[name])); - } - }); - return result; - }; - - /** - * @ngdoc function - * @name ui.router.util.$urlMatcherFactory#type - * @methodOf ui.router.util.$urlMatcherFactory - * - * @description - * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to - * generate URLs with typed parameters. - * - * @param {string} name The type name. - * @param {Object|Function} definition The type definition. See - * {@link ui.router.util.type:Type `Type`} for information on the values accepted. - * @param {Object|Function} definitionFn (optional) A function that is injected before the app - * runtime starts. The result of this function is merged into the existing `definition`. - * See {@link ui.router.util.type:Type `Type`} for information on the values accepted. - * - * @returns {Object} Returns `$urlMatcherFactoryProvider`. - * - * @example - * This is a simple example of a custom type that encodes and decodes items from an - * array, using the array index as the URL-encoded value: - * - *
      -   * var list = ['John', 'Paul', 'George', 'Ringo'];
      -   *
      -   * $urlMatcherFactoryProvider.type('listItem', {
      -   *   encode: function(item) {
      -   *     // Represent the list item in the URL using its corresponding index
      -   *     return list.indexOf(item);
      -   *   },
      -   *   decode: function(item) {
      -   *     // Look up the list item by index
      -   *     return list[parseInt(item, 10)];
      -   *   },
      -   *   is: function(item) {
      -   *     // Ensure the item is valid by checking to see that it appears
      -   *     // in the list
      -   *     return list.indexOf(item) > -1;
      -   *   }
      -   * });
      -   *
      -   * $stateProvider.state('list', {
      -   *   url: "/list/{item:listItem}",
      -   *   controller: function($scope, $stateParams) {
      -   *     console.log($stateParams.item);
      -   *   }
      -   * });
      -   *
      -   * // ...
      -   *
      -   * // Changes URL to '/list/3', logs "Ringo" to the console
      -   * $state.go('list', { item: "Ringo" });
      -   * 
      - * - * This is a more complex example of a type that relies on dependency injection to - * interact with services, and uses the parameter name from the URL to infer how to - * handle encoding and decoding parameter values: - * - *
      -   * // Defines a custom type that gets a value from a service,
      -   * // where each service gets different types of values from
      -   * // a backend API:
      -   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {
      -   *
      -   *   // Matches up services to URL parameter names
      -   *   var services = {
      -   *     user: Users,
      -   *     post: Posts
      -   *   };
      -   *
      -   *   return {
      -   *     encode: function(object) {
      -   *       // Represent the object in the URL using its unique ID
      -   *       return object.id;
      -   *     },
      -   *     decode: function(value, key) {
      -   *       // Look up the object by ID, using the parameter
      -   *       // name (key) to call the correct service
      -   *       return services[key].findById(value);
      -   *     },
      -   *     is: function(object, key) {
      -   *       // Check that object is a valid dbObject
      -   *       return angular.isObject(object) && object.id && services[key];
      -   *     }
      -   *     equals: function(a, b) {
      -   *       // Check the equality of decoded objects by comparing
      -   *       // their unique IDs
      -   *       return a.id === b.id;
      -   *     }
      -   *   };
      -   * });
      -   *
      -   * // In a config() block, you can then attach URLs with
      -   * // type-annotated parameters:
      -   * $stateProvider.state('users', {
      -   *   url: "/users",
      -   *   // ...
      -   * }).state('users.item', {
      -   *   url: "/{user:dbObject}",
      -   *   controller: function($scope, $stateParams) {
      -   *     // $stateParams.user will now be an object returned from
      -   *     // the Users service
      -   *   },
      -   *   // ...
      -   * });
      -   * 
      - */ - this.type = function (name, definition, definitionFn) { - if (!isDefined(definition)) return $types[name]; - if ($types.hasOwnProperty(name)) throw new Error("A type named '" + name + "' has already been defined."); - - $types[name] = new Type(extend({ name: name }, definition)); - if (definitionFn) { - typeQueue.push({ name: name, def: definitionFn }); - if (!enqueue) flushTypeQueue(); - } - return this; - }; - - // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s - function flushTypeQueue() { - while(typeQueue.length) { - var type = typeQueue.shift(); - if (type.pattern) throw new Error("You cannot override a type's .pattern at runtime."); - angular.extend($types[type.name], injector.invoke(type.def)); - } - } - - // Register default types. Store them in the prototype of $types. - forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); }); - $types = inherit($types, {}); - - /* No need to document $get, since it returns this */ - this.$get = ['$injector', function ($injector) { - injector = $injector; - enqueue = false; - flushTypeQueue(); - - forEach(defaultTypes, function(type, name) { - if (!$types[name]) $types[name] = new Type(type); - }); - return this; - }]; - - this.Param = function Param(id, type, config, location) { - var self = this; - config = unwrapShorthand(config); - type = getType(config, type, location); - var arrayMode = getArrayMode(); - type = arrayMode ? type.$asArray(arrayMode, location === "search") : type; - if (type.name === "string" && !arrayMode && location === "path" && config.value === undefined) - config.value = ""; // for 0.2.x; in 0.3.0+ do not automatically default to "" - var isOptional = config.value !== undefined; - var squash = getSquashPolicy(config, isOptional); - var replace = getReplace(config, arrayMode, isOptional, squash); - - function unwrapShorthand(config) { - var keys = isObject(config) ? objectKeys(config) : []; - var isShorthand = indexOf(keys, "value") === -1 && indexOf(keys, "type") === -1 && - indexOf(keys, "squash") === -1 && indexOf(keys, "array") === -1; - if (isShorthand) config = { value: config }; - config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; }; - return config; - } - - function getType(config, urlType, location) { - if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations."); - if (urlType) return urlType; - if (!config.type) return (location === "config" ? $types.any : $types.string); - - if (angular.isString(config.type)) - return $types[config.type]; - if (config.type instanceof Type) - return config.type; - return new Type(config.type); - } - - // array config: param name (param[]) overrides default settings. explicit config overrides param name. - function getArrayMode() { - var arrayDefaults = { array: (location === "search" ? "auto" : false) }; - var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {}; - return extend(arrayDefaults, arrayParamNomenclature, config).array; - } - - /** - * returns false, true, or the squash value to indicate the "default parameter url squash policy". - */ - function getSquashPolicy(config, isOptional) { - var squash = config.squash; - if (!isOptional || squash === false) return false; - if (!isDefined(squash) || squash == null) return defaultSquashPolicy; - if (squash === true || isString(squash)) return squash; - throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string"); - } - - function getReplace(config, arrayMode, isOptional, squash) { - var replace, configuredKeys, defaultPolicy = [ - { from: "", to: (isOptional || arrayMode ? undefined : "") }, - { from: null, to: (isOptional || arrayMode ? undefined : "") } - ]; - replace = isArray(config.replace) ? config.replace : []; - if (isString(squash)) - replace.push({ from: squash, to: undefined }); - configuredKeys = map(replace, function(item) { return item.from; } ); - return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace); - } - - /** - * [Internal] Get the default value of a parameter, which may be an injectable function. - */ - function $$getDefaultValue() { - if (!injector) throw new Error("Injectable functions cannot be called at configuration time"); - var defaultValue = injector.invoke(config.$$fn); - if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue)) - throw new Error("Default value (" + defaultValue + ") for parameter '" + self.id + "' is not an instance of Type (" + self.type.name + ")"); - return defaultValue; - } - - /** - * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the - * default value, which may be the result of an injectable function. - */ - function $value(value) { - function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; } - function $replace(value) { - var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; }); - return replacement.length ? replacement[0] : value; - } - value = $replace(value); - return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value); - } - - function toString() { return "{Param:" + id + " " + type + " squash: '" + squash + "' optional: " + isOptional + "}"; } - - extend(this, { - id: id, - type: type, - location: location, - array: arrayMode, - squash: squash, - replace: replace, - isOptional: isOptional, - value: $value, - dynamic: undefined, - config: config, - toString: toString - }); - }; - - function ParamSet(params) { - extend(this, params || {}); - } - - ParamSet.prototype = { - $$new: function() { - return inherit(this, extend(new ParamSet(), { $$parent: this})); - }, - $$keys: function () { - var keys = [], chain = [], parent = this, - ignore = objectKeys(ParamSet.prototype); - while (parent) { chain.push(parent); parent = parent.$$parent; } - chain.reverse(); - forEach(chain, function(paramset) { - forEach(objectKeys(paramset), function(key) { - if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key); - }); - }); - return keys; - }, - $$values: function(paramValues) { - var values = {}, self = this; - forEach(self.$$keys(), function(key) { - values[key] = self[key].value(paramValues && paramValues[key]); - }); - return values; - }, - $$equals: function(paramValues1, paramValues2) { - var equal = true, self = this; - forEach(self.$$keys(), function(key) { - var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key]; - if (!self[key].type.equals(left, right)) equal = false; - }); - return equal; - }, - $$validates: function $$validate(paramValues) { - var keys = this.$$keys(), i, param, rawVal, normalized, encoded; - for (i = 0; i < keys.length; i++) { - param = this[keys[i]]; - rawVal = paramValues[keys[i]]; - if ((rawVal === undefined || rawVal === null) && param.isOptional) - break; // There was no parameter value, but the param is optional - normalized = param.type.$normalize(rawVal); - if (!param.type.is(normalized)) - return false; // The value was not of the correct Type, and could not be decoded to the correct Type - encoded = param.type.encode(normalized); - if (angular.isString(encoded) && !param.type.pattern.exec(encoded)) - return false; // The value was of the correct type, but when encoded, did not match the Type's regexp - } - return true; - }, - $$parent: undefined - }; - - this.ParamSet = ParamSet; -} - -// Register as a provider so it's available to other providers -angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory); -angular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/urlRouter.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/urlRouter.js deleted file mode 100644 index 8ec704b92b..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/urlRouter.js +++ /dev/null @@ -1,431 +0,0 @@ -/** - * @ngdoc object - * @name ui.router.router.$urlRouterProvider - * - * @requires ui.router.util.$urlMatcherFactoryProvider - * @requires $locationProvider - * - * @description - * `$urlRouterProvider` has the responsibility of watching `$location`. - * When `$location` changes it runs through a list of rules one by one until a - * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify - * a url in a state configuration. All urls are compiled into a UrlMatcher object. - * - * There are several methods on `$urlRouterProvider` that make it useful to use directly - * in your module config. - */ -$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider']; -function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { - var rules = [], otherwise = null, interceptDeferred = false, listener; - - // Returns a string that is a prefix of all strings matching the RegExp - function regExpPrefix(re) { - var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source); - return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : ''; - } - - // Interpolates matched values into a String.replace()-style pattern - function interpolate(pattern, match) { - return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) { - return match[what === '$' ? 0 : Number(what)]; - }); - } - - /** - * @ngdoc function - * @name ui.router.router.$urlRouterProvider#rule - * @methodOf ui.router.router.$urlRouterProvider - * - * @description - * Defines rules that are used by `$urlRouterProvider` to find matches for - * specific URLs. - * - * @example - *
      -   * var app = angular.module('app', ['ui.router.router']);
      -   *
      -   * app.config(function ($urlRouterProvider) {
      -   *   // Here's an example of how you might allow case insensitive urls
      -   *   $urlRouterProvider.rule(function ($injector, $location) {
      -   *     var path = $location.path(),
      -   *         normalized = path.toLowerCase();
      -   *
      -   *     if (path !== normalized) {
      -   *       return normalized;
      -   *     }
      -   *   });
      -   * });
      -   * 
      - * - * @param {function} rule Handler function that takes `$injector` and `$location` - * services as arguments. You can use them to return a valid path as a string. - * - * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance - */ - this.rule = function (rule) { - if (!isFunction(rule)) throw new Error("'rule' must be a function"); - rules.push(rule); - return this; - }; - - /** - * @ngdoc object - * @name ui.router.router.$urlRouterProvider#otherwise - * @methodOf ui.router.router.$urlRouterProvider - * - * @description - * Defines a path that is used when an invalid route is requested. - * - * @example - *
      -   * var app = angular.module('app', ['ui.router.router']);
      -   *
      -   * app.config(function ($urlRouterProvider) {
      -   *   // if the path doesn't match any of the urls you configured
      -   *   // otherwise will take care of routing the user to the
      -   *   // specified url
      -   *   $urlRouterProvider.otherwise('/index');
      -   *
      -   *   // Example of using function rule as param
      -   *   $urlRouterProvider.otherwise(function ($injector, $location) {
      -   *     return '/a/valid/url';
      -   *   });
      -   * });
      -   * 
      - * - * @param {string|function} rule The url path you want to redirect to or a function - * rule that returns the url path. The function version is passed two params: - * `$injector` and `$location` services, and must return a url string. - * - * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance - */ - this.otherwise = function (rule) { - if (isString(rule)) { - var redirect = rule; - rule = function () { return redirect; }; - } - else if (!isFunction(rule)) throw new Error("'rule' must be a function"); - otherwise = rule; - return this; - }; - - - function handleIfMatch($injector, handler, match) { - if (!match) return false; - var result = $injector.invoke(handler, handler, { $match: match }); - return isDefined(result) ? result : true; - } - - /** - * @ngdoc function - * @name ui.router.router.$urlRouterProvider#when - * @methodOf ui.router.router.$urlRouterProvider - * - * @description - * Registers a handler for a given url matching. - * - * If the handler is a string, it is - * treated as a redirect, and is interpolated according to the syntax of match - * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). - * - * If the handler is a function, it is injectable. It gets invoked if `$location` - * matches. You have the option of inject the match object as `$match`. - * - * The handler can return - * - * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` - * will continue trying to find another one that matches. - * - **string** which is treated as a redirect and passed to `$location.url()` - * - **void** or any **truthy** value tells `$urlRouter` that the url was handled. - * - * @example - *
      -   * var app = angular.module('app', ['ui.router.router']);
      -   *
      -   * app.config(function ($urlRouterProvider) {
      -   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {
      -   *     if ($state.$current.navigable !== state ||
      -   *         !equalForKeys($match, $stateParams) {
      -   *      $state.transitionTo(state, $match, false);
      -   *     }
      -   *   });
      -   * });
      -   * 
      - * - * @param {string|object} what The incoming path that you want to redirect. - * @param {string|function} handler The path you want to redirect your user to. - */ - this.when = function (what, handler) { - var redirect, handlerIsString = isString(handler); - if (isString(what)) what = $urlMatcherFactory.compile(what); - - if (!handlerIsString && !isFunction(handler) && !isArray(handler)) - throw new Error("invalid 'handler' in when()"); - - var strategies = { - matcher: function (what, handler) { - if (handlerIsString) { - redirect = $urlMatcherFactory.compile(handler); - handler = ['$match', function ($match) { return redirect.format($match); }]; - } - return extend(function ($injector, $location) { - return handleIfMatch($injector, handler, what.exec($location.path(), $location.search())); - }, { - prefix: isString(what.prefix) ? what.prefix : '' - }); - }, - regex: function (what, handler) { - if (what.global || what.sticky) throw new Error("when() RegExp must not be global or sticky"); - - if (handlerIsString) { - redirect = handler; - handler = ['$match', function ($match) { return interpolate(redirect, $match); }]; - } - return extend(function ($injector, $location) { - return handleIfMatch($injector, handler, what.exec($location.path())); - }, { - prefix: regExpPrefix(what) - }); - } - }; - - var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp }; - - for (var n in check) { - if (check[n]) return this.rule(strategies[n](what, handler)); - } - - throw new Error("invalid 'what' in when()"); - }; - - /** - * @ngdoc function - * @name ui.router.router.$urlRouterProvider#deferIntercept - * @methodOf ui.router.router.$urlRouterProvider - * - * @description - * Disables (or enables) deferring location change interception. - * - * If you wish to customize the behavior of syncing the URL (for example, if you wish to - * defer a transition but maintain the current URL), call this method at configuration time. - * Then, at run time, call `$urlRouter.listen()` after you have configured your own - * `$locationChangeSuccess` event handler. - * - * @example - *
      -   * var app = angular.module('app', ['ui.router.router']);
      -   *
      -   * app.config(function ($urlRouterProvider) {
      -   *
      -   *   // Prevent $urlRouter from automatically intercepting URL changes;
      -   *   // this allows you to configure custom behavior in between
      -   *   // location changes and route synchronization:
      -   *   $urlRouterProvider.deferIntercept();
      -   *
      -   * }).run(function ($rootScope, $urlRouter, UserService) {
      -   *
      -   *   $rootScope.$on('$locationChangeSuccess', function(e) {
      -   *     // UserService is an example service for managing user state
      -   *     if (UserService.isLoggedIn()) return;
      -   *
      -   *     // Prevent $urlRouter's default handler from firing
      -   *     e.preventDefault();
      -   *
      -   *     UserService.handleLogin().then(function() {
      -   *       // Once the user has logged in, sync the current URL
      -   *       // to the router:
      -   *       $urlRouter.sync();
      -   *     });
      -   *   });
      -   *
      -   *   // Configures $urlRouter's listener *after* your custom listener
      -   *   $urlRouter.listen();
      -   * });
      -   * 
      - * - * @param {boolean} defer Indicates whether to defer location change interception. Passing - no parameter is equivalent to `true`. - */ - this.deferIntercept = function (defer) { - if (defer === undefined) defer = true; - interceptDeferred = defer; - }; - - /** - * @ngdoc object - * @name ui.router.router.$urlRouter - * - * @requires $location - * @requires $rootScope - * @requires $injector - * @requires $browser - * - * @description - * - */ - this.$get = $get; - $get.$inject = ['$location', '$rootScope', '$injector', '$browser', '$sniffer']; - function $get( $location, $rootScope, $injector, $browser, $sniffer) { - - var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl; - - function appendBasePath(url, isHtml5, absolute) { - if (baseHref === '/') return url; - if (isHtml5) return baseHref.slice(0, -1) + url; - if (absolute) return baseHref.slice(1) + url; - return url; - } - - // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree - function update(evt) { - if (evt && evt.defaultPrevented) return; - var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl; - lastPushedUrl = undefined; - // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573 - //if (ignoreUpdate) return true; - - function check(rule) { - var handled = rule($injector, $location); - - if (!handled) return false; - if (isString(handled)) $location.replace().url(handled); - return true; - } - var n = rules.length, i; - - for (i = 0; i < n; i++) { - if (check(rules[i])) return; - } - // always check otherwise last to allow dynamic updates to the set of rules - if (otherwise) check(otherwise); - } - - function listen() { - listener = listener || $rootScope.$on('$locationChangeSuccess', update); - return listener; - } - - if (!interceptDeferred) listen(); - - return { - /** - * @ngdoc function - * @name ui.router.router.$urlRouter#sync - * @methodOf ui.router.router.$urlRouter - * - * @description - * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`. - * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event, - * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed - * with the transition by calling `$urlRouter.sync()`. - * - * @example - *
      -       * angular.module('app', ['ui.router'])
      -       *   .run(function($rootScope, $urlRouter) {
      -       *     $rootScope.$on('$locationChangeSuccess', function(evt) {
      -       *       // Halt state change from even starting
      -       *       evt.preventDefault();
      -       *       // Perform custom logic
      -       *       var meetsRequirement = ...
      -       *       // Continue with the update and state transition if logic allows
      -       *       if (meetsRequirement) $urlRouter.sync();
      -       *     });
      -       * });
      -       * 
      - */ - sync: function() { - update(); - }, - - listen: function() { - return listen(); - }, - - update: function(read) { - if (read) { - location = $location.url(); - return; - } - if ($location.url() === location) return; - - $location.url(location); - $location.replace(); - }, - - push: function(urlMatcher, params, options) { - var url = urlMatcher.format(params || {}); - - // Handle the special hash param, if needed - if (url !== null && params && params['#']) { - url += '#' + params['#']; - } - - $location.url(url); - lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined; - if (options && options.replace) $location.replace(); - }, - - /** - * @ngdoc function - * @name ui.router.router.$urlRouter#href - * @methodOf ui.router.router.$urlRouter - * - * @description - * A URL generation method that returns the compiled URL for a given - * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters. - * - * @example - *
      -       * $bob = $urlRouter.href(new UrlMatcher("/about/:person"), {
      -       *   person: "bob"
      -       * });
      -       * // $bob == "/about/bob";
      -       * 
      - * - * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate. - * @param {object=} params An object of parameter values to fill the matcher's required parameters. - * @param {object=} options Options object. The options are: - * - * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". - * - * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher` - */ - href: function(urlMatcher, params, options) { - if (!urlMatcher.validates(params)) return null; - - var isHtml5 = $locationProvider.html5Mode(); - if (angular.isObject(isHtml5)) { - isHtml5 = isHtml5.enabled; - } - - isHtml5 = isHtml5 && $sniffer.history; - - var url = urlMatcher.format(params); - options = options || {}; - - if (!isHtml5 && url !== null) { - url = "#" + $locationProvider.hashPrefix() + url; - } - - // Handle special hash param, if needed - if (url !== null && params && params['#']) { - url += '#' + params['#']; - } - - url = appendBasePath(url, isHtml5, options.absolute); - - if (!options.absolute || !url) { - return url; - } - - var slash = (!isHtml5 && url ? '/' : ''), port = $location.port(); - port = (port === 80 || port === 443 ? '' : ':' + port); - - return [$location.protocol(), '://', $location.host(), port, slash, url].join(''); - } - }; - } -} - -angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/view.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/view.js deleted file mode 100644 index 94334d31bf..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/view.js +++ /dev/null @@ -1,45 +0,0 @@ - -$ViewProvider.$inject = []; -function $ViewProvider() { - - this.$get = $get; - /** - * @ngdoc object - * @name ui.router.state.$view - * - * @requires ui.router.util.$templateFactory - * @requires $rootScope - * - * @description - * - */ - $get.$inject = ['$rootScope', '$templateFactory']; - function $get( $rootScope, $templateFactory) { - return { - // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... }) - /** - * @ngdoc function - * @name ui.router.state.$view#load - * @methodOf ui.router.state.$view - * - * @description - * - * @param {string} name name - * @param {object} options option object. - */ - load: function load(name, options) { - var result, defaults = { - template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {} - }; - options = extend(defaults, options); - - if (options.view) { - result = $templateFactory.fromConfig(options.view, options.params, options.locals); - } - return result; - } - }; - } -} - -angular.module('ui.router.state').provider('$view', $ViewProvider); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/viewDirective.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/viewDirective.js deleted file mode 100644 index 709839aec4..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/viewDirective.js +++ /dev/null @@ -1,357 +0,0 @@ -/** - * @ngdoc directive - * @name ui.router.state.directive:ui-view - * - * @requires ui.router.state.$state - * @requires $compile - * @requires $controller - * @requires $injector - * @requires ui.router.state.$uiViewScroll - * @requires $document - * - * @restrict ECA - * - * @description - * The ui-view directive tells $state where to place your templates. - * - * @param {string=} name A view name. The name should be unique amongst the other views in the - * same state. You can have views of the same name that live in different states. - * - * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window - * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll - * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you - * scroll ui-view elements into view when they are populated during a state activation. - * - * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) - * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.* - * - * @param {string=} onload Expression to evaluate whenever the view updates. - * - * @example - * A view can be unnamed or named. - *
      - * 
      - * 
      - * - * - *
      - *
      - * - * You can only have one unnamed view within any template (or root html). If you are only using a - * single view and it is unnamed then you can populate it like so: - *
      - * 
      - * $stateProvider.state("home", { - * template: "

      HELLO!

      " - * }) - *
      - * - * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#methods_state `views`} - * config property, by name, in this case an empty name: - *
      - * $stateProvider.state("home", {
      - *   views: {
      - *     "": {
      - *       template: "

      HELLO!

      " - * } - * } - * }) - *
      - * - * But typically you'll only use the views property if you name your view or have more than one view - * in the same template. There's not really a compelling reason to name a view if its the only one, - * but you could if you wanted, like so: - *
      - * 
      - *
      - *
      - * $stateProvider.state("home", {
      - *   views: {
      - *     "main": {
      - *       template: "

      HELLO!

      " - * } - * } - * }) - *
      - * - * Really though, you'll use views to set up multiple views: - *
      - * 
      - *
      - *
      - *
      - * - *
      - * $stateProvider.state("home", {
      - *   views: {
      - *     "": {
      - *       template: "

      HELLO!

      " - * }, - * "chart": { - * template: "" - * }, - * "data": { - * template: "" - * } - * } - * }) - *
      - * - * Examples for `autoscroll`: - * - *
      - * 
      - * 
      - *
      - * 
      - * 
      - * 
      - * 
      - * 
      - * - * Resolve data: - * - * The resolved data from the state's `resolve` block is placed on the scope as `$resolve` (this - * can be customized using [[ViewDeclaration.resolveAs]]). This can be then accessed from the template. - * - * Note that when `controllerAs` is being used, `$resolve` is set on the controller instance *after* the - * controller is instantiated. The `$onInit()` hook can be used to perform initialization code which - * depends on `$resolve` data. - * - * Example usage of $resolve in a view template - *
      - * $stateProvider.state('home', {
      - *   template: '',
      - *   resolve: {
      - *     user: function(UserService) { return UserService.fetchUser(); }
      - *   }
      - * });
      - * 
      - */ -$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate', '$q']; -function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate, $q) { - - function getService() { - return ($injector.has) ? function(service) { - return $injector.has(service) ? $injector.get(service) : null; - } : function(service) { - try { - return $injector.get(service); - } catch (e) { - return null; - } - }; - } - - var service = getService(), - $animator = service('$animator'), - $animate = service('$animate'); - - // Returns a set of DOM manipulation functions based on which Angular version - // it should use - function getRenderer(attrs, scope) { - var statics = function() { - return { - enter: function (element, target, cb) { target.after(element); cb(); }, - leave: function (element, cb) { element.remove(); cb(); } - }; - }; - - if ($animate) { - return { - enter: function(element, target, cb) { - if (angular.version.minor > 2) { - $animate.enter(element, null, target).then(cb); - } else { - $animate.enter(element, null, target, cb); - } - }, - leave: function(element, cb) { - if (angular.version.minor > 2) { - $animate.leave(element).then(cb); - } else { - $animate.leave(element, cb); - } - } - }; - } - - if ($animator) { - var animate = $animator && $animator(scope, attrs); - - return { - enter: function(element, target, cb) {animate.enter(element, null, target); cb(); }, - leave: function(element, cb) { animate.leave(element); cb(); } - }; - } - - return statics(); - } - - var directive = { - restrict: 'ECA', - terminal: true, - priority: 400, - transclude: 'element', - compile: function (tElement, tAttrs, $transclude) { - return function (scope, $element, attrs) { - var previousEl, currentEl, currentScope, latestLocals, - onloadExp = attrs.onload || '', - autoScrollExp = attrs.autoscroll, - renderer = getRenderer(attrs, scope), - inherited = $element.inheritedData('$uiView'); - - scope.$on('$stateChangeSuccess', function() { - updateView(false); - }); - - updateView(true); - - function cleanupLastView() { - if (previousEl) { - previousEl.remove(); - previousEl = null; - } - - if (currentScope) { - currentScope.$destroy(); - currentScope = null; - } - - if (currentEl) { - var $uiViewData = currentEl.data('$uiViewAnim'); - renderer.leave(currentEl, function() { - $uiViewData.$$animLeave.resolve(); - previousEl = null; - }); - - previousEl = currentEl; - currentEl = null; - } - } - - function updateView(firstTime) { - var newScope, - name = getUiViewName(scope, attrs, $element, $interpolate), - previousLocals = name && $state.$current && $state.$current.locals[name]; - - if (!firstTime && previousLocals === latestLocals) return; // nothing to do - newScope = scope.$new(); - latestLocals = $state.$current.locals[name]; - - /** - * @ngdoc event - * @name ui.router.state.directive:ui-view#$viewContentLoading - * @eventOf ui.router.state.directive:ui-view - * @eventType emits on ui-view directive scope - * @description - * - * Fired once the view **begins loading**, *before* the DOM is rendered. - * - * @param {Object} event Event object. - * @param {string} viewName Name of the view. - */ - newScope.$emit('$viewContentLoading', name); - - var clone = $transclude(newScope, function(clone) { - var animEnter = $q.defer(), animLeave = $q.defer(); - var viewAnimData = { - $animEnter: animEnter.promise, - $animLeave: animLeave.promise, - $$animLeave: animLeave - }; - - clone.data('$uiViewAnim', viewAnimData); - renderer.enter(clone, $element, function onUiViewEnter() { - animEnter.resolve(); - if(currentScope) { - currentScope.$emit('$viewContentAnimationEnded'); - } - - if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) { - $uiViewScroll(clone); - } - }); - cleanupLastView(); - }); - - currentEl = clone; - currentScope = newScope; - /** - * @ngdoc event - * @name ui.router.state.directive:ui-view#$viewContentLoaded - * @eventOf ui.router.state.directive:ui-view - * @eventType emits on ui-view directive scope - * @description - * Fired once the view is **loaded**, *after* the DOM is rendered. - * - * @param {Object} event Event object. - * @param {string} viewName Name of the view. - */ - currentScope.$emit('$viewContentLoaded', name); - currentScope.$eval(onloadExp); - } - }; - } - }; - - return directive; -} - -$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate']; -function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) { - return { - restrict: 'ECA', - priority: -400, - compile: function (tElement) { - var initial = tElement.html(); - return function (scope, $element, attrs) { - var current = $state.$current, - name = getUiViewName(scope, attrs, $element, $interpolate), - locals = current && current.locals[name]; - - if (! locals) { - return; - } - - $element.data('$uiView', { name: name, state: locals.$$state }); - $element.html(locals.$template ? locals.$template : initial); - - var resolveData = angular.extend({}, locals); - scope[locals.$$resolveAs] = resolveData; - - var link = $compile($element.contents()); - - if (locals.$$controller) { - locals.$scope = scope; - locals.$element = $element; - var controller = $controller(locals.$$controller, locals); - if (locals.$$controllerAs) { - scope[locals.$$controllerAs] = controller; - scope[locals.$$controllerAs][locals.$$resolveAs] = resolveData; - } - if (isFunction(controller.$onInit)) controller.$onInit(); - $element.data('$ngControllerController', controller); - $element.children().data('$ngControllerController', controller); - } - - link(scope); - }; - } - }; -} - -/** - * Shared ui-view code for both directives: - * Given scope, element, and its attributes, return the view's name - */ -function getUiViewName(scope, attrs, element, $interpolate) { - var name = $interpolate(attrs.uiView || attrs.name || '')(scope); - var uiViewCreatedBy = element.inheritedData('$uiView'); - return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : '')); -} - -angular.module('ui.router.state').directive('uiView', $ViewDirective); -angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/viewScroll.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/viewScroll.js deleted file mode 100644 index 81114e20de..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular-ui-router/src/viewScroll.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @ngdoc object - * @name ui.router.state.$uiViewScrollProvider - * - * @description - * Provider that returns the {@link ui.router.state.$uiViewScroll} service function. - */ -function $ViewScrollProvider() { - - var useAnchorScroll = false; - - /** - * @ngdoc function - * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll - * @methodOf ui.router.state.$uiViewScrollProvider - * - * @description - * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for - * scrolling based on the url anchor. - */ - this.useAnchorScroll = function () { - useAnchorScroll = true; - }; - - /** - * @ngdoc object - * @name ui.router.state.$uiViewScroll - * - * @requires $anchorScroll - * @requires $timeout - * - * @description - * When called with a jqLite element, it scrolls the element into view (after a - * `$timeout` so the DOM has time to refresh). - * - * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor, - * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}. - */ - this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) { - if (useAnchorScroll) { - return $anchorScroll; - } - - return function ($element) { - return $timeout(function () { - $element[0].scrollIntoView(); - }, 0, false); - }; - }]; -} - -angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/.bower.json deleted file mode 100644 index 8eb867dcfc..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/.bower.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "angular", - "version": "1.5.8", - "license": "MIT", - "main": "./angular.js", - "ignore": [], - "dependencies": {}, - "homepage": "https://github.com/angular/bower-angular", - "_release": "1.5.8", - "_resolution": { - "type": "version", - "tag": "v1.5.8", - "commit": "7e0e546eb6caedbb298c91a9f6bf7de7eeaa4ad2" - }, - "_source": "https://github.com/angular/bower-angular.git", - "_target": "1.5.8", - "_originalSource": "angular" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/LICENSE.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/LICENSE.md deleted file mode 100644 index 2c395eef1b..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Angular - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/README.md deleted file mode 100644 index d1bc0eddf4..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# packaged angular - -This repo is for distribution on `npm` and `bower`. The source for this module is in the -[main AngularJS repo](https://github.com/angular/angular.js). -Please file issues and pull requests against that repo. - -## Install - -You can install this package either with `npm` or with `bower`. - -### npm - -```shell -npm install angular -``` - -Then add a ` -``` - -Or `require('angular')` from your code. - -### bower - -```shell -bower install angular -``` - -Then add a ` -``` - -## Documentation - -Documentation is available on the -[AngularJS docs site](http://docs.angularjs.org/). - -## License - -The MIT License - -Copyright (c) 2010-2015 Google, Inc. http://angularjs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular-csp.css b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular-csp.css deleted file mode 100644 index f3cd926cb3..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular-csp.css +++ /dev/null @@ -1,21 +0,0 @@ -/* Include this file in your html if you are using the CSP mode. */ - -@charset "UTF-8"; - -[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], -.ng-cloak, .x-ng-cloak, -.ng-hide:not(.ng-hide-animate) { - display: none !important; -} - -ng\:form { - display: block; -} - -.ng-animate-shim { - visibility:hidden; -} - -.ng-anchor { - position:absolute; -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular.min.js deleted file mode 100644 index bf50a2884e..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular.min.js +++ /dev/null @@ -1,318 +0,0 @@ -/* - AngularJS v1.5.8 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(C){'use strict';function N(a){return function(){var b=arguments[0],d;d="["+(a?a+":":"")+b+"] http://errors.angularjs.org/1.5.8/"+(a?a+"/":"")+b;for(b=1;b").append(a).html();try{return a[0].nodeType===Ma?Q(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+Q(b)})}catch(c){return Q(d)}}function zc(a){try{return decodeURIComponent(a)}catch(b){}}function Ac(a){var b={};q((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"), -c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=zc(e),w(e)&&(f=w(f)?zc(f):!0,ua.call(b,e)?L(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function Tb(a){var b=[];q(a,function(a,c){L(a)?q(a,function(a){b.push(ea(c,!0)+(!0===a?"":"="+ea(a,!0)))}):b.push(ea(c,!0)+(!0===a?"":"="+ea(a,!0)))});return b.length?b.join("&"):""}function qb(a){return ea(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ea(a,b){return encodeURIComponent(a).replace(/%40/gi, -"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ee(a,b){var d,c,e=Na.length;for(c=0;c/,">"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);b.unshift("ng");c=cb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector", -d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;C&&e.test(C.name)&&(d.debugInfoEnabled=!0,C.name=C.name.replace(e,""));if(C&&!f.test(C.name))return c();C.name=C.name.replace(f,"");ca.resumeBootstrap=function(a){q(a,function(a){b.push(a)});return c()};z(ca.resumeDeferredBootstrap)&&ca.resumeDeferredBootstrap()}function ge(){C.name="NG_ENABLE_DEBUG_INFO!"+C.name;C.location.reload()}function he(a){a=ca.element(a).injector();if(!a)throw xa("test");return a.get("$$testability")} -function Cc(a,b){b=b||"_";return a.replace(ie,function(a,c){return(c?b:"")+a.toLowerCase()})}function je(){var a;if(!Dc){var b=rb();(qa=y(b)?C.jQuery:b?C[b]:void 0)&&qa.fn.on?(F=qa,S(qa.fn,{scope:Oa.scope,isolateScope:Oa.isolateScope,controller:Oa.controller,injector:Oa.injector,inheritedData:Oa.inheritedData}),a=qa.cleanData,qa.cleanData=function(b){for(var c,e=0,f;null!=(f=b[e]);e++)(c=qa._data(f,"events"))&&c.$destroy&&qa(f).triggerHandler("$destroy");a(b)}):F=O;ca.element=F;Dc=!0}}function sb(a, -b,d){if(!a)throw xa("areq",b||"?",d||"required");return a}function Pa(a,b,d){d&&L(a)&&(a=a[a.length-1]);sb(z(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Qa(a,b){if("hasOwnProperty"===a)throw xa("badname",b);}function Ec(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g")+c[2];for(c=c[0];c--;)d=d.lastChild;f=$a(f,d.childNodes);d=e.firstChild; -d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";q(f,function(a){e.appendChild(a)});return e}function Pc(a,b){var d=a.parentNode;d&&d.replaceChild(b,a);b.appendChild(a)}function O(a){if(a instanceof O)return a;var b;G(a)&&(a=W(a),b=!0);if(!(this instanceof O)){if(b&&"<"!=a.charAt(0))throw Wb("nosel");return new O(a)}if(b){b=C.document;var d;a=(d=Of.exec(a))?[b.createElement(d[1])]:(d=Oc(a,b))?d.childNodes:[]}Qc(this,a)}function Xb(a){return a.cloneNode(!0)}function wb(a, -b){b||eb(a);if(a.querySelectorAll)for(var d=a.querySelectorAll("*"),c=0,e=d.length;c=Ea?!1:"function"===typeof a&&/^(?:class\b|constructor\()/.test(Function.prototype.toString.call(a)+" ");return d?(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d= -L(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,a))},get:d,annotate:cb.$$annotate,has:function(b){return n.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var k={},l=[],m=new Ra([],!0),n={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,ha(b),!1)}),constant:d(function(a,b){Qa(a,"constant");n[a]=b;u[a]=b}),decorator:function(a,b){var c= -p.get(a+"Provider"),d=c.$get;c.$get=function(){var a=B.invoke(d,c);return B.invoke(b,null,{$delegate:a})}}}},p=n.$injector=h(n,function(a,b){ca.isString(b)&&l.push(b);throw Ha("unpr",l.join(" <- "));}),u={},R=h(u,function(a,b){var c=p.get(a+"Provider",b);return B.invoke(c.$get,c,void 0,a)}),B=R;n.$injectorProvider={$get:ha(R)};var r=g(a),B=R.get("$injector");B.strictDi=b;q(r,function(a){a&&B.invoke(a)});return B}function Xe(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window", -"$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===wa(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;z(c)?c=c():Qb(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):T(c)||(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=G(a)?a:d.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"=== -a&&f(null):f(null)}var h=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===b&&""===a||Qf(function(){c.$evalAsync(g)})});return g}]}function gb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;L(a)&&(a=a.join(" "));L(b)&&(b=b.join(" "));return a+" "+b}function Zf(a){G(a)&&(a=a.split(" "));var b=U();q(a,function(a){a.length&&(b[a]=!0)});return b}function Ia(a){return D(a)?a:{}}function $f(a,b,d,c){function e(a){try{a.apply(null,va.call(arguments,1))}finally{if(R--,0===R)for(;B.length;)try{B.pop()()}catch(b){d.error(b)}}} -function f(){t=null;g();h()}function g(){r=K();r=y(r)?null:r;na(r,E)&&(r=E);E=r}function h(){if(v!==k.url()||J!==r)v=k.url(),J=r,q(M,function(a){a(k.url(),r)})}var k=this,l=a.location,m=a.history,n=a.setTimeout,p=a.clearTimeout,u={};k.isMock=!1;var R=0,B=[];k.$$completeOutstandingRequest=e;k.$$incOutstandingRequestCount=function(){R++};k.notifyWhenNoOutstandingRequests=function(a){0===R?a():B.push(a)};var r,J,v=l.href,fa=b.find("base"),t=null,K=c.history?function(){try{return m.state}catch(a){}}: -A;g();J=r;k.url=function(b,d,e){y(e)&&(e=null);l!==a.location&&(l=a.location);m!==a.history&&(m=a.history);if(b){var f=J===e;if(v===b&&(!c.history||f))return k;var h=v&&Ja(v)===Ja(b);v=b;J=e;!c.history||h&&f?(h||(t=b),d?l.replace(b):h?(d=l,e=b.indexOf("#"),e=-1===e?"":b.substr(e),d.hash=e):l.href=b,l.href!==b&&(t=b)):(m[d?"replaceState":"pushState"](e,"",b),g(),J=r);t&&(t=b);return k}return t||l.href.replace(/%27/g,"'")};k.state=function(){return r};var M=[],H=!1,E=null;k.onUrlChange=function(b){if(!H){if(c.history)F(a).on("popstate", -f);F(a).on("hashchange",f);H=!0}M.push(b);return b};k.$$applicationDestroyed=function(){F(a).off("hashchange popstate",f)};k.$$checkUrlChange=h;k.baseHref=function(){var a=fa.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};k.defer=function(a,b){var c;R++;c=n(function(){delete u[c];e(a)},b||0);u[c]=!0;return c};k.defer.cancel=function(a){return u[a]?(delete u[a],p(a),e(A),!0):!1}}function df(){this.$get=["$window","$log","$sniffer","$document",function(a,b,d,c){return new $f(a,c,b, -d)}]}function ef(){this.$get=function(){function a(a,c){function e(a){a!=n&&(p?p==a&&(p=a.n):p=a,f(a.n,a.p),f(a,n),n=a,n.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw N("$cacheFactory")("iid",a);var g=0,h=S({},c,{id:a}),k=U(),l=c&&c.capacity||Number.MAX_VALUE,m=U(),n=null,p=null;return b[a]={put:function(a,b){if(!y(b)){if(ll&&this.remove(p.key);return b}},get:function(a){if(l";b=pa.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function x(a,b){try{a.addClass(b)}catch(c){}}function aa(a,b,c,d,e){a instanceof F||(a=F(a));for(var f=/\S+/,g=0,h=a.length;g< -h;g++){var k=a[g];k.nodeType===Ma&&k.nodeValue.match(f)&&Pc(k,a[g]=C.document.createElement("span"))}var l=s(a,b,a,c,d,e);aa.$$addScopeClass(a);var m=null;return function(b,c,d){sb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var f=d.parentBoundTranscludeFn,g=d.transcludeControllers;d=d.futureParentElement;f&&f.$$boundTransclude&&(f=f.$$boundTransclude);m||(m=(d=d&&d[0])?"foreignobject"!==wa(d)&&ma.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==m?F(da(m,F("
      ").append(a).html())): -c?Oa.clone.call(a):a;if(g)for(var h in g)d.data("$"+h+"Controller",g[h].instance);aa.$$addScopeInfo(d,b);c&&c(d,b);l&&l(b,d,d,f);return d}}function s(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,m,p,r,v;if(n)for(v=Array(c.length),m=0;mx.priority)break;if(w=x.scope)x.templateUrl||(D(w)?(X("new/isolated scope",u||r,x,t),u=x):X("new/isolated scope",u,x,t)),r=r||x;I=x.name;if(!Fa&&(x.replace&&(x.templateUrl||x.template)||x.transclude&& -!x.$$tlb)){for(w=A+1;Fa=a[w++];)if(Fa.transclude&&!Fa.$$tlb||Fa.replace&&(Fa.templateUrl||Fa.template)){za=!0;break}Fa=!0}!x.templateUrl&&x.controller&&(w=x.controller,v=v||U(),X("'"+I+"' controller",v[I],x,t),v[I]=x);if(w=x.transclude)if(M=!0,x.$$tlb||(X("transclusion",E,x,t),E=x),"element"==w)fa=!0,n=x.priority,P=t,t=d.$$element=F(aa.$$createComment(I,d[I])),b=t[0],ea(f,va.call(P,0),b),P[0].$$parentNode=P[0].parentNode,K=ac(za,P,e,n,g&&g.name,{nonTlbTranscludeDirective:E});else{var oa=U();P=F(Xb(b)).contents(); -if(D(w)){P=[];var Q=U(),O=U();q(w,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Q[a]=b;oa[b]=null;O[b]=c});q(t.contents(),function(a){var b=Q[Aa(wa(a))];b?(O[b]=!0,oa[b]=oa[b]||[],oa[b].push(a)):P.push(a)});q(O,function(a,b){if(!a)throw ga("reqslot",b);});for(var V in oa)oa[V]&&(oa[V]=ac(za,oa[V],e))}t.empty();K=ac(za,P,e,void 0,void 0,{needsNewScope:x.$$isolateScope||x.$$newScope});K.$$slots=oa}if(x.template)if(B=!0,X("template",H,x,t),H=x,w=z(x.template)?x.template(t,d):x.template, -w=xa(w),x.replace){g=x;P=Vb.test(w)?$c(da(x.templateNamespace,W(w))):[];b=P[0];if(1!=P.length||1!==b.nodeType)throw ga("tplrt",I,"");ea(f,t,b);C={$attr:{}};w=$b(b,[],C);var Z=a.splice(A+1,a.length-(A+1));(u||r)&&T(w,u,r);a=a.concat(w).concat(Z);$(d,C);C=a.length}else t.html(w);if(x.templateUrl)B=!0,X("template",H,x,t),H=x,x.replace&&(g=x),p=ba(a.splice(A,a.length-A),t,d,f,M&&K,h,k,{controllerDirectives:v,newScopeDirective:r!==x&&r,newIsolateScopeDirective:u,templateDirective:H,nonTlbTranscludeDirective:E}), -C=a.length;else if(x.compile)try{s=x.compile(t,d,K);var Y=x.$$originalDirective||x;z(s)?m(null,ab(Y,s),G,hb):s&&m(ab(Y,s.pre),ab(Y,s.post),G,hb)}catch(ca){c(ca,ya(t))}x.terminal&&(p.terminal=!0,n=Math.max(n,x.priority))}p.scope=r&&!0===r.scope;p.transcludeOnThisElement=M;p.templateOnThisElement=B;p.transclude=K;l.hasElementTranscludeDirective=fa;return p}function ib(a,b,c,d){var e;if(G(b)){var f=b.match(l);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&& -e.instance;if(!e){var h="$"+b+"Controller";e=g?c.inheritedData(h):c.data(h)}if(!e&&!f)throw ga("ctreq",b,a);}else if(L(b))for(e=[],g=0,f=b.length;gp.priority)&&-1!=p.restrict.indexOf(g)){l&&(p=Rb(p,{$$start:l,$$end:m}));if(!p.$$bindings){var u=p,v=p,x=p.name,H={isolateScope:null,bindToController:null};D(v.scope)&&(!0===v.bindToController?(H.bindToController=d(v.scope,x,!0),H.isolateScope={}): -H.isolateScope=d(v.scope,x,!1));D(v.bindToController)&&(H.bindToController=d(v.bindToController,x,!0));if(D(H.bindToController)){var E=v.controller,M=v.controllerAs;if(!E)throw ga("noctrl",x);if(!Xc(E,M))throw ga("noident",x);}var t=u.$$bindings=H;D(t.isolateScope)&&(p.$$isolateBindings=t.isolateScope)}b.push(p);k=p}}catch(I){c(I)}}return k}function V(b){if(f.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,e=c.length;d"+b+"";return c.childNodes[0].childNodes;default:return b}}function ha(a,b){if("srcdoc"==b)return M.HTML;var c=wa(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!= -c&&("src"==b||"ngSrc"==b))return M.RESOURCE_URL}function ia(a,c,d,e,f){var g=ha(a,e);f=k[e]||f;var h=b(d,!0,g,f);if(h){if("multiple"===e&&"select"===wa(a))throw ga("selmulti",ya(a));c.push({priority:100,compile:function(){return{pre:function(a,c,k){c=k.$$observers||(k.$$observers=U());if(m.test(e))throw ga("nodomevents");var l=k[e];l!==d&&(h=l&&b(l,!0,g,f),d=l);h&&(k[e]=h(a),(c[e]||(c[e]=[])).$$inter=!0,(k.$$observers&&k.$$observers[e].$$scope||a).$watch(h,function(a,b){"class"===e&&a!=b?k.$updateClass(a, -b):k.$set(e,a)}))}}}})}}function ea(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g=b)return a;for(;b--;)8===a[b].nodeType&&bg.call(a,b,1);return a}function Xc(a,b){if(b&&G(b))return b;if(G(a)){var d=cd.exec(a);if(d)return d[3]}}function ff(){var a={},b=!1;this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,c){Qa(b,"controller");D(b)?S(a,b):a[b]=c};this.allowGlobals=function(){b=!0};this.$get=["$injector", -"$window",function(d,c){function e(a,b,c,d){if(!a||!D(a.$scope))throw N("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var l,m,n;h=!0===h;k&&G(k)&&(n=k);if(G(f)){k=f.match(cd);if(!k)throw cg("ctrlfmt",f);m=k[1];n=n||k[3];f=a.hasOwnProperty(m)?a[m]:Ec(g.$scope,m,!0)||(b?Ec(c,m,!0):void 0);Pa(f,m,!0)}if(h)return h=(L(f)?f[f.length-1]:f).prototype,l=Object.create(h||null),n&&e(g,n,l,m||f.name),S(function(){var a=d.invoke(f,l,g,m);a!==l&&(D(a)||z(a))&&(l=a,n&&e(g,n,l,m||f.name));return l}, -{instance:l,identifier:n});l=d.instantiate(f,g,m);n&&e(g,n,l,m||f.name);return l}}]}function gf(){this.$get=["$window",function(a){return F(a.document)}]}function hf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}function cc(a){return D(a)?da(a)?a.toISOString():bb(a):a}function nf(){this.$get=function(){return function(a){if(!a)return"";var b=[];tc(a,function(a,c){null===a||y(a)||(L(a)?q(a,function(a){b.push(ea(c)+"="+ea(cc(a)))}):b.push(ea(c)+"="+ea(cc(a))))}); -return b.join("&")}}}function of(){this.$get=function(){return function(a){function b(a,e,f){null===a||y(a)||(L(a)?q(a,function(a,c){b(a,e+"["+(D(a)?c:"")+"]")}):D(a)&&!da(a)?tc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ea(e)+"="+ea(cc(a))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function dc(a,b){if(G(a)){var d=a.replace(dg,"").trim();if(d){var c=b("Content-Type");(c=c&&0===c.indexOf(dd))||(c=(c=d.match(eg))&&fg[c[0]].test(d));c&&(a=xc(d))}}return a}function ed(a){var b= -U(),d;G(a)?q(a.split("\n"),function(a){d=a.indexOf(":");var e=Q(W(a.substr(0,d)));a=W(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):D(a)&&q(a,function(a,d){var f=Q(d),g=W(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function fd(a){var b;return function(d){b||(b=ed(a));return d?(d=b[Q(d)],void 0===d&&(d=null),d):b}}function gd(a,b,d,c){if(z(c))return c(a,b,d);q(c,function(c){a=c(a,b,d)});return a}function mf(){var a=this.defaults={transformResponse:[dc],transformRequest:[function(a){return D(a)&&"[object File]"!== -ma.call(a)&&"[object Blob]"!==ma.call(a)&&"[object FormData]"!==ma.call(a)?bb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ia(ec),put:ia(ec),patch:ia(ec)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},b=!1;this.useApplyAsync=function(a){return w(a)?(b=!!a,this):b};var d=!0;this.useLegacyPromiseExtensions=function(a){return w(a)?(d=!!a,this):d};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory", -"$rootScope","$q","$injector",function(e,f,g,h,k,l){function m(b){function c(a,b){for(var d=0,e=b.length;da?b:k.reject(b)}if(!D(b))throw N("$http")("badreq",b);if(!G(b.url))throw N("$http")("badreq",b.url);var g=S({method:"get",transformRequest:a.transformRequest, -transformResponse:a.transformResponse,paramSerializer:a.paramSerializer},b);g.headers=function(b){var c=a.headers,d=S({},b.headers),f,g,h,c=S({},c.common,c[Q(b.method)]);a:for(f in c){g=Q(f);for(h in d)if(Q(h)===g)continue a;d[f]=c[f]}return e(d,ia(b))}(b);g.method=ub(g.method);g.paramSerializer=G(g.paramSerializer)?l.get(g.paramSerializer):g.paramSerializer;var h=[],m=[],p=k.when(g);q(R,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError);(a.response||a.responseError)&&m.push(a.response, -a.responseError)});p=c(p,h);p=p.then(function(b){var c=b.headers,d=gd(b.data,fd(c),void 0,b.transformRequest);y(d)&&q(c,function(a,b){"content-type"===Q(b)&&delete c[b]});y(b.withCredentials)&&!y(a.withCredentials)&&(b.withCredentials=a.withCredentials);return n(b,d).then(f,f)});p=c(p,m);d?(p.success=function(a){Pa(a,"fn");p.then(function(b){a(b.data,b.status,b.headers,g)});return p},p.error=function(a){Pa(a,"fn");p.then(null,function(b){a(b.data,b.status,b.headers,g)});return p}):(p.success=hd("success"), -p.error=hd("error"));return p}function n(c,d){function g(a){if(a){var c={};q(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function l(a,c,d,e){function f(){n(c,a,d,e)}E&&(200<=a&&300>a?E.put(P,[a,c,ed(d),e]):E.remove(P));b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function n(a,b,d,e){b=-1<=b?b:0;(200<=b&&300>b?M.resolve:M.reject)({data:a,status:b,headers:fd(d),config:c,statusText:e})}function t(a){n(a.data,a.status,ia(a.headers()), -a.statusText)}function R(){var a=m.pendingRequests.indexOf(c);-1!==a&&m.pendingRequests.splice(a,1)}var M=k.defer(),H=M.promise,E,I,Da=c.headers,P=p(c.url,c.paramSerializer(c.params));m.pendingRequests.push(c);H.then(R,R);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(E=D(c.cache)?c.cache:D(a.cache)?a.cache:u);E&&(I=E.get(P),w(I)?I&&z(I.then)?I.then(t,t):L(I)?n(I[1],I[0],ia(I[2]),I[3]):n(I,200,{},"OK"):E.put(P,H));y(I)&&((I=id(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]: -void 0)&&(Da[c.xsrfHeaderName||a.xsrfHeaderName]=I),e(c.method,P,d,l,Da,c.timeout,c.withCredentials,c.responseType,g(c.eventHandlers),g(c.uploadEventHandlers)));return H}function p(a,b){0=l&&(v.resolve(r),q(fa.$$intervalId),delete g[fa.$$intervalId]);J||a.$apply()},k);g[fa.$$intervalId]=v;return fa}var g={};f.cancel=function(a){return a&&a.$$intervalId in g?(g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId), -delete g[a.$$intervalId],!0):!1};return f}]}function fc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=qb(a[b]);return a.join("/")}function jd(a,b){var d=Y(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=Z(d.port)||hg[d.protocol]||null}function kd(a,b){var d="/"!==a.charAt(0);d&&(a="/"+a);var c=Y(a);b.$$path=decodeURIComponent(d&&"/"===c.pathname.charAt(0)?c.pathname.substring(1):c.pathname);b.$$search=Ac(c.search);b.$$hash=decodeURIComponent(c.hash);b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path= -"/"+b.$$path)}function ka(a,b){if(0===b.lastIndexOf(a,0))return b.substr(a.length)}function Ja(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function jb(a){return a.replace(/(#.+)|#$/,"$1")}function gc(a,b,d){this.$$html5=!0;d=d||"";jd(a,this);this.$$parse=function(a){var d=ka(b,a);if(!G(d))throw Gb("ipthprfx",a,b);kd(d,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Tb(this.$$search),d=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=fc(this.$$path)+(a?"?"+ -a:"")+d;this.$$absUrl=b+this.$$url.substr(1)};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;w(f=ka(a,c))?(g=f,g=w(f=ka(d,f))?b+(ka("/",f)||f):a+g):w(f=ka(b,c))?g=b+f:b==c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function hc(a,b,d){jd(a,this);this.$$parse=function(c){var e=ka(a,c)||ka(b,c),f;y(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",y(e)&&(a=c,this.replace())):(f=ka(d,e),y(f)&&(f=e));kd(f,this);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;0===f.lastIndexOf(e, -0)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=Tb(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=fc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url?d+this.$$url:"")};this.$$parseLinkUrl=function(b,d){return Ja(a)==Ja(b)?(this.$$parse(b),!0):!1}}function ld(a,b,d){this.$$html5=!0;hc.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a==Ja(c)? -f=c:(g=ka(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=Tb(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=fc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url}}function Hb(a){return function(){return this[a]}}function md(a,b){return function(d){if(y(d))return this[a];this[a]=b(d);this.$$compose();return this}}function sf(){var a="",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return w(b)?(a=b,this): -a};this.html5Mode=function(a){return Ga(a)?(b.enabled=a,this):D(a)?(Ga(a.enabled)&&(b.enabled=a.enabled),Ga(a.requireBase)&&(b.requireBase=a.requireBase),Ga(a.rewriteLinks)&&(b.rewriteLinks=a.rewriteLinks),this):b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,c,e,f,g){function h(a,b,d){var e=l.url(),f=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(g){throw l.url(e),l.$$state=f,g;}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state, -b)}var l,m;m=c.baseHref();var n=c.url(),p;if(b.enabled){if(!m&&b.requireBase)throw Gb("nobase");p=n.substring(0,n.indexOf("/",n.indexOf("//")+2))+(m||"/");m=e.history?gc:ld}else p=Ja(n),m=hc;var u=p.substr(0,Ja(p).lastIndexOf("/")+1);l=new m(p,u,"#"+a);l.$$parseLinkUrl(n,n);l.$$state=c.state();var R=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(b.rewriteLinks&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!=a.which&&2!=a.button){for(var e=F(a.target);"a"!==wa(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return; -var h=e.prop("href"),k=e.attr("href")||e.attr("xlink:href");D(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=Y(h.animVal).href);R.test(h)||!h||e.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(h,k)||(a.preventDefault(),l.absUrl()!=c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=!0))}});jb(l.absUrl())!=jb(n)&&c.url(l.absUrl(),!0);var q=!0;c.onUrlChange(function(a,b){y(ka(u,a))?g.location.href=a:(d.$evalAsync(function(){var c=l.absUrl(),e=l.$$state,f;a=jb(a);l.$$parse(a);l.$$state= -b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;l.absUrl()===a&&(f?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(q=!1,k(c,e)))}),d.$$phase||d.$digest())});d.$watch(function(){var a=jb(c.url()),b=jb(l.absUrl()),f=c.state(),g=l.$$replace,m=a!==b||l.$$html5&&e.history&&f!==l.$$state;if(q||m)q=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,f).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=f):(m&&h(b,g,f===l.$$state?null:l.$$state), -k(a,f)))});l.$$replace=!1});return l}]}function tf(){var a=!0,b=this;this.debugEnabled=function(b){return w(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||A;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];q(arguments,function(b){a.push(c(b))}); -return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Sa(a,b){if("__defineGetter__"===a||"__defineSetter__"===a||"__lookupGetter__"===a||"__lookupSetter__"===a||"__proto__"===a)throw X("isecfld",b);return a}function ig(a){return a+""}function ra(a,b){if(a){if(a.constructor===a)throw X("isecfn",b);if(a.window===a)throw X("isecwindow",b);if(a.children&& -(a.nodeName||a.prop&&a.attr&&a.find))throw X("isecdom",b);if(a===Object)throw X("isecobj",b);}return a}function nd(a,b){if(a){if(a.constructor===a)throw X("isecfn",b);if(a===jg||a===kg||a===lg)throw X("isecff",b);}}function Ib(a,b){if(a&&(a===(0).constructor||a===(!1).constructor||a==="".constructor||a==={}.constructor||a===[].constructor||a===Function.constructor))throw X("isecaf",b);}function mg(a,b){return"undefined"!==typeof a?a:b}function od(a,b){return"undefined"===typeof a?b:"undefined"=== -typeof b?a:a+b}function V(a,b){var d,c;switch(a.type){case s.Program:d=!0;q(a.body,function(a){V(a.expression,b);d=d&&a.expression.constant});a.constant=d;break;case s.Literal:a.constant=!0;a.toWatch=[];break;case s.UnaryExpression:V(a.argument,b);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;break;case s.BinaryExpression:V(a.left,b);V(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case s.LogicalExpression:V(a.left,b);V(a.right, -b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case s.ConditionalExpression:V(a.test,b);V(a.alternate,b);V(a.consequent,b);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case s.Identifier:a.constant=!1;a.toWatch=[a];break;case s.MemberExpression:V(a.object,b);a.computed&&V(a.property,b);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=[a];break;case s.CallExpression:d=a.filter?!b(a.callee.name).$stateful: -!1;c=[];q(a.arguments,function(a){V(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=a.filter&&!b(a.callee.name).$stateful?c:[a];break;case s.AssignmentExpression:V(a.left,b);V(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=[a];break;case s.ArrayExpression:d=!0;c=[];q(a.elements,function(a){V(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=c;break;case s.ObjectExpression:d=!0;c=[];q(a.properties,function(a){V(a.value, -b);d=d&&a.value.constant&&!a.computed;a.value.constant||c.push.apply(c,a.value.toWatch)});a.constant=d;a.toWatch=c;break;case s.ThisExpression:a.constant=!1;a.toWatch=[];break;case s.LocalsExpression:a.constant=!1,a.toWatch=[]}}function pd(a){if(1==a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function qd(a){return a.type===s.Identifier||a.type===s.MemberExpression}function rd(a){if(1===a.body.length&&qd(a.body[0].expression))return{type:s.AssignmentExpression, -left:a.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function sd(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===s.Literal||a.body[0].expression.type===s.ArrayExpression||a.body[0].expression.type===s.ObjectExpression)}function td(a,b){this.astBuilder=a;this.$filter=b}function ud(a,b){this.astBuilder=a;this.$filter=b}function Jb(a){return"constructor"==a}function ic(a){return z(a.valueOf)?a.valueOf():ng.call(a)}function uf(){var a=U(),b=U(),d={"true":!0, -"false":!1,"null":null,undefined:void 0},c,e;this.addLiteral=function(a,b){d[a]=b};this.setIdentifierFns=function(a,b){c=a;e=b;return this};this.$get=["$filter",function(f){function g(c,d,e){var g,k,H;e=e||J;switch(typeof c){case "string":H=c=c.trim();var E=e?b:a;g=E[H];if(!g){":"===c.charAt(0)&&":"===c.charAt(1)&&(k=!0,c=c.substring(2));g=e?r:B;var q=new jc(g);g=(new kc(q,f,g)).parse(c);g.constant?g.$$watchDelegate=p:k?g.$$watchDelegate=g.literal?n:m:g.inputs&&(g.$$watchDelegate=l);e&&(g=h(g));E[H]= -g}return u(g,d);case "function":return u(c,d);default:return u(A,d)}}function h(a){function b(c,d,e,f){var g=J;J=!0;try{return a(c,d,e,f)}finally{J=g}}if(!a)return a;b.$$watchDelegate=a.$$watchDelegate;b.assign=h(a.assign);b.constant=a.constant;b.literal=a.literal;for(var c=0;a.inputs&&c=this.promise.$$state.status&&d&&d.length&&a(function(){for(var a,e,f=0,g=d.length;fa)for(b in l++,f)ua.call(e,b)||(u--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,h,k=1q&&(A=4-q,y[A]||(y[A]=[]),y[A].push({msg:z(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:k}));else if(a===c){r=!1;break a}}catch(G){f(G)}if(!(p=t.$$watchersCount&&t.$$childHead||t!==this&&t.$$nextSibling))for(;t!==this&&!(p=t.$$nextSibling);)t=t.$parent}while(t=p);if((r||v.length)&& -!q--)throw J.$$phase=null,d("infdig",b,y);}while(r||v.length);for(J.$$phase=null;KEa)throw sa("iequirks");var c=ia(la);c.isEnabled=function(){return a};c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=Xa);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs, -f=c.getTrusted,g=c.trustAs;q(la,function(a,b){var d=Q(b);c[db("parse_as_"+d)]=function(b){return e(a,b)};c[db("get_trusted_"+d)]=function(b){return f(a,b)};c[db("trust_as_"+d)]=function(b){return g(a,b)}});return c}]}function Af(){this.$get=["$window","$document",function(a,b){var d={},c=!(a.chrome&&a.chrome.app&&a.chrome.app.runtime)&&a.history&&a.history.pushState,e=Z((/android (\d+)/.exec(Q((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},h,k=/^(Moz|webkit|ms)(?=[A-Z])/, -l=g.body&&g.body.style,m=!1,n=!1;if(l){for(var p in l)if(m=k.exec(p)){h=m[0];h=h[0].toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in l&&"webkit");m=!!("transition"in l||h+"Transition"in l);n=!!("animation"in l||h+"Animation"in l);!e||m&&n||(m=G(l.webkitTransition),n=G(l.webkitAnimation))}return{history:!(!c||4>e||f),hasEvent:function(a){if("input"===a&&11>=Ea)return!1;if(y(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ba(),vendorPrefix:h,transitions:m,animations:n,android:e}}]} -function Cf(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$templateCache","$http","$q","$sce",function(b,d,c,e){function f(g,h){f.totalPendingRequests++;if(!G(g)||y(b.get(g)))g=e.getTrustedResourceUrl(g);var k=d.defaults&&d.defaults.transformResponse;L(k)?k=k.filter(function(a){return a!==dc}):k===dc&&(k=null);return d.get(g,S({cache:b,transformResponse:k},a))["finally"](function(){f.totalPendingRequests--}).then(function(a){b.put(g,a.data);return a.data},function(a){if(!h)throw pg("tpload", -g,a.status,a.statusText);return c.reject(a)})}f.totalPendingRequests=0;return f}]}function Df(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];q(a,function(a){var c=ca.element(a).data("$binding");c&&q(c,function(c){d?(new RegExp("(^|\\s)"+wd(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!=c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;hc&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)==mc;e++); -if(e==(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)==mc;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Gd&&(d=d.splice(0,Gd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function xg(a,b,d,c){var e=a.d,f=e.length-a.i;b=y(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++; -for(;fh;)k.unshift(0),h++;0=b.lgSize&&h.unshift(k.splice(-b.lgSize,k.length).join(""));k.length> -b.gSize;)h.unshift(k.splice(-b.gSize,k.length).join(""));k.length&&h.unshift(k.join(""));k=h.join(d);f.length&&(k+=c+f.join(""));e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Kb(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length-d)f+=d;0===f&&-12==d&&(f=12);return Kb(f,b,c,e)}}function kb(a,b,d){return function(c,e){var f= -c["get"+a](),g=ub((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Hd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Id(a){return function(b){var d=Hd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Kb(b,a)}}function nc(a,b){return 0>=a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Bd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear, -k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=Z(b[9]+b[10]),g=Z(b[9]+b[11]));h.call(a,Z(b[1]),Z(b[2])-1,Z(b[3]));f=Z(b[4]||0)-f;g=Z(b[5]||0)-g;h=Z(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var g="",h=[],k,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;G(c)&&(c=yg.test(c)?Z(c):b(c));T(c)&&(c=new Date(c));if(!da(c)||!isFinite(c.getTime()))return c; -for(;d;)(l=zg.exec(d))?(h=$a(h,l,1),d=h.pop()):(h.push(d),d=null);var m=c.getTimezoneOffset();f&&(m=yc(f,m),c=Sb(c,f,!0));q(h,function(b){k=Ag[b];g+=k?k(c,a.DATETIME_FORMATS,m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function rg(){return function(a,b){y(b)&&(b=2);return bb(a,b)}}function sg(){return function(a,b,d){b=Infinity===Math.abs(Number(b))?Number(b):Z(b);if(isNaN(b))return a;T(a)&&(a=a.toString());if(!ta(a))return a;d=!d||isNaN(d)?0:Z(d);d=0>d?Math.max(0,a.length+ -d):d;return 0<=b?oc(a,d,d+b):0===d?oc(a,b,a.length):oc(a,Math.max(0,d+b),d)}}function oc(a,b,d){return G(a)?a.slice(b,d):va.call(a,b,d)}function Dd(a){function b(b){return b.map(function(b){var c=1,d=Xa;if(z(b))d=b;else if(G(b)){if("+"==b.charAt(0)||"-"==b.charAt(0))c="-"==b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(d=a(b),d.constant))var e=d(),d=function(a){return a[e]}}return{get:d,descending:c}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}} -function c(a,b){var c=0,d=a.type,k=b.type;if(d===k){var k=a.value,l=b.value;"string"===d?(k=k.toLowerCase(),l=l.toLowerCase()):"object"===d&&(D(k)&&(k=a.index),D(l)&&(l=b.index));k!==l&&(c=kb||37<=b&&40>=b|| -m(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut",m)}b.on("change",l);if(Ld[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!k){var b=this.validity,c=b.badInput,d=b.typeMismatch;k=f.defer(function(){k=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Nb(a,b){return function(d,c){var e,f;if(da(d))return d;if(G(d)){'"'==d.charAt(0)&&'"'==d.charAt(d.length- -1)&&(d=d.substring(1,d.length-1));if(Bg.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},q(e,function(a,c){c=s};g.$observe("min", -function(a){s=p(a);h.$validate()})}if(w(g.max)||g.ngMax){var r;h.$validators.max=function(a){return!n(a)||y(r)||d(a)<=r};g.$observe("max",function(a){r=p(a);h.$validate()})}}}function Md(a,b,d,c){(c.$$hasNativeValidators=D(b[0].validity))&&c.$parsers.push(function(a){var c=b.prop("validity")||{};return c.badInput||c.typeMismatch?void 0:a})}function Nd(a,b,d,c,e){if(w(c)){a=a(c);if(!a.constant)throw nb("constexpr",d,c);return a(b)}return e}function qc(a,b){a="ngClass"+a;return["$animate",function(d){function c(a, -b){var c=[],d=0;a:for(;d(?:<\/\1>|)$/,Vb=/<|&#?\w+;/,Mf=/<([\w:-]+)/,Nf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, -ja={option:[1,'"],thead:[1,"","
      "],col:[2,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],_default:[0,"",""]};ja.optgroup=ja.option;ja.tbody=ja.tfoot=ja.colgroup=ja.caption=ja.thead;ja.th=ja.td;var Uf=C.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Oa=O.prototype={ready:function(a){function b(){d||(d=!0,a())}var d=!1;"complete"=== -C.document.readyState?C.setTimeout(b):(this.on("DOMContentLoaded",b),O(C).on("load",b))},toString:function(){var a=[];q(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?F(this[a]):F(this[this.length+a])},length:0,push:Dg,sort:[].sort,splice:[].splice},Eb={};q("multiple selected checked disabled readOnly required open".split(" "),function(a){Eb[Q(a)]=a});var Vc={};q("input select option textarea button form details".split(" "),function(a){Vc[a]=!0});var bd={ngMinlength:"minlength", -ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};q({data:Yb,removeData:eb,hasData:function(a){for(var b in fb[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b/,Xf=/^[^\(]*\(\s*([^\)]*)\)/m,Eg=/,/,Fg=/^\s*(_?)(\S+?)\1\s*$/,Vf=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ha=N("$injector");cb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw G(d)&&d||(d=a.name||Yf(a)),Ha("strictdi",d); -b=Wc(a);q(b[1].split(Eg),function(a){a.replace(Fg,function(a,b,d){c.push(d)})})}a.$inject=c}}else L(a)?(b=a.length-1,Pa(a[b],"fn"),c=a.slice(0,b)):Pa(a,"fn",!0);return c};var Rd=N("$animate"),$e=function(){this.$get=A},af=function(){var a=new Ra,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=G(b)?b.split(" "):L(b)?b:[],q(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){q(b,function(b){var c=a.get(b);if(c){var d=Zf(b.attr("class")),e="",f="";q(c, -function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});q(b,function(a){e&&Bb(a,e);f&&Ab(a,f)});a.remove(b)}});b.length=0}return{enabled:A,on:A,off:A,pin:A,push:function(g,h,k,l){l&&l();k=k||{};k.from&&g.css(k.from);k.to&&g.css(k.to);if(k.addClass||k.removeClass)if(h=k.addClass,l=k.removeClass,k=a.get(g)||{},h=e(k,h,!0),l=e(k,l,!1),h||l)a.put(g,k),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},Ye=["$provide",function(a){var b=this;this.$$registeredAnimations= -Object.create(null);this.register=function(d,c){if(d&&"."!==d.charAt(0))throw Rd("notcsel",d);var e=d+"-animation";b.$$registeredAnimations[d.substr(1)]=e;a.factory(e,c)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Rd("nongcls","ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var h;a:{for(h=0;h <= >= && || ! = |".split(" "),function(a){Ob[a]=!0});var Jg={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},jc=function(a){this.options=a};jc.prototype={constructor:jc, -lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart? -this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0): -(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=w(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw X("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index< -this.text.length;){var d=Q(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"==d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index< -this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index","<=",">=");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:s.BinaryExpression,operator:b.text, -left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:s.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object(): -this.selfReferential.hasOwnProperty(this.peek().text)?a=pa(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:s.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:s.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")): -"["===b.text?(a={type:s.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:s.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.filterChain());while(this.expect(",")) -}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:s.Identifier,name:a.text}},constant:function(){return{type:s.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:s.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break; -b={type:s.Property,kind:"init"};this.peek().constant?(b.key=this.constant(),b.computed=!1,this.consume(":"),b.value=this.expression()):this.peek().identifier?(b.key=this.identifier(),b.computed=!1,this.peek(":")?(this.consume(":"),b.value=this.expression()):b.value=b.key):this.peek("[")?(this.consume("["),b.key=this.expression(),this.consume("]"),b.computed=!0,this.consume(":"),b.value=this.expression()):this.throwError("invalid key",this.peek());a.push(b)}while(this.expect(","))}this.consume("}"); -return{type:s.ObjectExpression,properties:a}},throwError:function(a,b){throw X("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw X("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw X("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length> -a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},selfReferential:{"this":{type:s.ThisExpression},$locals:{type:s.LocalsExpression}}};td.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:b,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};V(c,d.$filter);var e="",f;this.stage="assign"; -if(f=rd(c))this.state.computing="assign",e=this.nextId(),this.recurse(f,e),this.return_(e),e="fn.assign="+this.generateFunction("assign","s,v,l");f=pd(c.body);d.stage="inputs";q(f,function(a,b){var c="fn"+b;d.state[c]={vars:[],body:[],own:{}};d.state.computing=c;var e=d.nextId();d.recurse(a,e);d.return_(e);d.state.inputs.push(c);a.watchId=b});this.state.computing="fn";this.stage="main";this.recurse(c);e='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+ -e+this.watchFns()+"return fn;";e=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext","ifDefined","plus","text",e))(this.$filter,Sa,ra,nd,ig,Ib,mg,od,a);this.state=this.stage=void 0;e.literal=sd(c);e.constant=c.constant;return e},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;q(b,function(b){a.push("var "+b+"="+d.generateFunction(b,"s"))});b.length&&a.push("fn.inputs=["+b.join(",")+"];"); -return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;q(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,k=this,l,m,n;c=c||A;if(!f&&w(a.watchId))b= -b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case s.Program:q(a.body,function(b,c){k.recurse(b.expression,void 0,void 0,function(a){h=a});c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case s.Literal:m=this.escape(a.value);this.assign(b,m);c(m);break;case s.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){h=a});m=a.operator+"("+this.ifDefined(h,0)+")";this.assign(b,m); -c(m);break;case s.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){h=a});m="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")";this.assign(b,m);c(m);break;case s.LogicalExpression:b=b||this.nextId();k.recurse(a.left,b);k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b));c(b);break;case s.ConditionalExpression:b=b||this.nextId();k.recurse(a.test, -b);k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b));c(b);break;case s.Identifier:b=b||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);Sa(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){e&&1!==e&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(b,k.nonComputedMember("s", -a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Jb(a.name))&&k.addEnsureSafeObject(b);c(b);break;case s.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();k.recurse(a.object,g,void 0,function(){k.if_(k.notNull(g),function(){e&&1!==e&&k.addEnsureSafeAssignContext(g);if(a.computed)h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),k.addEnsureSafeMemberName(h),e&&1!==e&&k.if_(k.not(k.computedMember(g,h)),k.lazyAssign(k.computedMember(g, -h),"{}")),m=k.ensureSafeObject(k.computedMember(g,h)),k.assign(b,m),d&&(d.computed=!0,d.name=h);else{Sa(a.property.name);e&&1!==e&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}"));m=k.nonComputedMember(g,a.property.name);if(k.state.expensiveChecks||Jb(a.property.name))m=k.ensureSafeObject(m);k.assign(b,m);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(b,"undefined")});c(b)},!!e);break;case s.CallExpression:b=b||this.nextId(); -a.filter?(h=k.filter(a.callee.name),l=[],q(a.arguments,function(a){var b=k.nextId();k.recurse(a,b);l.push(b)}),m=h+"("+l.join(",")+")",k.assign(b,m),c(b)):(h=k.nextId(),g={},l=[],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){k.addEnsureSafeFunction(h);q(a.arguments,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(k.ensureSafeObject(a))})});g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),m=k.member(g.context,g.name,g.computed)+"("+l.join(",")+")"):m= -h+"("+l.join(",")+")";m=k.ensureSafeObject(m);k.assign(b,m)},function(){k.assign(b,"undefined")});c(b)}));break;case s.AssignmentExpression:h=this.nextId();g={};if(!qd(a.left))throw X("lval");this.recurse(a.left,void 0,g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h);k.addEnsureSafeObject(k.member(g.context,g.name,g.computed));k.addEnsureSafeAssignContext(g.context);m=k.member(g.context,g.name,g.computed)+a.operator+h;k.assign(b,m);c(b||m)})},1);break;case s.ArrayExpression:l= -[];q(a.elements,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(a)})});m="["+l.join(",")+"]";this.assign(b,m);c(m);break;case s.ObjectExpression:l=[];n=!1;q(a.properties,function(a){a.computed&&(n=!0)});n?(b=b||this.nextId(),this.assign(b,"{}"),q(a.properties,function(a){a.computed?(g=k.nextId(),k.recurse(a.key,g)):g=a.key.type===s.Identifier?a.key.name:""+a.key.value;h=k.nextId();k.recurse(a.value,h);k.assign(k.member(b,g,a.computed),h)})):(q(a.properties,function(b){k.recurse(b.value, -a.constant?void 0:k.nextId(),void 0,function(a){l.push(k.escape(b.key.type===s.Identifier?b.key.name:""+b.key.value)+":"+a)})}),m="{"+l.join(",")+"}",this.assign(b,m));c(b||m);break;case s.ThisExpression:this.assign(b,"s");c("s");break;case s.LocalsExpression:this.assign(b,"l");c("l");break;case s.NGValueParameter:this.assign(b,"v"),c("v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]}, -assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"), -d(),c.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/[$_a-zA-Z][$_a-zA-Z0-9]*/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a), -";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+ -a+",text)"},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(G(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(T(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"=== -typeof a)return"undefined";throw X("esc");},nextId:function(a,b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};ud.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=b;V(c,d.$filter);var e,f;if(e=rd(c))f=this.recurse(e);e=pd(c.body);var g;e&&(g=[],q(e,function(a,b){var c=d.recurse(a);a.input=c;g.push(c);a.watchId=b}));var h=[];q(c.body,function(a){h.push(d.recurse(a.expression))}); -e=0===c.body.length?A:1===c.body.length?h[0]:function(a,b){var c;q(h,function(d){c=d(a,b)});return c};f&&(e.assign=function(a,b,c){return f(a,c,b)});g&&(e.inputs=g);e.literal=sd(c);e.constant=c.constant;return e},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,b);case s.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case s.BinaryExpression:return c=this.recurse(a.left), -e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case s.Identifier:return Sa(a.name,f.expression),f.identifier(a.name,f.expensiveChecks||Jb(a.name),b,d,f.expression);case s.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(Sa(a.property.name, -f.expression),e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d,f.expression):this.nonComputedMember(c,e,f.expensiveChecks,b,d,f.expression);case s.CallExpression:return g=[],q(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var n=[],p=0;p":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)|| -b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,name:void 0,value:a}:a}},identifier:function(a,b,d,c,e){return function(f,g,h,k){f=g&&a in g?g:f;c&&1!==c&&f&&!f[a]&&(f[a]={});g=f?f[a]:void 0;b&&ra(g,e);return d?{context:f,name:a,value:g}:g}},computedMember:function(a,b,d,c,e){return function(f,g,h,k){var l=a(f,g,h,k),m,n;null!=l&&(m=b(f, -g,h,k),m+="",Sa(m,e),c&&1!==c&&(Ib(l),l&&!l[m]&&(l[m]={})),n=l[m],ra(n,e));return d?{context:l,name:m,value:n}:n}},nonComputedMember:function(a,b,d,c,e,f){return function(g,h,k,l){g=a(g,h,k,l);e&&1!==e&&(Ib(g),g&&!g[b]&&(g[b]={}));h=null!=g?g[b]:void 0;(d||Jb(b))&&ra(h,f);return c?{context:g,name:b,value:h}:h}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};var kc=function(a,b,d){this.lexer=a;this.$filter=b;this.options=d;this.ast=new s(a,d);this.astCompiler=d.csp?new ud(this.ast, -b):new td(this.ast,b)};kc.prototype={constructor:kc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};var ng=Object.prototype.valueOf,sa=N("$sce"),la={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},pg=N("$compile"),$=C.document.createElement("a"),yd=Y(C.location.href);zd.$inject=["$document"];Mc.$inject=["$provide"];var Gd=22,Fd=".",mc="0";Ad.$inject=["$locale"];Cd.$inject=["$locale"];var Ag={yyyy:ba("FullYear",4,0,!1,!0),yy:ba("FullYear",2,0, -!0,!0),y:ba("FullYear",1,0,!1,!0),MMMM:kb("Month"),MMM:kb("Month",!0),MM:ba("Month",2,1),M:ba("Month",1,1),LLLL:kb("Month",!1,!0),dd:ba("Date",2),d:ba("Date",1),HH:ba("Hours",2),H:ba("Hours",1),hh:ba("Hours",2,-12),h:ba("Hours",1,-12),mm:ba("Minutes",2),m:ba("Minutes",1),ss:ba("Seconds",2),s:ba("Seconds",1),sss:ba("Milliseconds",3),EEEE:kb("Day"),EEE:kb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Kb(Math[0=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},zg=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,yg=/^\-?\d+$/;Bd.$inject=["$locale"];var tg=ha(Q),ug=ha(ub);Dd.$inject=["$parse"];var oe=ha({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===ma.call(b.prop("href"))? -"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),vb={};q(Eb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!=a){var c=Aa("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});vb[c]=function(){return{restrict:"A",priority:100,link:e}}}});q(bd,function(a,b){vb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"==e.ngPattern.charAt(0)&&(c=e.ngPattern.match(Cg))){e.$set("ngPattern", -new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});q(["src","srcset","href"],function(a){var b=Aa("ng-"+a);vb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===ma.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b),Ea&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Lb={$addControl:A,$$renameControl:function(a,b){a.$name=b},$removeControl:A,$setValidity:A, -$setDirty:A,$setPristine:A,$setSubmitted:A};Jd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Sd=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||A}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Jd,compile:function(d,f){d.addClass(Ua).addClass(ob);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var n=f[0];if(!("action"in e)){var p=function(b){a.$apply(function(){n.$commitViewValue(); -n.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",p,!1);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",p,!1)},0,!1)})}(f[1]||n.$$parentForm).$addControl(n);var q=g?c(n.$name):A;g&&(q(a,n),e.$observe(g,function(b){n.$name!==b&&(q(a,void 0),n.$$parentForm.$$renameControl(n,b),q=c(n.$name),q(a,n))}));d.on("$destroy",function(){n.$$parentForm.$removeControl(n);q(a,void 0);S(n,Lb)})}}}}}]},pe=Sd(),Ce=Sd(!0),Bg=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/, -Kg=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Lg=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,Mg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Td=/^(\d{4,})-(\d{2})-(\d{2})$/,Ud=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,rc=/^(\d{4,})-W(\d\d)$/,Vd=/^(\d{4,})-(\d\d)$/, -Wd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Ld=U();q(["date","datetime-local","month","time","week"],function(a){Ld[a]=!0});var Xd={text:function(a,b,d,c,e,f){lb(a,b,d,c,e,f);pc(c)},date:mb("date",Td,Nb(Td,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":mb("datetimelocal",Ud,Nb(Ud,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:mb("time",Wd,Nb(Wd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:mb("week",rc,function(a,b){if(da(a))return a;if(G(a)){rc.lastIndex=0;var d=rc.exec(a); -if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Hd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds());return new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:mb("month",Vd,Nb(Vd,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Md(a,b,d,c);lb(a,b,d,c,e,f);c.$$parserName="number";c.$parsers.push(function(a){if(c.$isEmpty(a))return null;if(Mg.test(a))return parseFloat(a)});c.$formatters.push(function(a){if(!c.$isEmpty(a)){if(!T(a))throw nb("numfmt", -a);a=a.toString()}return a});if(w(d.min)||d.ngMin){var g;c.$validators.min=function(a){return c.$isEmpty(a)||y(g)||a>=g};d.$observe("min",function(a){w(a)&&!T(a)&&(a=parseFloat(a));g=T(a)&&!isNaN(a)?a:void 0;c.$validate()})}if(w(d.max)||d.ngMax){var h;c.$validators.max=function(a){return c.$isEmpty(a)||y(h)||a<=h};d.$observe("max",function(a){w(a)&&!T(a)&&(a=parseFloat(a));h=T(a)&&!isNaN(a)?a:void 0;c.$validate()})}},url:function(a,b,d,c,e,f){lb(a,b,d,c,e,f);pc(c);c.$$parserName="url";c.$validators.url= -function(a,b){var d=a||b;return c.$isEmpty(d)||Kg.test(d)}},email:function(a,b,d,c,e,f){lb(a,b,d,c,e,f);pc(c);c.$$parserName="email";c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||Lg.test(d)}},radio:function(a,b,d,c){y(d.name)&&b.attr("name",++pb);b.on("click",function(a){b[0].checked&&c.$setViewValue(d.value,a&&a.type)});c.$render=function(){b[0].checked=d.value==c.$viewValue};d.$observe("value",c.$render)},checkbox:function(a,b,d,c,e,f,g,h){var k=Nd(h,a,"ngTrueValue",d.ngTrueValue, -!0),l=Nd(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return na(a,k)});c.$parsers.push(function(a){return a?k:l})},hidden:A,button:A,submit:A,reset:A,file:A},Gc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(Xd[Q(g.type)]||Xd.text)(e,f, -g,h[0],b,a,d,c)}}}}],Ng=/^(true|false|\d+)$/,Ue=function(){return{restrict:"A",priority:100,compile:function(a,b){return Ng.test(b.ngValue)?function(a,b,e){e.$set("value",a.$eval(e.ngValue))}:function(a,b,e){a.$watch(e.ngValue,function(a){e.$set("value",a)})}}}},ue=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=y(a)?"":a})}}}}],we=["$interpolate","$compile", -function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=y(a)?"":a})}}}}],ve=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){var d= -f(b);c.html(a.getTrustedHtml(d)||"")})}}}}],Te=ha({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),xe=qc("",!0),ze=qc("Odd",0),ye=qc("Even",1),Ae=Ta({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Be=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Lc={},Og={blur:!0,focus:!0};q("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "), -function(a){var b=Aa("ng-"+a);Lc[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g=d(f[b],null,!0);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};Og[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var Ee=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var h,k,l;d.$watch(e.ngIf,function(d){d?k||g(function(d,f){k=f;d[d.length++]= -b.$$createComment("end ngIf",e.ngIf);h={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),k&&(k.$destroy(),k=null),h&&(l=tb(h.clone),a.leave(l).then(function(){l=null}),h=null))})}}}],Fe=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ca.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,m,n,p){var q=0,s,B,r,y=function(){B&&(B.remove(),B=null);s&& -(s.$destroy(),s=null);r&&(d.leave(r).then(function(){B=null}),B=r,r=null)};c.$watch(f,function(f){var m=function(){!w(h)||h&&!c.$eval(h)||b()},t=++q;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&t===q){var b=c.$new();n.template=a;a=p(b,function(a){y();d.enter(a,null,e).then(m)});s=b;r=a;s.$emit("$includeContentLoaded",f);c.$eval(g)}},function(){c.$$destroyed||t!==q||(y(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(y(),n.template=null)})}}}}],We=["$compile",function(a){return{restrict:"ECA", -priority:-400,require:"ngInclude",link:function(b,d,c,e){ma.call(d[0]).match(/SVG/)?(d.empty(),a(Oc(e.template,C.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Ge=Ta({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),Se=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=b.attr(d.$attr.ngList)||", ",f="false"!==d.ngTrim,g=f?W(e):e;c.$parsers.push(function(a){if(!y(a)){var b= -[];a&&q(a.split(g),function(a){a&&b.push(f?W(a):a)});return b}});c.$formatters.push(function(a){if(L(a))return a.join(e)});c.$isEmpty=function(a){return!a||!a.length}}}},ob="ng-valid",Od="ng-invalid",Ua="ng-pristine",Mb="ng-dirty",Qd="ng-pending",nb=N("ngModel"),Pg=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,b,d,c,e,f,g,h,k,l){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={}; -this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=void 0;this.$name=l(d.name||"",!1)(a);this.$$parentForm=Lb;var m=e(d.ngModel),n=m.assign,p=m,u=n,s=null,B,r=this;this.$$setOptions=function(a){if((r.$options=a)&&a.getterSetter){var b=e(d.ngModel+"()"),f=e(d.ngModel+"($$$p)");p=function(a){var c=m(a);z(c)&&(c=b(a)); -return c};u=function(a,b){z(m(a))?f(a,{$$$p:b}):n(a,b)}}else if(!m.assign)throw nb("nonassign",d.ngModel,ya(c));};this.$render=A;this.$isEmpty=function(a){return y(a)||""===a||null===a||a!==a};this.$$updateEmptyClasses=function(a){r.$isEmpty(a)?(f.removeClass(c,"ng-not-empty"),f.addClass(c,"ng-empty")):(f.removeClass(c,"ng-empty"),f.addClass(c,"ng-not-empty"))};var J=0;Kd({ctrl:this,$element:c,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]},$animate:f});this.$setPristine=function(){r.$dirty= -!1;r.$pristine=!0;f.removeClass(c,Mb);f.addClass(c,Ua)};this.$setDirty=function(){r.$dirty=!0;r.$pristine=!1;f.removeClass(c,Ua);f.addClass(c,Mb);r.$$parentForm.$setDirty()};this.$setUntouched=function(){r.$touched=!1;r.$untouched=!0;f.setClass(c,"ng-untouched","ng-touched")};this.$setTouched=function(){r.$touched=!0;r.$untouched=!1;f.setClass(c,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){g.cancel(s);r.$viewValue=r.$$lastCommittedViewValue;r.$render()};this.$validate=function(){if(!T(r.$modelValue)|| -!isNaN(r.$modelValue)){var a=r.$$rawModelValue,b=r.$valid,c=r.$modelValue,d=r.$options&&r.$options.allowInvalid;r.$$runValidators(a,r.$$lastCommittedViewValue,function(e){d||b===e||(r.$modelValue=e?a:void 0,r.$modelValue!==c&&r.$$writeModelToScope())})}};this.$$runValidators=function(a,b,c){function d(){var c=!0;q(r.$validators,function(d,e){var g=d(a,b);c=c&&g;f(e,g)});return c?!0:(q(r.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;q(r.$asyncValidators,function(e,g){var h= -e(a,b);if(!h||!z(h.then))throw nb("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?k.all(c).then(function(){g(d)},A):g(!0)}function f(a,b){h===J&&r.$setValidity(a,b)}function g(a){h===J&&c(a)}J++;var h=J;(function(){var a=r.$$parserName||"parse";if(y(B))f(a,null);else return B||(q(r.$validators,function(a,b){f(b,null)}),q(r.$asyncValidators,function(a,b){f(b,null)})),f(a,B),B;return!0})()?d()?e():g(!1):g(!1)};this.$commitViewValue=function(){var a= -r.$viewValue;g.cancel(s);if(r.$$lastCommittedViewValue!==a||""===a&&r.$$hasNativeValidators)r.$$updateEmptyClasses(a),r.$$lastCommittedViewValue=a,r.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var b=r.$$lastCommittedViewValue;if(B=y(b)?void 0:!0)for(var c=0;ce||c.$isEmpty(b)||b.length<=e}}}}},Jc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=Z(a)||0;c.$validate()});c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};C.angular.bootstrap? -C.console&&console.log("WARNING: Tried to load angular more than once."):(je(),le(ca),ca.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "), -SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",", -PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),F(C.document).ready(function(){fe(C.document,Bc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend(''); -//# sourceMappingURL=angular.min.js.map diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular.min.js.gzip b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular.min.js.gzip deleted file mode 100644 index dc10f045a8..0000000000 Binary files a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular.min.js.gzip and /dev/null differ diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular.min.js.map b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/angular.min.js.map deleted file mode 100644 index fab63263f3..0000000000 --- a/jhipster/jhip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AA6gF,KAAvB,CAAAllB,QAAA,CAA8C,gRAA9C;", -"sources":["angular.js"], -"names":["window","minErr","isArrayLike","obj","isWindow","isArray","isString","jqLite","length","Object","isNumber","Array","item","forEach","iterator","context","key","isFunction","hasOwnProperty","call","isPrimitive","isBlankObject","forEachSorted","keys","sort","i","reverseParams","iteratorFn","value","nextUid","uid","baseExtend","dst","objs","deep","h","$$hashKey","ii","isObject","j","jj","src","isDate","Date","valueOf","isRegExp","RegExp","nodeName","cloneNode","isElement","clone","extend","slice","arguments","merge","toInt","str","parseInt","inherit","parent","extra","create","noop","identity","$","valueFn","valueRef","hasCustomToString","toString","isUndefined","isDefined","getPrototypeOf","isScope","$evalAsync","$watch","isBoolean","isTypedArray","TYPED_ARRAY_REGEXP","test","node","prop","attr","find","makeMap","items","split","nodeName_","element","lowercase","arrayRemove","array","index","indexOf","splice","copy","source","destination","copyRecurse","push","copyElement","stackSource","stackDest","ngMinErr","needsRecurse","copyType","undefined","constructor","buffer","byteOffset","copied","ArrayBuffer","byteLength","set","Uint8Array","re","match","lastIndex","type","equals","o1","o2","t1","t2","getTime","keySet","createMap","charAt","concat","array1","array2","bind","self","fn","curryArgs","startIndex","apply","toJsonReplacer","val","document","toJson","pretty","JSON","stringify","fromJson","json","parse","timezoneToOffset","timezone","fallback","replace","ALL_COLONS","requestedTimezoneOffset","isNaN","convertTimezoneToLocal","date","reverse","dateTimezoneOffset","getTimezoneOffset","timezoneOffset","setMinutes","getMinutes","minutes","startingTag","empty","e","elemHtml","append","html","nodeType","NODE_TYPE_TEXT","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","splitPoint","substring","toKeyValue","parts","arrayValue","encodeUriQuery","join","encodeUriSegment","pctEncodeSpaces","encodeURIComponent","getNgAttribute","ngAttr","ngAttrPrefixes","getAttribute","angularInit","bootstrap","appElement","module","config","prefix","name","hasAttribute","candidate","querySelector","strictDi","modules","defaultConfig","doBootstrap","injector","tag","unshift","$provide","debugInfoEnabled","$compileProvider","createInjector","invoke","bootstrapApply","scope","compile","$apply","data","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","angular","resumeBootstrap","angular.resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","location","reload","getTestability","rootElement","get","snake_case","separator","SNAKE_CASE_REGEXP","letter","pos","toLowerCase","bindJQuery","originalCleanData","bindJQueryFired","jqName","jq","jQuery","on","JQLitePrototype","isolateScope","controller","inheritedData","cleanData","jQuery.cleanData","elems","events","elem","_data","$destroy","triggerHandler","JQLite","assertArg","arg","reason","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","getter","path","bindFnToScope","lastInstance","len","getBlockNodes","nodes","endNode","blockNodes","nextSibling","setupModuleLoader","ensure","factory","$injectorMinErr","$$minErr","requires","configFn","invokeLater","provider","method","insertMethod","queue","invokeQueue","moduleInstance","invokeLaterAndSetModuleName","recipeName","factoryFunction","$$moduleName","configBlocks","runBlocks","_invokeQueue","_configBlocks","_runBlocks","service","constant","decorator","animation","filter","directive","component","run","block","shallowCopy","publishExternalAPI","version","uppercase","$$counter","csp","angularModule","ngModule","$$sanitizeUri","$$SanitizeUriProvider","$CompileProvider","a","htmlAnchorDirective","input","inputDirective","textarea","form","formDirective","script","scriptDirective","select","selectDirective","style","styleDirective","option","optionDirective","ngBind","ngBindDirective","ngBindHtml","ngBindHtmlDirective","ngBindTemplate","ngBindTemplateDirective","ngClass","ngClassDirective","ngClassEven","ngClassEvenDirective","ngClassOdd","ngClassOddDirective","ngCloak","ngCloakDirective","ngController","ngControllerDirective","ngForm","ngFormDirective","ngHide","ngHideDirective","ngIf","ngIfDirective","ngInclude","ngIncludeDirective","ngInit","ngInitDirective","ngNonBindable","ngNonBindableDirective","ngPluralize","ngPluralizeDirective","ngRepeat","ngRepeatDirective","ngShow","ngShowDirective","ngStyle","ngStyleDirective","ngSwitch","ngSwitchDirective","ngSwitchWhen","ngSwitchWhenDirective","ngSwitchDefault","ngSwitchDefaultDirective","ngOptions","ngOptionsDirective","ngTransclude","ngTranscludeDirective","ngModel","ngModelDirective","ngList","ngListDirective","ngChange","ngChangeDirective","pattern","patternDirective","ngPattern","required","requiredDirective","ngRequired","minlength","minlengthDirective","ngMinlength","maxlength","maxlengthDirective","ngMaxlength","ngValue","ngValueDirective","ngModelOptions","ngModelOptionsDirective","ngIncludeFillContentDirective","ngAttributeAliasDirectives","ngEventDirectives","$anchorScroll","$AnchorScrollProvider","$animate","$AnimateProvider","$animateCss","$CoreAnimateCssProvider","$$animateJs","$$CoreAnimateJsProvider","$$animateQueue","$$CoreAnimateQueueProvider","$$AnimateRunner","$$AnimateRunnerFactoryProvider","$$animateAsyncRun","$$AnimateAsyncRunFactoryProvider","$browser","$BrowserProvider","$cacheFactory","$CacheFactoryProvider","$controller","$ControllerProvider","$document","$DocumentProvider","$exceptionHandler","$ExceptionHandlerProvider","$filter","$FilterProvider","$$forceReflow","$$ForceReflowProvider","$interpolate","$InterpolateProvider","$interval","$IntervalProvider","$http","$HttpProvider","$httpParamSerializer","$HttpParamSerializerProvider","$httpParamSerializerJQLike","$HttpParamSerializerJQLikeProvider","$httpBackend","$HttpBackendProvider","$xhrFactory","$xhrFactoryProvider","$jsonpCallbacks","$jsonpCallbacksProvider","$location","$LocationProvider","$log","$LogProvider","$parse","$ParseProvider","$rootScope","$RootScopeProvider","$q","$QProvider","$$q","$$QProvider","$sce","$SceProvider","$sceDelegate","$SceDelegateProvider","$sniffer","$SnifferProvider","$templateCache","$TemplateCacheProvider","$templateRequest","$TemplateRequestProvider","$$testability","$$TestabilityProvider","$timeout","$TimeoutProvider","$window","$WindowProvider","$$rAF","$$RAFProvider","$$jqLite","$$jqLiteProvider","$$HashMap","$$HashMapProvider","$$cookieReader","$$CookieReaderProvider","camelCase","SPECIAL_CHARS_REGEXP","_","offset","toUpperCase","MOZ_HACK_REGEXP","jqLiteAcceptsData","NODE_TYPE_ELEMENT","NODE_TYPE_DOCUMENT","jqLiteBuildFragment","tmp","fragment","createDocumentFragment","HTML_REGEXP","appendChild","createElement","TAG_NAME_REGEXP","exec","wrap","wrapMap","_default","innerHTML","XHTML_TAG_REGEXP","lastChild","childNodes","firstChild","textContent","createTextNode","jqLiteWrapNode","wrapper","parentNode","replaceChild","argIsString","trim","jqLiteMinErr","parsed","SINGLE_TAG_REGEXP","jqLiteAddNodes","jqLiteClone","jqLiteDealoc","onlyDescendants","jqLiteRemoveData","querySelectorAll","descendants","l","jqLiteOff","unsupported","expandoStore","jqLiteExpandoStore","handle","removeHandler","listenerFns","removeEventListener","MOUSE_EVENT_MAP","expandoId","ng339","jqCache","createIfNecessary","jqId","jqLiteData","isSimpleSetter","isSimpleGetter","massGetter","jqLiteHasClass","selector","jqLiteRemoveClass","cssClasses","setAttribute","cssClass","jqLiteAddClass","existingClasses","root","elements","jqLiteController","jqLiteInheritedData","documentElement","names","NODE_TYPE_DOCUMENT_FRAGMENT","host","jqLiteEmpty","removeChild","jqLiteRemove","keepData","jqLiteDocumentLoaded","action","win","readyState","setTimeout","getBooleanAttrName","booleanAttr","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","createEventHandler","eventHandler","event","isDefaultPrevented","event.isDefaultPrevented","defaultPrevented","eventFns","eventFnsLength","immediatePropagationStopped","originalStopImmediatePropagation","stopImmediatePropagation","event.stopImmediatePropagation","stopPropagation","isImmediatePropagationStopped","event.isImmediatePropagationStopped","handlerWrapper","specialHandlerWrapper","defaultHandlerWrapper","handler","specialMouseHandlerWrapper","target","related","relatedTarget","jqLiteContains","$get","this.$get","hasClass","classes","addClass","removeClass","hashKey","nextUidFn","objType","HashMap","isolatedUid","this.nextUid","put","extractArgs","fnText","Function","prototype","STRIP_COMMENTS","ARROW_ARG","FN_ARGS","anonFn","args","modulesToLoad","supportObject","delegate","provider_","providerInjector","instantiate","providerCache","providerSuffix","enforceReturnValue","enforcedReturnValue","result","instanceInjector","factoryFn","enforce","loadModules","moduleFn","runInvokeQueue","invokeArgs","loadedModules","message","stack","createInternalInjector","cache","getService","serviceName","caller","INSTANTIATING","err","shift","injectionArgs","locals","$inject","$$annotate","msie","Type","ctor","annotate","has","$injector","instanceCache","decorFn","origProvider","orig$get","origProvider.$get","origInstance","$delegate","protoInstanceInjector","autoScrollingEnabled","disableAutoScrolling","this.disableAutoScrolling","getFirstAnchor","list","some","scrollTo","scrollIntoView","scroll","yOffset","getComputedStyle","position","getBoundingClientRect","bottom","elemTop","top","scrollBy","hash","elm","getElementById","getElementsByName","autoScrollWatch","autoScrollWatchAction","newVal","oldVal","mergeClasses","b","splitClasses","klass","prepareAnimateOptions","options","Browser","completeOutstandingRequest","outstandingRequestCount","outstandingRequestCallbacks","pop","error","cacheStateAndFireUrlChange","pendingLocation","cacheState","fireUrlChange","cachedState","getCurrentState","lastCachedState","lastBrowserUrl","url","lastHistoryState","urlChangeListeners","listener","history","clearTimeout","pendingDeferIds","isMock","$$completeOutstandingRequest","$$incOutstandingRequestCount","self.$$incOutstandingRequestCount","notifyWhenNoOutstandingRequests","self.notifyWhenNoOutstandingRequests","callback","href","baseElement","state","self.url","sameState","sameBase","stripHash","substr","self.state","urlChangeInit","onUrlChange","self.onUrlChange","$$applicationDestroyed","self.$$applicationDestroyed","off","$$checkUrlChange","baseHref","self.baseHref","defer","self.defer","delay","timeoutId","cancel","self.defer.cancel","deferId","cacheFactory","cacheId","refresh","entry","freshEnd","staleEnd","n","link","p","nextEntry","prevEntry","caches","size","stats","id","capacity","Number","MAX_VALUE","lruHash","lruEntry","remove","removeAll","destroy","info","cacheFactory.info","cacheFactory.get","$$sanitizeUriProvider","parseIsolateBindings","directiveName","isController","LOCAL_REGEXP","bindings","definition","scopeName","bindingCache","$compileMinErr","mode","collection","optional","attrName","assertValidDirectiveName","getDirectiveRequire","require","REQUIRE_PREFIX_REGEXP","hasDirectives","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","ALL_OR_NOTHING_ATTRS","EVENT_HANDLER_ATTR_REGEXP","this.directive","registerDirective","directiveFactory","Suffix","directives","priority","restrict","this.component","makeInjectable","tElement","tAttrs","$element","$attrs","template","templateUrl","ddo","controllerAs","identifierForController","transclude","bindToController","aHrefSanitizationWhitelist","this.aHrefSanitizationWhitelist","regexp","imgSrcSanitizationWhitelist","this.imgSrcSanitizationWhitelist","this.debugInfoEnabled","enabled","TTL","onChangesTtl","this.onChangesTtl","flushOnChangesQueue","onChangesQueue","errors","Attributes","attributesToCopy","$attr","$$element","setSpecialAttr","specialAttrHolder","attributes","attribute","removeNamedItem","setNamedItem","safeAddClass","className","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","NOT_EMPTY","domNode","nodeValue","compositeLinkFn","compileNodes","$$addScopeClass","namespace","publicLinkFn","cloneConnectFn","needsNewScope","$parent","$new","parentBoundTranscludeFn","transcludeControllers","futureParentElement","$$boundTransclude","$linkNode","wrapTemplate","controllerName","instance","$$addScopeInfo","nodeList","$rootElement","childLinkFn","childScope","childBoundTranscludeFn","stableNodeList","nodeLinkFnFound","linkFns","idx","nodeLinkFn","transcludeOnThisElement","createBoundTranscludeFn","templateOnThisElement","attrs","linkFnFound","collectDirectives","applyDirectivesToNode","terminal","previousBoundTranscludeFn","boundTranscludeFn","transcludedScope","cloneFn","controllers","containingScope","$$transcluded","boundSlots","$$slots","slotName","attrsMap","addDirective","directiveNormalize","isNgAttr","nAttrs","attrStartName","attrEndName","ngAttrName","NG_ATTR_BINDING","PREFIX_REGEXP","multiElementMatch","MULTI_ELEMENT_DIR_RE","directiveIsMultiElement","nName","addAttrInterpolateDirective","animVal","addTextInterpolateDirective","NODE_TYPE_COMMENT","collectCommentDirectives","byPriority","groupScan","attrStart","attrEnd","depth","groupElementsLinkFnWrapper","linkFn","groupedElementsLink","compilationGenerator","eager","compiled","lazyCompilation","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","addLinkFns","pre","post","newIsolateScopeDirective","$$isolateScope","cloneAndAnnotateFn","linkNode","controllersBoundTransclude","cloneAttachFn","hasElementTranscludeDirective","elementControllers","slotTranscludeFn","scopeToChild","controllerScope","newScopeDirective","isSlotFilled","transcludeFn.isSlotFilled","controllerDirectives","setupControllers","templateDirective","$$originalDirective","$$isolateBindings","scopeBindingInfo","initializeDirectiveBindings","removeWatches","$on","controllerDirective","$$bindings","bindingInfo","identifier","controllerResult","getControllers","controllerInstance","$onChanges","initialChanges","$onInit","$doCheck","$onDestroy","callOnDestroyHook","invokeLinkFn","$postLink","terminalPriority","nonTlbTranscludeDirective","hasTranscludeDirective","hasTemplate","$compileNode","$template","childTranscludeFn","didScanForMultipleTransclusion","mightHaveMultipleTransclusionError","directiveValue","$$start","$$end","assertNoDuplicate","$$tlb","scanningIndex","candidateDirective","$$createComment","replaceWith","$$parentNode","replaceDirective","slots","contents","slotMap","filledSlots","elementSelector","filled","$$newScope","denormalizeTemplate","removeComments","templateNamespace","newTemplateAttrs","templateDirectives","unprocessedDirectives","markDirectiveScope","mergeTemplateAttributes","compileTemplateUrl","Math","max","inheritType","dataName","property","controllerKey","$scope","$transclude","newScope","tDirectives","startAttrName","endAttrName","multiElement","srcAttr","dstAttr","$set","linkQueue","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","then","content","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","$$destroyed","oldClasses","delayedNodeLinkFn","ignoreChildLinkFn","diff","what","previousDirective","wrapModuleNameIfDefined","moduleName","text","interpolateFn","textInterpolateCompileFn","templateNode","templateNodeParent","hasCompileParent","$$addBindingClass","textInterpolateLinkFn","$$addBindingInfo","expressions","interpolateFnWatchAction","getTrustedContext","attrNormalizedName","HTML","RESOURCE_URL","allOrNothing","trustedContext","attrInterpolatePreLinkFn","$$observers","newValue","$$inter","$$scope","oldValue","$updateClass","elementsToRemove","newNode","firstElementToRemove","removeCount","j2","hasData","annotation","recordChanges","currentValue","previousValue","$$postDigest","changes","triggerOnChangesHook","SimpleChange","removeWatchCollection","initializeBinding","lastValue","parentGet","parentSet","compare","$observe","_UNINITIALIZED_VALUE","literal","assign","parentValueWatch","parentValue","$stateful","removeWatch","$watchCollection","initialValue","parentValueWatchAction","SIMPLE_ATTR_NAME","$normalize","$addClass","classVal","$removeClass","newClasses","toAdd","tokenDifference","toRemove","writeAttr","booleanKey","aliasedKey","ALIASED_ATTR","observer","trimmedSrcset","srcPattern","rawUris","nbrUrisWith2parts","floor","innerIdx","lastTuple","removeAttr","listeners","startSymbol","endSymbol","binding","isolated","noTemplate","compile.$$createComment","comment","createComment","previous","current","str1","str2","values","tokens1","tokens2","token","jqNodes","ident","CNTRL_REG","globals","this.has","register","this.register","allowGlobals","this.allowGlobals","addIdentifier","expression","later","$controllerMinErr","controllerPrototype","$controllerInit","exception","cause","serializeValue","v","toISOString","ngParamSerializer","params","jQueryLikeParamSerializer","serialize","toSerialize","topLevel","defaultHttpResponseTransform","headers","tempData","JSON_PROTECTION_PREFIX","contentType","jsonStart","JSON_START","JSON_ENDS","parseHeaders","line","headerVal","headerKey","headersGetter","headersObj","transformData","status","fns","defaults","transformResponse","transformRequest","d","common","CONTENT_TYPE_APPLICATION_JSON","patch","xsrfCookieName","xsrfHeaderName","paramSerializer","useApplyAsync","this.useApplyAsync","useLegacyPromise","useLegacyPromiseExtensions","this.useLegacyPromiseExtensions","interceptorFactories","interceptors","requestConfig","chainInterceptors","promise","thenFn","rejectFn","executeHeaderFns","headerContent","processedHeaders","headerFn","header","response","resp","reject","mergeHeaders","defHeaders","reqHeaders","defHeaderName","lowercaseDefHeaderName","reqHeaderName","requestInterceptors","responseInterceptors","when","reversedInterceptors","interceptor","request","requestError","responseError","serverRequest","reqData","withCredentials","sendReq","success","promise.success","promise.error","$httpMinErrLegacyFn","createApplyHandlers","eventHandlers","applyHandlers","callEventHandler","$applyAsync","$$phase","done","headersString","statusText","resolveHttpPromise","resolvePromise","deferred","resolve","resolvePromiseWithResult","removePendingReq","pendingRequests","cachedResp","buildUrl","defaultCache","xsrfValue","urlIsSameOrigin","timeout","responseType","uploadEventHandlers","serializedParams","interceptorFactory","createShortMethods","createShortMethodsWithData","createXhr","XMLHttpRequest","createHttpBackend","$browserDefer","callbacks","rawDocument","jsonpReq","callbackPath","async","body","wasCalled","addEventListener","timeoutRequest","jsonpDone","xhr","abort","completeRequest","createCallback","getResponse","removeCallback","open","setRequestHeader","onload","xhr.onload","responseText","urlResolve","protocol","getAllResponseHeaders","onerror","onabort","upload","send","this.startSymbol","this.endSymbol","escape","ch","unescapeText","escapedStartRegexp","escapedEndRegexp","constantWatchDelegate","objectEquality","constantInterp","unwatch","constantInterpolateWatch","mustHaveExpression","parseStringifyInterceptor","getTrusted","$interpolateMinErr","interr","unescapedText","exp","$$watchDelegate","endIndex","parseFns","textLength","expressionPositions","startSymbolLength","endSymbolLength","throwNoconcat","compute","interpolationFn","$watchGroup","interpolateFnWatcher","oldValues","currValue","$interpolate.startSymbol","$interpolate.endSymbol","interval","count","invokeApply","hasParams","iteration","setInterval","clearInterval","skipApply","$$intervalId","tick","notify","intervals","interval.cancel","encodePath","segments","parseAbsoluteUrl","absoluteUrl","locationObj","parsedUrl","$$protocol","$$host","hostname","$$port","port","DEFAULT_PORTS","parseAppUrl","relativeUrl","prefixed","$$path","pathname","$$search","search","$$hash","stripBaseUrl","base","lastIndexOf","trimEmptyHash","LocationHtml5Url","appBase","appBaseNoFile","basePrefix","$$html5","$$parse","this.$$parse","pathUrl","$locationMinErr","$$compose","this.$$compose","$$url","$$absUrl","$$parseLinkUrl","this.$$parseLinkUrl","relHref","appUrl","prevAppUrl","rewrittenUrl","LocationHashbangUrl","hashPrefix","withoutBaseUrl","withoutHashUrl","windowsFilePathExp","firstPathSegmentMatch","LocationHashbangInHtml5Url","locationGetter","locationGetterSetter","preprocess","html5Mode","requireBase","rewriteLinks","this.hashPrefix","this.html5Mode","setBrowserUrlWithFallback","oldUrl","oldState","$$state","afterLocationChange","$broadcast","absUrl","LocationMode","initialUrl","IGNORE_URI_REGEXP","ctrlKey","metaKey","shiftKey","which","button","absHref","preventDefault","initializing","newUrl","newState","$digest","$locationWatch","currentReplace","$$replace","urlOrStateChanged","debug","debugEnabled","this.debugEnabled","flag","formatError","Error","sourceURL","consoleLog","console","logFn","log","hasApply","arg1","arg2","warn","ensureSafeMemberName","fullExpression","$parseMinErr","getStringValue","ensureSafeObject","children","ensureSafeFunction","CALL","APPLY","BIND","ensureSafeAssignContext","ifDefined","plusFn","r","findConstantAndWatchExpressions","ast","allConstants","argsToWatch","AST","Program","expr","Literal","toWatch","UnaryExpression","argument","BinaryExpression","left","right","LogicalExpression","ConditionalExpression","alternate","consequent","Identifier","MemberExpression","object","computed","CallExpression","callee","AssignmentExpression","ArrayExpression","ObjectExpression","properties","ThisExpression","LocalsExpression","getInputs","lastExpression","isAssignable","assignableAST","NGValueParameter","operator","isLiteral","ASTCompiler","astBuilder","ASTInterpreter","isPossiblyDangerousMemberName","getValueOf","objectValueOf","cacheDefault","cacheExpensive","literals","identStart","identContinue","addLiteral","this.addLiteral","literalName","literalValue","setIdentifierFns","this.setIdentifierFns","identifierStart","identifierContinue","interceptorFn","expensiveChecks","parsedExpression","oneTime","cacheKey","runningChecksEnabled","parseOptions","$parseOptionsExpensive","$parseOptions","lexer","Lexer","parser","Parser","oneTimeLiteralWatchDelegate","oneTimeWatchDelegate","inputs","inputsWatchDelegate","expensiveChecksInterceptor","addInterceptor","expensiveCheckFn","expensiveCheckOldValue","expressionInputDirtyCheck","oldValueOfValue","prettyPrintExpression","inputExpressions","lastResult","oldInputValueOf","expressionInputWatch","newInputValue","oldInputValueOfValues","oldInputValues","expressionInputsWatch","changed","oneTimeWatch","oneTimeListener","old","isAllDefined","allDefined","constantWatch","watchDelegate","useInputs","regularInterceptedExpression","oneTimeInterceptedExpression","noUnsafeEval","isIdentifierStart","isIdentifierContinue","$$runningExpensiveChecks","$parse.$$runningExpensiveChecks","qFactory","nextTick","exceptionHandler","Promise","simpleBind","scheduleProcessQueue","processScheduled","pending","Deferred","$qMinErr","TypeError","onFulfilled","onRejected","progressBack","catch","finally","handleCallback","$$reject","$$resolve","that","rejectPromise","progress","makePromise","resolved","isResolved","callbackOutput","errback","$Q","resolver","resolveFn","all","promises","counter","results","race","requestAnimationFrame","webkitRequestAnimationFrame","cancelAnimationFrame","webkitCancelAnimationFrame","webkitCancelRequestAnimationFrame","rafSupported","raf","timer","supported","createChildScopeClass","ChildScope","$$watchers","$$nextSibling","$$childHead","$$childTail","$$listeners","$$listenerCount","$$watchersCount","$id","$$ChildScope","$rootScopeMinErr","lastDirtyWatch","applyAsyncId","digestTtl","this.digestTtl","destroyChildScope","$event","currentScope","cleanUpScope","$$prevSibling","$root","Scope","beginPhase","phase","incrementWatchersCount","decrementListenerCount","initWatchVal","flushApplyAsync","applyAsyncQueue","scheduleApplyAsync","isolate","child","watchExp","watcher","last","eq","deregisterWatch","watchExpressions","watchGroupAction","changeReactionScheduled","firstRun","newValues","deregisterFns","shouldCall","deregisterWatchGroup","unwatchFn","watchGroupSubAction","$watchCollectionInterceptor","_value","bothNaN","newItem","oldItem","internalArray","oldLength","changeDetected","newLength","internalObject","veryOldValue","trackVeryOldValue","changeDetector","initRun","$watchCollectionAction","watch","watchers","dirty","ttl","watchLog","logIdx","asyncTask","asyncQueuePosition","asyncQueue","$eval","msg","next","postDigestQueuePosition","postDigestQueue","eventName","this.$watchGroup","$applyAsyncExpression","namedListeners","indexOfListener","$emit","targetScope","listenerArgs","$$asyncQueue","$$postDigestQueue","$$applyAsyncQueue","sanitizeUri","uri","isImage","regex","normalizedVal","adjustMatcher","matcher","$sceMinErr","escapeForRegexp","adjustMatchers","matchers","adjustedMatchers","SCE_CONTEXTS","resourceUrlWhitelist","resourceUrlBlacklist","this.resourceUrlWhitelist","this.resourceUrlBlacklist","matchUrl","generateHolderType","Base","holderType","trustedValue","$$unwrapTrustedValue","this.$$unwrapTrustedValue","holderType.prototype.valueOf","holderType.prototype.toString","htmlSanitizer","trustedValueHolderBase","byType","CSS","URL","JS","trustAs","Constructor","maybeTrusted","allowed","this.enabled","sce","isEnabled","sce.isEnabled","sce.getTrusted","parseAs","sce.parseAs","enumValue","lName","eventSupport","hasHistoryPushState","chrome","app","runtime","pushState","android","userAgent","navigator","boxee","vendorPrefix","vendorRegex","bodyStyle","transitions","animations","webkitTransition","webkitAnimation","hasEvent","divElm","httpOptions","this.httpOptions","handleRequestFn","tpl","ignoreRequestError","totalPendingRequests","getTrustedResourceUrl","transformer","handleError","$templateRequestMinErr","testability","testability.findBindings","opt_exactMatch","getElementsByClassName","matches","dataBinding","bindingName","testability.findModels","prefixes","attributeEquals","testability.getLocation","testability.setLocation","testability.whenStable","deferreds","$$timeoutId","timeout.cancel","urlParsingNode","requestUrl","originUrl","$$CookieReader","safeDecodeURIComponent","lastCookies","lastCookieString","cookieArray","cookie","currentCookieString","filters","suffix","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comparator","anyPropertyKey","matchAgainstAnyProp","getTypeForFilter","expressionType","predicateFn","createPredicateFn","shouldMatchPrimitives","actual","expected","deepCompare","dontMatchWholeObject","actualType","expectedType","expectedVal","matchAnyProperty","actualVal","$locale","formats","NUMBER_FORMATS","amount","currencySymbol","fractionSize","CURRENCY_SYM","PATTERNS","maxFrac","formatNumber","GROUP_SEP","DECIMAL_SEP","number","numStr","exponent","digits","numberOfIntegerDigits","zeros","ZERO_CHAR","MAX_DIGITS","roundNumber","parsedNumber","minFrac","fractionLen","min","roundAt","digit","k","carry","reduceRight","groupSep","decimalSep","isInfinity","isFinite","isZero","abs","formattedText","integerLen","decimals","reduce","groups","lgSize","gSize","negPre","negSuf","posPre","posSuf","padNumber","num","negWrap","neg","dateGetter","dateStrGetter","shortForm","standAlone","getFirstThursdayOfYear","year","dayOfWeekOnFirst","getDay","weekGetter","firstThurs","getFullYear","thisThurs","getMonth","getDate","round","eraGetter","ERAS","jsonStringToDate","string","R_ISO8601_STR","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","m","s","ms","parseFloat","format","DATETIME_FORMATS","NUMBER_STRING","DATE_FORMATS_SPLIT","DATE_FORMATS","spacing","limit","begin","Infinity","sliceFn","end","processPredicates","sortPredicates","map","predicate","descending","defaultCompare","v1","v2","type1","type2","value1","value2","sortPredicate","reverseOrder","compareFn","predicates","compareValues","getComparisonObject","tieBreaker","predicateValues","doComparison","ngDirective","FormController","controls","$error","$$success","$pending","$name","$dirty","$pristine","$valid","$invalid","$submitted","$$parentForm","nullFormCtrl","$rollbackViewValue","form.$rollbackViewValue","control","$commitViewValue","form.$commitViewValue","$addControl","form.$addControl","$$renameControl","form.$$renameControl","newName","oldName","$removeControl","form.$removeControl","$setValidity","addSetValidityMethod","ctrl","unset","$setDirty","form.$setDirty","PRISTINE_CLASS","DIRTY_CLASS","$setPristine","form.$setPristine","setClass","SUBMITTED_CLASS","$setUntouched","form.$setUntouched","$setSubmitted","form.$setSubmitted","stringBasedInputType","$formatters","$isEmpty","baseInputType","composing","ev","ngTrim","$viewValue","$$hasNativeValidators","$setViewValue","deferListener","origValue","keyCode","PARTIAL_VALIDATION_TYPES","PARTIAL_VALIDATION_EVENTS","validity","origBadInput","badInput","origTypeMismatch","typeMismatch","$render","ctrl.$render","createDateParser","mapping","iso","ISO_DATE_REGEXP","yyyy","MM","dd","HH","getHours","mm","ss","getSeconds","sss","getMilliseconds","part","NaN","createDateInputType","parseDate","dynamicDateInputType","isValidDate","parseObservedDateValue","badInputChecker","$options","previousDate","$$parserName","$parsers","parsedDate","ngModelMinErr","ngMin","minVal","$validators","ctrl.$validators.min","$validate","ngMax","maxVal","ctrl.$validators.max","VALIDITY_STATE_PROPERTY","parseConstantExpr","parseFn","classDirective","arrayDifference","arrayClasses","addClasses","digestClassCounts","classCounts","classesToUpdate","updateClasses","ngClassWatchAction","$index","old$index","mod","cachedToggleClass","switchValue","classCache","toggleValidationCss","validationErrorKey","isValid","VALID_CLASS","INVALID_CLASS","setValidity","isObjectEmpty","PENDING_CLASS","combinedState","REGEX_STRING_REGEXP","documentMode","rules","ngCspElement","ngCspAttribute","noInlineStyle","name_","el","full","major","minor","dot","codeName","expando","JQLite._data","mouseleave","mouseenter","optgroup","tbody","tfoot","colgroup","caption","thead","th","td","Node","contains","compareDocumentPosition","ready","trigger","fired","removeData","jqLiteHasData","jqLiteCleanData","removeAttribute","css","NODE_TYPE_ATTRIBUTE","lowercasedName","specified","getNamedItem","ret","getText","$dv","multiple","selected","nodeCount","jqLiteOn","types","addHandler","noEventListener","one","onFn","replaceNode","insertBefore","contentDocument","prepend","wrapNode","detach","after","newElement","toggleClass","condition","classCondition","nextElementSibling","getElementsByTagName","extraParameters","dummyEvent","handlerArgs","eventFnsCopy","arg3","unbind","FN_ARG_SPLIT","FN_ARG","argDecl","underscore","$animateMinErr","postDigestElements","updateData","handleCSSClassChanges","existing","pin","domOperation","from","to","classesAdded","add","classesRemoved","runner","complete","$$registeredAnimations","classNameFilter","this.classNameFilter","$$classNameFilter","reservedRegex","NG_ANIMATE_CLASSNAME","domInsert","parentElement","afterElement","afterNode","ELEMENT_NODE","previousElementSibling","enter","move","leave","addclass","animate","tempClasses","waitForTick","waitQueue","passed","AnimateRunner","setHost","rafTick","_doneCallbacks","_tick","this._tick","doc","hidden","_state","chain","AnimateRunner.chain","AnimateRunner.all","runners","onProgress","DONE_COMPLETE_STATE","getPromise","resolveHandler","rejectHandler","pause","resume","_resolve","INITIAL_STATE","DONE_PENDING_STATE","initialOptions","closed","$$prepared","cleanupStyles","start","UNINITIALIZED_VALUE","isFirstChange","SimpleChange.prototype.isFirstChange","offsetWidth","APPLICATION_JSON","$httpMinErr","$interpolateMinErr.throwNoconcat","$interpolateMinErr.interr","callbackId","called","callbackMap","PATH_MATCH","locationPrototype","paramValue","Location","Location.prototype.state","OPERATORS","ESCAPE","lex","tokens","readString","peek","readNumber","peekMultichar","readIdent","is","isWhitespace","ch2","ch3","op2","op3","op1","throwError","chars","codePointAt","isValidIdentifierStart","isValidIdentifierContinue","cp","charCodeAt","cp1","cp2","isExpOperator","colStr","peekCh","quote","rawString","hex","String","fromCharCode","rep","ExpressionStatement","Property","program","expressionStatement","expect","filterChain","assignment","ternary","logicalOR","consume","logicalAND","equality","relational","additive","multiplicative","unary","primary","arrayDeclaration","selfReferential","parseArguments","baseExpression","peekToken","kind","e1","e2","e3","e4","peekAhead","t","nextId","vars","own","assignable","stage","computing","recurse","return_","generateFunction","fnKey","intoId","watchId","fnString","USE","STRICT","filterPrefix","watchFns","varsPrefix","section","nameId","recursionFn","skipWatchIdCheck","if_","lazyAssign","computedMember","lazyRecurse","plus","not","getHasOwnProperty","nonComputedMember","addEnsureSafeObject","notNull","addEnsureSafeAssignContext","addEnsureSafeMemberName","addEnsureSafeFunction","member","filterName","defaultValue","UNSAFE_CHARACTERS","SAFE_IDENTIFIER","stringEscapeFn","stringEscapeRegex","c","skip","init","fn.assign","rhs","lhs","unary+","unary-","unary!","binary+","binary-","binary*","binary/","binary%","binary===","binary!==","binary==","binary!=","binary<","binary>","binary<=","binary>=","binary&&","binary||","ternary?:","astCompiler","yy","y","MMMM","MMM","M","LLLL","H","hh","EEEE","EEE","ampmGetter","AMPMS","Z","timeZoneGetter","zone","paddedZone","ww","w","G","GG","GGG","GGGG","longEraGetter","ERANAMES","xlinkHref","propName","defaultLinkFn","normalized","ngBooleanAttrWatchAction","htmlAttr","ngAttrAliasWatchAction","nullFormRenameControl","formDirectiveFactory","isNgForm","getSetter","ngFormCompile","formElement","nameAttr","ngFormPreLink","ctrls","handleFormSubmission","setter","URL_REGEXP","EMAIL_REGEXP","NUMBER_REGEXP","DATE_REGEXP","DATETIMELOCAL_REGEXP","WEEK_REGEXP","MONTH_REGEXP","TIME_REGEXP","inputType","textInputType","weekParser","isoWeek","existingDate","week","hours","seconds","milliseconds","addDays","numberInputType","urlInputType","ctrl.$validators.url","modelValue","viewValue","emailInputType","email","ctrl.$validators.email","radioInputType","checked","checkboxInputType","trueValue","ngTrueValue","falseValue","ngFalseValue","ctrl.$isEmpty","CONSTANT_VALUE_REGEXP","tplAttr","ngValueConstantLink","ngValueLink","valueWatchAction","$compile","ngBindCompile","templateElement","ngBindLink","ngBindWatchAction","ngBindTemplateCompile","ngBindTemplateLink","ngBindHtmlCompile","ngBindHtmlGetter","ngBindHtmlWatch","sceValueOf","ngBindHtmlLink","ngBindHtmlWatchAction","getTrustedHtml","$viewChangeListeners","forceAsyncEvents","ngEventHandler","previousElements","ngIfWatchAction","srcExp","onloadExp","autoScrollExp","autoscroll","changeCounter","previousElement","currentElement","cleanupLastIncludeContent","ngIncludeWatchAction","afterAnimation","thisChangeId","namespaceAdaptedClone","trimValues","NgModelController","$modelValue","$$rawModelValue","$asyncValidators","$untouched","$touched","parsedNgModel","parsedNgModelAssign","ngModelGet","ngModelSet","pendingDebounce","parserValid","$$setOptions","this.$$setOptions","getterSetter","invokeModelGetter","invokeModelSetter","$$$p","this.$isEmpty","$$updateEmptyClasses","this.$$updateEmptyClasses","NOT_EMPTY_CLASS","EMPTY_CLASS","currentValidationRunId","this.$setPristine","this.$setDirty","this.$setUntouched","UNTOUCHED_CLASS","TOUCHED_CLASS","$setTouched","this.$setTouched","this.$rollbackViewValue","$$lastCommittedViewValue","this.$validate","prevValid","prevModelValue","allowInvalid","$$runValidators","allValid","$$writeModelToScope","this.$$runValidators","doneCallback","processSyncValidators","syncValidatorsValid","validator","processAsyncValidators","validatorPromises","validationDone","localValidationRunId","processParseErrors","errorKey","this.$commitViewValue","$$parseAndValidate","this.$$parseAndValidate","this.$$writeModelToScope","this.$setViewValue","updateOnDefault","$$debounceViewValueCommit","this.$$debounceViewValueCommit","debounceDelay","debounce","ngModelWatch","formatters","ngModelCompile","ngModelPreLink","modelCtrl","formCtrl","ngModelPostLink","updateOn","DEFAULT_REGEXP","ngOptionsMinErr","NG_OPTIONS_REGEXP","parseOptionsExpression","optionsExp","selectElement","Option","selectValue","label","group","disabled","getOptionValuesKeys","optionValues","optionValuesKeys","keyName","itemKey","valueName","selectAs","trackBy","viewValueFn","trackByFn","getTrackByValueFn","getHashOfValue","getTrackByValue","getLocals","displayFn","groupByFn","disableWhenFn","valuesFn","getWatchables","watchedArray","optionValuesLength","disableWhen","getOptions","optionItems","selectValueMap","optionItem","getOptionFromViewValue","getViewValueFromOption","optionTemplate","optGroupTemplate","ngOptionsPreLink","registerOption","ngOptionsPostLink","updateOptionElement","updateOptions","selectCtrl","readValue","groupElementMap","providedEmptyOption","emptyOption","addOption","groupElement","listFragment","optionElement","ngModelCtrl","nextValue","unknownOption","ngModelCtrl.$isEmpty","writeValue","selectCtrl.writeValue","selectCtrl.readValue","selectedValues","selections","selectedOption","BRACE","IS_WHEN","updateElementText","newText","numberExp","whenExp","whens","whensExpFns","braceReplacement","watchRemover","lastCount","attributeName","tmpMatch","whenKey","ngPluralizeWatchAction","countIsNaN","pluralCat","whenExpFn","ngRepeatMinErr","updateScope","valueIdentifier","keyIdentifier","arrayLength","$first","$last","$middle","$odd","$even","ngRepeatCompile","ngRepeatEndComment","aliasAs","trackByExp","trackByExpGetter","trackByIdExpFn","trackByIdArrayFn","trackByIdObjFn","hashFnLocals","ngRepeatLink","lastBlockMap","ngRepeatAction","previousNode","nextNode","nextBlockMap","collectionLength","trackById","collectionKeys","nextBlockOrder","trackByIdFn","blockKey","ngRepeatTransclude","ngShowWatchAction","NG_HIDE_CLASS","NG_HIDE_IN_PROGRESS_CLASS","ngHideWatchAction","ngStyleWatchAction","newStyles","oldStyles","ngSwitchController","cases","selectedTranscludes","selectedElements","previousLeaveAnimations","selectedScopes","spliceFactory","ngSwitchWatchAction","selectedTransclude","caseElement","selectedScope","anchor","ngTranscludeMinErr","ngTranscludeCompile","fallbackLinkFn","ngTranscludePostLink","useFallbackContent","ngTranscludeSlot","ngTranscludeCloneAttachFn","noopNgModelController","SelectController","optionsMap","renderUnknownOption","self.renderUnknownOption","unknownVal","removeUnknownOption","self.removeUnknownOption","self.readValue","self.writeValue","hasOption","self.addOption","removeOption","self.removeOption","self.hasOption","self.registerOption","optionScope","optionAttrs","interpolateValueFn","interpolateTextFn","valueAttributeObserveAction","interpolateWatchAction","selectPreLink","lastView","lastViewRef","selectMultipleWatch","selectPostLink","ngModelCtrl.$render","selectCtrlName","ctrl.$validators.required","patternExp","ctrl.$validators.pattern","intVal","ctrl.$validators.maxlength","ctrl.$validators.minlength","getDecimals","opt_precision","pow","ONE","OTHER","$$csp","head"] -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/bower.json deleted file mode 100644 index 1d1b272b63..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/bower.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "angular", - "version": "1.5.8", - "license": "MIT", - "main": "./angular.js", - "ignore": [], - "dependencies": { - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/index.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/index.js deleted file mode 100644 index 5c1aafcca2..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/index.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./angular'); -module.exports = angular; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/package.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/package.json deleted file mode 100644 index fe0bb7e262..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/angular/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "angular", - "version": "1.5.8", - "description": "HTML enhanced for web apps", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/angular/angular.js.git" - }, - "keywords": [ - "angular", - "framework", - "browser", - "client-side" - ], - "author": "Angular Core Team ", - "license": "MIT", - "bugs": { - "url": "https://github.com/angular/angular.js/issues" - }, - "homepage": "http://angularjs.org" -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/.bower.json deleted file mode 100644 index 16d3dd4b37..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/.bower.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "bootstrap-ui-datetime-picker", - "version": "2.4.3", - "homepage": "https://github.com/Gillardo/bootstrap-ui-datetime-picker", - "authors": [ - "Gillardo " - ], - "description": "AngularJs directive to use a date and/or time picker as a dropdown from an input", - "license": "MIT", - "main": [ - "dist/datetime-picker.js" - ], - "keywords": [ - "date-picker", - "time-picker", - "angular", - "bootstrap", - "angular-ui" - ], - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "template", - "/datetime-picker.js", - "gruntfile.js", - "package.json", - "tests" - ], - "dependencies": { - "angular-bootstrap": "^1.2.0" - }, - "_release": "2.4.3", - "_resolution": { - "type": "version", - "tag": "2.4.3", - "commit": "41381ddb752877f14369352f34d3b51430ebe34f" - }, - "_source": "https://github.com/gillardo/bootstrap-ui-datetime-picker.git", - "_target": "2.4.3", - "_originalSource": "bootstrap-ui-datetime-picker" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/LICENSE b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/LICENSE deleted file mode 100644 index ad1397a3bd..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2010-2015 Google, Inc. http://angularjs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/README.md deleted file mode 100644 index a4008146b9..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/README.md +++ /dev/null @@ -1,201 +0,0 @@ -# Bootstrap-UI/datetime-picker - -AngularJs directive to use a date and/or time picker as a dropdown from an input. - -[Demo](https://rawgit.com/Gillardo/bootstrap-ui-datetime-picker/master/example/index.html) - -## Installation -To use the directive you must have the following angular-ui bootstrap directives included already -* DatePicker -* TimePicker - -You should already have the ui.bootstrap dependancy included in your app.js file like below, You then need to add ui.bootstrap.datetimepicker, as so -``` -angular.module('app', ['ui.bootstrap', 'ui.bootstrap.datetimepicker']); -``` -Download the source from dist/datetime-picker.min.js file and include it in your project. - -Or use Bower (thank you krico for setup) -``` -bower install --save bootstrap-ui-datetime-picker -``` -and link with `bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.min.js` - -## Usage -You have the following properties available to use with the directive. All are optional unless stated otherwise -* ngModel (required) - Your date object -* isOpen - (true/false) -* closeOnDateSelection (true/false) -* closeOnTimeNow (true/false) -* enableDate (true/false) -* enableTime (true/false) -* buttonBar (object) -* initialPicker ('date'/'time') -* reOpenDefault (false/'date'/'time') - NOTE: `true` not supported -* datepickerOptions (object) -* timepickerOptions (object) -* defaultTime (string) -* saveAs (boolean|function|'ISO'|'json'|'number') -* readAs (boolean|function) - -##### isOpen -Whether the popup/dropdown is visible or not. Defaults to false -##### closeOnDateSelection -Close popup once a date has been chosen. TimePicker will stay open until user closes. -##### closeOnTimeNow -Close popup once a time has been chosen via now button. -##### enableDate -Whether you would like the user to be able to select a date. Defaults to true -##### enableTime -Whether you would like the user to be able to select a time. Defaults to true -##### buttonBar -To show or hide the button bar, or any of the buttons inside it. Defaults to the uiDatetimePickerConfig. -Only specify the elements that you want to override, as each button defaults to the uiDatetimePickerConfig setup, if it is not configured on scope of the datetimePicker -##### initialPicker -The initial picker to open when the control is first pressed -##### reOpenDefault -The picker to set as the picker to open once the control has already been opened at least once. Setting to `false` will default to the date picker if both date and time are enabled, or just the enabled control if only time or date is in use. -##### datepickerOptions -Object to configure settings for the datepicker (can be found on [angularUI site](https://angular-ui.github.io/bootstrap/#/datepicker)) -##### timepickerOptions -Object to configure settings for the timepicker (can be found on [angularUI site](https://angular-ui.github.io/bootstrap/#/timepicker)) -##### defaultTime -Initial time when a new date is selected (e.g. "14:00:00" or "2:00 pm") -##### whenClosed -An callback function to call when the picker dropdown is closed. See demo for more details. -##### saveAs -A boolean value to switch saving the Date to the model as a string, or a ngModel.$parsers function to take over the transformation from the Date object to a string. -Possible values: -* true -* false -* 'ISO' (Date.toISOString()) -* 'json' (Date.toJSON()) -* 'number' (Date.valueOf()) -* a function accepting a value parameter and returning the converted value to save to the model. -Note: If using an html5 input type, the default parser will use Date.toLocaleString() to convert to a string. To override this, provide a function with your desired formatted conversion. Otherwise all other input types will use the supplied date format. -##### readAs -A boolean value to convert a string (or Date.valueOf()) value back to a Date object from the ngModel, or a ngModel.$formatters function to take over the transformation completely. - -## uiDatetimePickerConfig -Now datetimePicker options are globally set by default. If you do not state the values within the declaration, the config options are used instead. Here are the default options - -``` -.constant('uiDatetimePickerConfig', { - dateFormat: 'yyyy-MM-dd HH:mm', - defaultTime: '00:00:00', - html5Types: { - date: 'yyyy-MM-dd', - 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss', - 'month': 'yyyy-MM' - }, - initialPicker: 'date', - reOpenDefault: false, - enableDate: true, - enableTime: true, - buttonBar: { - show: true, - now: { - show: true, - text: 'Now' - }, - today: { - show: true, - text: 'Today' - }, - clear: { - show: true, - text: 'Clear' - }, - date: { - show: true, - text: 'Date' - }, - time: { - show: true, - text: 'Time' - }, - close: { - show: true, - text: 'Close' - } - }, - closeOnDateSelection: true, - closeOnTimeNow: true, - appendToBody: false, - altInputFormats: [], - ngModelOptions: { }, - saveAs: false, - readAs: false, - }) -``` - -## Css -Personally i dont like the look of the angular-ui calendar itself, this is because the buttons are configured to use the btn-default style. To get round this there are 3 css classes applied to the datetimepicker and depending on the picker that is being shown. These classes surround the div element that contains the angular-ui datepicker and timepicker. Using these classes you can change the style of the calendar. The class are - -``` -.datetime-picker-dropdown -``` - -Applied to the dropdown that the pickers are contained within - -``` -.datetime-picker-dropdown > li.date-picker-menu -``` -Applied when the date picker is visible - -``` -.datetime-picker-dropdown > li.time-picker-menu -``` -Applied when the time picker is visible - -###### EXAMPLE -For example, if i add this css code, you will see the difference to the calendar in the images below - -``` -.datetime-picker-dropdown > li.date-picker-menu div > table .btn-default { - border: 0; -} -``` -###### BEFORE -![alt tag](http://imageshack.com/a/img633/6894/9Dt0Le.gif) -###### AFTER -![alt tag](http://imageshack.com/a/img673/5236/to31hz.gif) - - -## Example -Here is an example to use the directive with a bootstrap input, displaying a calendar button - -####HTML -``` -

      - - - - -

      -``` -####JAVASCRIPT - -``` -app.controller('MyController', function() { - var that = this; - - this.isOpen = false; - - this.openCalendar = function(e) { - e.preventDefault(); - e.stopPropagation(); - - that.isOpen = true; - }; -}); -``` - -## Bug -If you do find a bug, can you please create a plunkr to replicate the error before raising an issue. Attach the plunkr as a link to the issue so i can replicate the error and work out a solution. - -## Pull Requests -If you submit a PR, please test your changes against the demo page to make sure no functionality has been broken. - -## Support -This was developed using angular-ui bootstrap Version: 1.2.0 - 2016-04-07. If you have a bug, please check what version of angular-ui you are using. If you are using a version prior to this, then please upgrade if you can and try it. If the problem persists, please let me know. I do have a day job but will try to get back to you asap. If you can fix the bug, then let me know how, or even better, submit a pull request. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/bootstrap-ui-datetime-picker-tests.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/bootstrap-ui-datetime-picker-tests.js deleted file mode 100644 index c5623d89b9..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/bootstrap-ui-datetime-picker-tests.js +++ /dev/null @@ -1,5 +0,0 @@ -// Write your tests here! -// Here is an example. -Tinytest.add('example', function (test) { - test.equal(true, true); -}); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/bower.json deleted file mode 100644 index 2202e35524..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/bower.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "bootstrap-ui-datetime-picker", - "version": "2.4.3", - "homepage": "https://github.com/Gillardo/bootstrap-ui-datetime-picker", - "authors": [ - "Gillardo " - ], - "description": "AngularJs directive to use a date and/or time picker as a dropdown from an input", - "license": "MIT", - "main": [ - "dist/datetime-picker.js" - ], - "keywords": [ - "date-picker", - "time-picker", - "angular", - "bootstrap", - "angular-ui" - ], - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "template", - "/datetime-picker.js", - "gruntfile.js", - "package.json", - "tests" - ], - "dependencies": { - "angular-bootstrap": "^1.2.0" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.js deleted file mode 100644 index c96afb28ed..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.js +++ /dev/null @@ -1,659 +0,0 @@ -// https://github.com/Gillardo/bootstrap-ui-datetime-picker -// Version: 2.4.3 -// Released: 2016-07-14 -angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.position']) - .constant('uiDatetimePickerConfig', { - dateFormat: 'yyyy-MM-dd HH:mm', - defaultTime: '00:00:00', - html5Types: { - date: 'yyyy-MM-dd', - 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss', - 'month': 'yyyy-MM' - }, - initialPicker: 'date', - reOpenDefault: false, - enableDate: true, - enableTime: true, - buttonBar: { - show: true, - now: { - show: true, - text: 'Now' - }, - today: { - show: true, - text: 'Today' - }, - clear: { - show: true, - text: 'Clear' - }, - date: { - show: true, - text: 'Date' - }, - time: { - show: true, - text: 'Time' - }, - close: { - show: true, - text: 'Close' - } - }, - closeOnDateSelection: true, - closeOnTimeNow: true, - appendToBody: false, - altInputFormats: [], - ngModelOptions: {}, - saveAs: false, - readAs: false - }) - .controller('DateTimePickerController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$document', '$timeout', '$uibPosition', 'dateFilter', 'uibDateParser', 'uiDatetimePickerConfig', '$rootScope', - function ($scope, $element, $attrs, $compile, $parse, $document, $timeout, $uibPosition, dateFilter, uibDateParser, uiDatetimePickerConfig, $rootScope) { - var dateFormat = uiDatetimePickerConfig.dateFormat, - ngModel, ngModelOptions, $popup, cache = {}, watchListeners = [], - closeOnDateSelection = angular.isDefined($attrs.closeOnDateSelection) ? $scope.$parent.$eval($attrs.closeOnDateSelection) : uiDatetimePickerConfig.closeOnDateSelection, - closeOnTimeNow = angular.isDefined($attrs.closeOnTimeNow) ? $scope.$parent.$eval($attrs.closeOnTimeNow) : uiDatetimePickerConfig.closeOnTimeNow, - appendToBody = angular.isDefined($attrs.datepickerAppendToBody) ? $scope.$parent.$eval($attrs.datepickerAppendToBody) : uiDatetimePickerConfig.appendToBody, - altInputFormats = angular.isDefined($attrs.altInputFormats) ? $scope.$parent.$eval($attrs.altInputFormats) : uiDatetimePickerConfig.altInputFormats, - saveAs = angular.isDefined($attrs.saveAs) ? $scope.$parent.$eval($attrs.saveAs) || $attrs.saveAs : uiDatetimePickerConfig.saveAs, - readAs = angular.isDefined($attrs.readAs) ? $scope.$parent.$eval($attrs.readAs) : uiDatetimePickerConfig.readAs; - - this.init = function (_ngModel) { - ngModel = _ngModel; - ngModelOptions = ngModel.$options || uiDatetimePickerConfig.ngModelOptions; - - $scope.buttonBar = angular.isDefined($attrs.buttonBar) ? $scope.$parent.$eval($attrs.buttonBar) : uiDatetimePickerConfig.buttonBar; - - // determine which pickers should be available. Defaults to date and time - $scope.enableDate = angular.isDefined($scope.enableDate) ? $scope.enableDate : uiDatetimePickerConfig.enableDate; - $scope.enableTime = angular.isDefined($scope.enableTime) ? $scope.enableTime : uiDatetimePickerConfig.enableTime; - - // determine default picker - $scope.initialPicker = angular.isDefined($attrs.initialPicker) ? $attrs.initialPicker : ($scope.enableDate ? uiDatetimePickerConfig.initialPicker : 'time'); - - // determine the picker to open when control is re-opened - $scope.reOpenDefault = angular.isDefined($attrs.reOpenDefault) ? $attrs.reOpenDefault : uiDatetimePickerConfig.reOpenDefault; - - // check if an illegal combination of options exists - if ($scope.initialPicker == 'date' && !$scope.enableDate) { - throw new Error("datetimePicker can't have initialPicker set to date and have enableDate set to false."); - } - - // default picker view - $scope.showPicker = !$scope.enableDate ? 'time' : $scope.initialPicker; - - var isHtml5DateInput = false; - - if (uiDatetimePickerConfig.html5Types[$attrs.type]) { - dateFormat = uiDatetimePickerConfig.html5Types[$attrs.type]; - isHtml5DateInput = true; - } else { - dateFormat = $attrs.datetimePicker || uiDatetimePickerConfig.dateFormat; - $attrs.$observe('datetimePicker', function (value) { - var newDateFormat = value || uiDatetimePickerConfig.dateFormat; - - if (newDateFormat !== dateFormat) { - dateFormat = newDateFormat; - ngModel.$modelValue = null; - - if (!dateFormat) { - throw new Error('datetimePicker must have a date format specified.'); - } - } - }); - } - - if (!dateFormat) { - throw new Error('datetimePicker must have a date format specified.'); - } - - // popup element used to display calendar - var popupEl = angular.element('' + - '
      ' + - '
      ' + - '
      ' + - '
      ' + - '
      ' + - '
      '); - - if (ngModelOptions) { - timezone = ngModelOptions.timezone; - $scope.ngModelOptions = angular.copy(ngModelOptions); - $scope.ngModelOptions.timezone = null; - if ($scope.ngModelOptions.updateOnDefault === true) { - $scope.ngModelOptions.updateOn = $scope.ngModelOptions.updateOn ? - $scope.ngModelOptions.updateOn + ' default' : 'default'; - } - - popupEl.attr('ng-model-options', 'ngModelOptions'); - } else { - timezone = null; - } - - // get attributes from directive - popupEl.attr({ - 'ng-model': 'date', - 'ng-change': 'dateSelection(date)' - }); - - // datepicker element - var datepickerEl = angular.element(popupEl.children()[0]); - - if (!$scope.datepickerOptions) { - $scope.datepickerOptions = {}; - } - - if (isHtml5DateInput) { - if ($attrs.type === 'month') { - $scope.datepickerOptions.datepickerMode = 'month'; - $scope.datepickerOptions.minMode = 'month'; - } - } - - datepickerEl.attr('datepicker-options', 'datepickerOptions'); - - // set datepickerMode to day by default as need to create watch - // else disabled cannot pass in mode - if (!angular.isDefined($scope.datepickerOptions.datepickerMode)) { - $scope.datepickerOptions.datepickerMode = 'day'; - } - - // timepicker element - var timepickerEl = angular.element(popupEl.children()[1]); - - if (!$scope.timepickerOptions) - $scope.timepickerOptions = {}; - - for (var key in $scope.timepickerOptions) { - timepickerEl.attr(cameltoDash(key), 'timepickerOptions.' + key); - } - - // watch attrs - NOTE: minDate and maxDate are used with datePicker and timePicker. By using the minDate and maxDate - // with the timePicker, you can dynamically set the min and max time values. This cannot be done using the min and max values - // with the timePickerOptions - angular.forEach(['minDate', 'maxDate', 'initDate'], function (key) { - if ($scope.datepickerOptions[key]) { - if (key == 'minDate') { - timepickerEl.attr('min', 'datepickerOptions.minDate'); - } else if (key == 'maxDate') - timepickerEl.attr('max', 'datepickerOptions.maxDate'); - } - }); - - // do not check showWeeks attr, as should be used via datePickerOptions - - if (!isHtml5DateInput) { - // Internal API to maintain the correct ng-invalid-[key] class - ngModel.$$parserName = 'datetime'; - ngModel.$validators.datetime = validator; - ngModel.$parsers.unshift(parseDate); - ngModel.$formatters.push(function (value) { - if (ngModel.$isEmpty(value)) { - $scope.date = value; - return value; - } - - $scope.date = uibDateParser.fromTimezone(value, ngModelOptions.timezone); - - dateFormat = dateFormat.replace(/M!/, 'MM') - .replace(/d!/, 'dd'); - - return uibDateParser.filter($scope.date, dateFormat); - }); - } else { - ngModel.$formatters.push(function (value) { - $scope.date = uibDateParser.fromTimezone(value, ngModelOptions.timezone); - return value; - }); - } - - if (saveAs) { - // If it is determined closure var's need to be exposed to the parser, don't add the formatter here. - // Instead just call the method from within the stock parser with this context and/or any needed closure variables. - if (angular.isFunction(saveAs)) - ngModel.$parsers.push(saveAs); - else - ngModel.$parsers.push(saveAsParser); - - // Assuming if saveAs is !false, we'll want to convert, either pass the function, or the stock str/num -> Date obj formatter. - if (angular.isFunction(readAs)) - ngModel.$formatters.push(readAs); - else - ngModel.$formatters.push(readAsFormatter); - } - // Detect changes in the view from the text box - ngModel.$viewChangeListeners.push(function () { - $scope.date = parseDateString(ngModel.$viewValue); - }); - - $element.bind('keydown', inputKeydownBind); - - $popup = $compile(popupEl)($scope); - // Prevent jQuery cache memory leak (template is now redundant after linking) - popupEl.remove(); - - if (appendToBody) { - $document.find('body').append($popup); - } else { - $element.after($popup); - } - - function readAsFormatter(value) { - if (ngModel.$isEmpty(value)) - return value; - - var d = new Date(value); - if (angular.isDate(d) && !isNaN(d)) - return d; - - return value; - } - - function saveAsParser(value) { - if (!value || angular.isString(value) || !angular.isDate(value) || isNaN(value)) - return value; - - if (saveAs === 'ISO') - return value.toISOString(); - - if (saveAs === 'json') - return value.toJSON(); - - if (saveAs === 'number') - return value.valueOf(); - - if (!isHtml5DateInput) { - dateFormat = dateFormat.replace(/M!/, 'MM') - .replace(/d!/, 'dd'); - return uibDateParser.filter(uibDateParser.fromTimezone(value, ngModelOptions.timezone), dateFormat); - } else { - return uibDateParser.fromTimezone(value, ngModelOptions.timezone).toLocaleString(); - } - } - }; - - // get text - $scope.getText = function (key) { - return $scope.buttonBar[key].text || uiDatetimePickerConfig.buttonBar[key].text; - }; - - $scope.keydown = function (evt) { - if (evt.which === 27) { - $scope.close(false); - $element[0].focus(); - } - }; - - // determine if button is to be shown or not - $scope.doShow = function (key) { - if (angular.isDefined($scope.buttonBar[key].show)) - return $scope.buttonBar[key].show; - else - return uiDatetimePickerConfig.buttonBar[key].show; - }; - - // Inner change - $scope.dateSelection = function (dt, opt) { - - // check if timePicker is being shown and merge dates, so that the date - // part is never changed, only the time - if ($scope.enableTime && $scope.showPicker === 'time') { - - // only proceed if dt is a date - if (dt || dt != null) { - // check if our $scope.date is null, and if so, set to todays date - if (!angular.isDefined($scope.date) || $scope.date == null) { - $scope.date = new Date(); - } - - // dt will not be undefined if the now or today button is pressed - if (dt && dt != null) { - // get the existing date and update the time - var date = new Date($scope.date); - date.setHours(dt.getHours()); - date.setMinutes(dt.getMinutes()); - date.setSeconds(dt.getSeconds()); - date.setMilliseconds(dt.getMilliseconds()); - dt = date; - } - } - } - - if (angular.isDefined(dt)) { - if (!$scope.date) { - var defaultTime = angular.isDefined($attrs.defaultTime) ? $attrs.defaultTime : uiDatetimePickerConfig.defaultTime; - var t = new Date('2001-01-01 ' + defaultTime); - - if (!isNaN(t) && dt != null) { - dt.setHours(t.getHours()); - dt.setMinutes(t.getMinutes()); - dt.setSeconds(t.getSeconds()); - dt.setMilliseconds(t.getMilliseconds()); - } - } - $scope.date = dt; - } - - var date = $scope.date ? dateFilter($scope.date, dateFormat) : null; - - $element.val(date); - ngModel.$setViewValue(date); - - if (closeOnDateSelection) { - // do not close when using timePicker as make impossible to choose a time - if ($scope.showPicker != 'time' && date != null) { - // if time is enabled, swap to timePicker - if ($scope.enableTime) { - $scope.open('time'); - } else { - $scope.close(false); - } - } else if (closeOnTimeNow && $scope.showPicker === 'time' && date != null && opt === 'now') { - $scope.close(false); - } - } - - }; - - $scope.$watch('isOpen', function (value) { - $scope.dropdownStyle = { - display: value ? 'block' : 'none' - }; - - if (value) { - cache['openDate'] = $scope.date; - - var position = appendToBody ? $uibPosition.offset($element) : $uibPosition.position($element); - - if (appendToBody) { - $scope.dropdownStyle.top = (position.top + $element.prop('offsetHeight')) + 'px'; - } else { - $scope.dropdownStyle.top = undefined; - } - - $scope.dropdownStyle.left = position.left + 'px'; - - $timeout(function () { - $scope.$broadcast('uib:datepicker.focus'); - $document.bind('click', documentClickBind); - }, 0, false); - - $scope.open($scope.showPicker); - } else { - $document.unbind('click', documentClickBind); - } - }); - - $scope.isDisabled = function (date) { - if (date === 'today' || date === 'now') - date = uibDateParser.fromTimezone(new Date(), timezone); - - var dates = {}; - angular.forEach(['minDate', 'maxDate'], function (key) { - if (!$scope.datepickerOptions[key]) { - dates[key] = null; - } else if (angular.isDate($scope.datepickerOptions[key])) { - dates[key] = uibDateParser.fromTimezone(new Date($scope.datepickerOptions[key]), timezone); - } else { - dates[key] = new Date(dateFilter($scope.datepickerOptions[key], 'medium')); - } - }); - - return $scope.datepickerOptions && - dates.minDate && $scope.compare(date, dates.minDate) < 0 || - dates.maxDate && $scope.compare(date, dates.maxDate) > 0; - }; - - $scope.compare = function (date1, date2) { - return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()); - }; - - $scope.select = function (opt, evt) { - if (angular.isDefined(evt)) { - evt.preventDefault(); - evt.stopPropagation(); - } - - var date = null; - var isNow = opt === 'now'; - - if (opt === 'today' || opt == 'now') { - var now = new Date(); - if (angular.isDate($scope.date)) { - date = new Date($scope.date); - date.setFullYear(now.getFullYear(), now.getMonth(), now.getDate()); - date.setHours(now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds()); - } else { - date = now; - } - } - - $scope.dateSelection(date, opt); - }; - - $scope.open = function (picker, evt) { - if (angular.isDefined(evt)) { - evt.preventDefault(); - evt.stopPropagation(); - } - - // need to delay this, else timePicker never shown - $timeout(function () { - $scope.showPicker = picker; - }, 0); - - // in order to update the timePicker, we need to update the model reference! - // as found here https://angular-ui.github.io/bootstrap/#/timepicker - if (picker == 'time') { - $timeout(function () { - $scope.date = parseDateString(ngModel.$viewValue); - }, 50); - } - }; - - $scope.close = function (closePressed, evt) { - if (angular.isDefined(evt)) { - evt.preventDefault(); - evt.stopPropagation(); - } - - $scope.isOpen = false; - - // if enableDate and enableTime are true, reopen the picker in date mode first - if ($scope.enableDate && $scope.enableTime) - $scope.showPicker = $scope.reOpenDefault === false ? 'date' : $scope.reOpenDefault; - - // if a on-close-fn has been defined, lets call it - // we only call this if closePressed is defined! - if (angular.isDefined(closePressed)) { - $scope.whenClosed({args: {closePressed: closePressed, openDate: cache['openDate'] || null, closeDate: $scope.date}}); - } else { - $element[0].focus(); - } - }; - - $scope.$on('$destroy', function () { - if ($scope.isOpen === true) { - if (!$rootScope.$$phase) { - $scope.$apply(function () { - $scope.close(); - }); - } - } - - watchListeners.forEach(function (a) { - a(); - }); - $popup.remove(); - $element.unbind('keydown', inputKeydownBind); - $document.unbind('click', documentClickBind); - }); - - function documentClickBind(evt) { - var popup = $popup[0]; - var dpContainsTarget = $element[0].contains(evt.target); - - // The popup node may not be an element node - // In some browsers (IE only) element nodes have the 'contains' function - var popupContainsTarget = popup.contains !== undefined && popup.contains(evt.target); - - if ($scope.isOpen && !(dpContainsTarget || popupContainsTarget)) { - $scope.$apply(function () { - $scope.close(false); - }); - } - } - - function inputKeydownBind(evt) { - if (evt.which === 27 && $scope.isOpen) { - evt.preventDefault(); - evt.stopPropagation(); - $scope.$apply(function () { - $scope.close(false); - }); - $element[0].focus(); - } else if (evt.which === 40 && !$scope.isOpen) { - evt.preventDefault(); - evt.stopPropagation(); - $scope.$apply(function () { - $scope.isOpen = true; - }); - } - } - - function cameltoDash(string) { - return string.replace(/([A-Z])/g, function ($1) { - return '-' + $1.toLowerCase(); - }); - } - - function parseDateString(viewValue) { - var date = uibDateParser.parse(viewValue, dateFormat, $scope.date); - if (isNaN(date)) { - for (var i = 0; i < altInputFormats.length; i++) { - date = uibDateParser.parse(viewValue, altInputFormats[i], $scope.date); - if (!isNaN(date)) { - return date; - } - } - } - return date; - } - - function parseDate(viewValue) { - if (angular.isNumber(viewValue) && !isNaN(viewValue)) { - // presumably timestamp to date object - viewValue = new Date(viewValue); - } - - if (!viewValue) { - return null; - } - - if (angular.isDate(viewValue) && !isNaN(viewValue)) { - return viewValue; - } - - if (angular.isString(viewValue)) { - var date = parseDateString(viewValue); - if (!isNaN(date)) { - return uibDateParser.toTimezone(date, ngModelOptions.timezone); - } - - return undefined; - } else { - return undefined; - } - } - - function validateMinMax(value) { - if ($scope.datepickerOptions.minDate && value < $scope.datepickerOptions.minDate) { - return false; - } else if ($scope.datepickerOptions.maxDate && value > $scope.datepickerOptions.maxDate) { - return false; - } else { - return true; - } - } - - function validator(modelValue, viewValue) { - var value = modelValue || viewValue; - - if (!($attrs.ngRequired || $attrs.required) && !value) { - return true; - } - - if (angular.isNumber(value)) { - value = new Date(value); - } - - if (!value) { - return true; - } else if (angular.isDate(value) && !isNaN(value)) { - return validateMinMax(value); - } else if (angular.isDate(new Date(value)) && !isNaN(new Date(value).valueOf())) { - return validateMinMax(new Date(value)); - } else if (angular.isString(value)) { - return !isNaN(parseDateString(viewValue)) && validateMinMax(parseDateString(viewValue)); - } else { - return false; - } - } - - }]) - .directive('datetimePicker', function () { - return { - restrict: 'A', - require: ['ngModel', 'datetimePicker'], - controller: 'DateTimePickerController', - scope: { - isOpen: '=?', - datepickerOptions: '=?', - timepickerOptions: '=?', - enableDate: '=?', - enableTime: '=?', - initialPicker: '=?', - reOpenDefault: '=?', - whenClosed: '&' - }, - link: function (scope, element, attrs, ctrls) { - var ngModel = ctrls[0], - ctrl = ctrls[1]; - - ctrl.init(ngModel); - } - }; - }) - .directive('datePickerWrap', function () { - return { - restrict: 'EA', - replace: true, - transclude: true, - templateUrl: 'template/date-picker.html' - }; - }) - - .directive('timePickerWrap', function () { - return { - restrict: 'EA', - replace: true, - transclude: true, - templateUrl: 'template/time-picker.html' - }; - }); - -angular.module('ui.bootstrap.datetimepicker').run(['$templateCache', function($templateCache) { - 'use strict'; - - $templateCache.put('template/date-picker.html', - "
      " - ); - - - $templateCache.put('template/time-picker.html', - "
      " - ); - -}]); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.min.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.min.js deleted file mode 100644 index 0643ea3706..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.min.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/Gillardo/bootstrap-ui-datetime-picker -// Version: 2.4.3 -// Released: 2016-07-14 -angular.module("ui.bootstrap.datetimepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("uiDatetimePickerConfig",{dateFormat:"yyyy-MM-dd HH:mm",defaultTime:"00:00:00",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},initialPicker:"date",reOpenDefault:!1,enableDate:!0,enableTime:!0,buttonBar:{show:!0,now:{show:!0,text:"Now"},today:{show:!0,text:"Today"},clear:{show:!0,text:"Clear"},date:{show:!0,text:"Date"},time:{show:!0,text:"Time"},close:{show:!0,text:"Close"}},closeOnDateSelection:!0,closeOnTimeNow:!0,appendToBody:!1,altInputFormats:[],ngModelOptions:{},saveAs:!1,readAs:!1}).controller("DateTimePickerController",["$scope","$element","$attrs","$compile","$parse","$document","$timeout","$uibPosition","dateFilter","uibDateParser","uiDatetimePickerConfig","$rootScope",function(a,b,c,d,e,f,g,h,i,j,k,l){function m(c){var d=v[0],e=b[0].contains(c.target),f=void 0!==d.contains&&d.contains(c.target);!a.isOpen||e||f||a.$apply(function(){a.close(!1)})}function n(c){27===c.which&&a.isOpen?(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.close(!1)}),b[0].focus()):40!==c.which||a.isOpen||(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!0}))}function o(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function p(b){var c=j.parse(b,w,a.date);if(isNaN(c))for(var d=0;da.datepickerOptions.maxDate)}function s(a,b){var d=a||b;return c.ngRequired||c.required||d?(angular.isNumber(d)&&(d=new Date(d)),d?angular.isDate(d)&&!isNaN(d)?r(d):angular.isDate(new Date(d))&&!isNaN(new Date(d).valueOf())?r(new Date(d)):angular.isString(d)?!isNaN(p(b))&&r(p(b)):!1:!0):!0}var t,u,v,w=k.dateFormat,x={},y=[],z=angular.isDefined(c.closeOnDateSelection)?a.$parent.$eval(c.closeOnDateSelection):k.closeOnDateSelection,A=angular.isDefined(c.closeOnTimeNow)?a.$parent.$eval(c.closeOnTimeNow):k.closeOnTimeNow,B=angular.isDefined(c.datepickerAppendToBody)?a.$parent.$eval(c.datepickerAppendToBody):k.appendToBody,C=angular.isDefined(c.altInputFormats)?a.$parent.$eval(c.altInputFormats):k.altInputFormats,D=angular.isDefined(c.saveAs)?a.$parent.$eval(c.saveAs)||c.saveAs:k.saveAs,E=angular.isDefined(c.readAs)?a.$parent.$eval(c.readAs):k.readAs;this.init=function(e){function g(a){if(t.$isEmpty(a))return a;var b=new Date(a);return angular.isDate(b)&&!isNaN(b)?b:a}function h(a){return!a||angular.isString(a)||!angular.isDate(a)||isNaN(a)?a:"ISO"===D?a.toISOString():"json"===D?a.toJSON():"number"===D?a.valueOf():i?j.fromTimezone(a,u.timezone).toLocaleString():(w=w.replace(/M!/,"MM").replace(/d!/,"dd"),j.filter(j.fromTimezone(a,u.timezone),w))}if(t=e,u=t.$options||k.ngModelOptions,a.buttonBar=angular.isDefined(c.buttonBar)?a.$parent.$eval(c.buttonBar):k.buttonBar,a.enableDate=angular.isDefined(a.enableDate)?a.enableDate:k.enableDate,a.enableTime=angular.isDefined(a.enableTime)?a.enableTime:k.enableTime,a.initialPicker=angular.isDefined(c.initialPicker)?c.initialPicker:a.enableDate?k.initialPicker:"time",a.reOpenDefault=angular.isDefined(c.reOpenDefault)?c.reOpenDefault:k.reOpenDefault,"date"==a.initialPicker&&!a.enableDate)throw new Error("datetimePicker can't have initialPicker set to date and have enableDate set to false.");a.showPicker=a.enableDate?a.initialPicker:"time";var i=!1;if(k.html5Types[c.type]?(w=k.html5Types[c.type],i=!0):(w=c.datetimePicker||k.dateFormat,c.$observe("datetimePicker",function(a){var b=a||k.dateFormat;if(b!==w&&(w=b,t.$modelValue=null,!w))throw new Error("datetimePicker must have a date format specified.")})),!w)throw new Error("datetimePicker must have a date format specified.");var l=angular.element('
      ');u?(timezone=u.timezone,a.ngModelOptions=angular.copy(u),a.ngModelOptions.timezone=null,a.ngModelOptions.updateOnDefault===!0&&(a.ngModelOptions.updateOn=a.ngModelOptions.updateOn?a.ngModelOptions.updateOn+" default":"default"),l.attr("ng-model-options","ngModelOptions")):timezone=null,l.attr({"ng-model":"date","ng-change":"dateSelection(date)"});var m=angular.element(l.children()[0]);a.datepickerOptions||(a.datepickerOptions={}),i&&"month"===c.type&&(a.datepickerOptions.datepickerMode="month",a.datepickerOptions.minMode="month"),m.attr("datepicker-options","datepickerOptions"),angular.isDefined(a.datepickerOptions.datepickerMode)||(a.datepickerOptions.datepickerMode="day");var r=angular.element(l.children()[1]);a.timepickerOptions||(a.timepickerOptions={});for(var x in a.timepickerOptions)r.attr(o(x),"timepickerOptions."+x);angular.forEach(["minDate","maxDate","initDate"],function(b){a.datepickerOptions[b]&&("minDate"==b?r.attr("min","datepickerOptions.minDate"):"maxDate"==b&&r.attr("max","datepickerOptions.maxDate"))}),i?t.$formatters.push(function(b){return a.date=j.fromTimezone(b,u.timezone),b}):(t.$$parserName="datetime",t.$validators.datetime=s,t.$parsers.unshift(q),t.$formatters.push(function(b){return t.$isEmpty(b)?(a.date=b,b):(a.date=j.fromTimezone(b,u.timezone),w=w.replace(/M!/,"MM").replace(/d!/,"dd"),j.filter(a.date,w))})),D&&(angular.isFunction(D)?t.$parsers.push(D):t.$parsers.push(h),angular.isFunction(E)?t.$formatters.push(E):t.$formatters.push(g)),t.$viewChangeListeners.push(function(){a.date=p(t.$viewValue)}),b.bind("keydown",n),v=d(l)(a),l.remove(),B?f.find("body").append(v):b.after(v)},a.getText=function(b){return a.buttonBar[b].text||k.buttonBar[b].text},a.keydown=function(c){27===c.which&&(a.close(!1),b[0].focus())},a.doShow=function(b){return angular.isDefined(a.buttonBar[b].show)?a.buttonBar[b].show:k.buttonBar[b].show},a.dateSelection=function(d,e){if(a.enableTime&&"time"===a.showPicker&&(d||null!=d)&&(angular.isDefined(a.date)&&null!=a.date||(a.date=new Date),d&&null!=d)){var f=new Date(a.date);f.setHours(d.getHours()),f.setMinutes(d.getMinutes()),f.setSeconds(d.getSeconds()),f.setMilliseconds(d.getMilliseconds()),d=f}if(angular.isDefined(d)){if(!a.date){var g=angular.isDefined(c.defaultTime)?c.defaultTime:k.defaultTime,h=new Date("2001-01-01 "+g);isNaN(h)||null==d||(d.setHours(h.getHours()),d.setMinutes(h.getMinutes()),d.setSeconds(h.getSeconds()),d.setMilliseconds(h.getMilliseconds()))}a.date=d}var f=a.date?i(a.date,w):null;b.val(f),t.$setViewValue(f),z&&("time"!=a.showPicker&&null!=f?a.enableTime?a.open("time"):a.close(!1):A&&"time"===a.showPicker&&null!=f&&"now"===e&&a.close(!1))},a.$watch("isOpen",function(c){if(a.dropdownStyle={display:c?"block":"none"},c){x.openDate=a.date;var d=B?h.offset(b):h.position(b);B?a.dropdownStyle.top=d.top+b.prop("offsetHeight")+"px":a.dropdownStyle.top=void 0,a.dropdownStyle.left=d.left+"px",g(function(){a.$broadcast("uib:datepicker.focus"),f.bind("click",m)},0,!1),a.open(a.showPicker)}else f.unbind("click",m)}),a.isDisabled=function(b){"today"!==b&&"now"!==b||(b=j.fromTimezone(new Date,timezone));var c={};return angular.forEach(["minDate","maxDate"],function(b){a.datepickerOptions[b]?angular.isDate(a.datepickerOptions[b])?c[b]=j.fromTimezone(new Date(a.datepickerOptions[b]),timezone):c[b]=new Date(i(a.datepickerOptions[b],"medium")):c[b]=null}),a.datepickerOptions&&c.minDate&&a.compare(b,c.minDate)<0||c.maxDate&&a.compare(b,c.maxDate)>0},a.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},a.select=function(b,c){angular.isDefined(c)&&(c.preventDefault(),c.stopPropagation());var d=null;if("today"===b||"now"==b){var e=new Date;angular.isDate(a.date)?(d=new Date(a.date),d.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),d.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())):d=e}a.dateSelection(d,b)},a.open=function(b,c){angular.isDefined(c)&&(c.preventDefault(),c.stopPropagation()),g(function(){a.showPicker=b},0),"time"==b&&g(function(){a.date=p(t.$viewValue)},50)},a.close=function(c,d){angular.isDefined(d)&&(d.preventDefault(),d.stopPropagation()),a.isOpen=!1,a.enableDate&&a.enableTime&&(a.showPicker=a.reOpenDefault===!1?"date":a.reOpenDefault),angular.isDefined(c)?a.whenClosed({args:{closePressed:c,openDate:x.openDate||null,closeDate:a.date}}):b[0].focus()},a.$on("$destroy",function(){a.isOpen===!0&&(l.$$phase||a.$apply(function(){a.close()})),y.forEach(function(a){a()}),v.remove(),b.unbind("keydown",n),f.unbind("click",m)})}]).directive("datetimePicker",function(){return{restrict:"A",require:["ngModel","datetimePicker"],controller:"DateTimePickerController",scope:{isOpen:"=?",datepickerOptions:"=?",timepickerOptions:"=?",enableDate:"=?",enableTime:"=?",initialPicker:"=?",reOpenDefault:"=?",whenClosed:"&"},link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("datePickerWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/date-picker.html"}}).directive("timePickerWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/time-picker.html"}}),angular.module("ui.bootstrap.datetimepicker").run(["$templateCache",function(a){"use strict";a.put("template/date-picker.html",''),a.put("template/time-picker.html",'')}]); \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.tpls.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.tpls.js deleted file mode 100644 index bff3ebdd33..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.tpls.js +++ /dev/null @@ -1,13 +0,0 @@ -angular.module('ui.bootstrap.datetimepicker').run(['$templateCache', function($templateCache) { - 'use strict'; - - $templateCache.put('template/date-picker.html', - "
      " - ); - - - $templateCache.put('template/time-picker.html', - "
      " - ); - -}]); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/example/index.html b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/example/index.html deleted file mode 100644 index 4b4cd83051..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/example/index.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - -

      DateTime Picker Demo

      -

      Use datetime calendar to choose a date and/or time from a popup calendar. This can be used as a replacement for the bootstrap-ui datepicker-popup control

      -
      -
      -

      Pick a date

      -
        -
      • dateDisabled used, todays date is disabled when the picker is displaying days
      • -
      • closeOnDateSelection="false"
      • -
      • datepickerOptions - showWeeks=false, startingDay=1
      • -
      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.picker1.date }}

      -
      -
      -
      -
      -

      Pick a time

      -
        -
      • timepickerOptions - showMeridian=false, readonlyInput=true
      • -
      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.picker2.date }}

      -
      -
      -
      -
      -

      Pick a date and time

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.picker3.date }}

      -
      -
      -
      -
      -

      Pick two dates to calculate difference

      -

      Pick a date range, using two dates. Use minDate and maxDate to make sure your end date cannot be before your start date and vice-versa

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.dayRange }} (days)

      -
      -
      -
      -

      Global Configured DateTime Picker

      -

      Date picker only passes in the model and isOpen parameters, the rest are determined by the constant uiDatetimePickerConfig

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.picker6.date }}

      -
      -
      -
      -

      Use bootstrap dropup class

      -

      Use dropup to make the dropdown menu go upwards instead of down. NOTE: Cannot currently use append-to-body="true" with dropup class

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.picker7.date }}

      -
      -
      -
      -
      -

      View Mode

      -

      Use a particular view mode only for the datepicker.

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.picker8.date }}

      -
      -
      -
      -
      -

      Default Time

      -

      Set a default time when choosing a date

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.picker9.date }}

      -
      -
      -
      -

      Min / Max times

      -

      Pick a minimum time in 1 picker and a maximum time in another picker. The opposite picker will disable so you cannot overlay the ranges

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      -
      -

      Customize Button bar

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      -
      -

      Call function when closed

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.closedArgs }}

      -
      -
      -
      -
      -

      Save As ISO

      -
      -
      - -
      -

      - - - - -

      -
      -
      -
      - -
      -

      {{ ctrl.picker14.date }}

      -
      -
      -
      -
      -
      - - - \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/example/index.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/example/index.js deleted file mode 100644 index 7a798ca5ea..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/example/index.js +++ /dev/null @@ -1,168 +0,0 @@ -var app = angular.module('app', ['ui.bootstrap', 'ui.bootstrap.datetimepicker']); - -app.controller('MyController', ['$scope', function($scope) { - - var that = this; - - // date picker - this.picker1 = { - date: new Date('2015-03-01T00:00:00Z'), - datepickerOptions: { - showWeeks: false, - startingDay: 1, - dateDisabled: function(data) { - return (data.mode === 'day' && (new Date().toDateString() == data.date.toDateString())); - } - } - }; - - // time picker - this.picker2 = { - date: new Date('2015-03-01T12:30:00Z'), - timepickerOptions: { - readonlyInput: false, - showMeridian: false - } - }; - - // date and time picker - this.picker3 = { - date: new Date() - }; - - // min date picker - this.picker4 = { - date: new Date(), - datepickerOptions: { - maxDate: null - } - }; - - // max date picker - this.picker5 = { - date: new Date(), - datepickerOptions: { - minDate: null - } - }; - - // set date for max picker, 10 days in future - this.picker5.date.setDate(this.picker5.date.getDate() + 10); - - // global config picker - this.picker6 = { - date: new Date() - }; - - // dropdown up picker - this.picker7 = { - date: new Date() - }; - - // view mode picker - this.picker8 = { - date: new Date(), - datepickerOptions: { - mode: 'year', - minMode: 'year', - maxMode: 'year' - } - }; - - // dropdown up picker - this.picker9 = { - date: null - }; - - // min time picker - this.picker10 = { - date: new Date('2016-03-01T09:00:00Z'), - timepickerOptions: { - max: null - } - }; - - // max time picker - this.picker11 = { - date: new Date('2016-03-01T10:00:00Z'), - timepickerOptions: { - min: null - } - }; - - // button bar - this.picker12 = { - date: new Date(), - buttonBar: { - show: true, - now: { - show: true, - text: 'Now!' - }, - today: { - show: true, - text: 'Today!' - }, - clear: { - show: false, - text: 'Wipe' - }, - date: { - show: true, - text: 'Date' - }, - time: { - show: true, - text: 'Time' - }, - close: { - show: true, - text: 'Shut' - } - } - }; - - // when closed picker - this.picker13 = { - date: new Date(), - closed: function(args) { - that.closedArgs = args; - } - }; - - // saveAs - ISO - this.picker14 = { - date: new Date().toISOString() - } - - this.openCalendar = function(e, picker) { - that[picker].open = true; - }; - - // watch min and max dates to calculate difference - var unwatchMinMaxValues = $scope.$watch(function() { - return [that.picker4, that.picker5, that.picker10, that.picker11]; - }, function() { - // min max dates - that.picker4.datepickerOptions.maxDate = that.picker5.date; - that.picker5.datepickerOptions.minDate = that.picker4.date; - - if (that.picker4.date && that.picker5.date) { - var diff = that.picker4.date.getTime() - that.picker5.date.getTime(); - that.dayRange = Math.round(Math.abs(diff/(1000*60*60*24))) - } else { - that.dayRange = 'n/a'; - } - - // min max times - that.picker10.timepickerOptions.max = that.picker11.date; - that.picker11.timepickerOptions.min = that.picker10.date; - }, true); - - - // destroy watcher - $scope.$on('$destroy', function() { - unwatchMinMaxValues(); - }); - -}]); \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/example/style.css b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/example/style.css deleted file mode 100644 index 7adeb333ae..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/example/style.css +++ /dev/null @@ -1,15 +0,0 @@ -.form-horizontal { - width:500px; -} - -.datetime-picker-dropdown { - -} - -.datetime-picker-dropdown > li.date-picker-menu div > table .btn-default { - border: 0; -} - -.datetime-picker-dropdown > li.time-picker-menu div > table { - -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/package.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/package.js deleted file mode 100644 index 8662f2e729..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap-ui-datetime-picker/package.js +++ /dev/null @@ -1,30 +0,0 @@ -Package.describe({ - name: 'hexencoded:bootstrap-ui-datetime-picker', - version: '2.0.42', - // Brief, one-line summary of the package. - summary: 'AngularJs directive to use a date and/or time picker as a dropdown from an input', - // URL to the Git repository containing the source code for this package. - git: 'https://github.com/hexencoded/bootstrap-ui-datetime-picker.git', - // By default, Meteor will default to using README.md for documentation. - // To avoid submitting documentation, set this field to null. - documentation: 'README.md' -}); - -Package.onUse(function(api) { - api.versionsFrom('1.2.1'); - // api.use('ecmascript'); - // api.addFiles('bootstrap-ui-datetime-picker.js'); - - // Dependencies - api.use('angular:angular@1.4.0', 'client'); - api.use('angularui:angular-ui-bootstrap@1.1.0', 'client'); - - api.addFiles('dist/datetime-picker.js', 'client'); // Files in use -}); - -Package.onTest(function(api) { - api.use('ecmascript'); - api.use('tinytest'); - api.use('hexencoded:bootstrap-ui-datetime-picker'); - api.addFiles('bootstrap-ui-datetime-picker-tests.js'); -}); diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/.bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/.bower.json deleted file mode 100644 index af176f90c2..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/.bower.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "bootstrap", - "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", - "keywords": [ - "css", - "js", - "less", - "mobile-first", - "responsive", - "front-end", - "framework", - "web" - ], - "homepage": "http://getbootstrap.com", - "license": "MIT", - "moduleType": "globals", - "main": [ - "less/bootstrap.less", - "dist/js/bootstrap.js" - ], - "ignore": [ - "/.*", - "_config.yml", - "CNAME", - "composer.json", - "CONTRIBUTING.md", - "docs", - "js/tests", - "test-infra" - ], - "dependencies": { - "jquery": "1.9.1 - 3" - }, - "version": "3.3.7", - "_release": "3.3.7", - "_resolution": { - "type": "version", - "tag": "v3.3.7", - "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" - }, - "_source": "https://github.com/twbs/bootstrap.git", - "_target": "3.3.7", - "_originalSource": "bootstrap" -} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/CHANGELOG.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/CHANGELOG.md deleted file mode 100644 index b25f838413..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -Bootstrap uses [GitHub's Releases feature](https://github.com/blog/1547-release-your-software) for its changelogs. - -See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. - -Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/Gemfile b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/Gemfile deleted file mode 100644 index feb162291c..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source 'https://rubygems.org' - -group :development, :test do - gem 'jekyll', '~> 3.1.2' - gem 'jekyll-sitemap', '~> 0.11.0' -end diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/Gemfile.lock b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/Gemfile.lock deleted file mode 100644 index 1b5dc3e902..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/Gemfile.lock +++ /dev/null @@ -1,43 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.4.0) - colorator (0.1) - ffi (1.9.14-x64-mingw32) - jekyll (3.1.6) - colorator (~> 0.1) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) - mercenary (~> 0.3.3) - rouge (~> 1.7) - safe_yaml (~> 1.0) - jekyll-sass-converter (1.4.0) - sass (~> 3.4) - jekyll-sitemap (0.11.0) - addressable (~> 2.4.0) - jekyll-watch (1.4.0) - listen (~> 3.0, < 3.1) - kramdown (1.11.1) - liquid (3.0.6) - listen (3.0.8) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - mercenary (0.3.6) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) - rouge (1.11.1) - safe_yaml (1.0.4) - sass (3.4.22) - -PLATFORMS - x64-mingw32 - -DEPENDENCIES - jekyll (~> 3.1.2) - jekyll-sitemap (~> 0.11.0) - -BUNDLED WITH - 1.12.5 diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/Gruntfile.js b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/Gruntfile.js deleted file mode 100644 index 994a500871..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/Gruntfile.js +++ /dev/null @@ -1,511 +0,0 @@ -/*! - * Bootstrap's Gruntfile - * http://getbootstrap.com - * Copyright 2013-2016 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - -module.exports = function (grunt) { - 'use strict'; - - // Force use of Unix newlines - grunt.util.linefeed = '\n'; - - RegExp.quote = function (string) { - return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&'); - }; - - var fs = require('fs'); - var path = require('path'); - var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js'); - var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js'); - var getLessVarsData = function () { - var filePath = path.join(__dirname, 'less/variables.less'); - var fileContent = fs.readFileSync(filePath, { encoding: 'utf8' }); - var parser = new BsLessdocParser(fileContent); - return { sections: parser.parseFile() }; - }; - var generateRawFiles = require('./grunt/bs-raw-files-generator.js'); - var generateCommonJSModule = require('./grunt/bs-commonjs-generator.js'); - var configBridge = grunt.file.readJSON('./grunt/configBridge.json', { encoding: 'utf8' }); - - Object.keys(configBridge.paths).forEach(function (key) { - configBridge.paths[key].forEach(function (val, i, arr) { - arr[i] = path.join('./docs/assets', val); - }); - }); - - // Project configuration. - grunt.initConfig({ - - // Metadata. - pkg: grunt.file.readJSON('package.json'), - banner: '/*!\n' + - ' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' + - ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + - ' * Licensed under the <%= pkg.license %> license\n' + - ' */\n', - jqueryCheck: configBridge.config.jqueryCheck.join('\n'), - jqueryVersionCheck: configBridge.config.jqueryVersionCheck.join('\n'), - - // Task configuration. - clean: { - dist: 'dist', - docs: 'docs/dist' - }, - - jshint: { - options: { - jshintrc: 'js/.jshintrc' - }, - grunt: { - options: { - jshintrc: 'grunt/.jshintrc' - }, - src: ['Gruntfile.js', 'package.js', 'grunt/*.js'] - }, - core: { - src: 'js/*.js' - }, - test: { - options: { - jshintrc: 'js/tests/unit/.jshintrc' - }, - src: 'js/tests/unit/*.js' - }, - assets: { - src: ['docs/assets/js/src/*.js', 'docs/assets/js/*.js', '!docs/assets/js/*.min.js'] - } - }, - - jscs: { - options: { - config: 'js/.jscsrc' - }, - grunt: { - src: '<%= jshint.grunt.src %>' - }, - core: { - src: '<%= jshint.core.src %>' - }, - test: { - src: '<%= jshint.test.src %>' - }, - assets: { - options: { - requireCamelCaseOrUpperCaseIdentifiers: null - }, - src: '<%= jshint.assets.src %>' - } - }, - - concat: { - options: { - banner: '<%= banner %>\n<%= jqueryCheck %>\n<%= jqueryVersionCheck %>', - stripBanners: false - }, - bootstrap: { - src: [ - 'js/transition.js', - 'js/alert.js', - 'js/button.js', - 'js/carousel.js', - 'js/collapse.js', - 'js/dropdown.js', - 'js/modal.js', - 'js/tooltip.js', - 'js/popover.js', - 'js/scrollspy.js', - 'js/tab.js', - 'js/affix.js' - ], - dest: 'dist/js/<%= pkg.name %>.js' - } - }, - - uglify: { - options: { - compress: { - warnings: false - }, - mangle: true, - preserveComments: /^!|@preserve|@license|@cc_on/i - }, - core: { - src: '<%= concat.bootstrap.dest %>', - dest: 'dist/js/<%= pkg.name %>.min.js' - }, - customize: { - src: configBridge.paths.customizerJs, - dest: 'docs/assets/js/customize.min.js' - }, - docsJs: { - src: configBridge.paths.docsJs, - dest: 'docs/assets/js/docs.min.js' - } - }, - - qunit: { - options: { - inject: 'js/tests/unit/phantom.js' - }, - files: 'js/tests/index.html' - }, - - less: { - compileCore: { - options: { - strictMath: true, - sourceMap: true, - outputSourceFiles: true, - sourceMapURL: '<%= pkg.name %>.css.map', - sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map' - }, - src: 'less/bootstrap.less', - dest: 'dist/css/<%= pkg.name %>.css' - }, - compileTheme: { - options: { - strictMath: true, - sourceMap: true, - outputSourceFiles: true, - sourceMapURL: '<%= pkg.name %>-theme.css.map', - sourceMapFilename: 'dist/css/<%= pkg.name %>-theme.css.map' - }, - src: 'less/theme.less', - dest: 'dist/css/<%= pkg.name %>-theme.css' - } - }, - - autoprefixer: { - options: { - browsers: configBridge.config.autoprefixerBrowsers - }, - core: { - options: { - map: true - }, - src: 'dist/css/<%= pkg.name %>.css' - }, - theme: { - options: { - map: true - }, - src: 'dist/css/<%= pkg.name %>-theme.css' - }, - docs: { - src: ['docs/assets/css/src/docs.css'] - }, - examples: { - expand: true, - cwd: 'docs/examples/', - src: ['**/*.css'], - dest: 'docs/examples/' - } - }, - - csslint: { - options: { - csslintrc: 'less/.csslintrc' - }, - dist: [ - 'dist/css/bootstrap.css', - 'dist/css/bootstrap-theme.css' - ], - examples: [ - 'docs/examples/**/*.css' - ], - docs: { - options: { - ids: false, - 'overqualified-elements': false - }, - src: 'docs/assets/css/src/docs.css' - } - }, - - cssmin: { - options: { - // TODO: disable `zeroUnits` optimization once clean-css 3.2 is released - // and then simplify the fix for https://github.com/twbs/bootstrap/issues/14837 accordingly - compatibility: 'ie8', - keepSpecialComments: '*', - sourceMap: true, - sourceMapInlineSources: true, - advanced: false - }, - minifyCore: { - src: 'dist/css/<%= pkg.name %>.css', - dest: 'dist/css/<%= pkg.name %>.min.css' - }, - minifyTheme: { - src: 'dist/css/<%= pkg.name %>-theme.css', - dest: 'dist/css/<%= pkg.name %>-theme.min.css' - }, - docs: { - src: [ - 'docs/assets/css/ie10-viewport-bug-workaround.css', - 'docs/assets/css/src/pygments-manni.css', - 'docs/assets/css/src/docs.css' - ], - dest: 'docs/assets/css/docs.min.css' - } - }, - - csscomb: { - options: { - config: 'less/.csscomb.json' - }, - dist: { - expand: true, - cwd: 'dist/css/', - src: ['*.css', '!*.min.css'], - dest: 'dist/css/' - }, - examples: { - expand: true, - cwd: 'docs/examples/', - src: '**/*.css', - dest: 'docs/examples/' - }, - docs: { - src: 'docs/assets/css/src/docs.css', - dest: 'docs/assets/css/src/docs.css' - } - }, - - copy: { - fonts: { - expand: true, - src: 'fonts/**', - dest: 'dist/' - }, - docs: { - expand: true, - cwd: 'dist/', - src: [ - '**/*' - ], - dest: 'docs/dist/' - } - }, - - connect: { - server: { - options: { - port: 3000, - base: '.' - } - } - }, - - jekyll: { - options: { - bundleExec: true, - config: '_config.yml', - incremental: false - }, - docs: {}, - github: { - options: { - raw: 'github: true' - } - } - }, - - htmlmin: { - dist: { - options: { - collapseBooleanAttributes: true, - collapseWhitespace: true, - conservativeCollapse: true, - decodeEntities: false, - minifyCSS: { - compatibility: 'ie8', - keepSpecialComments: 0 - }, - minifyJS: true, - minifyURLs: false, - processConditionalComments: true, - removeAttributeQuotes: true, - removeComments: true, - removeOptionalAttributes: true, - removeOptionalTags: true, - removeRedundantAttributes: true, - removeScriptTypeAttributes: true, - removeStyleLinkTypeAttributes: true, - removeTagWhitespace: false, - sortAttributes: true, - sortClassName: true - }, - expand: true, - cwd: '_gh_pages', - dest: '_gh_pages', - src: [ - '**/*.html', - '!examples/**/*.html' - ] - } - }, - - pug: { - options: { - pretty: true, - data: getLessVarsData - }, - customizerVars: { - src: 'docs/_pug/customizer-variables.pug', - dest: 'docs/_includes/customizer-variables.html' - }, - customizerNav: { - src: 'docs/_pug/customizer-nav.pug', - dest: 'docs/_includes/nav/customize.html' - } - }, - - htmllint: { - options: { - ignore: [ - 'Attribute "autocomplete" not allowed on element "button" at this point.', - 'Attribute "autocomplete" is only allowed when the input type is "color", "date", "datetime", "datetime-local", "email", "hidden", "month", "number", "password", "range", "search", "tel", "text", "time", "url", or "week".', - 'Element "img" is missing required attribute "src".' - ] - }, - src: '_gh_pages/**/*.html' - }, - - watch: { - src: { - files: '<%= jshint.core.src %>', - tasks: ['jshint:core', 'qunit', 'concat'] - }, - test: { - files: '<%= jshint.test.src %>', - tasks: ['jshint:test', 'qunit'] - }, - less: { - files: 'less/**/*.less', - tasks: 'less' - } - }, - - 'saucelabs-qunit': { - all: { - options: { - build: process.env.TRAVIS_JOB_ID, - throttled: 10, - maxRetries: 3, - maxPollRetries: 4, - urls: ['http://127.0.0.1:3000/js/tests/index.html?hidepassed'], - browsers: grunt.file.readYAML('grunt/sauce_browsers.yml') - } - } - }, - - exec: { - npmUpdate: { - command: 'npm update' - } - }, - - compress: { - main: { - options: { - archive: 'bootstrap-<%= pkg.version %>-dist.zip', - mode: 'zip', - level: 9, - pretty: true - }, - files: [ - { - expand: true, - cwd: 'dist/', - src: ['**'], - dest: 'bootstrap-<%= pkg.version %>-dist' - } - ] - } - } - - }); - - - // These plugins provide necessary tasks. - require('load-grunt-tasks')(grunt, { scope: 'devDependencies' }); - require('time-grunt')(grunt); - - // Docs HTML validation task - grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint']); - - var runSubset = function (subset) { - return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset; - }; - var isUndefOrNonZero = function (val) { - return val === undefined || val !== '0'; - }; - - // Test task. - var testSubtasks = []; - // Skip core tests if running a different subset of the test suite - if (runSubset('core') && - // Skip core tests if this is a Savage build - process.env.TRAVIS_REPO_SLUG !== 'twbs-savage/bootstrap') { - testSubtasks = testSubtasks.concat(['dist-css', 'dist-js', 'csslint:dist', 'test-js', 'docs']); - } - // Skip HTML validation if running a different subset of the test suite - if (runSubset('validate-html') && - // Skip HTML5 validator on Travis when [skip validator] is in the commit message - isUndefOrNonZero(process.env.TWBS_DO_VALIDATOR)) { - testSubtasks.push('validate-html'); - } - // Only run Sauce Labs tests if there's a Sauce access key - if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' && - // Skip Sauce if running a different subset of the test suite - runSubset('sauce-js-unit') && - // Skip Sauce on Travis when [skip sauce] is in the commit message - isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) { - testSubtasks.push('connect'); - testSubtasks.push('saucelabs-qunit'); - } - grunt.registerTask('test', testSubtasks); - grunt.registerTask('test-js', ['jshint:core', 'jshint:test', 'jshint:grunt', 'jscs:core', 'jscs:test', 'jscs:grunt', 'qunit']); - - // JS distribution task. - grunt.registerTask('dist-js', ['concat', 'uglify:core', 'commonjs']); - - // CSS distribution task. - grunt.registerTask('less-compile', ['less:compileCore', 'less:compileTheme']); - grunt.registerTask('dist-css', ['less-compile', 'autoprefixer:core', 'autoprefixer:theme', 'csscomb:dist', 'cssmin:minifyCore', 'cssmin:minifyTheme']); - - // Full distribution task. - grunt.registerTask('dist', ['clean:dist', 'dist-css', 'copy:fonts', 'dist-js']); - - // Default task. - grunt.registerTask('default', ['clean:dist', 'copy:fonts', 'test']); - - grunt.registerTask('build-glyphicons-data', function () { generateGlyphiconsData.call(this, grunt); }); - - // task for building customizer - grunt.registerTask('build-customizer', ['build-customizer-html', 'build-raw-files']); - grunt.registerTask('build-customizer-html', 'pug'); - grunt.registerTask('build-raw-files', 'Add scripts/less files to customizer.', function () { - var banner = grunt.template.process('<%= banner %>'); - generateRawFiles(grunt, banner); - }); - - grunt.registerTask('commonjs', 'Generate CommonJS entrypoint module in dist dir.', function () { - var srcFiles = grunt.config.get('concat.bootstrap.src'); - var destFilepath = 'dist/js/npm.js'; - generateCommonJSModule(grunt, srcFiles, destFilepath); - }); - - // Docs task. - grunt.registerTask('docs-css', ['autoprefixer:docs', 'autoprefixer:examples', 'csscomb:docs', 'csscomb:examples', 'cssmin:docs']); - grunt.registerTask('lint-docs-css', ['csslint:docs', 'csslint:examples']); - grunt.registerTask('docs-js', ['uglify:docsJs', 'uglify:customize']); - grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']); - grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-glyphicons-data', 'build-customizer']); - grunt.registerTask('docs-github', ['jekyll:github', 'htmlmin']); - - grunt.registerTask('prep-release', ['dist', 'docs', 'docs-github', 'compress']); -}; diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/ISSUE_TEMPLATE.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/ISSUE_TEMPLATE.md deleted file mode 100644 index 66c3a2bb21..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,22 +0,0 @@ -Before opening an issue: - -- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue) -- [Validate](http://validator.w3.org/nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems -- Prepare a [reduced test case](https://css-tricks.com/reduced-test-cases/) for any bugs -- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md) - -When asking general "how to" questions: - -- Please do not open an issue here -- Instead, ask for help on [StackOverflow, IRC, or Slack](https://github.com/twbs/bootstrap/blob/master/README.md#community) - -When reporting a bug, include: - -- Operating system and version (Windows, Mac OS X, Android, iOS, Win10 Mobile) -- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser) -- Reduced test cases and potential fixes using [JS Bin](https://jsbin.com) - -When suggesting a feature, include: - -- As much detail as possible for what we should add and why it's important to Bootstrap -- Relevant links to prior art, screenshots, or live demos whenever possible diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/LICENSE b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/LICENSE deleted file mode 100644 index 7a300022c3..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2011-2016 Twitter, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/README.md b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/README.md deleted file mode 100644 index f92150f4f6..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# [Bootstrap](http://getbootstrap.com) - -[![Slack](https://bootstrap-slack.herokuapp.com/badge.svg)](https://bootstrap-slack.herokuapp.com) -![Bower version](https://img.shields.io/bower/v/bootstrap.svg) -[![npm version](https://img.shields.io/npm/v/bootstrap.svg)](https://www.npmjs.com/package/bootstrap) -[![Build Status](https://img.shields.io/travis/twbs/bootstrap/master.svg)](https://travis-ci.org/twbs/bootstrap) -[![devDependency Status](https://img.shields.io/david/dev/twbs/bootstrap.svg)](https://david-dm.org/twbs/bootstrap#info=devDependencies) -[![NuGet](https://img.shields.io/nuget/v/bootstrap.svg)](https://www.nuget.org/packages/Bootstrap) -[![Selenium Test Status](https://saucelabs.com/browser-matrix/bootstrap.svg)](https://saucelabs.com/u/bootstrap) - -Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thornton](https://twitter.com/fat), and maintained by the [core team](https://github.com/orgs/twbs/people) with the massive support and involvement of the community. - -To get started, check out ! - - -## Table of contents - -* [Quick start](#quick-start) -* [Bugs and feature requests](#bugs-and-feature-requests) -* [Documentation](#documentation) -* [Contributing](#contributing) -* [Community](#community) -* [Versioning](#versioning) -* [Creators](#creators) -* [Copyright and license](#copyright-and-license) - - -## Quick start - -Several quick start options are available: - -* [Download the latest release](https://github.com/twbs/bootstrap/archive/v3.3.7.zip). -* Clone the repo: `git clone https://github.com/twbs/bootstrap.git`. -* Install with [Bower](http://bower.io): `bower install bootstrap`. -* Install with [npm](https://www.npmjs.com): `npm install bootstrap@3`. -* Install with [Meteor](https://www.meteor.com): `meteor add twbs:bootstrap`. -* Install with [Composer](https://getcomposer.org): `composer require twbs/bootstrap`. - -Read the [Getting started page](http://getbootstrap.com/getting-started/) for information on the framework contents, templates and examples, and more. - -### What's included - -Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this: - -``` -bootstrap/ -├── css/ -│ ├── bootstrap.css -│ ├── bootstrap.css.map -│ ├── bootstrap.min.css -│ ├── bootstrap.min.css.map -│ ├── bootstrap-theme.css -│ ├── bootstrap-theme.css.map -│ ├── bootstrap-theme.min.css -│ └── bootstrap-theme.min.css.map -├── js/ -│ ├── bootstrap.js -│ └── bootstrap.min.js -└── fonts/ - ├── glyphicons-halflings-regular.eot - ├── glyphicons-halflings-regular.svg - ├── glyphicons-halflings-regular.ttf - ├── glyphicons-halflings-regular.woff - └── glyphicons-halflings-regular.woff2 -``` - -We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). CSS [source maps](https://developer.chrome.com/devtools/docs/css-preprocessors) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Fonts from Glyphicons are included, as is the optional Bootstrap theme. - - -## Bugs and feature requests - -Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new). - -Note that **feature requests must target [Bootstrap v4](https://github.com/twbs/bootstrap/tree/v4-dev),** because Bootstrap v3 is now in maintenance mode and is closed off to new features. This is so that we can focus our efforts on Bootstrap v4. - - -## Documentation - -Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at . The docs may also be run locally. - -### Running documentation locally - -1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation) and other Ruby dependencies with `bundle install`. - **Note for Windows users:** Read [this unofficial guide](http://jekyll-windows.juthilo.com/) to get Jekyll up and running without problems. -2. From the root `/bootstrap` directory, run `bundle exec jekyll serve` in the command line. -4. Open `http://localhost:9001` in your browser, and voilà. - -Learn more about using Jekyll by reading its [documentation](http://jekyllrb.com/docs/home/). - -### Documentation for previous releases - -Documentation for v2.3.2 has been made available for the time being at while folks transition to Bootstrap 3. - -[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download. - - -## Contributing - -Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development. - -Moreover, if your pull request contains JavaScript patches or features, you must include [relevant unit tests](https://github.com/twbs/bootstrap/tree/master/js/tests). All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo). - -**Bootstrap v3 is now closed off to new features.** It has gone into maintenance mode so that we can focus our efforts on [Bootstrap v4](https://github.com/twbs/bootstrap/tree/v4-dev), the future of the framework. Pull requests which add new features (rather than fix bugs) should target [Bootstrap v4 (the `v4-dev` git branch)](https://github.com/twbs/bootstrap/tree/v4-dev) instead. - -Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at . - - -## Community - -Get updates on Bootstrap's development and chat with the project maintainers and community members. - -* Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap). -* Read and subscribe to [The Official Bootstrap Blog](http://blog.getbootstrap.com). -* Join [the official Slack room](https://bootstrap-slack.herokuapp.com). -* Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel. -* Implementation help may be found at Stack Overflow (tagged [`twitter-bootstrap-3`](https://stackoverflow.com/questions/tagged/twitter-bootstrap-3)). -* Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/browse/keyword/bootstrap) or similar delivery mechanisms for maximum discoverability. - - -## Versioning - -For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible. - -See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release. - - -## Creators - -**Mark Otto** - -* -* - -**Jacob Thornton** - -* -* - - -## Copyright and license - -Code and documentation copyright 2011-2016 Twitter, Inc. Code released under [the MIT license](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE). diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/bower.json b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/bower.json deleted file mode 100644 index b1b1bc0da5..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/bower.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "bootstrap", - "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", - "keywords": [ - "css", - "js", - "less", - "mobile-first", - "responsive", - "front-end", - "framework", - "web" - ], - "homepage": "http://getbootstrap.com", - "license": "MIT", - "moduleType": "globals", - "main": [ - "less/bootstrap.less", - "dist/js/bootstrap.js" - ], - "ignore": [ - "/.*", - "_config.yml", - "CNAME", - "composer.json", - "CONTRIBUTING.md", - "docs", - "js/tests", - "test-infra" - ], - "dependencies": { - "jquery": "1.9.1 - 3" - } -} diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.css b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.css deleted file mode 100644 index 31d8882661..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.css +++ /dev/null @@ -1,587 +0,0 @@ -/*! - * Bootstrap v3.3.7 (http://getbootstrap.com) - * Copyright 2011-2016 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -.btn-default, -.btn-primary, -.btn-success, -.btn-info, -.btn-warning, -.btn-danger { - text-shadow: 0 -1px 0 rgba(0, 0, 0, .2); - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); -} -.btn-default:active, -.btn-primary:active, -.btn-success:active, -.btn-info:active, -.btn-warning:active, -.btn-danger:active, -.btn-default.active, -.btn-primary.active, -.btn-success.active, -.btn-info.active, -.btn-warning.active, -.btn-danger.active { - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); -} -.btn-default.disabled, -.btn-primary.disabled, -.btn-success.disabled, -.btn-info.disabled, -.btn-warning.disabled, -.btn-danger.disabled, -.btn-default[disabled], -.btn-primary[disabled], -.btn-success[disabled], -.btn-info[disabled], -.btn-warning[disabled], -.btn-danger[disabled], -fieldset[disabled] .btn-default, -fieldset[disabled] .btn-primary, -fieldset[disabled] .btn-success, -fieldset[disabled] .btn-info, -fieldset[disabled] .btn-warning, -fieldset[disabled] .btn-danger { - -webkit-box-shadow: none; - box-shadow: none; -} -.btn-default .badge, -.btn-primary .badge, -.btn-success .badge, -.btn-info .badge, -.btn-warning .badge, -.btn-danger .badge { - text-shadow: none; -} -.btn:active, -.btn.active { - background-image: none; -} -.btn-default { - text-shadow: 0 1px 0 #fff; - background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%); - background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0)); - background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - background-repeat: repeat-x; - border-color: #dbdbdb; - border-color: #ccc; -} -.btn-default:hover, -.btn-default:focus { - background-color: #e0e0e0; - background-position: 0 -15px; -} -.btn-default:active, -.btn-default.active { - background-color: #e0e0e0; - border-color: #dbdbdb; -} -.btn-default.disabled, -.btn-default[disabled], -fieldset[disabled] .btn-default, -.btn-default.disabled:hover, -.btn-default[disabled]:hover, -fieldset[disabled] .btn-default:hover, -.btn-default.disabled:focus, -.btn-default[disabled]:focus, -fieldset[disabled] .btn-default:focus, -.btn-default.disabled.focus, -.btn-default[disabled].focus, -fieldset[disabled] .btn-default.focus, -.btn-default.disabled:active, -.btn-default[disabled]:active, -fieldset[disabled] .btn-default:active, -.btn-default.disabled.active, -.btn-default[disabled].active, -fieldset[disabled] .btn-default.active { - background-color: #e0e0e0; - background-image: none; -} -.btn-primary { - background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%); - background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88)); - background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - background-repeat: repeat-x; - border-color: #245580; -} -.btn-primary:hover, -.btn-primary:focus { - background-color: #265a88; - background-position: 0 -15px; -} -.btn-primary:active, -.btn-primary.active { - background-color: #265a88; - border-color: #245580; -} -.btn-primary.disabled, -.btn-primary[disabled], -fieldset[disabled] .btn-primary, -.btn-primary.disabled:hover, -.btn-primary[disabled]:hover, -fieldset[disabled] .btn-primary:hover, -.btn-primary.disabled:focus, -.btn-primary[disabled]:focus, -fieldset[disabled] .btn-primary:focus, -.btn-primary.disabled.focus, -.btn-primary[disabled].focus, -fieldset[disabled] .btn-primary.focus, -.btn-primary.disabled:active, -.btn-primary[disabled]:active, -fieldset[disabled] .btn-primary:active, -.btn-primary.disabled.active, -.btn-primary[disabled].active, -fieldset[disabled] .btn-primary.active { - background-color: #265a88; - background-image: none; -} -.btn-success { - background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); - background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641)); - background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - background-repeat: repeat-x; - border-color: #3e8f3e; -} -.btn-success:hover, -.btn-success:focus { - background-color: #419641; - background-position: 0 -15px; -} -.btn-success:active, -.btn-success.active { - background-color: #419641; - border-color: #3e8f3e; -} -.btn-success.disabled, -.btn-success[disabled], -fieldset[disabled] .btn-success, -.btn-success.disabled:hover, -.btn-success[disabled]:hover, -fieldset[disabled] .btn-success:hover, -.btn-success.disabled:focus, -.btn-success[disabled]:focus, -fieldset[disabled] .btn-success:focus, -.btn-success.disabled.focus, -.btn-success[disabled].focus, -fieldset[disabled] .btn-success.focus, -.btn-success.disabled:active, -.btn-success[disabled]:active, -fieldset[disabled] .btn-success:active, -.btn-success.disabled.active, -.btn-success[disabled].active, -fieldset[disabled] .btn-success.active { - background-color: #419641; - background-image: none; -} -.btn-info { - background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); - background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2)); - background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - background-repeat: repeat-x; - border-color: #28a4c9; -} -.btn-info:hover, -.btn-info:focus { - background-color: #2aabd2; - background-position: 0 -15px; -} -.btn-info:active, -.btn-info.active { - background-color: #2aabd2; - border-color: #28a4c9; -} -.btn-info.disabled, -.btn-info[disabled], -fieldset[disabled] .btn-info, -.btn-info.disabled:hover, -.btn-info[disabled]:hover, -fieldset[disabled] .btn-info:hover, -.btn-info.disabled:focus, -.btn-info[disabled]:focus, -fieldset[disabled] .btn-info:focus, -.btn-info.disabled.focus, -.btn-info[disabled].focus, -fieldset[disabled] .btn-info.focus, -.btn-info.disabled:active, -.btn-info[disabled]:active, -fieldset[disabled] .btn-info:active, -.btn-info.disabled.active, -.btn-info[disabled].active, -fieldset[disabled] .btn-info.active { - background-color: #2aabd2; - background-image: none; -} -.btn-warning { - background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); - background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316)); - background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - background-repeat: repeat-x; - border-color: #e38d13; -} -.btn-warning:hover, -.btn-warning:focus { - background-color: #eb9316; - background-position: 0 -15px; -} -.btn-warning:active, -.btn-warning.active { - background-color: #eb9316; - border-color: #e38d13; -} -.btn-warning.disabled, -.btn-warning[disabled], -fieldset[disabled] .btn-warning, -.btn-warning.disabled:hover, -.btn-warning[disabled]:hover, -fieldset[disabled] .btn-warning:hover, -.btn-warning.disabled:focus, -.btn-warning[disabled]:focus, -fieldset[disabled] .btn-warning:focus, -.btn-warning.disabled.focus, -.btn-warning[disabled].focus, -fieldset[disabled] .btn-warning.focus, -.btn-warning.disabled:active, -.btn-warning[disabled]:active, -fieldset[disabled] .btn-warning:active, -.btn-warning.disabled.active, -.btn-warning[disabled].active, -fieldset[disabled] .btn-warning.active { - background-color: #eb9316; - background-image: none; -} -.btn-danger { - background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); - background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a)); - background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - background-repeat: repeat-x; - border-color: #b92c28; -} -.btn-danger:hover, -.btn-danger:focus { - background-color: #c12e2a; - background-position: 0 -15px; -} -.btn-danger:active, -.btn-danger.active { - background-color: #c12e2a; - border-color: #b92c28; -} -.btn-danger.disabled, -.btn-danger[disabled], -fieldset[disabled] .btn-danger, -.btn-danger.disabled:hover, -.btn-danger[disabled]:hover, -fieldset[disabled] .btn-danger:hover, -.btn-danger.disabled:focus, -.btn-danger[disabled]:focus, -fieldset[disabled] .btn-danger:focus, -.btn-danger.disabled.focus, -.btn-danger[disabled].focus, -fieldset[disabled] .btn-danger.focus, -.btn-danger.disabled:active, -.btn-danger[disabled]:active, -fieldset[disabled] .btn-danger:active, -.btn-danger.disabled.active, -.btn-danger[disabled].active, -fieldset[disabled] .btn-danger.active { - background-color: #c12e2a; - background-image: none; -} -.thumbnail, -.img-thumbnail { - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); - box-shadow: 0 1px 2px rgba(0, 0, 0, .075); -} -.dropdown-menu > li > a:hover, -.dropdown-menu > li > a:focus { - background-color: #e8e8e8; - background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); - background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); - background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); - background-repeat: repeat-x; -} -.dropdown-menu > .active > a, -.dropdown-menu > .active > a:hover, -.dropdown-menu > .active > a:focus { - background-color: #2e6da4; - background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); - background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); - background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); - background-repeat: repeat-x; -} -.navbar-default { - background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%); - background-image: -o-linear-gradient(top, #fff 0%, #f8f8f8 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8)); - background-image: linear-gradient(to bottom, #fff 0%, #f8f8f8 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - background-repeat: repeat-x; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); -} -.navbar-default .navbar-nav > .open > a, -.navbar-default .navbar-nav > .active > a { - background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); - background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2)); - background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0); - background-repeat: repeat-x; - -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); - box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); -} -.navbar-brand, -.navbar-nav > li > a { - text-shadow: 0 1px 0 rgba(255, 255, 255, .25); -} -.navbar-inverse { - background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%); - background-image: -o-linear-gradient(top, #3c3c3c 0%, #222 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222)); - background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - background-repeat: repeat-x; - border-radius: 4px; -} -.navbar-inverse .navbar-nav > .open > a, -.navbar-inverse .navbar-nav > .active > a { - background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%); - background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f)); - background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0); - background-repeat: repeat-x; - -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); - box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); -} -.navbar-inverse .navbar-brand, -.navbar-inverse .navbar-nav > li > a { - text-shadow: 0 -1px 0 rgba(0, 0, 0, .25); -} -.navbar-static-top, -.navbar-fixed-top, -.navbar-fixed-bottom { - border-radius: 0; -} -@media (max-width: 767px) { - .navbar .navbar-nav .open .dropdown-menu > .active > a, - .navbar .navbar-nav .open .dropdown-menu > .active > a:hover, - .navbar .navbar-nav .open .dropdown-menu > .active > a:focus { - color: #fff; - background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); - background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); - background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); - background-repeat: repeat-x; - } -} -.alert { - text-shadow: 0 1px 0 rgba(255, 255, 255, .2); - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); -} -.alert-success { - background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); - background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc)); - background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); - background-repeat: repeat-x; - border-color: #b2dba1; -} -.alert-info { - background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); - background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0)); - background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); - background-repeat: repeat-x; - border-color: #9acfea; -} -.alert-warning { - background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); - background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0)); - background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); - background-repeat: repeat-x; - border-color: #f5e79e; -} -.alert-danger { - background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); - background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3)); - background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); - background-repeat: repeat-x; - border-color: #dca7a7; -} -.progress { - background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); - background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5)); - background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); - background-repeat: repeat-x; -} -.progress-bar { - background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%); - background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090)); - background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0); - background-repeat: repeat-x; -} -.progress-bar-success { - background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); - background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44)); - background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); - background-repeat: repeat-x; -} -.progress-bar-info { - background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); - background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5)); - background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); - background-repeat: repeat-x; -} -.progress-bar-warning { - background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); - background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f)); - background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); - background-repeat: repeat-x; -} -.progress-bar-danger { - background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); - background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c)); - background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); - background-repeat: repeat-x; -} -.progress-bar-striped { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -} -.list-group { - border-radius: 4px; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); - box-shadow: 0 1px 2px rgba(0, 0, 0, .075); -} -.list-group-item.active, -.list-group-item.active:hover, -.list-group-item.active:focus { - text-shadow: 0 -1px 0 #286090; - background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%); - background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a)); - background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0); - background-repeat: repeat-x; - border-color: #2b669a; -} -.list-group-item.active .badge, -.list-group-item.active:hover .badge, -.list-group-item.active:focus .badge { - text-shadow: none; -} -.panel { - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05); - box-shadow: 0 1px 2px rgba(0, 0, 0, .05); -} -.panel-default > .panel-heading { - background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); - background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); - background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); - background-repeat: repeat-x; -} -.panel-primary > .panel-heading { - background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); - background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); - background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); - background-repeat: repeat-x; -} -.panel-success > .panel-heading { - background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); - background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6)); - background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); - background-repeat: repeat-x; -} -.panel-info > .panel-heading { - background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); - background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3)); - background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); - background-repeat: repeat-x; -} -.panel-warning > .panel-heading { - background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); - background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc)); - background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); - background-repeat: repeat-x; -} -.panel-danger > .panel-heading { - background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); - background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc)); - background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); - background-repeat: repeat-x; -} -.well { - background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); - background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); - background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5)); - background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); - background-repeat: repeat-x; - border-color: #dcdcdc; - -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); - box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); -} -/*# sourceMappingURL=bootstrap-theme.css.map */ diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.css.map b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.css.map deleted file mode 100644 index d876f60fb4..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["bootstrap-theme.css","less/theme.less","less/mixins/vendor-prefixes.less","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":"AAAA;;;;GAIG;ACeH;;;;;;EAME,yCAAA;EC2CA,4FAAA;EACQ,oFAAA;CFvDT;ACgBC;;;;;;;;;;;;ECsCA,yDAAA;EACQ,iDAAA;CFxCT;ACMC;;;;;;;;;;;;;;;;;;ECiCA,yBAAA;EACQ,iBAAA;CFnBT;AC/BD;;;;;;EAuBI,kBAAA;CDgBH;ACyBC;;EAEE,uBAAA;CDvBH;AC4BD;EErEI,sEAAA;EACA,iEAAA;EACA,2FAAA;EAAA,oEAAA;EAEA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F,sBAAA;CDmPD;ACxPD;;;EAQI,kBAAA;CDqPH;AC3OD;ECnME,kDAAA;EACQ,0CAAA;CFibT;ACrOD;EE5PI,yEAAA;EACA,oEAAA;EACA,8FAAA;EAAA,uEAAA;EACA,4BAAA;EACA,uHAAA;CHoeH;AC3OD;EE7PI,yEAAA;EACA,oEAAA;EACA,8FAAA;EAAA,uEAAA;EACA,4BAAA;EACA,uHAAA;CH2eH;ACjPD;EE9PI,yEAAA;EACA,oEAAA;EACA,8FAAA;EAAA,uEAAA;EACA,4BAAA;EACA,uHAAA;CHkfH;ACvPD;EE/PI,yEAAA;EACA,oEAAA;EACA,8FAAA;EAAA,uEAAA;EACA,4BAAA;EACA,uHAAA;CHyfH;AC7PD;EEhQI,yEAAA;EACA,oEAAA;EACA,8FAAA;EAAA,uEAAA;EACA,4BAAA;EACA,uHAAA;CHggBH;ACnQD;EEjQI,yEAAA;EACA,oEAAA;EACA,8FAAA;EAAA,uEAAA;EACA,4BAAA;EACA,uHAAA;CHugBH;ACnQD;EExQI,yEAAA;EACA,oEAAA;EACA,8FAAA;EAAA,uEAAA;EACA,4BAAA;EACA,uHAAA;EFsQF,sBAAA;EC3NA,0FAAA;EACQ,kFAAA;CFqeT","file":"bootstrap-theme.css","sourcesContent":["/*!\n * Bootstrap v3.3.7 (http://getbootstrap.com)\n * Copyright 2011-2016 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n.btn-default,\n.btn-primary,\n.btn-success,\n.btn-info,\n.btn-warning,\n.btn-danger {\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.btn-default:active,\n.btn-primary:active,\n.btn-success:active,\n.btn-info:active,\n.btn-warning:active,\n.btn-danger:active,\n.btn-default.active,\n.btn-primary.active,\n.btn-success.active,\n.btn-info.active,\n.btn-warning.active,\n.btn-danger.active {\n -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn-default.disabled,\n.btn-primary.disabled,\n.btn-success.disabled,\n.btn-info.disabled,\n.btn-warning.disabled,\n.btn-danger.disabled,\n.btn-default[disabled],\n.btn-primary[disabled],\n.btn-success[disabled],\n.btn-info[disabled],\n.btn-warning[disabled],\n.btn-danger[disabled],\nfieldset[disabled] .btn-default,\nfieldset[disabled] .btn-primary,\nfieldset[disabled] .btn-success,\nfieldset[disabled] .btn-info,\nfieldset[disabled] .btn-warning,\nfieldset[disabled] .btn-danger {\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.btn-default .badge,\n.btn-primary .badge,\n.btn-success .badge,\n.btn-info .badge,\n.btn-warning .badge,\n.btn-danger .badge {\n text-shadow: none;\n}\n.btn:active,\n.btn.active {\n background-image: none;\n}\n.btn-default {\n background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);\n background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);\n background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #dbdbdb;\n text-shadow: 0 1px 0 #fff;\n border-color: #ccc;\n}\n.btn-default:hover,\n.btn-default:focus {\n background-color: #e0e0e0;\n background-position: 0 -15px;\n}\n.btn-default:active,\n.btn-default.active {\n background-color: #e0e0e0;\n border-color: #dbdbdb;\n}\n.btn-default.disabled,\n.btn-default[disabled],\nfieldset[disabled] .btn-default,\n.btn-default.disabled:hover,\n.btn-default[disabled]:hover,\nfieldset[disabled] .btn-default:hover,\n.btn-default.disabled:focus,\n.btn-default[disabled]:focus,\nfieldset[disabled] .btn-default:focus,\n.btn-default.disabled.focus,\n.btn-default[disabled].focus,\nfieldset[disabled] .btn-default.focus,\n.btn-default.disabled:active,\n.btn-default[disabled]:active,\nfieldset[disabled] .btn-default:active,\n.btn-default.disabled.active,\n.btn-default[disabled].active,\nfieldset[disabled] .btn-default.active {\n background-color: #e0e0e0;\n background-image: none;\n}\n.btn-primary {\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #245580;\n}\n.btn-primary:hover,\n.btn-primary:focus {\n background-color: #265a88;\n background-position: 0 -15px;\n}\n.btn-primary:active,\n.btn-primary.active {\n background-color: #265a88;\n border-color: #245580;\n}\n.btn-primary.disabled,\n.btn-primary[disabled],\nfieldset[disabled] .btn-primary,\n.btn-primary.disabled:hover,\n.btn-primary[disabled]:hover,\nfieldset[disabled] .btn-primary:hover,\n.btn-primary.disabled:focus,\n.btn-primary[disabled]:focus,\nfieldset[disabled] .btn-primary:focus,\n.btn-primary.disabled.focus,\n.btn-primary[disabled].focus,\nfieldset[disabled] .btn-primary.focus,\n.btn-primary.disabled:active,\n.btn-primary[disabled]:active,\nfieldset[disabled] .btn-primary:active,\n.btn-primary.disabled.active,\n.btn-primary[disabled].active,\nfieldset[disabled] .btn-primary.active {\n background-color: #265a88;\n background-image: none;\n}\n.btn-success {\n background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);\n background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);\n background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #3e8f3e;\n}\n.btn-success:hover,\n.btn-success:focus {\n background-color: #419641;\n background-position: 0 -15px;\n}\n.btn-success:active,\n.btn-success.active {\n background-color: #419641;\n border-color: #3e8f3e;\n}\n.btn-success.disabled,\n.btn-success[disabled],\nfieldset[disabled] .btn-success,\n.btn-success.disabled:hover,\n.btn-success[disabled]:hover,\nfieldset[disabled] .btn-success:hover,\n.btn-success.disabled:focus,\n.btn-success[disabled]:focus,\nfieldset[disabled] .btn-success:focus,\n.btn-success.disabled.focus,\n.btn-success[disabled].focus,\nfieldset[disabled] .btn-success.focus,\n.btn-success.disabled:active,\n.btn-success[disabled]:active,\nfieldset[disabled] .btn-success:active,\n.btn-success.disabled.active,\n.btn-success[disabled].active,\nfieldset[disabled] .btn-success.active {\n background-color: #419641;\n background-image: none;\n}\n.btn-info {\n background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);\n background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);\n background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #28a4c9;\n}\n.btn-info:hover,\n.btn-info:focus {\n background-color: #2aabd2;\n background-position: 0 -15px;\n}\n.btn-info:active,\n.btn-info.active {\n background-color: #2aabd2;\n border-color: #28a4c9;\n}\n.btn-info.disabled,\n.btn-info[disabled],\nfieldset[disabled] .btn-info,\n.btn-info.disabled:hover,\n.btn-info[disabled]:hover,\nfieldset[disabled] .btn-info:hover,\n.btn-info.disabled:focus,\n.btn-info[disabled]:focus,\nfieldset[disabled] .btn-info:focus,\n.btn-info.disabled.focus,\n.btn-info[disabled].focus,\nfieldset[disabled] .btn-info.focus,\n.btn-info.disabled:active,\n.btn-info[disabled]:active,\nfieldset[disabled] .btn-info:active,\n.btn-info.disabled.active,\n.btn-info[disabled].active,\nfieldset[disabled] .btn-info.active {\n background-color: #2aabd2;\n background-image: none;\n}\n.btn-warning {\n background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);\n background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);\n background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #e38d13;\n}\n.btn-warning:hover,\n.btn-warning:focus {\n background-color: #eb9316;\n background-position: 0 -15px;\n}\n.btn-warning:active,\n.btn-warning.active {\n background-color: #eb9316;\n border-color: #e38d13;\n}\n.btn-warning.disabled,\n.btn-warning[disabled],\nfieldset[disabled] .btn-warning,\n.btn-warning.disabled:hover,\n.btn-warning[disabled]:hover,\nfieldset[disabled] .btn-warning:hover,\n.btn-warning.disabled:focus,\n.btn-warning[disabled]:focus,\nfieldset[disabled] .btn-warning:focus,\n.btn-warning.disabled.focus,\n.btn-warning[disabled].focus,\nfieldset[disabled] .btn-warning.focus,\n.btn-warning.disabled:active,\n.btn-warning[disabled]:active,\nfieldset[disabled] .btn-warning:active,\n.btn-warning.disabled.active,\n.btn-warning[disabled].active,\nfieldset[disabled] .btn-warning.active {\n background-color: #eb9316;\n background-image: none;\n}\n.btn-danger {\n background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);\n background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);\n background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #b92c28;\n}\n.btn-danger:hover,\n.btn-danger:focus {\n background-color: #c12e2a;\n background-position: 0 -15px;\n}\n.btn-danger:active,\n.btn-danger.active {\n background-color: #c12e2a;\n border-color: #b92c28;\n}\n.btn-danger.disabled,\n.btn-danger[disabled],\nfieldset[disabled] .btn-danger,\n.btn-danger.disabled:hover,\n.btn-danger[disabled]:hover,\nfieldset[disabled] .btn-danger:hover,\n.btn-danger.disabled:focus,\n.btn-danger[disabled]:focus,\nfieldset[disabled] .btn-danger:focus,\n.btn-danger.disabled.focus,\n.btn-danger[disabled].focus,\nfieldset[disabled] .btn-danger.focus,\n.btn-danger.disabled:active,\n.btn-danger[disabled]:active,\nfieldset[disabled] .btn-danger:active,\n.btn-danger.disabled.active,\n.btn-danger[disabled].active,\nfieldset[disabled] .btn-danger.active {\n background-color: #c12e2a;\n background-image: none;\n}\n.thumbnail,\n.img-thumbnail {\n -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n}\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);\n background-color: #e8e8e8;\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);\n background-color: #2e6da4;\n}\n.navbar-default {\n background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);\n background-image: -o-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);\n background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);\n}\n.navbar-default .navbar-nav > .open > a,\n.navbar-default .navbar-nav > .active > a {\n background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);\n background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);\n background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);\n -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);\n}\n.navbar-brand,\n.navbar-nav > li > a {\n text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);\n}\n.navbar-inverse {\n background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%);\n background-image: -o-linear-gradient(top, #3c3c3c 0%, #222 100%);\n background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n border-radius: 4px;\n}\n.navbar-inverse .navbar-nav > .open > a,\n.navbar-inverse .navbar-nav > .active > a {\n background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);\n background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);\n background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);\n -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);\n box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);\n}\n.navbar-inverse .navbar-brand,\n.navbar-inverse .navbar-nav > li > a {\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\n.navbar-static-top,\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n border-radius: 0;\n}\n@media (max-width: 767px) {\n .navbar .navbar-nav .open .dropdown-menu > .active > a,\n .navbar .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #fff;\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);\n }\n}\n.alert {\n text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);\n}\n.alert-success {\n background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);\n background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);\n background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);\n border-color: #b2dba1;\n}\n.alert-info {\n background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);\n background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);\n background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);\n border-color: #9acfea;\n}\n.alert-warning {\n background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);\n background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);\n background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);\n border-color: #f5e79e;\n}\n.alert-danger {\n background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);\n background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);\n background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);\n border-color: #dca7a7;\n}\n.progress {\n background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);\n background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);\n background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);\n}\n.progress-bar {\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);\n}\n.progress-bar-success {\n background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);\n background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);\n background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);\n}\n.progress-bar-info {\n background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);\n background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);\n background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);\n}\n.progress-bar-warning {\n background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);\n background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);\n background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);\n}\n.progress-bar-danger {\n background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);\n background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);\n background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);\n}\n.progress-bar-striped {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.list-group {\n border-radius: 4px;\n -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n text-shadow: 0 -1px 0 #286090;\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);\n border-color: #2b669a;\n}\n.list-group-item.active .badge,\n.list-group-item.active:hover .badge,\n.list-group-item.active:focus .badge {\n text-shadow: none;\n}\n.panel {\n -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n}\n.panel-default > .panel-heading {\n background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);\n}\n.panel-primary > .panel-heading {\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);\n}\n.panel-success > .panel-heading {\n background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);\n background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);\n background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);\n}\n.panel-info > .panel-heading {\n background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);\n background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);\n background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);\n}\n.panel-warning > .panel-heading {\n background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);\n background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);\n background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);\n}\n.panel-danger > .panel-heading {\n background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);\n background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);\n background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);\n}\n.well {\n background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);\n background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);\n background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);\n border-color: #dcdcdc;\n -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);\n}\n/*# sourceMappingURL=bootstrap-theme.css.map */","/*!\n * Bootstrap v3.3.7 (http://getbootstrap.com)\n * Copyright 2011-2016 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n\n//\n// Load core variables and mixins\n// --------------------------------------------------\n\n@import \"variables.less\";\n@import \"mixins.less\";\n\n\n//\n// Buttons\n// --------------------------------------------------\n\n// Common styles\n.btn-default,\n.btn-primary,\n.btn-success,\n.btn-info,\n.btn-warning,\n.btn-danger {\n text-shadow: 0 -1px 0 rgba(0,0,0,.2);\n @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);\n .box-shadow(@shadow);\n\n // Reset the shadow\n &:active,\n &.active {\n .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n }\n\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n .box-shadow(none);\n }\n\n .badge {\n text-shadow: none;\n }\n}\n\n// Mixin for generating new styles\n.btn-styles(@btn-color: #555) {\n #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 12%));\n .reset-filter(); // Disable gradients for IE9 because filter bleeds through rounded corners; see https://github.com/twbs/bootstrap/issues/10620\n background-repeat: repeat-x;\n border-color: darken(@btn-color, 14%);\n\n &:hover,\n &:focus {\n background-color: darken(@btn-color, 12%);\n background-position: 0 -15px;\n }\n\n &:active,\n &.active {\n background-color: darken(@btn-color, 12%);\n border-color: darken(@btn-color, 14%);\n }\n\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n &,\n &:hover,\n &:focus,\n &.focus,\n &:active,\n &.active {\n background-color: darken(@btn-color, 12%);\n background-image: none;\n }\n }\n}\n\n// Common styles\n.btn {\n // Remove the gradient for the pressed/active state\n &:active,\n &.active {\n background-image: none;\n }\n}\n\n// Apply the mixin to the buttons\n.btn-default { .btn-styles(@btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; }\n.btn-primary { .btn-styles(@btn-primary-bg); }\n.btn-success { .btn-styles(@btn-success-bg); }\n.btn-info { .btn-styles(@btn-info-bg); }\n.btn-warning { .btn-styles(@btn-warning-bg); }\n.btn-danger { .btn-styles(@btn-danger-bg); }\n\n\n//\n// Images\n// --------------------------------------------------\n\n.thumbnail,\n.img-thumbnail {\n .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n\n\n//\n// Dropdowns\n// --------------------------------------------------\n\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));\n background-color: darken(@dropdown-link-hover-bg, 5%);\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n background-color: darken(@dropdown-link-active-bg, 5%);\n}\n\n\n//\n// Navbar\n// --------------------------------------------------\n\n// Default navbar\n.navbar-default {\n #gradient > .vertical(@start-color: lighten(@navbar-default-bg, 10%); @end-color: @navbar-default-bg);\n .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered\n border-radius: @navbar-border-radius;\n @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075);\n .box-shadow(@shadow);\n\n .navbar-nav > .open > a,\n .navbar-nav > .active > a {\n #gradient > .vertical(@start-color: darken(@navbar-default-link-active-bg, 5%); @end-color: darken(@navbar-default-link-active-bg, 2%));\n .box-shadow(inset 0 3px 9px rgba(0,0,0,.075));\n }\n}\n.navbar-brand,\n.navbar-nav > li > a {\n text-shadow: 0 1px 0 rgba(255,255,255,.25);\n}\n\n// Inverted navbar\n.navbar-inverse {\n #gradient > .vertical(@start-color: lighten(@navbar-inverse-bg, 10%); @end-color: @navbar-inverse-bg);\n .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered; see https://github.com/twbs/bootstrap/issues/10257\n border-radius: @navbar-border-radius;\n .navbar-nav > .open > a,\n .navbar-nav > .active > a {\n #gradient > .vertical(@start-color: @navbar-inverse-link-active-bg; @end-color: lighten(@navbar-inverse-link-active-bg, 2.5%));\n .box-shadow(inset 0 3px 9px rgba(0,0,0,.25));\n }\n\n .navbar-brand,\n .navbar-nav > li > a {\n text-shadow: 0 -1px 0 rgba(0,0,0,.25);\n }\n}\n\n// Undo rounded corners in static and fixed navbars\n.navbar-static-top,\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n border-radius: 0;\n}\n\n// Fix active state of dropdown items in collapsed mode\n@media (max-width: @grid-float-breakpoint-max) {\n .navbar .navbar-nav .open .dropdown-menu > .active > a {\n &,\n &:hover,\n &:focus {\n color: #fff;\n #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n }\n }\n}\n\n\n//\n// Alerts\n// --------------------------------------------------\n\n// Common styles\n.alert {\n text-shadow: 0 1px 0 rgba(255,255,255,.2);\n @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05);\n .box-shadow(@shadow);\n}\n\n// Mixin for generating new styles\n.alert-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 7.5%));\n border-color: darken(@color, 15%);\n}\n\n// Apply the mixin to the alerts\n.alert-success { .alert-styles(@alert-success-bg); }\n.alert-info { .alert-styles(@alert-info-bg); }\n.alert-warning { .alert-styles(@alert-warning-bg); }\n.alert-danger { .alert-styles(@alert-danger-bg); }\n\n\n//\n// Progress bars\n// --------------------------------------------------\n\n// Give the progress background some depth\n.progress {\n #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg)\n}\n\n// Mixin for generating new styles\n.progress-bar-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%));\n}\n\n// Apply the mixin to the progress bars\n.progress-bar { .progress-bar-styles(@progress-bar-bg); }\n.progress-bar-success { .progress-bar-styles(@progress-bar-success-bg); }\n.progress-bar-info { .progress-bar-styles(@progress-bar-info-bg); }\n.progress-bar-warning { .progress-bar-styles(@progress-bar-warning-bg); }\n.progress-bar-danger { .progress-bar-styles(@progress-bar-danger-bg); }\n\n// Reset the striped class because our mixins don't do multiple gradients and\n// the above custom styles override the new `.progress-bar-striped` in v3.2.0.\n.progress-bar-striped {\n #gradient > .striped();\n}\n\n\n//\n// List groups\n// --------------------------------------------------\n\n.list-group {\n border-radius: @border-radius-base;\n .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%);\n #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%));\n border-color: darken(@list-group-active-border, 7.5%);\n\n .badge {\n text-shadow: none;\n }\n}\n\n\n//\n// Panels\n// --------------------------------------------------\n\n// Common styles\n.panel {\n .box-shadow(0 1px 2px rgba(0,0,0,.05));\n}\n\n// Mixin for generating new styles\n.panel-heading-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%));\n}\n\n// Apply the mixin to the panel headings only\n.panel-default > .panel-heading { .panel-heading-styles(@panel-default-heading-bg); }\n.panel-primary > .panel-heading { .panel-heading-styles(@panel-primary-heading-bg); }\n.panel-success > .panel-heading { .panel-heading-styles(@panel-success-heading-bg); }\n.panel-info > .panel-heading { .panel-heading-styles(@panel-info-heading-bg); }\n.panel-warning > .panel-heading { .panel-heading-styles(@panel-warning-heading-bg); }\n.panel-danger > .panel-heading { .panel-heading-styles(@panel-danger-heading-bg); }\n\n\n//\n// Wells\n// --------------------------------------------------\n\n.well {\n #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg);\n border-color: darken(@well-bg, 10%);\n @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);\n .box-shadow(@shadow);\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They have been removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n -webkit-animation: @animation;\n -o-animation: @animation;\n animation: @animation;\n}\n.animation-name(@name) {\n -webkit-animation-name: @name;\n animation-name: @name;\n}\n.animation-duration(@duration) {\n -webkit-animation-duration: @duration;\n animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n -webkit-animation-timing-function: @timing-function;\n animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n -webkit-animation-delay: @delay;\n animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n -webkit-animation-iteration-count: @iteration-count;\n animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n -webkit-animation-direction: @direction;\n animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n -webkit-animation-fill-mode: @fill-mode;\n animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility) {\n -webkit-backface-visibility: @visibility;\n -moz-backface-visibility: @visibility;\n backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n -webkit-box-sizing: @boxmodel;\n -moz-box-sizing: @boxmodel;\n box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n -webkit-column-count: @column-count;\n -moz-column-count: @column-count;\n column-count: @column-count;\n -webkit-column-gap: @column-gap;\n -moz-column-gap: @column-gap;\n column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n word-wrap: break-word;\n -webkit-hyphens: @mode;\n -moz-hyphens: @mode;\n -ms-hyphens: @mode; // IE10+\n -o-hyphens: @mode;\n hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n // Firefox\n &::-moz-placeholder {\n color: @color;\n opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526\n }\n &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+\n &::-webkit-input-placeholder { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n -webkit-transform: scale(@ratio);\n -ms-transform: scale(@ratio); // IE9 only\n -o-transform: scale(@ratio);\n transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n -webkit-transform: scale(@ratioX, @ratioY);\n -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n -o-transform: scale(@ratioX, @ratioY);\n transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n -webkit-transform: scaleX(@ratio);\n -ms-transform: scaleX(@ratio); // IE9 only\n -o-transform: scaleX(@ratio);\n transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n -webkit-transform: scaleY(@ratio);\n -ms-transform: scaleY(@ratio); // IE9 only\n -o-transform: scaleY(@ratio);\n transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n -webkit-transform: skewX(@x) skewY(@y);\n -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n -o-transform: skewX(@x) skewY(@y);\n transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n -webkit-transform: translate(@x, @y);\n -ms-transform: translate(@x, @y); // IE9 only\n -o-transform: translate(@x, @y);\n transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n -webkit-transform: translate3d(@x, @y, @z);\n transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n -webkit-transform: rotate(@degrees);\n -ms-transform: rotate(@degrees); // IE9 only\n -o-transform: rotate(@degrees);\n transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n -webkit-transform: rotateX(@degrees);\n -ms-transform: rotateX(@degrees); // IE9 only\n -o-transform: rotateX(@degrees);\n transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n -webkit-transform: rotateY(@degrees);\n -ms-transform: rotateY(@degrees); // IE9 only\n -o-transform: rotateY(@degrees);\n transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n -webkit-perspective: @perspective;\n -moz-perspective: @perspective;\n perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n -webkit-perspective-origin: @perspective;\n -moz-perspective-origin: @perspective;\n perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n -webkit-transform-origin: @origin;\n -moz-transform-origin: @origin;\n -ms-transform-origin: @origin; // IE9 only\n transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n -webkit-transition: @transition;\n -o-transition: @transition;\n transition: @transition;\n}\n.transition-property(@transition-property) {\n -webkit-transition-property: @transition-property;\n transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n -webkit-transition-delay: @transition-delay;\n transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n -webkit-transition-duration: @transition-duration;\n transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n -webkit-transition-timing-function: @timing-function;\n transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n -webkit-transition: -webkit-transform @transition;\n -moz-transition: -moz-transform @transition;\n -o-transition: -o-transform @transition;\n transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n -webkit-user-select: @select;\n -moz-user-select: @select;\n -ms-user-select: @select; // IE10+\n user-select: @select;\n}\n","// Gradients\n\n#gradient {\n\n // Horizontal gradient, from left to right\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n // Vertical gradient, from top to bottom\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {\n background-repeat: repeat-x;\n background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12\n background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n }\n .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .radial(@inner-color: #555; @outer-color: #333) {\n background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);\n background-image: radial-gradient(circle, @inner-color, @outer-color);\n background-repeat: no-repeat;\n }\n .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {\n background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n }\n}\n","// Reset filters for IE\n//\n// When you need to remove a gradient background, do not forget to use this to reset\n// the IE filter for IE9 and below.\n\n.reset-filter() {\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(enabled = false)\"));\n}\n"]} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.min.css b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.min.css deleted file mode 100644 index 5e39401957..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.min.css +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Bootstrap v3.3.7 (http://getbootstrap.com) - * Copyright 2011-2016 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */.btn-danger,.btn-default,.btn-info,.btn-primary,.btn-success,.btn-warning{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-danger.disabled,.btn-danger[disabled],.btn-default.disabled,.btn-default[disabled],.btn-info.disabled,.btn-info[disabled],.btn-primary.disabled,.btn-primary[disabled],.btn-success.disabled,.btn-success[disabled],.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-danger,fieldset[disabled] .btn-default,fieldset[disabled] .btn-info,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-success,fieldset[disabled] .btn-warning{-webkit-box-shadow:none;box-shadow:none}.btn-danger .badge,.btn-default .badge,.btn-info .badge,.btn-primary .badge,.btn-success .badge,.btn-warning .badge{text-shadow:none}.btn.active,.btn:active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc}.btn-default:focus,.btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.btn-default.active,.btn-default:active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-o-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#265a88));background-image:linear-gradient(to bottom,#337ab7 0,#265a88 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#245580}.btn-primary:focus,.btn-primary:hover{background-color:#265a88;background-position:0 -15px}.btn-primary.active,.btn-primary:active{background-color:#265a88;border-color:#245580}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#265a88;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:focus,.btn-success:hover{background-color:#419641;background-position:0 -15px}.btn-success.active,.btn-success:active{background-color:#419641;border-color:#3e8f3e}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:focus,.btn-info:hover{background-color:#2aabd2;background-position:0 -15px}.btn-info.active,.btn-info:active{background-color:#2aabd2;border-color:#28a4c9}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:focus,.btn-warning:hover{background-color:#eb9316;background-position:0 -15px}.btn-warning.active,.btn-warning:active{background-color:#eb9316;border-color:#e38d13}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:focus,.btn-danger:hover{background-color:#c12e2a;background-position:0 -15px}.btn-danger.active,.btn-danger:active{background-color:#c12e2a;border-color:#b92c28}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#c12e2a;background-image:none}.img-thumbnail,.thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#2e6da4;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-o-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dbdbdb),to(#e2e2e2));background-image:linear-gradient(to bottom,#dbdbdb 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-o-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#080808),to(#0f0f0f));background-image:linear-gradient(to bottom,#080808 0,#0f0f0f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-o-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#286090));background-image:linear-gradient(to bottom,#337ab7 0,#286090 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:repeat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{text-shadow:0 -1px 0 #286090;background-image:-webkit-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2b669a));background-image:linear-gradient(to bottom,#337ab7 0,#2b669a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);background-repeat:repeat-x;border-color:#2b669a}.list-group-item.active .badge,.list-group-item.active:focus .badge,.list-group-item.active:hover .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)} -/*# sourceMappingURL=bootstrap-theme.min.css.map */ \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.min.css.map b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.min.css.map deleted file mode 100644 index 94813e9006..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap-theme.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["less/theme.less","less/mixins/vendor-prefixes.less","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":";;;;AAmBA,YAAA,aAAA,UAAA,aAAA,aAAA,aAME,YAAA,EAAA,KAAA,EAAA,eC2CA,mBAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBDvCR,mBAAA,mBAAA,oBAAA,oBAAA,iBAAA,iBAAA,oBAAA,oBAAA,oBAAA,oBAAA,oBAAA,oBCsCA,mBAAA,MAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,iBDlCR,qBAAA,sBAAA,sBAAA,uBAAA,mBAAA,oBAAA,sBAAA,uBAAA,sBAAA,uBAAA,sBAAA,uBAAA,+BAAA,gCAAA,6BAAA,gCAAA,gCAAA,gCCiCA,mBAAA,KACQ,WAAA,KDlDV,mBAAA,oBAAA,iBAAA,oBAAA,oBAAA,oBAuBI,YAAA,KAyCF,YAAA,YAEE,iBAAA,KAKJ,aErEI,YAAA,EAAA,IAAA,EAAA,KACA,iBAAA,iDACA,iBAAA,4CAAA,iBAAA,qEAEA,iBAAA,+CCnBF,OAAA,+GH4CA,OAAA,0DACA,kBAAA,SAuC2C,aAAA,QAA2B,aAAA,KArCtE,mBAAA,mBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,oBAAA,oBAEE,iBAAA,QACA,aAAA,QAMA,sBAAA,6BA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,2BE/PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF4PJ,8BEhQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF6PJ,6BEjQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFoQJ,MExQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFsQF,aAAA,QC3NA,mBAAA,MAAA,EAAA,IAAA,IAAA,gBAAA,EAAA,IAAA,EAAA,qBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,gBAAA,EAAA,IAAA,EAAA","sourcesContent":["/*!\n * Bootstrap v3.3.7 (http://getbootstrap.com)\n * Copyright 2011-2016 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n\n//\n// Load core variables and mixins\n// --------------------------------------------------\n\n@import \"variables.less\";\n@import \"mixins.less\";\n\n\n//\n// Buttons\n// --------------------------------------------------\n\n// Common styles\n.btn-default,\n.btn-primary,\n.btn-success,\n.btn-info,\n.btn-warning,\n.btn-danger {\n text-shadow: 0 -1px 0 rgba(0,0,0,.2);\n @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);\n .box-shadow(@shadow);\n\n // Reset the shadow\n &:active,\n &.active {\n .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n }\n\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n .box-shadow(none);\n }\n\n .badge {\n text-shadow: none;\n }\n}\n\n// Mixin for generating new styles\n.btn-styles(@btn-color: #555) {\n #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 12%));\n .reset-filter(); // Disable gradients for IE9 because filter bleeds through rounded corners; see https://github.com/twbs/bootstrap/issues/10620\n background-repeat: repeat-x;\n border-color: darken(@btn-color, 14%);\n\n &:hover,\n &:focus {\n background-color: darken(@btn-color, 12%);\n background-position: 0 -15px;\n }\n\n &:active,\n &.active {\n background-color: darken(@btn-color, 12%);\n border-color: darken(@btn-color, 14%);\n }\n\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n &,\n &:hover,\n &:focus,\n &.focus,\n &:active,\n &.active {\n background-color: darken(@btn-color, 12%);\n background-image: none;\n }\n }\n}\n\n// Common styles\n.btn {\n // Remove the gradient for the pressed/active state\n &:active,\n &.active {\n background-image: none;\n }\n}\n\n// Apply the mixin to the buttons\n.btn-default { .btn-styles(@btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; }\n.btn-primary { .btn-styles(@btn-primary-bg); }\n.btn-success { .btn-styles(@btn-success-bg); }\n.btn-info { .btn-styles(@btn-info-bg); }\n.btn-warning { .btn-styles(@btn-warning-bg); }\n.btn-danger { .btn-styles(@btn-danger-bg); }\n\n\n//\n// Images\n// --------------------------------------------------\n\n.thumbnail,\n.img-thumbnail {\n .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n\n\n//\n// Dropdowns\n// --------------------------------------------------\n\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));\n background-color: darken(@dropdown-link-hover-bg, 5%);\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n background-color: darken(@dropdown-link-active-bg, 5%);\n}\n\n\n//\n// Navbar\n// --------------------------------------------------\n\n// Default navbar\n.navbar-default {\n #gradient > .vertical(@start-color: lighten(@navbar-default-bg, 10%); @end-color: @navbar-default-bg);\n .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered\n border-radius: @navbar-border-radius;\n @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075);\n .box-shadow(@shadow);\n\n .navbar-nav > .open > a,\n .navbar-nav > .active > a {\n #gradient > .vertical(@start-color: darken(@navbar-default-link-active-bg, 5%); @end-color: darken(@navbar-default-link-active-bg, 2%));\n .box-shadow(inset 0 3px 9px rgba(0,0,0,.075));\n }\n}\n.navbar-brand,\n.navbar-nav > li > a {\n text-shadow: 0 1px 0 rgba(255,255,255,.25);\n}\n\n// Inverted navbar\n.navbar-inverse {\n #gradient > .vertical(@start-color: lighten(@navbar-inverse-bg, 10%); @end-color: @navbar-inverse-bg);\n .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered; see https://github.com/twbs/bootstrap/issues/10257\n border-radius: @navbar-border-radius;\n .navbar-nav > .open > a,\n .navbar-nav > .active > a {\n #gradient > .vertical(@start-color: @navbar-inverse-link-active-bg; @end-color: lighten(@navbar-inverse-link-active-bg, 2.5%));\n .box-shadow(inset 0 3px 9px rgba(0,0,0,.25));\n }\n\n .navbar-brand,\n .navbar-nav > li > a {\n text-shadow: 0 -1px 0 rgba(0,0,0,.25);\n }\n}\n\n// Undo rounded corners in static and fixed navbars\n.navbar-static-top,\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n border-radius: 0;\n}\n\n// Fix active state of dropdown items in collapsed mode\n@media (max-width: @grid-float-breakpoint-max) {\n .navbar .navbar-nav .open .dropdown-menu > .active > a {\n &,\n &:hover,\n &:focus {\n color: #fff;\n #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n }\n }\n}\n\n\n//\n// Alerts\n// --------------------------------------------------\n\n// Common styles\n.alert {\n text-shadow: 0 1px 0 rgba(255,255,255,.2);\n @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05);\n .box-shadow(@shadow);\n}\n\n// Mixin for generating new styles\n.alert-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 7.5%));\n border-color: darken(@color, 15%);\n}\n\n// Apply the mixin to the alerts\n.alert-success { .alert-styles(@alert-success-bg); }\n.alert-info { .alert-styles(@alert-info-bg); }\n.alert-warning { .alert-styles(@alert-warning-bg); }\n.alert-danger { .alert-styles(@alert-danger-bg); }\n\n\n//\n// Progress bars\n// --------------------------------------------------\n\n// Give the progress background some depth\n.progress {\n #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg)\n}\n\n// Mixin for generating new styles\n.progress-bar-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%));\n}\n\n// Apply the mixin to the progress bars\n.progress-bar { .progress-bar-styles(@progress-bar-bg); }\n.progress-bar-success { .progress-bar-styles(@progress-bar-success-bg); }\n.progress-bar-info { .progress-bar-styles(@progress-bar-info-bg); }\n.progress-bar-warning { .progress-bar-styles(@progress-bar-warning-bg); }\n.progress-bar-danger { .progress-bar-styles(@progress-bar-danger-bg); }\n\n// Reset the striped class because our mixins don't do multiple gradients and\n// the above custom styles override the new `.progress-bar-striped` in v3.2.0.\n.progress-bar-striped {\n #gradient > .striped();\n}\n\n\n//\n// List groups\n// --------------------------------------------------\n\n.list-group {\n border-radius: @border-radius-base;\n .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%);\n #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%));\n border-color: darken(@list-group-active-border, 7.5%);\n\n .badge {\n text-shadow: none;\n }\n}\n\n\n//\n// Panels\n// --------------------------------------------------\n\n// Common styles\n.panel {\n .box-shadow(0 1px 2px rgba(0,0,0,.05));\n}\n\n// Mixin for generating new styles\n.panel-heading-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%));\n}\n\n// Apply the mixin to the panel headings only\n.panel-default > .panel-heading { .panel-heading-styles(@panel-default-heading-bg); }\n.panel-primary > .panel-heading { .panel-heading-styles(@panel-primary-heading-bg); }\n.panel-success > .panel-heading { .panel-heading-styles(@panel-success-heading-bg); }\n.panel-info > .panel-heading { .panel-heading-styles(@panel-info-heading-bg); }\n.panel-warning > .panel-heading { .panel-heading-styles(@panel-warning-heading-bg); }\n.panel-danger > .panel-heading { .panel-heading-styles(@panel-danger-heading-bg); }\n\n\n//\n// Wells\n// --------------------------------------------------\n\n.well {\n #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg);\n border-color: darken(@well-bg, 10%);\n @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);\n .box-shadow(@shadow);\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They have been removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n -webkit-animation: @animation;\n -o-animation: @animation;\n animation: @animation;\n}\n.animation-name(@name) {\n -webkit-animation-name: @name;\n animation-name: @name;\n}\n.animation-duration(@duration) {\n -webkit-animation-duration: @duration;\n animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n -webkit-animation-timing-function: @timing-function;\n animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n -webkit-animation-delay: @delay;\n animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n -webkit-animation-iteration-count: @iteration-count;\n animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n -webkit-animation-direction: @direction;\n animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n -webkit-animation-fill-mode: @fill-mode;\n animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility) {\n -webkit-backface-visibility: @visibility;\n -moz-backface-visibility: @visibility;\n backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n -webkit-box-sizing: @boxmodel;\n -moz-box-sizing: @boxmodel;\n box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n -webkit-column-count: @column-count;\n -moz-column-count: @column-count;\n column-count: @column-count;\n -webkit-column-gap: @column-gap;\n -moz-column-gap: @column-gap;\n column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n word-wrap: break-word;\n -webkit-hyphens: @mode;\n -moz-hyphens: @mode;\n -ms-hyphens: @mode; // IE10+\n -o-hyphens: @mode;\n hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n // Firefox\n &::-moz-placeholder {\n color: @color;\n opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526\n }\n &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+\n &::-webkit-input-placeholder { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n -webkit-transform: scale(@ratio);\n -ms-transform: scale(@ratio); // IE9 only\n -o-transform: scale(@ratio);\n transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n -webkit-transform: scale(@ratioX, @ratioY);\n -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n -o-transform: scale(@ratioX, @ratioY);\n transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n -webkit-transform: scaleX(@ratio);\n -ms-transform: scaleX(@ratio); // IE9 only\n -o-transform: scaleX(@ratio);\n transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n -webkit-transform: scaleY(@ratio);\n -ms-transform: scaleY(@ratio); // IE9 only\n -o-transform: scaleY(@ratio);\n transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n -webkit-transform: skewX(@x) skewY(@y);\n -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n -o-transform: skewX(@x) skewY(@y);\n transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n -webkit-transform: translate(@x, @y);\n -ms-transform: translate(@x, @y); // IE9 only\n -o-transform: translate(@x, @y);\n transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n -webkit-transform: translate3d(@x, @y, @z);\n transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n -webkit-transform: rotate(@degrees);\n -ms-transform: rotate(@degrees); // IE9 only\n -o-transform: rotate(@degrees);\n transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n -webkit-transform: rotateX(@degrees);\n -ms-transform: rotateX(@degrees); // IE9 only\n -o-transform: rotateX(@degrees);\n transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n -webkit-transform: rotateY(@degrees);\n -ms-transform: rotateY(@degrees); // IE9 only\n -o-transform: rotateY(@degrees);\n transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n -webkit-perspective: @perspective;\n -moz-perspective: @perspective;\n perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n -webkit-perspective-origin: @perspective;\n -moz-perspective-origin: @perspective;\n perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n -webkit-transform-origin: @origin;\n -moz-transform-origin: @origin;\n -ms-transform-origin: @origin; // IE9 only\n transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n -webkit-transition: @transition;\n -o-transition: @transition;\n transition: @transition;\n}\n.transition-property(@transition-property) {\n -webkit-transition-property: @transition-property;\n transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n -webkit-transition-delay: @transition-delay;\n transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n -webkit-transition-duration: @transition-duration;\n transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n -webkit-transition-timing-function: @timing-function;\n transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n -webkit-transition: -webkit-transform @transition;\n -moz-transition: -moz-transform @transition;\n -o-transition: -o-transform @transition;\n transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n -webkit-user-select: @select;\n -moz-user-select: @select;\n -ms-user-select: @select; // IE10+\n user-select: @select;\n}\n","// Gradients\n\n#gradient {\n\n // Horizontal gradient, from left to right\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n // Vertical gradient, from top to bottom\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {\n background-repeat: repeat-x;\n background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12\n background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n }\n .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .radial(@inner-color: #555; @outer-color: #333) {\n background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);\n background-image: radial-gradient(circle, @inner-color, @outer-color);\n background-repeat: no-repeat;\n }\n .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {\n background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n }\n}\n","// Reset filters for IE\n//\n// When you need to remove a gradient background, do not forget to use this to reset\n// the IE filter for IE9 and below.\n\n.reset-filter() {\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(enabled = false)\"));\n}\n"]} \ No newline at end of file diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap.css b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap.css deleted file mode 100644 index 6167622cec..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap.css +++ /dev/null @@ -1,6757 +0,0 @@ -/*! - * Bootstrap v3.3.7 (http://getbootstrap.com) - * Copyright 2011-2016 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ -html { - font-family: sans-serif; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} -body { - margin: 0; -} -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} -audio, -canvas, -progress, -video { - display: inline-block; - vertical-align: baseline; -} -audio:not([controls]) { - display: none; - height: 0; -} -[hidden], -template { - display: none; -} -a { - background-color: transparent; -} -a:active, -a:hover { - outline: 0; -} -abbr[title] { - border-bottom: 1px dotted; -} -b, -strong { - font-weight: bold; -} -dfn { - font-style: italic; -} -h1 { - margin: .67em 0; - font-size: 2em; -} -mark { - color: #000; - background: #ff0; -} -small { - font-size: 80%; -} -sub, -sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; -} -sup { - top: -.5em; -} -sub { - bottom: -.25em; -} -img { - border: 0; -} -svg:not(:root) { - overflow: hidden; -} -figure { - margin: 1em 40px; -} -hr { - height: 0; - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; -} -pre { - overflow: auto; -} -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} -button, -input, -optgroup, -select, -textarea { - margin: 0; - font: inherit; - color: inherit; -} -button { - overflow: visible; -} -button, -select { - text-transform: none; -} -button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; -} -button[disabled], -html input[disabled] { - cursor: default; -} -button::-moz-focus-inner, -input::-moz-focus-inner { - padding: 0; - border: 0; -} -input { - line-height: normal; -} -input[type="checkbox"], -input[type="radio"] { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: 0; -} -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} -input[type="search"] { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; - -webkit-appearance: textfield; -} -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} -fieldset { - padding: .35em .625em .75em; - margin: 0 2px; - border: 1px solid #c0c0c0; -} -legend { - padding: 0; - border: 0; -} -textarea { - overflow: auto; -} -optgroup { - font-weight: bold; -} -table { - border-spacing: 0; - border-collapse: collapse; -} -td, -th { - padding: 0; -} -/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ -@media print { - *, - *:before, - *:after { - color: #000 !important; - text-shadow: none !important; - background: transparent !important; - -webkit-box-shadow: none !important; - box-shadow: none !important; - } - a, - a:visited { - text-decoration: underline; - } - a[href]:after { - content: " (" attr(href) ")"; - } - abbr[title]:after { - content: " (" attr(title) ")"; - } - a[href^="#"]:after, - a[href^="javascript:"]:after { - content: ""; - } - pre, - blockquote { - border: 1px solid #999; - - page-break-inside: avoid; - } - thead { - display: table-header-group; - } - tr, - img { - page-break-inside: avoid; - } - img { - max-width: 100% !important; - } - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - h2, - h3 { - page-break-after: avoid; - } - .navbar { - display: none; - } - .btn > .caret, - .dropup > .btn > .caret { - border-top-color: #000 !important; - } - .label { - border: 1px solid #000; - } - .table { - border-collapse: collapse !important; - } - .table td, - .table th { - background-color: #fff !important; - } - .table-bordered th, - .table-bordered td { - border: 1px solid #ddd !important; - } -} -@font-face { - font-family: 'Glyphicons Halflings'; - - src: url('../fonts/glyphicons-halflings-regular.eot'); - src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); -} -.glyphicon { - position: relative; - top: 1px; - display: inline-block; - font-family: 'Glyphicons Halflings'; - font-style: normal; - font-weight: normal; - line-height: 1; - - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.glyphicon-asterisk:before { - content: "\002a"; -} -.glyphicon-plus:before { - content: "\002b"; -} -.glyphicon-euro:before, -.glyphicon-eur:before { - content: "\20ac"; -} -.glyphicon-minus:before { - content: "\2212"; -} -.glyphicon-cloud:before { - content: "\2601"; -} -.glyphicon-envelope:before { - content: "\2709"; -} -.glyphicon-pencil:before { - content: "\270f"; -} -.glyphicon-glass:before { - content: "\e001"; -} -.glyphicon-music:before { - content: "\e002"; -} -.glyphicon-search:before { - content: "\e003"; -} -.glyphicon-heart:before { - content: "\e005"; -} -.glyphicon-star:before { - content: "\e006"; -} -.glyphicon-star-empty:before { - content: "\e007"; -} -.glyphicon-user:before { - content: "\e008"; -} -.glyphicon-film:before { - content: "\e009"; -} -.glyphicon-th-large:before { - content: "\e010"; -} -.glyphicon-th:before { - content: "\e011"; -} -.glyphicon-th-list:before { - content: "\e012"; -} -.glyphicon-ok:before { - content: "\e013"; -} -.glyphicon-remove:before { - content: "\e014"; -} -.glyphicon-zoom-in:before { - content: "\e015"; -} -.glyphicon-zoom-out:before { - content: "\e016"; -} -.glyphicon-off:before { - content: "\e017"; -} -.glyphicon-signal:before { - content: "\e018"; -} -.glyphicon-cog:before { - content: "\e019"; -} -.glyphicon-trash:before { - content: "\e020"; -} -.glyphicon-home:before { - content: "\e021"; -} -.glyphicon-file:before { - content: "\e022"; -} -.glyphicon-time:before { - content: "\e023"; -} -.glyphicon-road:before { - content: "\e024"; -} -.glyphicon-download-alt:before { - content: "\e025"; -} -.glyphicon-download:before { - content: "\e026"; -} -.glyphicon-upload:before { - content: "\e027"; -} -.glyphicon-inbox:before { - content: "\e028"; -} -.glyphicon-play-circle:before { - content: "\e029"; -} -.glyphicon-repeat:before { - content: "\e030"; -} -.glyphicon-refresh:before { - content: "\e031"; -} -.glyphicon-list-alt:before { - content: "\e032"; -} -.glyphicon-lock:before { - content: "\e033"; -} -.glyphicon-flag:before { - content: "\e034"; -} -.glyphicon-headphones:before { - content: "\e035"; -} -.glyphicon-volume-off:before { - content: "\e036"; -} -.glyphicon-volume-down:before { - content: "\e037"; -} -.glyphicon-volume-up:before { - content: "\e038"; -} -.glyphicon-qrcode:before { - content: "\e039"; -} -.glyphicon-barcode:before { - content: "\e040"; -} -.glyphicon-tag:before { - content: "\e041"; -} -.glyphicon-tags:before { - content: "\e042"; -} -.glyphicon-book:before { - content: "\e043"; -} -.glyphicon-bookmark:before { - content: "\e044"; -} -.glyphicon-print:before { - content: "\e045"; -} -.glyphicon-camera:before { - content: "\e046"; -} -.glyphicon-font:before { - content: "\e047"; -} -.glyphicon-bold:before { - content: "\e048"; -} -.glyphicon-italic:before { - content: "\e049"; -} -.glyphicon-text-height:before { - content: "\e050"; -} -.glyphicon-text-width:before { - content: "\e051"; -} -.glyphicon-align-left:before { - content: "\e052"; -} -.glyphicon-align-center:before { - content: "\e053"; -} -.glyphicon-align-right:before { - content: "\e054"; -} -.glyphicon-align-justify:before { - content: "\e055"; -} -.glyphicon-list:before { - content: "\e056"; -} -.glyphicon-indent-left:before { - content: "\e057"; -} -.glyphicon-indent-right:before { - content: "\e058"; -} -.glyphicon-facetime-video:before { - content: "\e059"; -} -.glyphicon-picture:before { - content: "\e060"; -} -.glyphicon-map-marker:before { - content: "\e062"; -} -.glyphicon-adjust:before { - content: "\e063"; -} -.glyphicon-tint:before { - content: "\e064"; -} -.glyphicon-edit:before { - content: "\e065"; -} -.glyphicon-share:before { - content: "\e066"; -} -.glyphicon-check:before { - content: "\e067"; -} -.glyphicon-move:before { - content: "\e068"; -} -.glyphicon-step-backward:before { - content: "\e069"; -} -.glyphicon-fast-backward:before { - content: "\e070"; -} -.glyphicon-backward:before { - content: "\e071"; -} -.glyphicon-play:before { - content: "\e072"; -} -.glyphicon-pause:before { - content: "\e073"; -} -.glyphicon-stop:before { - content: "\e074"; -} -.glyphicon-forward:before { - content: "\e075"; -} -.glyphicon-fast-forward:before { - content: "\e076"; -} -.glyphicon-step-forward:before { - content: "\e077"; -} -.glyphicon-eject:before { - content: "\e078"; -} -.glyphicon-chevron-left:before { - content: "\e079"; -} -.glyphicon-chevron-right:before { - content: "\e080"; -} -.glyphicon-plus-sign:before { - content: "\e081"; -} -.glyphicon-minus-sign:before { - content: "\e082"; -} -.glyphicon-remove-sign:before { - content: "\e083"; -} -.glyphicon-ok-sign:before { - content: "\e084"; -} -.glyphicon-question-sign:before { - content: "\e085"; -} -.glyphicon-info-sign:before { - content: "\e086"; -} -.glyphicon-screenshot:before { - content: "\e087"; -} -.glyphicon-remove-circle:before { - content: "\e088"; -} -.glyphicon-ok-circle:before { - content: "\e089"; -} -.glyphicon-ban-circle:before { - content: "\e090"; -} -.glyphicon-arrow-left:before { - content: "\e091"; -} -.glyphicon-arrow-right:before { - content: "\e092"; -} -.glyphicon-arrow-up:before { - content: "\e093"; -} -.glyphicon-arrow-down:before { - content: "\e094"; -} -.glyphicon-share-alt:before { - content: "\e095"; -} -.glyphicon-resize-full:before { - content: "\e096"; -} -.glyphicon-resize-small:before { - content: "\e097"; -} -.glyphicon-exclamation-sign:before { - content: "\e101"; -} -.glyphicon-gift:before { - content: "\e102"; -} -.glyphicon-leaf:before { - content: "\e103"; -} -.glyphicon-fire:before { - content: "\e104"; -} -.glyphicon-eye-open:before { - content: "\e105"; -} -.glyphicon-eye-close:before { - content: "\e106"; -} -.glyphicon-warning-sign:before { - content: "\e107"; -} -.glyphicon-plane:before { - content: "\e108"; -} -.glyphicon-calendar:before { - content: "\e109"; -} -.glyphicon-random:before { - content: "\e110"; -} -.glyphicon-comment:before { - content: "\e111"; -} -.glyphicon-magnet:before { - content: "\e112"; -} -.glyphicon-chevron-up:before { - content: "\e113"; -} -.glyphicon-chevron-down:before { - content: "\e114"; -} -.glyphicon-retweet:before { - content: "\e115"; -} -.glyphicon-shopping-cart:before { - content: "\e116"; -} -.glyphicon-folder-close:before { - content: "\e117"; -} -.glyphicon-folder-open:before { - content: "\e118"; -} -.glyphicon-resize-vertical:before { - content: "\e119"; -} -.glyphicon-resize-horizontal:before { - content: "\e120"; -} -.glyphicon-hdd:before { - content: "\e121"; -} -.glyphicon-bullhorn:before { - content: "\e122"; -} -.glyphicon-bell:before { - content: "\e123"; -} -.glyphicon-certificate:before { - content: "\e124"; -} -.glyphicon-thumbs-up:before { - content: "\e125"; -} -.glyphicon-thumbs-down:before { - content: "\e126"; -} -.glyphicon-hand-right:before { - content: "\e127"; -} -.glyphicon-hand-left:before { - content: "\e128"; -} -.glyphicon-hand-up:before { - content: "\e129"; -} -.glyphicon-hand-down:before { - content: "\e130"; -} -.glyphicon-circle-arrow-right:before { - content: "\e131"; -} -.glyphicon-circle-arrow-left:before { - content: "\e132"; -} -.glyphicon-circle-arrow-up:before { - content: "\e133"; -} -.glyphicon-circle-arrow-down:before { - content: "\e134"; -} -.glyphicon-globe:before { - content: "\e135"; -} -.glyphicon-wrench:before { - content: "\e136"; -} -.glyphicon-tasks:before { - content: "\e137"; -} -.glyphicon-filter:before { - content: "\e138"; -} -.glyphicon-briefcase:before { - content: "\e139"; -} -.glyphicon-fullscreen:before { - content: "\e140"; -} -.glyphicon-dashboard:before { - content: "\e141"; -} -.glyphicon-paperclip:before { - content: "\e142"; -} -.glyphicon-heart-empty:before { - content: "\e143"; -} -.glyphicon-link:before { - content: "\e144"; -} -.glyphicon-phone:before { - content: "\e145"; -} -.glyphicon-pushpin:before { - content: "\e146"; -} -.glyphicon-usd:before { - content: "\e148"; -} -.glyphicon-gbp:before { - content: "\e149"; -} -.glyphicon-sort:before { - content: "\e150"; -} -.glyphicon-sort-by-alphabet:before { - content: "\e151"; -} -.glyphicon-sort-by-alphabet-alt:before { - content: "\e152"; -} -.glyphicon-sort-by-order:before { - content: "\e153"; -} -.glyphicon-sort-by-order-alt:before { - content: "\e154"; -} -.glyphicon-sort-by-attributes:before { - content: "\e155"; -} -.glyphicon-sort-by-attributes-alt:before { - content: "\e156"; -} -.glyphicon-unchecked:before { - content: "\e157"; -} -.glyphicon-expand:before { - content: "\e158"; -} -.glyphicon-collapse-down:before { - content: "\e159"; -} -.glyphicon-collapse-up:before { - content: "\e160"; -} -.glyphicon-log-in:before { - content: "\e161"; -} -.glyphicon-flash:before { - content: "\e162"; -} -.glyphicon-log-out:before { - content: "\e163"; -} -.glyphicon-new-window:before { - content: "\e164"; -} -.glyphicon-record:before { - content: "\e165"; -} -.glyphicon-save:before { - content: "\e166"; -} -.glyphicon-open:before { - content: "\e167"; -} -.glyphicon-saved:before { - content: "\e168"; -} -.glyphicon-import:before { - content: "\e169"; -} -.glyphicon-export:before { - content: "\e170"; -} -.glyphicon-send:before { - content: "\e171"; -} -.glyphicon-floppy-disk:before { - content: "\e172"; -} -.glyphicon-floppy-saved:before { - content: "\e173"; -} -.glyphicon-floppy-remove:before { - content: "\e174"; -} -.glyphicon-floppy-save:before { - content: "\e175"; -} -.glyphicon-floppy-open:before { - content: "\e176"; -} -.glyphicon-credit-card:before { - content: "\e177"; -} -.glyphicon-transfer:before { - content: "\e178"; -} -.glyphicon-cutlery:before { - content: "\e179"; -} -.glyphicon-header:before { - content: "\e180"; -} -.glyphicon-compressed:before { - content: "\e181"; -} -.glyphicon-earphone:before { - content: "\e182"; -} -.glyphicon-phone-alt:before { - content: "\e183"; -} -.glyphicon-tower:before { - content: "\e184"; -} -.glyphicon-stats:before { - content: "\e185"; -} -.glyphicon-sd-video:before { - content: "\e186"; -} -.glyphicon-hd-video:before { - content: "\e187"; -} -.glyphicon-subtitles:before { - content: "\e188"; -} -.glyphicon-sound-stereo:before { - content: "\e189"; -} -.glyphicon-sound-dolby:before { - content: "\e190"; -} -.glyphicon-sound-5-1:before { - content: "\e191"; -} -.glyphicon-sound-6-1:before { - content: "\e192"; -} -.glyphicon-sound-7-1:before { - content: "\e193"; -} -.glyphicon-copyright-mark:before { - content: "\e194"; -} -.glyphicon-registration-mark:before { - content: "\e195"; -} -.glyphicon-cloud-download:before { - content: "\e197"; -} -.glyphicon-cloud-upload:before { - content: "\e198"; -} -.glyphicon-tree-conifer:before { - content: "\e199"; -} -.glyphicon-tree-deciduous:before { - content: "\e200"; -} -.glyphicon-cd:before { - content: "\e201"; -} -.glyphicon-save-file:before { - content: "\e202"; -} -.glyphicon-open-file:before { - content: "\e203"; -} -.glyphicon-level-up:before { - content: "\e204"; -} -.glyphicon-copy:before { - content: "\e205"; -} -.glyphicon-paste:before { - content: "\e206"; -} -.glyphicon-alert:before { - content: "\e209"; -} -.glyphicon-equalizer:before { - content: "\e210"; -} -.glyphicon-king:before { - content: "\e211"; -} -.glyphicon-queen:before { - content: "\e212"; -} -.glyphicon-pawn:before { - content: "\e213"; -} -.glyphicon-bishop:before { - content: "\e214"; -} -.glyphicon-knight:before { - content: "\e215"; -} -.glyphicon-baby-formula:before { - content: "\e216"; -} -.glyphicon-tent:before { - content: "\26fa"; -} -.glyphicon-blackboard:before { - content: "\e218"; -} -.glyphicon-bed:before { - content: "\e219"; -} -.glyphicon-apple:before { - content: "\f8ff"; -} -.glyphicon-erase:before { - content: "\e221"; -} -.glyphicon-hourglass:before { - content: "\231b"; -} -.glyphicon-lamp:before { - content: "\e223"; -} -.glyphicon-duplicate:before { - content: "\e224"; -} -.glyphicon-piggy-bank:before { - content: "\e225"; -} -.glyphicon-scissors:before { - content: "\e226"; -} -.glyphicon-bitcoin:before { - content: "\e227"; -} -.glyphicon-btc:before { - content: "\e227"; -} -.glyphicon-xbt:before { - content: "\e227"; -} -.glyphicon-yen:before { - content: "\00a5"; -} -.glyphicon-jpy:before { - content: "\00a5"; -} -.glyphicon-ruble:before { - content: "\20bd"; -} -.glyphicon-rub:before { - content: "\20bd"; -} -.glyphicon-scale:before { - content: "\e230"; -} -.glyphicon-ice-lolly:before { - content: "\e231"; -} -.glyphicon-ice-lolly-tasted:before { - content: "\e232"; -} -.glyphicon-education:before { - content: "\e233"; -} -.glyphicon-option-horizontal:before { - content: "\e234"; -} -.glyphicon-option-vertical:before { - content: "\e235"; -} -.glyphicon-menu-hamburger:before { - content: "\e236"; -} -.glyphicon-modal-window:before { - content: "\e237"; -} -.glyphicon-oil:before { - content: "\e238"; -} -.glyphicon-grain:before { - content: "\e239"; -} -.glyphicon-sunglasses:before { - content: "\e240"; -} -.glyphicon-text-size:before { - content: "\e241"; -} -.glyphicon-text-color:before { - content: "\e242"; -} -.glyphicon-text-background:before { - content: "\e243"; -} -.glyphicon-object-align-top:before { - content: "\e244"; -} -.glyphicon-object-align-bottom:before { - content: "\e245"; -} -.glyphicon-object-align-horizontal:before { - content: "\e246"; -} -.glyphicon-object-align-left:before { - content: "\e247"; -} -.glyphicon-object-align-vertical:before { - content: "\e248"; -} -.glyphicon-object-align-right:before { - content: "\e249"; -} -.glyphicon-triangle-right:before { - content: "\e250"; -} -.glyphicon-triangle-left:before { - content: "\e251"; -} -.glyphicon-triangle-bottom:before { - content: "\e252"; -} -.glyphicon-triangle-top:before { - content: "\e253"; -} -.glyphicon-console:before { - content: "\e254"; -} -.glyphicon-superscript:before { - content: "\e255"; -} -.glyphicon-subscript:before { - content: "\e256"; -} -.glyphicon-menu-left:before { - content: "\e257"; -} -.glyphicon-menu-right:before { - content: "\e258"; -} -.glyphicon-menu-down:before { - content: "\e259"; -} -.glyphicon-menu-up:before { - content: "\e260"; -} -* { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -*:before, -*:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -html { - font-size: 10px; - - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -} -body { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 1.42857143; - color: #333; - background-color: #fff; -} -input, -button, -select, -textarea { - font-family: inherit; - font-size: inherit; - line-height: inherit; -} -a { - color: #337ab7; - text-decoration: none; -} -a:hover, -a:focus { - color: #23527c; - text-decoration: underline; -} -a:focus { - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -figure { - margin: 0; -} -img { - vertical-align: middle; -} -.img-responsive, -.thumbnail > img, -.thumbnail a > img, -.carousel-inner > .item > img, -.carousel-inner > .item > a > img { - display: block; - max-width: 100%; - height: auto; -} -.img-rounded { - border-radius: 6px; -} -.img-thumbnail { - display: inline-block; - max-width: 100%; - height: auto; - padding: 4px; - line-height: 1.42857143; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 4px; - -webkit-transition: all .2s ease-in-out; - -o-transition: all .2s ease-in-out; - transition: all .2s ease-in-out; -} -.img-circle { - border-radius: 50%; -} -hr { - margin-top: 20px; - margin-bottom: 20px; - border: 0; - border-top: 1px solid #eee; -} -.sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - border: 0; -} -.sr-only-focusable:active, -.sr-only-focusable:focus { - position: static; - width: auto; - height: auto; - margin: 0; - overflow: visible; - clip: auto; -} -[role="button"] { - cursor: pointer; -} -h1, -h2, -h3, -h4, -h5, -h6, -.h1, -.h2, -.h3, -.h4, -.h5, -.h6 { - font-family: inherit; - font-weight: 500; - line-height: 1.1; - color: inherit; -} -h1 small, -h2 small, -h3 small, -h4 small, -h5 small, -h6 small, -.h1 small, -.h2 small, -.h3 small, -.h4 small, -.h5 small, -.h6 small, -h1 .small, -h2 .small, -h3 .small, -h4 .small, -h5 .small, -h6 .small, -.h1 .small, -.h2 .small, -.h3 .small, -.h4 .small, -.h5 .small, -.h6 .small { - font-weight: normal; - line-height: 1; - color: #777; -} -h1, -.h1, -h2, -.h2, -h3, -.h3 { - margin-top: 20px; - margin-bottom: 10px; -} -h1 small, -.h1 small, -h2 small, -.h2 small, -h3 small, -.h3 small, -h1 .small, -.h1 .small, -h2 .small, -.h2 .small, -h3 .small, -.h3 .small { - font-size: 65%; -} -h4, -.h4, -h5, -.h5, -h6, -.h6 { - margin-top: 10px; - margin-bottom: 10px; -} -h4 small, -.h4 small, -h5 small, -.h5 small, -h6 small, -.h6 small, -h4 .small, -.h4 .small, -h5 .small, -.h5 .small, -h6 .small, -.h6 .small { - font-size: 75%; -} -h1, -.h1 { - font-size: 36px; -} -h2, -.h2 { - font-size: 30px; -} -h3, -.h3 { - font-size: 24px; -} -h4, -.h4 { - font-size: 18px; -} -h5, -.h5 { - font-size: 14px; -} -h6, -.h6 { - font-size: 12px; -} -p { - margin: 0 0 10px; -} -.lead { - margin-bottom: 20px; - font-size: 16px; - font-weight: 300; - line-height: 1.4; -} -@media (min-width: 768px) { - .lead { - font-size: 21px; - } -} -small, -.small { - font-size: 85%; -} -mark, -.mark { - padding: .2em; - background-color: #fcf8e3; -} -.text-left { - text-align: left; -} -.text-right { - text-align: right; -} -.text-center { - text-align: center; -} -.text-justify { - text-align: justify; -} -.text-nowrap { - white-space: nowrap; -} -.text-lowercase { - text-transform: lowercase; -} -.text-uppercase { - text-transform: uppercase; -} -.text-capitalize { - text-transform: capitalize; -} -.text-muted { - color: #777; -} -.text-primary { - color: #337ab7; -} -a.text-primary:hover, -a.text-primary:focus { - color: #286090; -} -.text-success { - color: #3c763d; -} -a.text-success:hover, -a.text-success:focus { - color: #2b542c; -} -.text-info { - color: #31708f; -} -a.text-info:hover, -a.text-info:focus { - color: #245269; -} -.text-warning { - color: #8a6d3b; -} -a.text-warning:hover, -a.text-warning:focus { - color: #66512c; -} -.text-danger { - color: #a94442; -} -a.text-danger:hover, -a.text-danger:focus { - color: #843534; -} -.bg-primary { - color: #fff; - background-color: #337ab7; -} -a.bg-primary:hover, -a.bg-primary:focus { - background-color: #286090; -} -.bg-success { - background-color: #dff0d8; -} -a.bg-success:hover, -a.bg-success:focus { - background-color: #c1e2b3; -} -.bg-info { - background-color: #d9edf7; -} -a.bg-info:hover, -a.bg-info:focus { - background-color: #afd9ee; -} -.bg-warning { - background-color: #fcf8e3; -} -a.bg-warning:hover, -a.bg-warning:focus { - background-color: #f7ecb5; -} -.bg-danger { - background-color: #f2dede; -} -a.bg-danger:hover, -a.bg-danger:focus { - background-color: #e4b9b9; -} -.page-header { - padding-bottom: 9px; - margin: 40px 0 20px; - border-bottom: 1px solid #eee; -} -ul, -ol { - margin-top: 0; - margin-bottom: 10px; -} -ul ul, -ol ul, -ul ol, -ol ol { - margin-bottom: 0; -} -.list-unstyled { - padding-left: 0; - list-style: none; -} -.list-inline { - padding-left: 0; - margin-left: -5px; - list-style: none; -} -.list-inline > li { - display: inline-block; - padding-right: 5px; - padding-left: 5px; -} -dl { - margin-top: 0; - margin-bottom: 20px; -} -dt, -dd { - line-height: 1.42857143; -} -dt { - font-weight: bold; -} -dd { - margin-left: 0; -} -@media (min-width: 768px) { - .dl-horizontal dt { - float: left; - width: 160px; - overflow: hidden; - clear: left; - text-align: right; - text-overflow: ellipsis; - white-space: nowrap; - } - .dl-horizontal dd { - margin-left: 180px; - } -} -abbr[title], -abbr[data-original-title] { - cursor: help; - border-bottom: 1px dotted #777; -} -.initialism { - font-size: 90%; - text-transform: uppercase; -} -blockquote { - padding: 10px 20px; - margin: 0 0 20px; - font-size: 17.5px; - border-left: 5px solid #eee; -} -blockquote p:last-child, -blockquote ul:last-child, -blockquote ol:last-child { - margin-bottom: 0; -} -blockquote footer, -blockquote small, -blockquote .small { - display: block; - font-size: 80%; - line-height: 1.42857143; - color: #777; -} -blockquote footer:before, -blockquote small:before, -blockquote .small:before { - content: '\2014 \00A0'; -} -.blockquote-reverse, -blockquote.pull-right { - padding-right: 15px; - padding-left: 0; - text-align: right; - border-right: 5px solid #eee; - border-left: 0; -} -.blockquote-reverse footer:before, -blockquote.pull-right footer:before, -.blockquote-reverse small:before, -blockquote.pull-right small:before, -.blockquote-reverse .small:before, -blockquote.pull-right .small:before { - content: ''; -} -.blockquote-reverse footer:after, -blockquote.pull-right footer:after, -.blockquote-reverse small:after, -blockquote.pull-right small:after, -.blockquote-reverse .small:after, -blockquote.pull-right .small:after { - content: '\00A0 \2014'; -} -address { - margin-bottom: 20px; - font-style: normal; - line-height: 1.42857143; -} -code, -kbd, -pre, -samp { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; -} -code { - padding: 2px 4px; - font-size: 90%; - color: #c7254e; - background-color: #f9f2f4; - border-radius: 4px; -} -kbd { - padding: 2px 4px; - font-size: 90%; - color: #fff; - background-color: #333; - border-radius: 3px; - -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); - box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); -} -kbd kbd { - padding: 0; - font-size: 100%; - font-weight: bold; - -webkit-box-shadow: none; - box-shadow: none; -} -pre { - display: block; - padding: 9.5px; - margin: 0 0 10px; - font-size: 13px; - line-height: 1.42857143; - color: #333; - word-break: break-all; - word-wrap: break-word; - background-color: #f5f5f5; - border: 1px solid #ccc; - border-radius: 4px; -} -pre code { - padding: 0; - font-size: inherit; - color: inherit; - white-space: pre-wrap; - background-color: transparent; - border-radius: 0; -} -.pre-scrollable { - max-height: 340px; - overflow-y: scroll; -} -.container { - padding-right: 15px; - padding-left: 15px; - margin-right: auto; - margin-left: auto; -} -@media (min-width: 768px) { - .container { - width: 750px; - } -} -@media (min-width: 992px) { - .container { - width: 970px; - } -} -@media (min-width: 1200px) { - .container { - width: 1170px; - } -} -.container-fluid { - padding-right: 15px; - padding-left: 15px; - margin-right: auto; - margin-left: auto; -} -.row { - margin-right: -15px; - margin-left: -15px; -} -.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { - position: relative; - min-height: 1px; - padding-right: 15px; - padding-left: 15px; -} -.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { - float: left; -} -.col-xs-12 { - width: 100%; -} -.col-xs-11 { - width: 91.66666667%; -} -.col-xs-10 { - width: 83.33333333%; -} -.col-xs-9 { - width: 75%; -} -.col-xs-8 { - width: 66.66666667%; -} -.col-xs-7 { - width: 58.33333333%; -} -.col-xs-6 { - width: 50%; -} -.col-xs-5 { - width: 41.66666667%; -} -.col-xs-4 { - width: 33.33333333%; -} -.col-xs-3 { - width: 25%; -} -.col-xs-2 { - width: 16.66666667%; -} -.col-xs-1 { - width: 8.33333333%; -} -.col-xs-pull-12 { - right: 100%; -} -.col-xs-pull-11 { - right: 91.66666667%; -} -.col-xs-pull-10 { - right: 83.33333333%; -} -.col-xs-pull-9 { - right: 75%; -} -.col-xs-pull-8 { - right: 66.66666667%; -} -.col-xs-pull-7 { - right: 58.33333333%; -} -.col-xs-pull-6 { - right: 50%; -} -.col-xs-pull-5 { - right: 41.66666667%; -} -.col-xs-pull-4 { - right: 33.33333333%; -} -.col-xs-pull-3 { - right: 25%; -} -.col-xs-pull-2 { - right: 16.66666667%; -} -.col-xs-pull-1 { - right: 8.33333333%; -} -.col-xs-pull-0 { - right: auto; -} -.col-xs-push-12 { - left: 100%; -} -.col-xs-push-11 { - left: 91.66666667%; -} -.col-xs-push-10 { - left: 83.33333333%; -} -.col-xs-push-9 { - left: 75%; -} -.col-xs-push-8 { - left: 66.66666667%; -} -.col-xs-push-7 { - left: 58.33333333%; -} -.col-xs-push-6 { - left: 50%; -} -.col-xs-push-5 { - left: 41.66666667%; -} -.col-xs-push-4 { - left: 33.33333333%; -} -.col-xs-push-3 { - left: 25%; -} -.col-xs-push-2 { - left: 16.66666667%; -} -.col-xs-push-1 { - left: 8.33333333%; -} -.col-xs-push-0 { - left: auto; -} -.col-xs-offset-12 { - margin-left: 100%; -} -.col-xs-offset-11 { - margin-left: 91.66666667%; -} -.col-xs-offset-10 { - margin-left: 83.33333333%; -} -.col-xs-offset-9 { - margin-left: 75%; -} -.col-xs-offset-8 { - margin-left: 66.66666667%; -} -.col-xs-offset-7 { - margin-left: 58.33333333%; -} -.col-xs-offset-6 { - margin-left: 50%; -} -.col-xs-offset-5 { - margin-left: 41.66666667%; -} -.col-xs-offset-4 { - margin-left: 33.33333333%; -} -.col-xs-offset-3 { - margin-left: 25%; -} -.col-xs-offset-2 { - margin-left: 16.66666667%; -} -.col-xs-offset-1 { - margin-left: 8.33333333%; -} -.col-xs-offset-0 { - margin-left: 0; -} -@media (min-width: 768px) { - .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { - float: left; - } - .col-sm-12 { - width: 100%; - } - .col-sm-11 { - width: 91.66666667%; - } - .col-sm-10 { - width: 83.33333333%; - } - .col-sm-9 { - width: 75%; - } - .col-sm-8 { - width: 66.66666667%; - } - .col-sm-7 { - width: 58.33333333%; - } - .col-sm-6 { - width: 50%; - } - .col-sm-5 { - width: 41.66666667%; - } - .col-sm-4 { - width: 33.33333333%; - } - .col-sm-3 { - width: 25%; - } - .col-sm-2 { - width: 16.66666667%; - } - .col-sm-1 { - width: 8.33333333%; - } - .col-sm-pull-12 { - right: 100%; - } - .col-sm-pull-11 { - right: 91.66666667%; - } - .col-sm-pull-10 { - right: 83.33333333%; - } - .col-sm-pull-9 { - right: 75%; - } - .col-sm-pull-8 { - right: 66.66666667%; - } - .col-sm-pull-7 { - right: 58.33333333%; - } - .col-sm-pull-6 { - right: 50%; - } - .col-sm-pull-5 { - right: 41.66666667%; - } - .col-sm-pull-4 { - right: 33.33333333%; - } - .col-sm-pull-3 { - right: 25%; - } - .col-sm-pull-2 { - right: 16.66666667%; - } - .col-sm-pull-1 { - right: 8.33333333%; - } - .col-sm-pull-0 { - right: auto; - } - .col-sm-push-12 { - left: 100%; - } - .col-sm-push-11 { - left: 91.66666667%; - } - .col-sm-push-10 { - left: 83.33333333%; - } - .col-sm-push-9 { - left: 75%; - } - .col-sm-push-8 { - left: 66.66666667%; - } - .col-sm-push-7 { - left: 58.33333333%; - } - .col-sm-push-6 { - left: 50%; - } - .col-sm-push-5 { - left: 41.66666667%; - } - .col-sm-push-4 { - left: 33.33333333%; - } - .col-sm-push-3 { - left: 25%; - } - .col-sm-push-2 { - left: 16.66666667%; - } - .col-sm-push-1 { - left: 8.33333333%; - } - .col-sm-push-0 { - left: auto; - } - .col-sm-offset-12 { - margin-left: 100%; - } - .col-sm-offset-11 { - margin-left: 91.66666667%; - } - .col-sm-offset-10 { - margin-left: 83.33333333%; - } - .col-sm-offset-9 { - margin-left: 75%; - } - .col-sm-offset-8 { - margin-left: 66.66666667%; - } - .col-sm-offset-7 { - margin-left: 58.33333333%; - } - .col-sm-offset-6 { - margin-left: 50%; - } - .col-sm-offset-5 { - margin-left: 41.66666667%; - } - .col-sm-offset-4 { - margin-left: 33.33333333%; - } - .col-sm-offset-3 { - margin-left: 25%; - } - .col-sm-offset-2 { - margin-left: 16.66666667%; - } - .col-sm-offset-1 { - margin-left: 8.33333333%; - } - .col-sm-offset-0 { - margin-left: 0; - } -} -@media (min-width: 992px) { - .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { - float: left; - } - .col-md-12 { - width: 100%; - } - .col-md-11 { - width: 91.66666667%; - } - .col-md-10 { - width: 83.33333333%; - } - .col-md-9 { - width: 75%; - } - .col-md-8 { - width: 66.66666667%; - } - .col-md-7 { - width: 58.33333333%; - } - .col-md-6 { - width: 50%; - } - .col-md-5 { - width: 41.66666667%; - } - .col-md-4 { - width: 33.33333333%; - } - .col-md-3 { - width: 25%; - } - .col-md-2 { - width: 16.66666667%; - } - .col-md-1 { - width: 8.33333333%; - } - .col-md-pull-12 { - right: 100%; - } - .col-md-pull-11 { - right: 91.66666667%; - } - .col-md-pull-10 { - right: 83.33333333%; - } - .col-md-pull-9 { - right: 75%; - } - .col-md-pull-8 { - right: 66.66666667%; - } - .col-md-pull-7 { - right: 58.33333333%; - } - .col-md-pull-6 { - right: 50%; - } - .col-md-pull-5 { - right: 41.66666667%; - } - .col-md-pull-4 { - right: 33.33333333%; - } - .col-md-pull-3 { - right: 25%; - } - .col-md-pull-2 { - right: 16.66666667%; - } - .col-md-pull-1 { - right: 8.33333333%; - } - .col-md-pull-0 { - right: auto; - } - .col-md-push-12 { - left: 100%; - } - .col-md-push-11 { - left: 91.66666667%; - } - .col-md-push-10 { - left: 83.33333333%; - } - .col-md-push-9 { - left: 75%; - } - .col-md-push-8 { - left: 66.66666667%; - } - .col-md-push-7 { - left: 58.33333333%; - } - .col-md-push-6 { - left: 50%; - } - .col-md-push-5 { - left: 41.66666667%; - } - .col-md-push-4 { - left: 33.33333333%; - } - .col-md-push-3 { - left: 25%; - } - .col-md-push-2 { - left: 16.66666667%; - } - .col-md-push-1 { - left: 8.33333333%; - } - .col-md-push-0 { - left: auto; - } - .col-md-offset-12 { - margin-left: 100%; - } - .col-md-offset-11 { - margin-left: 91.66666667%; - } - .col-md-offset-10 { - margin-left: 83.33333333%; - } - .col-md-offset-9 { - margin-left: 75%; - } - .col-md-offset-8 { - margin-left: 66.66666667%; - } - .col-md-offset-7 { - margin-left: 58.33333333%; - } - .col-md-offset-6 { - margin-left: 50%; - } - .col-md-offset-5 { - margin-left: 41.66666667%; - } - .col-md-offset-4 { - margin-left: 33.33333333%; - } - .col-md-offset-3 { - margin-left: 25%; - } - .col-md-offset-2 { - margin-left: 16.66666667%; - } - .col-md-offset-1 { - margin-left: 8.33333333%; - } - .col-md-offset-0 { - margin-left: 0; - } -} -@media (min-width: 1200px) { - .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { - float: left; - } - .col-lg-12 { - width: 100%; - } - .col-lg-11 { - width: 91.66666667%; - } - .col-lg-10 { - width: 83.33333333%; - } - .col-lg-9 { - width: 75%; - } - .col-lg-8 { - width: 66.66666667%; - } - .col-lg-7 { - width: 58.33333333%; - } - .col-lg-6 { - width: 50%; - } - .col-lg-5 { - width: 41.66666667%; - } - .col-lg-4 { - width: 33.33333333%; - } - .col-lg-3 { - width: 25%; - } - .col-lg-2 { - width: 16.66666667%; - } - .col-lg-1 { - width: 8.33333333%; - } - .col-lg-pull-12 { - right: 100%; - } - .col-lg-pull-11 { - right: 91.66666667%; - } - .col-lg-pull-10 { - right: 83.33333333%; - } - .col-lg-pull-9 { - right: 75%; - } - .col-lg-pull-8 { - right: 66.66666667%; - } - .col-lg-pull-7 { - right: 58.33333333%; - } - .col-lg-pull-6 { - right: 50%; - } - .col-lg-pull-5 { - right: 41.66666667%; - } - .col-lg-pull-4 { - right: 33.33333333%; - } - .col-lg-pull-3 { - right: 25%; - } - .col-lg-pull-2 { - right: 16.66666667%; - } - .col-lg-pull-1 { - right: 8.33333333%; - } - .col-lg-pull-0 { - right: auto; - } - .col-lg-push-12 { - left: 100%; - } - .col-lg-push-11 { - left: 91.66666667%; - } - .col-lg-push-10 { - left: 83.33333333%; - } - .col-lg-push-9 { - left: 75%; - } - .col-lg-push-8 { - left: 66.66666667%; - } - .col-lg-push-7 { - left: 58.33333333%; - } - .col-lg-push-6 { - left: 50%; - } - .col-lg-push-5 { - left: 41.66666667%; - } - .col-lg-push-4 { - left: 33.33333333%; - } - .col-lg-push-3 { - left: 25%; - } - .col-lg-push-2 { - left: 16.66666667%; - } - .col-lg-push-1 { - left: 8.33333333%; - } - .col-lg-push-0 { - left: auto; - } - .col-lg-offset-12 { - margin-left: 100%; - } - .col-lg-offset-11 { - margin-left: 91.66666667%; - } - .col-lg-offset-10 { - margin-left: 83.33333333%; - } - .col-lg-offset-9 { - margin-left: 75%; - } - .col-lg-offset-8 { - margin-left: 66.66666667%; - } - .col-lg-offset-7 { - margin-left: 58.33333333%; - } - .col-lg-offset-6 { - margin-left: 50%; - } - .col-lg-offset-5 { - margin-left: 41.66666667%; - } - .col-lg-offset-4 { - margin-left: 33.33333333%; - } - .col-lg-offset-3 { - margin-left: 25%; - } - .col-lg-offset-2 { - margin-left: 16.66666667%; - } - .col-lg-offset-1 { - margin-left: 8.33333333%; - } - .col-lg-offset-0 { - margin-left: 0; - } -} -table { - background-color: transparent; -} -caption { - padding-top: 8px; - padding-bottom: 8px; - color: #777; - text-align: left; -} -th { - text-align: left; -} -.table { - width: 100%; - max-width: 100%; - margin-bottom: 20px; -} -.table > thead > tr > th, -.table > tbody > tr > th, -.table > tfoot > tr > th, -.table > thead > tr > td, -.table > tbody > tr > td, -.table > tfoot > tr > td { - padding: 8px; - line-height: 1.42857143; - vertical-align: top; - border-top: 1px solid #ddd; -} -.table > thead > tr > th { - vertical-align: bottom; - border-bottom: 2px solid #ddd; -} -.table > caption + thead > tr:first-child > th, -.table > colgroup + thead > tr:first-child > th, -.table > thead:first-child > tr:first-child > th, -.table > caption + thead > tr:first-child > td, -.table > colgroup + thead > tr:first-child > td, -.table > thead:first-child > tr:first-child > td { - border-top: 0; -} -.table > tbody + tbody { - border-top: 2px solid #ddd; -} -.table .table { - background-color: #fff; -} -.table-condensed > thead > tr > th, -.table-condensed > tbody > tr > th, -.table-condensed > tfoot > tr > th, -.table-condensed > thead > tr > td, -.table-condensed > tbody > tr > td, -.table-condensed > tfoot > tr > td { - padding: 5px; -} -.table-bordered { - border: 1px solid #ddd; -} -.table-bordered > thead > tr > th, -.table-bordered > tbody > tr > th, -.table-bordered > tfoot > tr > th, -.table-bordered > thead > tr > td, -.table-bordered > tbody > tr > td, -.table-bordered > tfoot > tr > td { - border: 1px solid #ddd; -} -.table-bordered > thead > tr > th, -.table-bordered > thead > tr > td { - border-bottom-width: 2px; -} -.table-striped > tbody > tr:nth-of-type(odd) { - background-color: #f9f9f9; -} -.table-hover > tbody > tr:hover { - background-color: #f5f5f5; -} -table col[class*="col-"] { - position: static; - display: table-column; - float: none; -} -table td[class*="col-"], -table th[class*="col-"] { - position: static; - display: table-cell; - float: none; -} -.table > thead > tr > td.active, -.table > tbody > tr > td.active, -.table > tfoot > tr > td.active, -.table > thead > tr > th.active, -.table > tbody > tr > th.active, -.table > tfoot > tr > th.active, -.table > thead > tr.active > td, -.table > tbody > tr.active > td, -.table > tfoot > tr.active > td, -.table > thead > tr.active > th, -.table > tbody > tr.active > th, -.table > tfoot > tr.active > th { - background-color: #f5f5f5; -} -.table-hover > tbody > tr > td.active:hover, -.table-hover > tbody > tr > th.active:hover, -.table-hover > tbody > tr.active:hover > td, -.table-hover > tbody > tr:hover > .active, -.table-hover > tbody > tr.active:hover > th { - background-color: #e8e8e8; -} -.table > thead > tr > td.success, -.table > tbody > tr > td.success, -.table > tfoot > tr > td.success, -.table > thead > tr > th.success, -.table > tbody > tr > th.success, -.table > tfoot > tr > th.success, -.table > thead > tr.success > td, -.table > tbody > tr.success > td, -.table > tfoot > tr.success > td, -.table > thead > tr.success > th, -.table > tbody > tr.success > th, -.table > tfoot > tr.success > th { - background-color: #dff0d8; -} -.table-hover > tbody > tr > td.success:hover, -.table-hover > tbody > tr > th.success:hover, -.table-hover > tbody > tr.success:hover > td, -.table-hover > tbody > tr:hover > .success, -.table-hover > tbody > tr.success:hover > th { - background-color: #d0e9c6; -} -.table > thead > tr > td.info, -.table > tbody > tr > td.info, -.table > tfoot > tr > td.info, -.table > thead > tr > th.info, -.table > tbody > tr > th.info, -.table > tfoot > tr > th.info, -.table > thead > tr.info > td, -.table > tbody > tr.info > td, -.table > tfoot > tr.info > td, -.table > thead > tr.info > th, -.table > tbody > tr.info > th, -.table > tfoot > tr.info > th { - background-color: #d9edf7; -} -.table-hover > tbody > tr > td.info:hover, -.table-hover > tbody > tr > th.info:hover, -.table-hover > tbody > tr.info:hover > td, -.table-hover > tbody > tr:hover > .info, -.table-hover > tbody > tr.info:hover > th { - background-color: #c4e3f3; -} -.table > thead > tr > td.warning, -.table > tbody > tr > td.warning, -.table > tfoot > tr > td.warning, -.table > thead > tr > th.warning, -.table > tbody > tr > th.warning, -.table > tfoot > tr > th.warning, -.table > thead > tr.warning > td, -.table > tbody > tr.warning > td, -.table > tfoot > tr.warning > td, -.table > thead > tr.warning > th, -.table > tbody > tr.warning > th, -.table > tfoot > tr.warning > th { - background-color: #fcf8e3; -} -.table-hover > tbody > tr > td.warning:hover, -.table-hover > tbody > tr > th.warning:hover, -.table-hover > tbody > tr.warning:hover > td, -.table-hover > tbody > tr:hover > .warning, -.table-hover > tbody > tr.warning:hover > th { - background-color: #faf2cc; -} -.table > thead > tr > td.danger, -.table > tbody > tr > td.danger, -.table > tfoot > tr > td.danger, -.table > thead > tr > th.danger, -.table > tbody > tr > th.danger, -.table > tfoot > tr > th.danger, -.table > thead > tr.danger > td, -.table > tbody > tr.danger > td, -.table > tfoot > tr.danger > td, -.table > thead > tr.danger > th, -.table > tbody > tr.danger > th, -.table > tfoot > tr.danger > th { - background-color: #f2dede; -} -.table-hover > tbody > tr > td.danger:hover, -.table-hover > tbody > tr > th.danger:hover, -.table-hover > tbody > tr.danger:hover > td, -.table-hover > tbody > tr:hover > .danger, -.table-hover > tbody > tr.danger:hover > th { - background-color: #ebcccc; -} -.table-responsive { - min-height: .01%; - overflow-x: auto; -} -@media screen and (max-width: 767px) { - .table-responsive { - width: 100%; - margin-bottom: 15px; - overflow-y: hidden; - -ms-overflow-style: -ms-autohiding-scrollbar; - border: 1px solid #ddd; - } - .table-responsive > .table { - margin-bottom: 0; - } - .table-responsive > .table > thead > tr > th, - .table-responsive > .table > tbody > tr > th, - .table-responsive > .table > tfoot > tr > th, - .table-responsive > .table > thead > tr > td, - .table-responsive > .table > tbody > tr > td, - .table-responsive > .table > tfoot > tr > td { - white-space: nowrap; - } - .table-responsive > .table-bordered { - border: 0; - } - .table-responsive > .table-bordered > thead > tr > th:first-child, - .table-responsive > .table-bordered > tbody > tr > th:first-child, - .table-responsive > .table-bordered > tfoot > tr > th:first-child, - .table-responsive > .table-bordered > thead > tr > td:first-child, - .table-responsive > .table-bordered > tbody > tr > td:first-child, - .table-responsive > .table-bordered > tfoot > tr > td:first-child { - border-left: 0; - } - .table-responsive > .table-bordered > thead > tr > th:last-child, - .table-responsive > .table-bordered > tbody > tr > th:last-child, - .table-responsive > .table-bordered > tfoot > tr > th:last-child, - .table-responsive > .table-bordered > thead > tr > td:last-child, - .table-responsive > .table-bordered > tbody > tr > td:last-child, - .table-responsive > .table-bordered > tfoot > tr > td:last-child { - border-right: 0; - } - .table-responsive > .table-bordered > tbody > tr:last-child > th, - .table-responsive > .table-bordered > tfoot > tr:last-child > th, - .table-responsive > .table-bordered > tbody > tr:last-child > td, - .table-responsive > .table-bordered > tfoot > tr:last-child > td { - border-bottom: 0; - } -} -fieldset { - min-width: 0; - padding: 0; - margin: 0; - border: 0; -} -legend { - display: block; - width: 100%; - padding: 0; - margin-bottom: 20px; - font-size: 21px; - line-height: inherit; - color: #333; - border: 0; - border-bottom: 1px solid #e5e5e5; -} -label { - display: inline-block; - max-width: 100%; - margin-bottom: 5px; - font-weight: bold; -} -input[type="search"] { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -input[type="radio"], -input[type="checkbox"] { - margin: 4px 0 0; - margin-top: 1px \9; - line-height: normal; -} -input[type="file"] { - display: block; -} -input[type="range"] { - display: block; - width: 100%; -} -select[multiple], -select[size] { - height: auto; -} -input[type="file"]:focus, -input[type="radio"]:focus, -input[type="checkbox"]:focus { - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -output { - display: block; - padding-top: 7px; - font-size: 14px; - line-height: 1.42857143; - color: #555; -} -.form-control { - display: block; - width: 100%; - height: 34px; - padding: 6px 12px; - font-size: 14px; - line-height: 1.42857143; - color: #555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; - -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -} -.form-control:focus { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); - box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); -} -.form-control::-moz-placeholder { - color: #999; - opacity: 1; -} -.form-control:-ms-input-placeholder { - color: #999; -} -.form-control::-webkit-input-placeholder { - color: #999; -} -.form-control::-ms-expand { - background-color: transparent; - border: 0; -} -.form-control[disabled], -.form-control[readonly], -fieldset[disabled] .form-control { - background-color: #eee; - opacity: 1; -} -.form-control[disabled], -fieldset[disabled] .form-control { - cursor: not-allowed; -} -textarea.form-control { - height: auto; -} -input[type="search"] { - -webkit-appearance: none; -} -@media screen and (-webkit-min-device-pixel-ratio: 0) { - input[type="date"].form-control, - input[type="time"].form-control, - input[type="datetime-local"].form-control, - input[type="month"].form-control { - line-height: 34px; - } - input[type="date"].input-sm, - input[type="time"].input-sm, - input[type="datetime-local"].input-sm, - input[type="month"].input-sm, - .input-group-sm input[type="date"], - .input-group-sm input[type="time"], - .input-group-sm input[type="datetime-local"], - .input-group-sm input[type="month"] { - line-height: 30px; - } - input[type="date"].input-lg, - input[type="time"].input-lg, - input[type="datetime-local"].input-lg, - input[type="month"].input-lg, - .input-group-lg input[type="date"], - .input-group-lg input[type="time"], - .input-group-lg input[type="datetime-local"], - .input-group-lg input[type="month"] { - line-height: 46px; - } -} -.form-group { - margin-bottom: 15px; -} -.radio, -.checkbox { - position: relative; - display: block; - margin-top: 10px; - margin-bottom: 10px; -} -.radio label, -.checkbox label { - min-height: 20px; - padding-left: 20px; - margin-bottom: 0; - font-weight: normal; - cursor: pointer; -} -.radio input[type="radio"], -.radio-inline input[type="radio"], -.checkbox input[type="checkbox"], -.checkbox-inline input[type="checkbox"] { - position: absolute; - margin-top: 4px \9; - margin-left: -20px; -} -.radio + .radio, -.checkbox + .checkbox { - margin-top: -5px; -} -.radio-inline, -.checkbox-inline { - position: relative; - display: inline-block; - padding-left: 20px; - margin-bottom: 0; - font-weight: normal; - vertical-align: middle; - cursor: pointer; -} -.radio-inline + .radio-inline, -.checkbox-inline + .checkbox-inline { - margin-top: 0; - margin-left: 10px; -} -input[type="radio"][disabled], -input[type="checkbox"][disabled], -input[type="radio"].disabled, -input[type="checkbox"].disabled, -fieldset[disabled] input[type="radio"], -fieldset[disabled] input[type="checkbox"] { - cursor: not-allowed; -} -.radio-inline.disabled, -.checkbox-inline.disabled, -fieldset[disabled] .radio-inline, -fieldset[disabled] .checkbox-inline { - cursor: not-allowed; -} -.radio.disabled label, -.checkbox.disabled label, -fieldset[disabled] .radio label, -fieldset[disabled] .checkbox label { - cursor: not-allowed; -} -.form-control-static { - min-height: 34px; - padding-top: 7px; - padding-bottom: 7px; - margin-bottom: 0; -} -.form-control-static.input-lg, -.form-control-static.input-sm { - padding-right: 0; - padding-left: 0; -} -.input-sm { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -select.input-sm { - height: 30px; - line-height: 30px; -} -textarea.input-sm, -select[multiple].input-sm { - height: auto; -} -.form-group-sm .form-control { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -.form-group-sm select.form-control { - height: 30px; - line-height: 30px; -} -.form-group-sm textarea.form-control, -.form-group-sm select[multiple].form-control { - height: auto; -} -.form-group-sm .form-control-static { - height: 30px; - min-height: 32px; - padding: 6px 10px; - font-size: 12px; - line-height: 1.5; -} -.input-lg { - height: 46px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.3333333; - border-radius: 6px; -} -select.input-lg { - height: 46px; - line-height: 46px; -} -textarea.input-lg, -select[multiple].input-lg { - height: auto; -} -.form-group-lg .form-control { - height: 46px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.3333333; - border-radius: 6px; -} -.form-group-lg select.form-control { - height: 46px; - line-height: 46px; -} -.form-group-lg textarea.form-control, -.form-group-lg select[multiple].form-control { - height: auto; -} -.form-group-lg .form-control-static { - height: 46px; - min-height: 38px; - padding: 11px 16px; - font-size: 18px; - line-height: 1.3333333; -} -.has-feedback { - position: relative; -} -.has-feedback .form-control { - padding-right: 42.5px; -} -.form-control-feedback { - position: absolute; - top: 0; - right: 0; - z-index: 2; - display: block; - width: 34px; - height: 34px; - line-height: 34px; - text-align: center; - pointer-events: none; -} -.input-lg + .form-control-feedback, -.input-group-lg + .form-control-feedback, -.form-group-lg .form-control + .form-control-feedback { - width: 46px; - height: 46px; - line-height: 46px; -} -.input-sm + .form-control-feedback, -.input-group-sm + .form-control-feedback, -.form-group-sm .form-control + .form-control-feedback { - width: 30px; - height: 30px; - line-height: 30px; -} -.has-success .help-block, -.has-success .control-label, -.has-success .radio, -.has-success .checkbox, -.has-success .radio-inline, -.has-success .checkbox-inline, -.has-success.radio label, -.has-success.checkbox label, -.has-success.radio-inline label, -.has-success.checkbox-inline label { - color: #3c763d; -} -.has-success .form-control { - border-color: #3c763d; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); -} -.has-success .form-control:focus { - border-color: #2b542c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; -} -.has-success .input-group-addon { - color: #3c763d; - background-color: #dff0d8; - border-color: #3c763d; -} -.has-success .form-control-feedback { - color: #3c763d; -} -.has-warning .help-block, -.has-warning .control-label, -.has-warning .radio, -.has-warning .checkbox, -.has-warning .radio-inline, -.has-warning .checkbox-inline, -.has-warning.radio label, -.has-warning.checkbox label, -.has-warning.radio-inline label, -.has-warning.checkbox-inline label { - color: #8a6d3b; -} -.has-warning .form-control { - border-color: #8a6d3b; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); -} -.has-warning .form-control:focus { - border-color: #66512c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; -} -.has-warning .input-group-addon { - color: #8a6d3b; - background-color: #fcf8e3; - border-color: #8a6d3b; -} -.has-warning .form-control-feedback { - color: #8a6d3b; -} -.has-error .help-block, -.has-error .control-label, -.has-error .radio, -.has-error .checkbox, -.has-error .radio-inline, -.has-error .checkbox-inline, -.has-error.radio label, -.has-error.checkbox label, -.has-error.radio-inline label, -.has-error.checkbox-inline label { - color: #a94442; -} -.has-error .form-control { - border-color: #a94442; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); -} -.has-error .form-control:focus { - border-color: #843534; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; -} -.has-error .input-group-addon { - color: #a94442; - background-color: #f2dede; - border-color: #a94442; -} -.has-error .form-control-feedback { - color: #a94442; -} -.has-feedback label ~ .form-control-feedback { - top: 25px; -} -.has-feedback label.sr-only ~ .form-control-feedback { - top: 0; -} -.help-block { - display: block; - margin-top: 5px; - margin-bottom: 10px; - color: #737373; -} -@media (min-width: 768px) { - .form-inline .form-group { - display: inline-block; - margin-bottom: 0; - vertical-align: middle; - } - .form-inline .form-control { - display: inline-block; - width: auto; - vertical-align: middle; - } - .form-inline .form-control-static { - display: inline-block; - } - .form-inline .input-group { - display: inline-table; - vertical-align: middle; - } - .form-inline .input-group .input-group-addon, - .form-inline .input-group .input-group-btn, - .form-inline .input-group .form-control { - width: auto; - } - .form-inline .input-group > .form-control { - width: 100%; - } - .form-inline .control-label { - margin-bottom: 0; - vertical-align: middle; - } - .form-inline .radio, - .form-inline .checkbox { - display: inline-block; - margin-top: 0; - margin-bottom: 0; - vertical-align: middle; - } - .form-inline .radio label, - .form-inline .checkbox label { - padding-left: 0; - } - .form-inline .radio input[type="radio"], - .form-inline .checkbox input[type="checkbox"] { - position: relative; - margin-left: 0; - } - .form-inline .has-feedback .form-control-feedback { - top: 0; - } -} -.form-horizontal .radio, -.form-horizontal .checkbox, -.form-horizontal .radio-inline, -.form-horizontal .checkbox-inline { - padding-top: 7px; - margin-top: 0; - margin-bottom: 0; -} -.form-horizontal .radio, -.form-horizontal .checkbox { - min-height: 27px; -} -.form-horizontal .form-group { - margin-right: -15px; - margin-left: -15px; -} -@media (min-width: 768px) { - .form-horizontal .control-label { - padding-top: 7px; - margin-bottom: 0; - text-align: right; - } -} -.form-horizontal .has-feedback .form-control-feedback { - right: 15px; -} -@media (min-width: 768px) { - .form-horizontal .form-group-lg .control-label { - padding-top: 11px; - font-size: 18px; - } -} -@media (min-width: 768px) { - .form-horizontal .form-group-sm .control-label { - padding-top: 6px; - font-size: 12px; - } -} -.btn { - display: inline-block; - padding: 6px 12px; - margin-bottom: 0; - font-size: 14px; - font-weight: normal; - line-height: 1.42857143; - text-align: center; - white-space: nowrap; - vertical-align: middle; - -ms-touch-action: manipulation; - touch-action: manipulation; - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - background-image: none; - border: 1px solid transparent; - border-radius: 4px; -} -.btn:focus, -.btn:active:focus, -.btn.active:focus, -.btn.focus, -.btn:active.focus, -.btn.active.focus { - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -.btn:hover, -.btn:focus, -.btn.focus { - color: #333; - text-decoration: none; -} -.btn:active, -.btn.active { - background-image: none; - outline: 0; - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); -} -.btn.disabled, -.btn[disabled], -fieldset[disabled] .btn { - cursor: not-allowed; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - box-shadow: none; - opacity: .65; -} -a.btn.disabled, -fieldset[disabled] a.btn { - pointer-events: none; -} -.btn-default { - color: #333; - background-color: #fff; - border-color: #ccc; -} -.btn-default:focus, -.btn-default.focus { - color: #333; - background-color: #e6e6e6; - border-color: #8c8c8c; -} -.btn-default:hover { - color: #333; - background-color: #e6e6e6; - border-color: #adadad; -} -.btn-default:active, -.btn-default.active, -.open > .dropdown-toggle.btn-default { - color: #333; - background-color: #e6e6e6; - border-color: #adadad; -} -.btn-default:active:hover, -.btn-default.active:hover, -.open > .dropdown-toggle.btn-default:hover, -.btn-default:active:focus, -.btn-default.active:focus, -.open > .dropdown-toggle.btn-default:focus, -.btn-default:active.focus, -.btn-default.active.focus, -.open > .dropdown-toggle.btn-default.focus { - color: #333; - background-color: #d4d4d4; - border-color: #8c8c8c; -} -.btn-default:active, -.btn-default.active, -.open > .dropdown-toggle.btn-default { - background-image: none; -} -.btn-default.disabled:hover, -.btn-default[disabled]:hover, -fieldset[disabled] .btn-default:hover, -.btn-default.disabled:focus, -.btn-default[disabled]:focus, -fieldset[disabled] .btn-default:focus, -.btn-default.disabled.focus, -.btn-default[disabled].focus, -fieldset[disabled] .btn-default.focus { - background-color: #fff; - border-color: #ccc; -} -.btn-default .badge { - color: #fff; - background-color: #333; -} -.btn-primary { - color: #fff; - background-color: #337ab7; - border-color: #2e6da4; -} -.btn-primary:focus, -.btn-primary.focus { - color: #fff; - background-color: #286090; - border-color: #122b40; -} -.btn-primary:hover { - color: #fff; - background-color: #286090; - border-color: #204d74; -} -.btn-primary:active, -.btn-primary.active, -.open > .dropdown-toggle.btn-primary { - color: #fff; - background-color: #286090; - border-color: #204d74; -} -.btn-primary:active:hover, -.btn-primary.active:hover, -.open > .dropdown-toggle.btn-primary:hover, -.btn-primary:active:focus, -.btn-primary.active:focus, -.open > .dropdown-toggle.btn-primary:focus, -.btn-primary:active.focus, -.btn-primary.active.focus, -.open > .dropdown-toggle.btn-primary.focus { - color: #fff; - background-color: #204d74; - border-color: #122b40; -} -.btn-primary:active, -.btn-primary.active, -.open > .dropdown-toggle.btn-primary { - background-image: none; -} -.btn-primary.disabled:hover, -.btn-primary[disabled]:hover, -fieldset[disabled] .btn-primary:hover, -.btn-primary.disabled:focus, -.btn-primary[disabled]:focus, -fieldset[disabled] .btn-primary:focus, -.btn-primary.disabled.focus, -.btn-primary[disabled].focus, -fieldset[disabled] .btn-primary.focus { - background-color: #337ab7; - border-color: #2e6da4; -} -.btn-primary .badge { - color: #337ab7; - background-color: #fff; -} -.btn-success { - color: #fff; - background-color: #5cb85c; - border-color: #4cae4c; -} -.btn-success:focus, -.btn-success.focus { - color: #fff; - background-color: #449d44; - border-color: #255625; -} -.btn-success:hover { - color: #fff; - background-color: #449d44; - border-color: #398439; -} -.btn-success:active, -.btn-success.active, -.open > .dropdown-toggle.btn-success { - color: #fff; - background-color: #449d44; - border-color: #398439; -} -.btn-success:active:hover, -.btn-success.active:hover, -.open > .dropdown-toggle.btn-success:hover, -.btn-success:active:focus, -.btn-success.active:focus, -.open > .dropdown-toggle.btn-success:focus, -.btn-success:active.focus, -.btn-success.active.focus, -.open > .dropdown-toggle.btn-success.focus { - color: #fff; - background-color: #398439; - border-color: #255625; -} -.btn-success:active, -.btn-success.active, -.open > .dropdown-toggle.btn-success { - background-image: none; -} -.btn-success.disabled:hover, -.btn-success[disabled]:hover, -fieldset[disabled] .btn-success:hover, -.btn-success.disabled:focus, -.btn-success[disabled]:focus, -fieldset[disabled] .btn-success:focus, -.btn-success.disabled.focus, -.btn-success[disabled].focus, -fieldset[disabled] .btn-success.focus { - background-color: #5cb85c; - border-color: #4cae4c; -} -.btn-success .badge { - color: #5cb85c; - background-color: #fff; -} -.btn-info { - color: #fff; - background-color: #5bc0de; - border-color: #46b8da; -} -.btn-info:focus, -.btn-info.focus { - color: #fff; - background-color: #31b0d5; - border-color: #1b6d85; -} -.btn-info:hover { - color: #fff; - background-color: #31b0d5; - border-color: #269abc; -} -.btn-info:active, -.btn-info.active, -.open > .dropdown-toggle.btn-info { - color: #fff; - background-color: #31b0d5; - border-color: #269abc; -} -.btn-info:active:hover, -.btn-info.active:hover, -.open > .dropdown-toggle.btn-info:hover, -.btn-info:active:focus, -.btn-info.active:focus, -.open > .dropdown-toggle.btn-info:focus, -.btn-info:active.focus, -.btn-info.active.focus, -.open > .dropdown-toggle.btn-info.focus { - color: #fff; - background-color: #269abc; - border-color: #1b6d85; -} -.btn-info:active, -.btn-info.active, -.open > .dropdown-toggle.btn-info { - background-image: none; -} -.btn-info.disabled:hover, -.btn-info[disabled]:hover, -fieldset[disabled] .btn-info:hover, -.btn-info.disabled:focus, -.btn-info[disabled]:focus, -fieldset[disabled] .btn-info:focus, -.btn-info.disabled.focus, -.btn-info[disabled].focus, -fieldset[disabled] .btn-info.focus { - background-color: #5bc0de; - border-color: #46b8da; -} -.btn-info .badge { - color: #5bc0de; - background-color: #fff; -} -.btn-warning { - color: #fff; - background-color: #f0ad4e; - border-color: #eea236; -} -.btn-warning:focus, -.btn-warning.focus { - color: #fff; - background-color: #ec971f; - border-color: #985f0d; -} -.btn-warning:hover { - color: #fff; - background-color: #ec971f; - border-color: #d58512; -} -.btn-warning:active, -.btn-warning.active, -.open > .dropdown-toggle.btn-warning { - color: #fff; - background-color: #ec971f; - border-color: #d58512; -} -.btn-warning:active:hover, -.btn-warning.active:hover, -.open > .dropdown-toggle.btn-warning:hover, -.btn-warning:active:focus, -.btn-warning.active:focus, -.open > .dropdown-toggle.btn-warning:focus, -.btn-warning:active.focus, -.btn-warning.active.focus, -.open > .dropdown-toggle.btn-warning.focus { - color: #fff; - background-color: #d58512; - border-color: #985f0d; -} -.btn-warning:active, -.btn-warning.active, -.open > .dropdown-toggle.btn-warning { - background-image: none; -} -.btn-warning.disabled:hover, -.btn-warning[disabled]:hover, -fieldset[disabled] .btn-warning:hover, -.btn-warning.disabled:focus, -.btn-warning[disabled]:focus, -fieldset[disabled] .btn-warning:focus, -.btn-warning.disabled.focus, -.btn-warning[disabled].focus, -fieldset[disabled] .btn-warning.focus { - background-color: #f0ad4e; - border-color: #eea236; -} -.btn-warning .badge { - color: #f0ad4e; - background-color: #fff; -} -.btn-danger { - color: #fff; - background-color: #d9534f; - border-color: #d43f3a; -} -.btn-danger:focus, -.btn-danger.focus { - color: #fff; - background-color: #c9302c; - border-color: #761c19; -} -.btn-danger:hover { - color: #fff; - background-color: #c9302c; - border-color: #ac2925; -} -.btn-danger:active, -.btn-danger.active, -.open > .dropdown-toggle.btn-danger { - color: #fff; - background-color: #c9302c; - border-color: #ac2925; -} -.btn-danger:active:hover, -.btn-danger.active:hover, -.open > .dropdown-toggle.btn-danger:hover, -.btn-danger:active:focus, -.btn-danger.active:focus, -.open > .dropdown-toggle.btn-danger:focus, -.btn-danger:active.focus, -.btn-danger.active.focus, -.open > .dropdown-toggle.btn-danger.focus { - color: #fff; - background-color: #ac2925; - border-color: #761c19; -} -.btn-danger:active, -.btn-danger.active, -.open > .dropdown-toggle.btn-danger { - background-image: none; -} -.btn-danger.disabled:hover, -.btn-danger[disabled]:hover, -fieldset[disabled] .btn-danger:hover, -.btn-danger.disabled:focus, -.btn-danger[disabled]:focus, -fieldset[disabled] .btn-danger:focus, -.btn-danger.disabled.focus, -.btn-danger[disabled].focus, -fieldset[disabled] .btn-danger.focus { - background-color: #d9534f; - border-color: #d43f3a; -} -.btn-danger .badge { - color: #d9534f; - background-color: #fff; -} -.btn-link { - font-weight: normal; - color: #337ab7; - border-radius: 0; -} -.btn-link, -.btn-link:active, -.btn-link.active, -.btn-link[disabled], -fieldset[disabled] .btn-link { - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; -} -.btn-link, -.btn-link:hover, -.btn-link:focus, -.btn-link:active { - border-color: transparent; -} -.btn-link:hover, -.btn-link:focus { - color: #23527c; - text-decoration: underline; - background-color: transparent; -} -.btn-link[disabled]:hover, -fieldset[disabled] .btn-link:hover, -.btn-link[disabled]:focus, -fieldset[disabled] .btn-link:focus { - color: #777; - text-decoration: none; -} -.btn-lg, -.btn-group-lg > .btn { - padding: 10px 16px; - font-size: 18px; - line-height: 1.3333333; - border-radius: 6px; -} -.btn-sm, -.btn-group-sm > .btn { - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -.btn-xs, -.btn-group-xs > .btn { - padding: 1px 5px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -.btn-block { - display: block; - width: 100%; -} -.btn-block + .btn-block { - margin-top: 5px; -} -input[type="submit"].btn-block, -input[type="reset"].btn-block, -input[type="button"].btn-block { - width: 100%; -} -.fade { - opacity: 0; - -webkit-transition: opacity .15s linear; - -o-transition: opacity .15s linear; - transition: opacity .15s linear; -} -.fade.in { - opacity: 1; -} -.collapse { - display: none; -} -.collapse.in { - display: block; -} -tr.collapse.in { - display: table-row; -} -tbody.collapse.in { - display: table-row-group; -} -.collapsing { - position: relative; - height: 0; - overflow: hidden; - -webkit-transition-timing-function: ease; - -o-transition-timing-function: ease; - transition-timing-function: ease; - -webkit-transition-duration: .35s; - -o-transition-duration: .35s; - transition-duration: .35s; - -webkit-transition-property: height, visibility; - -o-transition-property: height, visibility; - transition-property: height, visibility; -} -.caret { - display: inline-block; - width: 0; - height: 0; - margin-left: 2px; - vertical-align: middle; - border-top: 4px dashed; - border-top: 4px solid \9; - border-right: 4px solid transparent; - border-left: 4px solid transparent; -} -.dropup, -.dropdown { - position: relative; -} -.dropdown-toggle:focus { - outline: 0; -} -.dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 160px; - padding: 5px 0; - margin: 2px 0 0; - font-size: 14px; - text-align: left; - list-style: none; - background-color: #fff; - -webkit-background-clip: padding-box; - background-clip: padding-box; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, .15); - border-radius: 4px; - -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); - box-shadow: 0 6px 12px rgba(0, 0, 0, .175); -} -.dropdown-menu.pull-right { - right: 0; - left: auto; -} -.dropdown-menu .divider { - height: 1px; - margin: 9px 0; - overflow: hidden; - background-color: #e5e5e5; -} -.dropdown-menu > li > a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 1.42857143; - color: #333; - white-space: nowrap; -} -.dropdown-menu > li > a:hover, -.dropdown-menu > li > a:focus { - color: #262626; - text-decoration: none; - background-color: #f5f5f5; -} -.dropdown-menu > .active > a, -.dropdown-menu > .active > a:hover, -.dropdown-menu > .active > a:focus { - color: #fff; - text-decoration: none; - background-color: #337ab7; - outline: 0; -} -.dropdown-menu > .disabled > a, -.dropdown-menu > .disabled > a:hover, -.dropdown-menu > .disabled > a:focus { - color: #777; -} -.dropdown-menu > .disabled > a:hover, -.dropdown-menu > .disabled > a:focus { - text-decoration: none; - cursor: not-allowed; - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); -} -.open > .dropdown-menu { - display: block; -} -.open > a { - outline: 0; -} -.dropdown-menu-right { - right: 0; - left: auto; -} -.dropdown-menu-left { - right: auto; - left: 0; -} -.dropdown-header { - display: block; - padding: 3px 20px; - font-size: 12px; - line-height: 1.42857143; - color: #777; - white-space: nowrap; -} -.dropdown-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 990; -} -.pull-right > .dropdown-menu { - right: 0; - left: auto; -} -.dropup .caret, -.navbar-fixed-bottom .dropdown .caret { - content: ""; - border-top: 0; - border-bottom: 4px dashed; - border-bottom: 4px solid \9; -} -.dropup .dropdown-menu, -.navbar-fixed-bottom .dropdown .dropdown-menu { - top: auto; - bottom: 100%; - margin-bottom: 2px; -} -@media (min-width: 768px) { - .navbar-right .dropdown-menu { - right: 0; - left: auto; - } - .navbar-right .dropdown-menu-left { - right: auto; - left: 0; - } -} -.btn-group, -.btn-group-vertical { - position: relative; - display: inline-block; - vertical-align: middle; -} -.btn-group > .btn, -.btn-group-vertical > .btn { - position: relative; - float: left; -} -.btn-group > .btn:hover, -.btn-group-vertical > .btn:hover, -.btn-group > .btn:focus, -.btn-group-vertical > .btn:focus, -.btn-group > .btn:active, -.btn-group-vertical > .btn:active, -.btn-group > .btn.active, -.btn-group-vertical > .btn.active { - z-index: 2; -} -.btn-group .btn + .btn, -.btn-group .btn + .btn-group, -.btn-group .btn-group + .btn, -.btn-group .btn-group + .btn-group { - margin-left: -1px; -} -.btn-toolbar { - margin-left: -5px; -} -.btn-toolbar .btn, -.btn-toolbar .btn-group, -.btn-toolbar .input-group { - float: left; -} -.btn-toolbar > .btn, -.btn-toolbar > .btn-group, -.btn-toolbar > .input-group { - margin-left: 5px; -} -.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { - border-radius: 0; -} -.btn-group > .btn:first-child { - margin-left: 0; -} -.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.btn-group > .btn:last-child:not(:first-child), -.btn-group > .dropdown-toggle:not(:first-child) { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group > .btn-group { - float: left; -} -.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, -.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group .dropdown-toggle:active, -.btn-group.open .dropdown-toggle { - outline: 0; -} -.btn-group > .btn + .dropdown-toggle { - padding-right: 8px; - padding-left: 8px; -} -.btn-group > .btn-lg + .dropdown-toggle { - padding-right: 12px; - padding-left: 12px; -} -.btn-group.open .dropdown-toggle { - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); -} -.btn-group.open .dropdown-toggle.btn-link { - -webkit-box-shadow: none; - box-shadow: none; -} -.btn .caret { - margin-left: 0; -} -.btn-lg .caret { - border-width: 5px 5px 0; - border-bottom-width: 0; -} -.dropup .btn-lg .caret { - border-width: 0 5px 5px; -} -.btn-group-vertical > .btn, -.btn-group-vertical > .btn-group, -.btn-group-vertical > .btn-group > .btn { - display: block; - float: none; - width: 100%; - max-width: 100%; -} -.btn-group-vertical > .btn-group > .btn { - float: none; -} -.btn-group-vertical > .btn + .btn, -.btn-group-vertical > .btn + .btn-group, -.btn-group-vertical > .btn-group + .btn, -.btn-group-vertical > .btn-group + .btn-group { - margin-top: -1px; - margin-left: 0; -} -.btn-group-vertical > .btn:not(:first-child):not(:last-child) { - border-radius: 0; -} -.btn-group-vertical > .btn:first-child:not(:last-child) { - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group-vertical > .btn:last-child:not(:first-child) { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, -.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.btn-group-justified { - display: table; - width: 100%; - table-layout: fixed; - border-collapse: separate; -} -.btn-group-justified > .btn, -.btn-group-justified > .btn-group { - display: table-cell; - float: none; - width: 1%; -} -.btn-group-justified > .btn-group .btn { - width: 100%; -} -.btn-group-justified > .btn-group .dropdown-menu { - left: auto; -} -[data-toggle="buttons"] > .btn input[type="radio"], -[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], -[data-toggle="buttons"] > .btn input[type="checkbox"], -[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { - position: absolute; - clip: rect(0, 0, 0, 0); - pointer-events: none; -} -.input-group { - position: relative; - display: table; - border-collapse: separate; -} -.input-group[class*="col-"] { - float: none; - padding-right: 0; - padding-left: 0; -} -.input-group .form-control { - position: relative; - z-index: 2; - float: left; - width: 100%; - margin-bottom: 0; -} -.input-group .form-control:focus { - z-index: 3; -} -.input-group-lg > .form-control, -.input-group-lg > .input-group-addon, -.input-group-lg > .input-group-btn > .btn { - height: 46px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.3333333; - border-radius: 6px; -} -select.input-group-lg > .form-control, -select.input-group-lg > .input-group-addon, -select.input-group-lg > .input-group-btn > .btn { - height: 46px; - line-height: 46px; -} -textarea.input-group-lg > .form-control, -textarea.input-group-lg > .input-group-addon, -textarea.input-group-lg > .input-group-btn > .btn, -select[multiple].input-group-lg > .form-control, -select[multiple].input-group-lg > .input-group-addon, -select[multiple].input-group-lg > .input-group-btn > .btn { - height: auto; -} -.input-group-sm > .form-control, -.input-group-sm > .input-group-addon, -.input-group-sm > .input-group-btn > .btn { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -select.input-group-sm > .form-control, -select.input-group-sm > .input-group-addon, -select.input-group-sm > .input-group-btn > .btn { - height: 30px; - line-height: 30px; -} -textarea.input-group-sm > .form-control, -textarea.input-group-sm > .input-group-addon, -textarea.input-group-sm > .input-group-btn > .btn, -select[multiple].input-group-sm > .form-control, -select[multiple].input-group-sm > .input-group-addon, -select[multiple].input-group-sm > .input-group-btn > .btn { - height: auto; -} -.input-group-addon, -.input-group-btn, -.input-group .form-control { - display: table-cell; -} -.input-group-addon:not(:first-child):not(:last-child), -.input-group-btn:not(:first-child):not(:last-child), -.input-group .form-control:not(:first-child):not(:last-child) { - border-radius: 0; -} -.input-group-addon, -.input-group-btn { - width: 1%; - white-space: nowrap; - vertical-align: middle; -} -.input-group-addon { - padding: 6px 12px; - font-size: 14px; - font-weight: normal; - line-height: 1; - color: #555; - text-align: center; - background-color: #eee; - border: 1px solid #ccc; - border-radius: 4px; -} -.input-group-addon.input-sm { - padding: 5px 10px; - font-size: 12px; - border-radius: 3px; -} -.input-group-addon.input-lg { - padding: 10px 16px; - font-size: 18px; - border-radius: 6px; -} -.input-group-addon input[type="radio"], -.input-group-addon input[type="checkbox"] { - margin-top: 0; -} -.input-group .form-control:first-child, -.input-group-addon:first-child, -.input-group-btn:first-child > .btn, -.input-group-btn:first-child > .btn-group > .btn, -.input-group-btn:first-child > .dropdown-toggle, -.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), -.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.input-group-addon:first-child { - border-right: 0; -} -.input-group .form-control:last-child, -.input-group-addon:last-child, -.input-group-btn:last-child > .btn, -.input-group-btn:last-child > .btn-group > .btn, -.input-group-btn:last-child > .dropdown-toggle, -.input-group-btn:first-child > .btn:not(:first-child), -.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} -.input-group-addon:last-child { - border-left: 0; -} -.input-group-btn { - position: relative; - font-size: 0; - white-space: nowrap; -} -.input-group-btn > .btn { - position: relative; -} -.input-group-btn > .btn + .btn { - margin-left: -1px; -} -.input-group-btn > .btn:hover, -.input-group-btn > .btn:focus, -.input-group-btn > .btn:active { - z-index: 2; -} -.input-group-btn:first-child > .btn, -.input-group-btn:first-child > .btn-group { - margin-right: -1px; -} -.input-group-btn:last-child > .btn, -.input-group-btn:last-child > .btn-group { - z-index: 2; - margin-left: -1px; -} -.nav { - padding-left: 0; - margin-bottom: 0; - list-style: none; -} -.nav > li { - position: relative; - display: block; -} -.nav > li > a { - position: relative; - display: block; - padding: 10px 15px; -} -.nav > li > a:hover, -.nav > li > a:focus { - text-decoration: none; - background-color: #eee; -} -.nav > li.disabled > a { - color: #777; -} -.nav > li.disabled > a:hover, -.nav > li.disabled > a:focus { - color: #777; - text-decoration: none; - cursor: not-allowed; - background-color: transparent; -} -.nav .open > a, -.nav .open > a:hover, -.nav .open > a:focus { - background-color: #eee; - border-color: #337ab7; -} -.nav .nav-divider { - height: 1px; - margin: 9px 0; - overflow: hidden; - background-color: #e5e5e5; -} -.nav > li > a > img { - max-width: none; -} -.nav-tabs { - border-bottom: 1px solid #ddd; -} -.nav-tabs > li { - float: left; - margin-bottom: -1px; -} -.nav-tabs > li > a { - margin-right: 2px; - line-height: 1.42857143; - border: 1px solid transparent; - border-radius: 4px 4px 0 0; -} -.nav-tabs > li > a:hover { - border-color: #eee #eee #ddd; -} -.nav-tabs > li.active > a, -.nav-tabs > li.active > a:hover, -.nav-tabs > li.active > a:focus { - color: #555; - cursor: default; - background-color: #fff; - border: 1px solid #ddd; - border-bottom-color: transparent; -} -.nav-tabs.nav-justified { - width: 100%; - border-bottom: 0; -} -.nav-tabs.nav-justified > li { - float: none; -} -.nav-tabs.nav-justified > li > a { - margin-bottom: 5px; - text-align: center; -} -.nav-tabs.nav-justified > .dropdown .dropdown-menu { - top: auto; - left: auto; -} -@media (min-width: 768px) { - .nav-tabs.nav-justified > li { - display: table-cell; - width: 1%; - } - .nav-tabs.nav-justified > li > a { - margin-bottom: 0; - } -} -.nav-tabs.nav-justified > li > a { - margin-right: 0; - border-radius: 4px; -} -.nav-tabs.nav-justified > .active > a, -.nav-tabs.nav-justified > .active > a:hover, -.nav-tabs.nav-justified > .active > a:focus { - border: 1px solid #ddd; -} -@media (min-width: 768px) { - .nav-tabs.nav-justified > li > a { - border-bottom: 1px solid #ddd; - border-radius: 4px 4px 0 0; - } - .nav-tabs.nav-justified > .active > a, - .nav-tabs.nav-justified > .active > a:hover, - .nav-tabs.nav-justified > .active > a:focus { - border-bottom-color: #fff; - } -} -.nav-pills > li { - float: left; -} -.nav-pills > li > a { - border-radius: 4px; -} -.nav-pills > li + li { - margin-left: 2px; -} -.nav-pills > li.active > a, -.nav-pills > li.active > a:hover, -.nav-pills > li.active > a:focus { - color: #fff; - background-color: #337ab7; -} -.nav-stacked > li { - float: none; -} -.nav-stacked > li + li { - margin-top: 2px; - margin-left: 0; -} -.nav-justified { - width: 100%; -} -.nav-justified > li { - float: none; -} -.nav-justified > li > a { - margin-bottom: 5px; - text-align: center; -} -.nav-justified > .dropdown .dropdown-menu { - top: auto; - left: auto; -} -@media (min-width: 768px) { - .nav-justified > li { - display: table-cell; - width: 1%; - } - .nav-justified > li > a { - margin-bottom: 0; - } -} -.nav-tabs-justified { - border-bottom: 0; -} -.nav-tabs-justified > li > a { - margin-right: 0; - border-radius: 4px; -} -.nav-tabs-justified > .active > a, -.nav-tabs-justified > .active > a:hover, -.nav-tabs-justified > .active > a:focus { - border: 1px solid #ddd; -} -@media (min-width: 768px) { - .nav-tabs-justified > li > a { - border-bottom: 1px solid #ddd; - border-radius: 4px 4px 0 0; - } - .nav-tabs-justified > .active > a, - .nav-tabs-justified > .active > a:hover, - .nav-tabs-justified > .active > a:focus { - border-bottom-color: #fff; - } -} -.tab-content > .tab-pane { - display: none; -} -.tab-content > .active { - display: block; -} -.nav-tabs .dropdown-menu { - margin-top: -1px; - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.navbar { - position: relative; - min-height: 50px; - margin-bottom: 20px; - border: 1px solid transparent; -} -@media (min-width: 768px) { - .navbar { - border-radius: 4px; - } -} -@media (min-width: 768px) { - .navbar-header { - float: left; - } -} -.navbar-collapse { - padding-right: 15px; - padding-left: 15px; - overflow-x: visible; - -webkit-overflow-scrolling: touch; - border-top: 1px solid transparent; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); -} -.navbar-collapse.in { - overflow-y: auto; -} -@media (min-width: 768px) { - .navbar-collapse { - width: auto; - border-top: 0; - -webkit-box-shadow: none; - box-shadow: none; - } - .navbar-collapse.collapse { - display: block !important; - height: auto !important; - padding-bottom: 0; - overflow: visible !important; - } - .navbar-collapse.in { - overflow-y: visible; - } - .navbar-fixed-top .navbar-collapse, - .navbar-static-top .navbar-collapse, - .navbar-fixed-bottom .navbar-collapse { - padding-right: 0; - padding-left: 0; - } -} -.navbar-fixed-top .navbar-collapse, -.navbar-fixed-bottom .navbar-collapse { - max-height: 340px; -} -@media (max-device-width: 480px) and (orientation: landscape) { - .navbar-fixed-top .navbar-collapse, - .navbar-fixed-bottom .navbar-collapse { - max-height: 200px; - } -} -.container > .navbar-header, -.container-fluid > .navbar-header, -.container > .navbar-collapse, -.container-fluid > .navbar-collapse { - margin-right: -15px; - margin-left: -15px; -} -@media (min-width: 768px) { - .container > .navbar-header, - .container-fluid > .navbar-header, - .container > .navbar-collapse, - .container-fluid > .navbar-collapse { - margin-right: 0; - margin-left: 0; - } -} -.navbar-static-top { - z-index: 1000; - border-width: 0 0 1px; -} -@media (min-width: 768px) { - .navbar-static-top { - border-radius: 0; - } -} -.navbar-fixed-top, -.navbar-fixed-bottom { - position: fixed; - right: 0; - left: 0; - z-index: 1030; -} -@media (min-width: 768px) { - .navbar-fixed-top, - .navbar-fixed-bottom { - border-radius: 0; - } -} -.navbar-fixed-top { - top: 0; - border-width: 0 0 1px; -} -.navbar-fixed-bottom { - bottom: 0; - margin-bottom: 0; - border-width: 1px 0 0; -} -.navbar-brand { - float: left; - height: 50px; - padding: 15px 15px; - font-size: 18px; - line-height: 20px; -} -.navbar-brand:hover, -.navbar-brand:focus { - text-decoration: none; -} -.navbar-brand > img { - display: block; -} -@media (min-width: 768px) { - .navbar > .container .navbar-brand, - .navbar > .container-fluid .navbar-brand { - margin-left: -15px; - } -} -.navbar-toggle { - position: relative; - float: right; - padding: 9px 10px; - margin-top: 8px; - margin-right: 15px; - margin-bottom: 8px; - background-color: transparent; - background-image: none; - border: 1px solid transparent; - border-radius: 4px; -} -.navbar-toggle:focus { - outline: 0; -} -.navbar-toggle .icon-bar { - display: block; - width: 22px; - height: 2px; - border-radius: 1px; -} -.navbar-toggle .icon-bar + .icon-bar { - margin-top: 4px; -} -@media (min-width: 768px) { - .navbar-toggle { - display: none; - } -} -.navbar-nav { - margin: 7.5px -15px; -} -.navbar-nav > li > a { - padding-top: 10px; - padding-bottom: 10px; - line-height: 20px; -} -@media (max-width: 767px) { - .navbar-nav .open .dropdown-menu { - position: static; - float: none; - width: auto; - margin-top: 0; - background-color: transparent; - border: 0; - -webkit-box-shadow: none; - box-shadow: none; - } - .navbar-nav .open .dropdown-menu > li > a, - .navbar-nav .open .dropdown-menu .dropdown-header { - padding: 5px 15px 5px 25px; - } - .navbar-nav .open .dropdown-menu > li > a { - line-height: 20px; - } - .navbar-nav .open .dropdown-menu > li > a:hover, - .navbar-nav .open .dropdown-menu > li > a:focus { - background-image: none; - } -} -@media (min-width: 768px) { - .navbar-nav { - float: left; - margin: 0; - } - .navbar-nav > li { - float: left; - } - .navbar-nav > li > a { - padding-top: 15px; - padding-bottom: 15px; - } -} -.navbar-form { - padding: 10px 15px; - margin-top: 8px; - margin-right: -15px; - margin-bottom: 8px; - margin-left: -15px; - border-top: 1px solid transparent; - border-bottom: 1px solid transparent; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); -} -@media (min-width: 768px) { - .navbar-form .form-group { - display: inline-block; - margin-bottom: 0; - vertical-align: middle; - } - .navbar-form .form-control { - display: inline-block; - width: auto; - vertical-align: middle; - } - .navbar-form .form-control-static { - display: inline-block; - } - .navbar-form .input-group { - display: inline-table; - vertical-align: middle; - } - .navbar-form .input-group .input-group-addon, - .navbar-form .input-group .input-group-btn, - .navbar-form .input-group .form-control { - width: auto; - } - .navbar-form .input-group > .form-control { - width: 100%; - } - .navbar-form .control-label { - margin-bottom: 0; - vertical-align: middle; - } - .navbar-form .radio, - .navbar-form .checkbox { - display: inline-block; - margin-top: 0; - margin-bottom: 0; - vertical-align: middle; - } - .navbar-form .radio label, - .navbar-form .checkbox label { - padding-left: 0; - } - .navbar-form .radio input[type="radio"], - .navbar-form .checkbox input[type="checkbox"] { - position: relative; - margin-left: 0; - } - .navbar-form .has-feedback .form-control-feedback { - top: 0; - } -} -@media (max-width: 767px) { - .navbar-form .form-group { - margin-bottom: 5px; - } - .navbar-form .form-group:last-child { - margin-bottom: 0; - } -} -@media (min-width: 768px) { - .navbar-form { - width: auto; - padding-top: 0; - padding-bottom: 0; - margin-right: 0; - margin-left: 0; - border: 0; - -webkit-box-shadow: none; - box-shadow: none; - } -} -.navbar-nav > li > .dropdown-menu { - margin-top: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { - margin-bottom: 0; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.navbar-btn { - margin-top: 8px; - margin-bottom: 8px; -} -.navbar-btn.btn-sm { - margin-top: 10px; - margin-bottom: 10px; -} -.navbar-btn.btn-xs { - margin-top: 14px; - margin-bottom: 14px; -} -.navbar-text { - margin-top: 15px; - margin-bottom: 15px; -} -@media (min-width: 768px) { - .navbar-text { - float: left; - margin-right: 15px; - margin-left: 15px; - } -} -@media (min-width: 768px) { - .navbar-left { - float: left !important; - } - .navbar-right { - float: right !important; - margin-right: -15px; - } - .navbar-right ~ .navbar-right { - margin-right: 0; - } -} -.navbar-default { - background-color: #f8f8f8; - border-color: #e7e7e7; -} -.navbar-default .navbar-brand { - color: #777; -} -.navbar-default .navbar-brand:hover, -.navbar-default .navbar-brand:focus { - color: #5e5e5e; - background-color: transparent; -} -.navbar-default .navbar-text { - color: #777; -} -.navbar-default .navbar-nav > li > a { - color: #777; -} -.navbar-default .navbar-nav > li > a:hover, -.navbar-default .navbar-nav > li > a:focus { - color: #333; - background-color: transparent; -} -.navbar-default .navbar-nav > .active > a, -.navbar-default .navbar-nav > .active > a:hover, -.navbar-default .navbar-nav > .active > a:focus { - color: #555; - background-color: #e7e7e7; -} -.navbar-default .navbar-nav > .disabled > a, -.navbar-default .navbar-nav > .disabled > a:hover, -.navbar-default .navbar-nav > .disabled > a:focus { - color: #ccc; - background-color: transparent; -} -.navbar-default .navbar-toggle { - border-color: #ddd; -} -.navbar-default .navbar-toggle:hover, -.navbar-default .navbar-toggle:focus { - background-color: #ddd; -} -.navbar-default .navbar-toggle .icon-bar { - background-color: #888; -} -.navbar-default .navbar-collapse, -.navbar-default .navbar-form { - border-color: #e7e7e7; -} -.navbar-default .navbar-nav > .open > a, -.navbar-default .navbar-nav > .open > a:hover, -.navbar-default .navbar-nav > .open > a:focus { - color: #555; - background-color: #e7e7e7; -} -@media (max-width: 767px) { - .navbar-default .navbar-nav .open .dropdown-menu > li > a { - color: #777; - } - .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, - .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { - color: #333; - background-color: transparent; - } - .navbar-default .navbar-nav .open .dropdown-menu > .active > a, - .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, - .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { - color: #555; - background-color: #e7e7e7; - } - .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, - .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, - .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { - color: #ccc; - background-color: transparent; - } -} -.navbar-default .navbar-link { - color: #777; -} -.navbar-default .navbar-link:hover { - color: #333; -} -.navbar-default .btn-link { - color: #777; -} -.navbar-default .btn-link:hover, -.navbar-default .btn-link:focus { - color: #333; -} -.navbar-default .btn-link[disabled]:hover, -fieldset[disabled] .navbar-default .btn-link:hover, -.navbar-default .btn-link[disabled]:focus, -fieldset[disabled] .navbar-default .btn-link:focus { - color: #ccc; -} -.navbar-inverse { - background-color: #222; - border-color: #080808; -} -.navbar-inverse .navbar-brand { - color: #9d9d9d; -} -.navbar-inverse .navbar-brand:hover, -.navbar-inverse .navbar-brand:focus { - color: #fff; - background-color: transparent; -} -.navbar-inverse .navbar-text { - color: #9d9d9d; -} -.navbar-inverse .navbar-nav > li > a { - color: #9d9d9d; -} -.navbar-inverse .navbar-nav > li > a:hover, -.navbar-inverse .navbar-nav > li > a:focus { - color: #fff; - background-color: transparent; -} -.navbar-inverse .navbar-nav > .active > a, -.navbar-inverse .navbar-nav > .active > a:hover, -.navbar-inverse .navbar-nav > .active > a:focus { - color: #fff; - background-color: #080808; -} -.navbar-inverse .navbar-nav > .disabled > a, -.navbar-inverse .navbar-nav > .disabled > a:hover, -.navbar-inverse .navbar-nav > .disabled > a:focus { - color: #444; - background-color: transparent; -} -.navbar-inverse .navbar-toggle { - border-color: #333; -} -.navbar-inverse .navbar-toggle:hover, -.navbar-inverse .navbar-toggle:focus { - background-color: #333; -} -.navbar-inverse .navbar-toggle .icon-bar { - background-color: #fff; -} -.navbar-inverse .navbar-collapse, -.navbar-inverse .navbar-form { - border-color: #101010; -} -.navbar-inverse .navbar-nav > .open > a, -.navbar-inverse .navbar-nav > .open > a:hover, -.navbar-inverse .navbar-nav > .open > a:focus { - color: #fff; - background-color: #080808; -} -@media (max-width: 767px) { - .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { - border-color: #080808; - } - .navbar-inverse .navbar-nav .open .dropdown-menu .divider { - background-color: #080808; - } - .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { - color: #9d9d9d; - } - .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, - .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { - color: #fff; - background-color: transparent; - } - .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, - .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, - .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { - color: #fff; - background-color: #080808; - } - .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, - .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, - .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { - color: #444; - background-color: transparent; - } -} -.navbar-inverse .navbar-link { - color: #9d9d9d; -} -.navbar-inverse .navbar-link:hover { - color: #fff; -} -.navbar-inverse .btn-link { - color: #9d9d9d; -} -.navbar-inverse .btn-link:hover, -.navbar-inverse .btn-link:focus { - color: #fff; -} -.navbar-inverse .btn-link[disabled]:hover, -fieldset[disabled] .navbar-inverse .btn-link:hover, -.navbar-inverse .btn-link[disabled]:focus, -fieldset[disabled] .navbar-inverse .btn-link:focus { - color: #444; -} -.breadcrumb { - padding: 8px 15px; - margin-bottom: 20px; - list-style: none; - background-color: #f5f5f5; - border-radius: 4px; -} -.breadcrumb > li { - display: inline-block; -} -.breadcrumb > li + li:before { - padding: 0 5px; - color: #ccc; - content: "/\00a0"; -} -.breadcrumb > .active { - color: #777; -} -.pagination { - display: inline-block; - padding-left: 0; - margin: 20px 0; - border-radius: 4px; -} -.pagination > li { - display: inline; -} -.pagination > li > a, -.pagination > li > span { - position: relative; - float: left; - padding: 6px 12px; - margin-left: -1px; - line-height: 1.42857143; - color: #337ab7; - text-decoration: none; - background-color: #fff; - border: 1px solid #ddd; -} -.pagination > li:first-child > a, -.pagination > li:first-child > span { - margin-left: 0; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} -.pagination > li:last-child > a, -.pagination > li:last-child > span { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} -.pagination > li > a:hover, -.pagination > li > span:hover, -.pagination > li > a:focus, -.pagination > li > span:focus { - z-index: 2; - color: #23527c; - background-color: #eee; - border-color: #ddd; -} -.pagination > .active > a, -.pagination > .active > span, -.pagination > .active > a:hover, -.pagination > .active > span:hover, -.pagination > .active > a:focus, -.pagination > .active > span:focus { - z-index: 3; - color: #fff; - cursor: default; - background-color: #337ab7; - border-color: #337ab7; -} -.pagination > .disabled > span, -.pagination > .disabled > span:hover, -.pagination > .disabled > span:focus, -.pagination > .disabled > a, -.pagination > .disabled > a:hover, -.pagination > .disabled > a:focus { - color: #777; - cursor: not-allowed; - background-color: #fff; - border-color: #ddd; -} -.pagination-lg > li > a, -.pagination-lg > li > span { - padding: 10px 16px; - font-size: 18px; - line-height: 1.3333333; -} -.pagination-lg > li:first-child > a, -.pagination-lg > li:first-child > span { - border-top-left-radius: 6px; - border-bottom-left-radius: 6px; -} -.pagination-lg > li:last-child > a, -.pagination-lg > li:last-child > span { - border-top-right-radius: 6px; - border-bottom-right-radius: 6px; -} -.pagination-sm > li > a, -.pagination-sm > li > span { - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; -} -.pagination-sm > li:first-child > a, -.pagination-sm > li:first-child > span { - border-top-left-radius: 3px; - border-bottom-left-radius: 3px; -} -.pagination-sm > li:last-child > a, -.pagination-sm > li:last-child > span { - border-top-right-radius: 3px; - border-bottom-right-radius: 3px; -} -.pager { - padding-left: 0; - margin: 20px 0; - text-align: center; - list-style: none; -} -.pager li { - display: inline; -} -.pager li > a, -.pager li > span { - display: inline-block; - padding: 5px 14px; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 15px; -} -.pager li > a:hover, -.pager li > a:focus { - text-decoration: none; - background-color: #eee; -} -.pager .next > a, -.pager .next > span { - float: right; -} -.pager .previous > a, -.pager .previous > span { - float: left; -} -.pager .disabled > a, -.pager .disabled > a:hover, -.pager .disabled > a:focus, -.pager .disabled > span { - color: #777; - cursor: not-allowed; - background-color: #fff; -} -.label { - display: inline; - padding: .2em .6em .3em; - font-size: 75%; - font-weight: bold; - line-height: 1; - color: #fff; - text-align: center; - white-space: nowrap; - vertical-align: baseline; - border-radius: .25em; -} -a.label:hover, -a.label:focus { - color: #fff; - text-decoration: none; - cursor: pointer; -} -.label:empty { - display: none; -} -.btn .label { - position: relative; - top: -1px; -} -.label-default { - background-color: #777; -} -.label-default[href]:hover, -.label-default[href]:focus { - background-color: #5e5e5e; -} -.label-primary { - background-color: #337ab7; -} -.label-primary[href]:hover, -.label-primary[href]:focus { - background-color: #286090; -} -.label-success { - background-color: #5cb85c; -} -.label-success[href]:hover, -.label-success[href]:focus { - background-color: #449d44; -} -.label-info { - background-color: #5bc0de; -} -.label-info[href]:hover, -.label-info[href]:focus { - background-color: #31b0d5; -} -.label-warning { - background-color: #f0ad4e; -} -.label-warning[href]:hover, -.label-warning[href]:focus { - background-color: #ec971f; -} -.label-danger { - background-color: #d9534f; -} -.label-danger[href]:hover, -.label-danger[href]:focus { - background-color: #c9302c; -} -.badge { - display: inline-block; - min-width: 10px; - padding: 3px 7px; - font-size: 12px; - font-weight: bold; - line-height: 1; - color: #fff; - text-align: center; - white-space: nowrap; - vertical-align: middle; - background-color: #777; - border-radius: 10px; -} -.badge:empty { - display: none; -} -.btn .badge { - position: relative; - top: -1px; -} -.btn-xs .badge, -.btn-group-xs > .btn .badge { - top: 0; - padding: 1px 5px; -} -a.badge:hover, -a.badge:focus { - color: #fff; - text-decoration: none; - cursor: pointer; -} -.list-group-item.active > .badge, -.nav-pills > .active > a > .badge { - color: #337ab7; - background-color: #fff; -} -.list-group-item > .badge { - float: right; -} -.list-group-item > .badge + .badge { - margin-right: 5px; -} -.nav-pills > li > a > .badge { - margin-left: 3px; -} -.jumbotron { - padding-top: 30px; - padding-bottom: 30px; - margin-bottom: 30px; - color: inherit; - background-color: #eee; -} -.jumbotron h1, -.jumbotron .h1 { - color: inherit; -} -.jumbotron p { - margin-bottom: 15px; - font-size: 21px; - font-weight: 200; -} -.jumbotron > hr { - border-top-color: #d5d5d5; -} -.container .jumbotron, -.container-fluid .jumbotron { - padding-right: 15px; - padding-left: 15px; - border-radius: 6px; -} -.jumbotron .container { - max-width: 100%; -} -@media screen and (min-width: 768px) { - .jumbotron { - padding-top: 48px; - padding-bottom: 48px; - } - .container .jumbotron, - .container-fluid .jumbotron { - padding-right: 60px; - padding-left: 60px; - } - .jumbotron h1, - .jumbotron .h1 { - font-size: 63px; - } -} -.thumbnail { - display: block; - padding: 4px; - margin-bottom: 20px; - line-height: 1.42857143; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 4px; - -webkit-transition: border .2s ease-in-out; - -o-transition: border .2s ease-in-out; - transition: border .2s ease-in-out; -} -.thumbnail > img, -.thumbnail a > img { - margin-right: auto; - margin-left: auto; -} -a.thumbnail:hover, -a.thumbnail:focus, -a.thumbnail.active { - border-color: #337ab7; -} -.thumbnail .caption { - padding: 9px; - color: #333; -} -.alert { - padding: 15px; - margin-bottom: 20px; - border: 1px solid transparent; - border-radius: 4px; -} -.alert h4 { - margin-top: 0; - color: inherit; -} -.alert .alert-link { - font-weight: bold; -} -.alert > p, -.alert > ul { - margin-bottom: 0; -} -.alert > p + p { - margin-top: 5px; -} -.alert-dismissable, -.alert-dismissible { - padding-right: 35px; -} -.alert-dismissable .close, -.alert-dismissible .close { - position: relative; - top: -2px; - right: -21px; - color: inherit; -} -.alert-success { - color: #3c763d; - background-color: #dff0d8; - border-color: #d6e9c6; -} -.alert-success hr { - border-top-color: #c9e2b3; -} -.alert-success .alert-link { - color: #2b542c; -} -.alert-info { - color: #31708f; - background-color: #d9edf7; - border-color: #bce8f1; -} -.alert-info hr { - border-top-color: #a6e1ec; -} -.alert-info .alert-link { - color: #245269; -} -.alert-warning { - color: #8a6d3b; - background-color: #fcf8e3; - border-color: #faebcc; -} -.alert-warning hr { - border-top-color: #f7e1b5; -} -.alert-warning .alert-link { - color: #66512c; -} -.alert-danger { - color: #a94442; - background-color: #f2dede; - border-color: #ebccd1; -} -.alert-danger hr { - border-top-color: #e4b9c0; -} -.alert-danger .alert-link { - color: #843534; -} -@-webkit-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} -@-o-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} -@keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} -.progress { - height: 20px; - margin-bottom: 20px; - overflow: hidden; - background-color: #f5f5f5; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); -} -.progress-bar { - float: left; - width: 0; - height: 100%; - font-size: 12px; - line-height: 20px; - color: #fff; - text-align: center; - background-color: #337ab7; - -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); - box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); - -webkit-transition: width .6s ease; - -o-transition: width .6s ease; - transition: width .6s ease; -} -.progress-striped .progress-bar, -.progress-bar-striped { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - -webkit-background-size: 40px 40px; - background-size: 40px 40px; -} -.progress.active .progress-bar, -.progress-bar.active { - -webkit-animation: progress-bar-stripes 2s linear infinite; - -o-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; -} -.progress-bar-success { - background-color: #5cb85c; -} -.progress-striped .progress-bar-success { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -} -.progress-bar-info { - background-color: #5bc0de; -} -.progress-striped .progress-bar-info { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -} -.progress-bar-warning { - background-color: #f0ad4e; -} -.progress-striped .progress-bar-warning { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -} -.progress-bar-danger { - background-color: #d9534f; -} -.progress-striped .progress-bar-danger { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -} -.media { - margin-top: 15px; -} -.media:first-child { - margin-top: 0; -} -.media, -.media-body { - overflow: hidden; - zoom: 1; -} -.media-body { - width: 10000px; -} -.media-object { - display: block; -} -.media-object.img-thumbnail { - max-width: none; -} -.media-right, -.media > .pull-right { - padding-left: 10px; -} -.media-left, -.media > .pull-left { - padding-right: 10px; -} -.media-left, -.media-right, -.media-body { - display: table-cell; - vertical-align: top; -} -.media-middle { - vertical-align: middle; -} -.media-bottom { - vertical-align: bottom; -} -.media-heading { - margin-top: 0; - margin-bottom: 5px; -} -.media-list { - padding-left: 0; - list-style: none; -} -.list-group { - padding-left: 0; - margin-bottom: 20px; -} -.list-group-item { - position: relative; - display: block; - padding: 10px 15px; - margin-bottom: -1px; - background-color: #fff; - border: 1px solid #ddd; -} -.list-group-item:first-child { - border-top-left-radius: 4px; - border-top-right-radius: 4px; -} -.list-group-item:last-child { - margin-bottom: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -a.list-group-item, -button.list-group-item { - color: #555; -} -a.list-group-item .list-group-item-heading, -button.list-group-item .list-group-item-heading { - color: #333; -} -a.list-group-item:hover, -button.list-group-item:hover, -a.list-group-item:focus, -button.list-group-item:focus { - color: #555; - text-decoration: none; - background-color: #f5f5f5; -} -button.list-group-item { - width: 100%; - text-align: left; -} -.list-group-item.disabled, -.list-group-item.disabled:hover, -.list-group-item.disabled:focus { - color: #777; - cursor: not-allowed; - background-color: #eee; -} -.list-group-item.disabled .list-group-item-heading, -.list-group-item.disabled:hover .list-group-item-heading, -.list-group-item.disabled:focus .list-group-item-heading { - color: inherit; -} -.list-group-item.disabled .list-group-item-text, -.list-group-item.disabled:hover .list-group-item-text, -.list-group-item.disabled:focus .list-group-item-text { - color: #777; -} -.list-group-item.active, -.list-group-item.active:hover, -.list-group-item.active:focus { - z-index: 2; - color: #fff; - background-color: #337ab7; - border-color: #337ab7; -} -.list-group-item.active .list-group-item-heading, -.list-group-item.active:hover .list-group-item-heading, -.list-group-item.active:focus .list-group-item-heading, -.list-group-item.active .list-group-item-heading > small, -.list-group-item.active:hover .list-group-item-heading > small, -.list-group-item.active:focus .list-group-item-heading > small, -.list-group-item.active .list-group-item-heading > .small, -.list-group-item.active:hover .list-group-item-heading > .small, -.list-group-item.active:focus .list-group-item-heading > .small { - color: inherit; -} -.list-group-item.active .list-group-item-text, -.list-group-item.active:hover .list-group-item-text, -.list-group-item.active:focus .list-group-item-text { - color: #c7ddef; -} -.list-group-item-success { - color: #3c763d; - background-color: #dff0d8; -} -a.list-group-item-success, -button.list-group-item-success { - color: #3c763d; -} -a.list-group-item-success .list-group-item-heading, -button.list-group-item-success .list-group-item-heading { - color: inherit; -} -a.list-group-item-success:hover, -button.list-group-item-success:hover, -a.list-group-item-success:focus, -button.list-group-item-success:focus { - color: #3c763d; - background-color: #d0e9c6; -} -a.list-group-item-success.active, -button.list-group-item-success.active, -a.list-group-item-success.active:hover, -button.list-group-item-success.active:hover, -a.list-group-item-success.active:focus, -button.list-group-item-success.active:focus { - color: #fff; - background-color: #3c763d; - border-color: #3c763d; -} -.list-group-item-info { - color: #31708f; - background-color: #d9edf7; -} -a.list-group-item-info, -button.list-group-item-info { - color: #31708f; -} -a.list-group-item-info .list-group-item-heading, -button.list-group-item-info .list-group-item-heading { - color: inherit; -} -a.list-group-item-info:hover, -button.list-group-item-info:hover, -a.list-group-item-info:focus, -button.list-group-item-info:focus { - color: #31708f; - background-color: #c4e3f3; -} -a.list-group-item-info.active, -button.list-group-item-info.active, -a.list-group-item-info.active:hover, -button.list-group-item-info.active:hover, -a.list-group-item-info.active:focus, -button.list-group-item-info.active:focus { - color: #fff; - background-color: #31708f; - border-color: #31708f; -} -.list-group-item-warning { - color: #8a6d3b; - background-color: #fcf8e3; -} -a.list-group-item-warning, -button.list-group-item-warning { - color: #8a6d3b; -} -a.list-group-item-warning .list-group-item-heading, -button.list-group-item-warning .list-group-item-heading { - color: inherit; -} -a.list-group-item-warning:hover, -button.list-group-item-warning:hover, -a.list-group-item-warning:focus, -button.list-group-item-warning:focus { - color: #8a6d3b; - background-color: #faf2cc; -} -a.list-group-item-warning.active, -button.list-group-item-warning.active, -a.list-group-item-warning.active:hover, -button.list-group-item-warning.active:hover, -a.list-group-item-warning.active:focus, -button.list-group-item-warning.active:focus { - color: #fff; - background-color: #8a6d3b; - border-color: #8a6d3b; -} -.list-group-item-danger { - color: #a94442; - background-color: #f2dede; -} -a.list-group-item-danger, -button.list-group-item-danger { - color: #a94442; -} -a.list-group-item-danger .list-group-item-heading, -button.list-group-item-danger .list-group-item-heading { - color: inherit; -} -a.list-group-item-danger:hover, -button.list-group-item-danger:hover, -a.list-group-item-danger:focus, -button.list-group-item-danger:focus { - color: #a94442; - background-color: #ebcccc; -} -a.list-group-item-danger.active, -button.list-group-item-danger.active, -a.list-group-item-danger.active:hover, -button.list-group-item-danger.active:hover, -a.list-group-item-danger.active:focus, -button.list-group-item-danger.active:focus { - color: #fff; - background-color: #a94442; - border-color: #a94442; -} -.list-group-item-heading { - margin-top: 0; - margin-bottom: 5px; -} -.list-group-item-text { - margin-bottom: 0; - line-height: 1.3; -} -.panel { - margin-bottom: 20px; - background-color: #fff; - border: 1px solid transparent; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); - box-shadow: 0 1px 1px rgba(0, 0, 0, .05); -} -.panel-body { - padding: 15px; -} -.panel-heading { - padding: 10px 15px; - border-bottom: 1px solid transparent; - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} -.panel-heading > .dropdown .dropdown-toggle { - color: inherit; -} -.panel-title { - margin-top: 0; - margin-bottom: 0; - font-size: 16px; - color: inherit; -} -.panel-title > a, -.panel-title > small, -.panel-title > .small, -.panel-title > small > a, -.panel-title > .small > a { - color: inherit; -} -.panel-footer { - padding: 10px 15px; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; -} -.panel > .list-group, -.panel > .panel-collapse > .list-group { - margin-bottom: 0; -} -.panel > .list-group .list-group-item, -.panel > .panel-collapse > .list-group .list-group-item { - border-width: 1px 0; - border-radius: 0; -} -.panel > .list-group:first-child .list-group-item:first-child, -.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { - border-top: 0; - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} -.panel > .list-group:last-child .list-group-item:last-child, -.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { - border-bottom: 0; - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; -} -.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.panel-heading + .list-group .list-group-item:first-child { - border-top-width: 0; -} -.list-group + .panel-footer { - border-top-width: 0; -} -.panel > .table, -.panel > .table-responsive > .table, -.panel > .panel-collapse > .table { - margin-bottom: 0; -} -.panel > .table caption, -.panel > .table-responsive > .table caption, -.panel > .panel-collapse > .table caption { - padding-right: 15px; - padding-left: 15px; -} -.panel > .table:first-child, -.panel > .table-responsive:first-child > .table:first-child { - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} -.panel > .table:first-child > thead:first-child > tr:first-child, -.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, -.panel > .table:first-child > tbody:first-child > tr:first-child, -.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} -.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, -.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, -.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, -.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, -.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, -.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, -.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, -.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { - border-top-left-radius: 3px; -} -.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, -.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, -.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, -.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, -.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, -.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, -.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, -.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { - border-top-right-radius: 3px; -} -.panel > .table:last-child, -.panel > .table-responsive:last-child > .table:last-child { - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; -} -.panel > .table:last-child > tbody:last-child > tr:last-child, -.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, -.panel > .table:last-child > tfoot:last-child > tr:last-child, -.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; -} -.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, -.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, -.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, -.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, -.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, -.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, -.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, -.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { - border-bottom-left-radius: 3px; -} -.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, -.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, -.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, -.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, -.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, -.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, -.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, -.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { - border-bottom-right-radius: 3px; -} -.panel > .panel-body + .table, -.panel > .panel-body + .table-responsive, -.panel > .table + .panel-body, -.panel > .table-responsive + .panel-body { - border-top: 1px solid #ddd; -} -.panel > .table > tbody:first-child > tr:first-child th, -.panel > .table > tbody:first-child > tr:first-child td { - border-top: 0; -} -.panel > .table-bordered, -.panel > .table-responsive > .table-bordered { - border: 0; -} -.panel > .table-bordered > thead > tr > th:first-child, -.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, -.panel > .table-bordered > tbody > tr > th:first-child, -.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, -.panel > .table-bordered > tfoot > tr > th:first-child, -.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, -.panel > .table-bordered > thead > tr > td:first-child, -.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, -.panel > .table-bordered > tbody > tr > td:first-child, -.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, -.panel > .table-bordered > tfoot > tr > td:first-child, -.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { - border-left: 0; -} -.panel > .table-bordered > thead > tr > th:last-child, -.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, -.panel > .table-bordered > tbody > tr > th:last-child, -.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, -.panel > .table-bordered > tfoot > tr > th:last-child, -.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, -.panel > .table-bordered > thead > tr > td:last-child, -.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, -.panel > .table-bordered > tbody > tr > td:last-child, -.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, -.panel > .table-bordered > tfoot > tr > td:last-child, -.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { - border-right: 0; -} -.panel > .table-bordered > thead > tr:first-child > td, -.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, -.panel > .table-bordered > tbody > tr:first-child > td, -.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, -.panel > .table-bordered > thead > tr:first-child > th, -.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, -.panel > .table-bordered > tbody > tr:first-child > th, -.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { - border-bottom: 0; -} -.panel > .table-bordered > tbody > tr:last-child > td, -.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, -.panel > .table-bordered > tfoot > tr:last-child > td, -.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, -.panel > .table-bordered > tbody > tr:last-child > th, -.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, -.panel > .table-bordered > tfoot > tr:last-child > th, -.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { - border-bottom: 0; -} -.panel > .table-responsive { - margin-bottom: 0; - border: 0; -} -.panel-group { - margin-bottom: 20px; -} -.panel-group .panel { - margin-bottom: 0; - border-radius: 4px; -} -.panel-group .panel + .panel { - margin-top: 5px; -} -.panel-group .panel-heading { - border-bottom: 0; -} -.panel-group .panel-heading + .panel-collapse > .panel-body, -.panel-group .panel-heading + .panel-collapse > .list-group { - border-top: 1px solid #ddd; -} -.panel-group .panel-footer { - border-top: 0; -} -.panel-group .panel-footer + .panel-collapse .panel-body { - border-bottom: 1px solid #ddd; -} -.panel-default { - border-color: #ddd; -} -.panel-default > .panel-heading { - color: #333; - background-color: #f5f5f5; - border-color: #ddd; -} -.panel-default > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #ddd; -} -.panel-default > .panel-heading .badge { - color: #f5f5f5; - background-color: #333; -} -.panel-default > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #ddd; -} -.panel-primary { - border-color: #337ab7; -} -.panel-primary > .panel-heading { - color: #fff; - background-color: #337ab7; - border-color: #337ab7; -} -.panel-primary > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #337ab7; -} -.panel-primary > .panel-heading .badge { - color: #337ab7; - background-color: #fff; -} -.panel-primary > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #337ab7; -} -.panel-success { - border-color: #d6e9c6; -} -.panel-success > .panel-heading { - color: #3c763d; - background-color: #dff0d8; - border-color: #d6e9c6; -} -.panel-success > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #d6e9c6; -} -.panel-success > .panel-heading .badge { - color: #dff0d8; - background-color: #3c763d; -} -.panel-success > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #d6e9c6; -} -.panel-info { - border-color: #bce8f1; -} -.panel-info > .panel-heading { - color: #31708f; - background-color: #d9edf7; - border-color: #bce8f1; -} -.panel-info > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #bce8f1; -} -.panel-info > .panel-heading .badge { - color: #d9edf7; - background-color: #31708f; -} -.panel-info > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #bce8f1; -} -.panel-warning { - border-color: #faebcc; -} -.panel-warning > .panel-heading { - color: #8a6d3b; - background-color: #fcf8e3; - border-color: #faebcc; -} -.panel-warning > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #faebcc; -} -.panel-warning > .panel-heading .badge { - color: #fcf8e3; - background-color: #8a6d3b; -} -.panel-warning > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #faebcc; -} -.panel-danger { - border-color: #ebccd1; -} -.panel-danger > .panel-heading { - color: #a94442; - background-color: #f2dede; - border-color: #ebccd1; -} -.panel-danger > .panel-heading + .panel-collapse > .panel-body { - border-top-color: #ebccd1; -} -.panel-danger > .panel-heading .badge { - color: #f2dede; - background-color: #a94442; -} -.panel-danger > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #ebccd1; -} -.embed-responsive { - position: relative; - display: block; - height: 0; - padding: 0; - overflow: hidden; -} -.embed-responsive .embed-responsive-item, -.embed-responsive iframe, -.embed-responsive embed, -.embed-responsive object, -.embed-responsive video { - position: absolute; - top: 0; - bottom: 0; - left: 0; - width: 100%; - height: 100%; - border: 0; -} -.embed-responsive-16by9 { - padding-bottom: 56.25%; -} -.embed-responsive-4by3 { - padding-bottom: 75%; -} -.well { - min-height: 20px; - padding: 19px; - margin-bottom: 20px; - background-color: #f5f5f5; - border: 1px solid #e3e3e3; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); -} -.well blockquote { - border-color: #ddd; - border-color: rgba(0, 0, 0, .15); -} -.well-lg { - padding: 24px; - border-radius: 6px; -} -.well-sm { - padding: 9px; - border-radius: 3px; -} -.close { - float: right; - font-size: 21px; - font-weight: bold; - line-height: 1; - color: #000; - text-shadow: 0 1px 0 #fff; - filter: alpha(opacity=20); - opacity: .2; -} -.close:hover, -.close:focus { - color: #000; - text-decoration: none; - cursor: pointer; - filter: alpha(opacity=50); - opacity: .5; -} -button.close { - -webkit-appearance: none; - padding: 0; - cursor: pointer; - background: transparent; - border: 0; -} -.modal-open { - overflow: hidden; -} -.modal { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1050; - display: none; - overflow: hidden; - -webkit-overflow-scrolling: touch; - outline: 0; -} -.modal.fade .modal-dialog { - -webkit-transition: -webkit-transform .3s ease-out; - -o-transition: -o-transform .3s ease-out; - transition: transform .3s ease-out; - -webkit-transform: translate(0, -25%); - -ms-transform: translate(0, -25%); - -o-transform: translate(0, -25%); - transform: translate(0, -25%); -} -.modal.in .modal-dialog { - -webkit-transform: translate(0, 0); - -ms-transform: translate(0, 0); - -o-transform: translate(0, 0); - transform: translate(0, 0); -} -.modal-open .modal { - overflow-x: hidden; - overflow-y: auto; -} -.modal-dialog { - position: relative; - width: auto; - margin: 10px; -} -.modal-content { - position: relative; - background-color: #fff; - -webkit-background-clip: padding-box; - background-clip: padding-box; - border: 1px solid #999; - border: 1px solid rgba(0, 0, 0, .2); - border-radius: 6px; - outline: 0; - -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); - box-shadow: 0 3px 9px rgba(0, 0, 0, .5); -} -.modal-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1040; - background-color: #000; -} -.modal-backdrop.fade { - filter: alpha(opacity=0); - opacity: 0; -} -.modal-backdrop.in { - filter: alpha(opacity=50); - opacity: .5; -} -.modal-header { - padding: 15px; - border-bottom: 1px solid #e5e5e5; -} -.modal-header .close { - margin-top: -2px; -} -.modal-title { - margin: 0; - line-height: 1.42857143; -} -.modal-body { - position: relative; - padding: 15px; -} -.modal-footer { - padding: 15px; - text-align: right; - border-top: 1px solid #e5e5e5; -} -.modal-footer .btn + .btn { - margin-bottom: 0; - margin-left: 5px; -} -.modal-footer .btn-group .btn + .btn { - margin-left: -1px; -} -.modal-footer .btn-block + .btn-block { - margin-left: 0; -} -.modal-scrollbar-measure { - position: absolute; - top: -9999px; - width: 50px; - height: 50px; - overflow: scroll; -} -@media (min-width: 768px) { - .modal-dialog { - width: 600px; - margin: 30px auto; - } - .modal-content { - -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5); - box-shadow: 0 5px 15px rgba(0, 0, 0, .5); - } - .modal-sm { - width: 300px; - } -} -@media (min-width: 992px) { - .modal-lg { - width: 900px; - } -} -.tooltip { - position: absolute; - z-index: 1070; - display: block; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 12px; - font-style: normal; - font-weight: normal; - line-height: 1.42857143; - text-align: left; - text-align: start; - text-decoration: none; - text-shadow: none; - text-transform: none; - letter-spacing: normal; - word-break: normal; - word-spacing: normal; - word-wrap: normal; - white-space: normal; - filter: alpha(opacity=0); - opacity: 0; - - line-break: auto; -} -.tooltip.in { - filter: alpha(opacity=90); - opacity: .9; -} -.tooltip.top { - padding: 5px 0; - margin-top: -3px; -} -.tooltip.right { - padding: 0 5px; - margin-left: 3px; -} -.tooltip.bottom { - padding: 5px 0; - margin-top: 3px; -} -.tooltip.left { - padding: 0 5px; - margin-left: -3px; -} -.tooltip-inner { - max-width: 200px; - padding: 3px 8px; - color: #fff; - text-align: center; - background-color: #000; - border-radius: 4px; -} -.tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} -.tooltip.top .tooltip-arrow { - bottom: 0; - left: 50%; - margin-left: -5px; - border-width: 5px 5px 0; - border-top-color: #000; -} -.tooltip.top-left .tooltip-arrow { - right: 5px; - bottom: 0; - margin-bottom: -5px; - border-width: 5px 5px 0; - border-top-color: #000; -} -.tooltip.top-right .tooltip-arrow { - bottom: 0; - left: 5px; - margin-bottom: -5px; - border-width: 5px 5px 0; - border-top-color: #000; -} -.tooltip.right .tooltip-arrow { - top: 50%; - left: 0; - margin-top: -5px; - border-width: 5px 5px 5px 0; - border-right-color: #000; -} -.tooltip.left .tooltip-arrow { - top: 50%; - right: 0; - margin-top: -5px; - border-width: 5px 0 5px 5px; - border-left-color: #000; -} -.tooltip.bottom .tooltip-arrow { - top: 0; - left: 50%; - margin-left: -5px; - border-width: 0 5px 5px; - border-bottom-color: #000; -} -.tooltip.bottom-left .tooltip-arrow { - top: 0; - right: 5px; - margin-top: -5px; - border-width: 0 5px 5px; - border-bottom-color: #000; -} -.tooltip.bottom-right .tooltip-arrow { - top: 0; - left: 5px; - margin-top: -5px; - border-width: 0 5px 5px; - border-bottom-color: #000; -} -.popover { - position: absolute; - top: 0; - left: 0; - z-index: 1060; - display: none; - max-width: 276px; - padding: 1px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 1.42857143; - text-align: left; - text-align: start; - text-decoration: none; - text-shadow: none; - text-transform: none; - letter-spacing: normal; - word-break: normal; - word-spacing: normal; - word-wrap: normal; - white-space: normal; - background-color: #fff; - -webkit-background-clip: padding-box; - background-clip: padding-box; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, .2); - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); - box-shadow: 0 5px 10px rgba(0, 0, 0, .2); - - line-break: auto; -} -.popover.top { - margin-top: -10px; -} -.popover.right { - margin-left: 10px; -} -.popover.bottom { - margin-top: 10px; -} -.popover.left { - margin-left: -10px; -} -.popover-title { - padding: 8px 14px; - margin: 0; - font-size: 14px; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; - border-radius: 5px 5px 0 0; -} -.popover-content { - padding: 9px 14px; -} -.popover > .arrow, -.popover > .arrow:after { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} -.popover > .arrow { - border-width: 11px; -} -.popover > .arrow:after { - content: ""; - border-width: 10px; -} -.popover.top > .arrow { - bottom: -11px; - left: 50%; - margin-left: -11px; - border-top-color: #999; - border-top-color: rgba(0, 0, 0, .25); - border-bottom-width: 0; -} -.popover.top > .arrow:after { - bottom: 1px; - margin-left: -10px; - content: " "; - border-top-color: #fff; - border-bottom-width: 0; -} -.popover.right > .arrow { - top: 50%; - left: -11px; - margin-top: -11px; - border-right-color: #999; - border-right-color: rgba(0, 0, 0, .25); - border-left-width: 0; -} -.popover.right > .arrow:after { - bottom: -10px; - left: 1px; - content: " "; - border-right-color: #fff; - border-left-width: 0; -} -.popover.bottom > .arrow { - top: -11px; - left: 50%; - margin-left: -11px; - border-top-width: 0; - border-bottom-color: #999; - border-bottom-color: rgba(0, 0, 0, .25); -} -.popover.bottom > .arrow:after { - top: 1px; - margin-left: -10px; - content: " "; - border-top-width: 0; - border-bottom-color: #fff; -} -.popover.left > .arrow { - top: 50%; - right: -11px; - margin-top: -11px; - border-right-width: 0; - border-left-color: #999; - border-left-color: rgba(0, 0, 0, .25); -} -.popover.left > .arrow:after { - right: 1px; - bottom: -10px; - content: " "; - border-right-width: 0; - border-left-color: #fff; -} -.carousel { - position: relative; -} -.carousel-inner { - position: relative; - width: 100%; - overflow: hidden; -} -.carousel-inner > .item { - position: relative; - display: none; - -webkit-transition: .6s ease-in-out left; - -o-transition: .6s ease-in-out left; - transition: .6s ease-in-out left; -} -.carousel-inner > .item > img, -.carousel-inner > .item > a > img { - line-height: 1; -} -@media all and (transform-3d), (-webkit-transform-3d) { - .carousel-inner > .item { - -webkit-transition: -webkit-transform .6s ease-in-out; - -o-transition: -o-transform .6s ease-in-out; - transition: transform .6s ease-in-out; - - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - -webkit-perspective: 1000px; - perspective: 1000px; - } - .carousel-inner > .item.next, - .carousel-inner > .item.active.right { - left: 0; - -webkit-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0); - } - .carousel-inner > .item.prev, - .carousel-inner > .item.active.left { - left: 0; - -webkit-transform: translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0); - } - .carousel-inner > .item.next.left, - .carousel-inner > .item.prev.right, - .carousel-inner > .item.active { - left: 0; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} -.carousel-inner > .active, -.carousel-inner > .next, -.carousel-inner > .prev { - display: block; -} -.carousel-inner > .active { - left: 0; -} -.carousel-inner > .next, -.carousel-inner > .prev { - position: absolute; - top: 0; - width: 100%; -} -.carousel-inner > .next { - left: 100%; -} -.carousel-inner > .prev { - left: -100%; -} -.carousel-inner > .next.left, -.carousel-inner > .prev.right { - left: 0; -} -.carousel-inner > .active.left { - left: -100%; -} -.carousel-inner > .active.right { - left: 100%; -} -.carousel-control { - position: absolute; - top: 0; - bottom: 0; - left: 0; - width: 15%; - font-size: 20px; - color: #fff; - text-align: center; - text-shadow: 0 1px 2px rgba(0, 0, 0, .6); - background-color: rgba(0, 0, 0, 0); - filter: alpha(opacity=50); - opacity: .5; -} -.carousel-control.left { - background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); - background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); - background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001))); - background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); - background-repeat: repeat-x; -} -.carousel-control.right { - right: 0; - left: auto; - background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); - background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); - background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5))); - background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); - background-repeat: repeat-x; -} -.carousel-control:hover, -.carousel-control:focus { - color: #fff; - text-decoration: none; - filter: alpha(opacity=90); - outline: 0; - opacity: .9; -} -.carousel-control .icon-prev, -.carousel-control .icon-next, -.carousel-control .glyphicon-chevron-left, -.carousel-control .glyphicon-chevron-right { - position: absolute; - top: 50%; - z-index: 5; - display: inline-block; - margin-top: -10px; -} -.carousel-control .icon-prev, -.carousel-control .glyphicon-chevron-left { - left: 50%; - margin-left: -10px; -} -.carousel-control .icon-next, -.carousel-control .glyphicon-chevron-right { - right: 50%; - margin-right: -10px; -} -.carousel-control .icon-prev, -.carousel-control .icon-next { - width: 20px; - height: 20px; - font-family: serif; - line-height: 1; -} -.carousel-control .icon-prev:before { - content: '\2039'; -} -.carousel-control .icon-next:before { - content: '\203a'; -} -.carousel-indicators { - position: absolute; - bottom: 10px; - left: 50%; - z-index: 15; - width: 60%; - padding-left: 0; - margin-left: -30%; - text-align: center; - list-style: none; -} -.carousel-indicators li { - display: inline-block; - width: 10px; - height: 10px; - margin: 1px; - text-indent: -999px; - cursor: pointer; - background-color: #000 \9; - background-color: rgba(0, 0, 0, 0); - border: 1px solid #fff; - border-radius: 10px; -} -.carousel-indicators .active { - width: 12px; - height: 12px; - margin: 0; - background-color: #fff; -} -.carousel-caption { - position: absolute; - right: 15%; - bottom: 20px; - left: 15%; - z-index: 10; - padding-top: 20px; - padding-bottom: 20px; - color: #fff; - text-align: center; - text-shadow: 0 1px 2px rgba(0, 0, 0, .6); -} -.carousel-caption .btn { - text-shadow: none; -} -@media screen and (min-width: 768px) { - .carousel-control .glyphicon-chevron-left, - .carousel-control .glyphicon-chevron-right, - .carousel-control .icon-prev, - .carousel-control .icon-next { - width: 30px; - height: 30px; - margin-top: -10px; - font-size: 30px; - } - .carousel-control .glyphicon-chevron-left, - .carousel-control .icon-prev { - margin-left: -10px; - } - .carousel-control .glyphicon-chevron-right, - .carousel-control .icon-next { - margin-right: -10px; - } - .carousel-caption { - right: 20%; - left: 20%; - padding-bottom: 30px; - } - .carousel-indicators { - bottom: 20px; - } -} -.clearfix:before, -.clearfix:after, -.dl-horizontal dd:before, -.dl-horizontal dd:after, -.container:before, -.container:after, -.container-fluid:before, -.container-fluid:after, -.row:before, -.row:after, -.form-horizontal .form-group:before, -.form-horizontal .form-group:after, -.btn-toolbar:before, -.btn-toolbar:after, -.btn-group-vertical > .btn-group:before, -.btn-group-vertical > .btn-group:after, -.nav:before, -.nav:after, -.navbar:before, -.navbar:after, -.navbar-header:before, -.navbar-header:after, -.navbar-collapse:before, -.navbar-collapse:after, -.pager:before, -.pager:after, -.panel-body:before, -.panel-body:after, -.modal-header:before, -.modal-header:after, -.modal-footer:before, -.modal-footer:after { - display: table; - content: " "; -} -.clearfix:after, -.dl-horizontal dd:after, -.container:after, -.container-fluid:after, -.row:after, -.form-horizontal .form-group:after, -.btn-toolbar:after, -.btn-group-vertical > .btn-group:after, -.nav:after, -.navbar:after, -.navbar-header:after, -.navbar-collapse:after, -.pager:after, -.panel-body:after, -.modal-header:after, -.modal-footer:after { - clear: both; -} -.center-block { - display: block; - margin-right: auto; - margin-left: auto; -} -.pull-right { - float: right !important; -} -.pull-left { - float: left !important; -} -.hide { - display: none !important; -} -.show { - display: block !important; -} -.invisible { - visibility: hidden; -} -.text-hide { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} -.hidden { - display: none !important; -} -.affix { - position: fixed; -} -@-ms-viewport { - width: device-width; -} -.visible-xs, -.visible-sm, -.visible-md, -.visible-lg { - display: none !important; -} -.visible-xs-block, -.visible-xs-inline, -.visible-xs-inline-block, -.visible-sm-block, -.visible-sm-inline, -.visible-sm-inline-block, -.visible-md-block, -.visible-md-inline, -.visible-md-inline-block, -.visible-lg-block, -.visible-lg-inline, -.visible-lg-inline-block { - display: none !important; -} -@media (max-width: 767px) { - .visible-xs { - display: block !important; - } - table.visible-xs { - display: table !important; - } - tr.visible-xs { - display: table-row !important; - } - th.visible-xs, - td.visible-xs { - display: table-cell !important; - } -} -@media (max-width: 767px) { - .visible-xs-block { - display: block !important; - } -} -@media (max-width: 767px) { - .visible-xs-inline { - display: inline !important; - } -} -@media (max-width: 767px) { - .visible-xs-inline-block { - display: inline-block !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm { - display: block !important; - } - table.visible-sm { - display: table !important; - } - tr.visible-sm { - display: table-row !important; - } - th.visible-sm, - td.visible-sm { - display: table-cell !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm-block { - display: block !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm-inline { - display: inline !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm-inline-block { - display: inline-block !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md { - display: block !important; - } - table.visible-md { - display: table !important; - } - tr.visible-md { - display: table-row !important; - } - th.visible-md, - td.visible-md { - display: table-cell !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md-block { - display: block !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md-inline { - display: inline !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md-inline-block { - display: inline-block !important; - } -} -@media (min-width: 1200px) { - .visible-lg { - display: block !important; - } - table.visible-lg { - display: table !important; - } - tr.visible-lg { - display: table-row !important; - } - th.visible-lg, - td.visible-lg { - display: table-cell !important; - } -} -@media (min-width: 1200px) { - .visible-lg-block { - display: block !important; - } -} -@media (min-width: 1200px) { - .visible-lg-inline { - display: inline !important; - } -} -@media (min-width: 1200px) { - .visible-lg-inline-block { - display: inline-block !important; - } -} -@media (max-width: 767px) { - .hidden-xs { - display: none !important; - } -} -@media (min-width: 768px) and (max-width: 991px) { - .hidden-sm { - display: none !important; - } -} -@media (min-width: 992px) and (max-width: 1199px) { - .hidden-md { - display: none !important; - } -} -@media (min-width: 1200px) { - .hidden-lg { - display: none !important; - } -} -.visible-print { - display: none !important; -} -@media print { - .visible-print { - display: block !important; - } - table.visible-print { - display: table !important; - } - tr.visible-print { - display: table-row !important; - } - th.visible-print, - td.visible-print { - display: table-cell !important; - } -} -.visible-print-block { - display: none !important; -} -@media print { - .visible-print-block { - display: block !important; - } -} -.visible-print-inline { - display: none !important; -} -@media print { - .visible-print-inline { - display: inline !important; - } -} -.visible-print-inline-block { - display: none !important; -} -@media print { - .visible-print-inline-block { - display: inline-block !important; - } -} -@media print { - .hidden-print { - display: none !important; - } -} -/*# sourceMappingURL=bootstrap.css.map */ diff --git a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap.css.map b/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap.css.map deleted file mode 100644 index f010c82d11..0000000000 --- a/jhipster/jhipster-microservice/gateway-app/src/main/webapp/bower_components/bootstrap/dist/css/bootstrap.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["bootstrap.css","less/normalize.less","less/print.less","less/glyphicons.less","less/scaffolding.less","less/mixins/vendor-prefixes.less","less/mixins/tab-focus.less","less/mixins/image.less","less/type.less","less/mixins/text-emphasis.less","less/mixins/background-variant.less","less/mixins/text-overflow.less","less/code.less","less/grid.less","less/mixins/grid.less","less/mixins/grid-framework.less","less/tables.less","less/mixins/table-row.less","less/forms.less","less/mixins/forms.less","less/buttons.less","less/mixins/buttons.less","less/mixins/opacity.less","less/component-animations.less","less/dropdowns.less","less/mixins/nav-divider.less","less/mixins/reset-filter.less","less/button-groups.less","less/mixins/border-radius.less","less/input-groups.less","less/navs.less","less/navbar.less","less/mixins/nav-vertical-align.less","less/utilities.less","less/breadcrumbs.less","less/pagination.less","less/mixins/pagination.less","less/pager.less","less/labels.less","less/mixins/labels.less","less/badges.less","less/jumbotron.less","less/thumbnails.less","less/alerts.less","less/mixins/alerts.less","less/progress-bars.less","less/mixins/gradients.less","less/mixins/progress-bar.less","less/media.less","less/list-group.less","less/mixins/list-group.less","less/panels.less","less/mixins/panels.less","less/responsive-embed.less","less/wells.less","less/close.less","less/modals.less","less/tooltip.less","less/mixins/reset-text.less","less/popovers.less","less/carousel.less","less/mixins/clearfix.less","less/mixins/center-block.less","less/mixins/hide-text.less","less/responsive-utilities.less","less/mixins/responsive-visibility.less"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,4EAA4E;ACG5E;EACE,wBAAA;EACA,2BAAA;EACA,+BAAA;CDDD;ACQD;EACE,UAAA;CDND;ACmBD;;;;;;;;;;;;;EAaE,eAAA;CDjBD;ACyBD;;;;EAIE,sBAAA;EACA,yBAAA;CDvBD;AC+BD;EACE,cAAA;EACA,UAAA;CD7BD;ACqCD;;EAEE,cAAA;CDnCD;AC6CD;EACE,8BAAA;CD3CD;ACmDD;;EAEE,WAAA;CDjDD;AC2DD;EACE,0BAAA;CDzDD;ACgED;;EAEE,kBAAA;CD9DD;ACqED;EACE,mBAAA;CDnED;AC2ED;EACE,eAAA;EACA,iBAAA;CDzED;ACgFD;EACE,iBAAA;EACA,YAAA;CD9ED;ACqFD;EACE,eAAA;CDnFD;AC0FD;;EAEE,eAAA;EACA,eAAA;EACA,mBAAA;EACA,yBAAA;CDxFD;AC2FD;EACE,YAAA;CDzFD;AC4FD;EACE,gBAAA;CD1FD;ACoGD;EACE,UAAA;CDlGD;ACyGD;EACE,iBAAA;CDvGD;ACiHD;EACE,iBAAA;CD/GD;ACsHD;EACE,gCAAA;KAAA,6BAAA;UAAA,wBAAA;EACA,UAAA;CDpHD;AC2HD;EACE,eAAA;CDzHD;ACgID;;;;EAIE,kCAAA;EACA,eAAA;CD9HD;ACgJD;;;;;EAKE,eAAA;EACA,cAAA;EACA,UAAA;CD9ID;ACqJD;EACE,kBAAA;CDnJD;AC6JD;;EAEE,qBAAA;CD3JD;ACsKD;;;;EAIE,2BA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9DD;CACF;Aa18DD;EE9CI;IACE,YAAA;Gf2/DH;Eep/DD;IACE,YAAA;Gfs/DD;Eev/DD;IACE,oBAAA;Gfy/DD;Ee1/DD;IACE,oBAAA;Gf4/DD;Ee7/DD;IACE,WAAA;Gf+/DD;EehgED;IACE,oBAAA;GfkgED;EengED;IACE,oBAAA;GfqgED;EetgED;IACE,WAAA;GfwgED;EezgED;IACE,oBAAA;Gf2gED;Ee5gED;IACE,oBAAA;Gf8gED;Ee/gED;IACE,WAAA;GfihED;EelhED;IACE,oBAAA;GfohED;EerhED;IACE,mBAAA;GfuhED;EezgED;IACE,YAAA;Gf2gED;Ee5gED;IACE,oBAAA;Gf8gED;Ee/gED;IACE,oBAAA;GfihED;EelhED;IACE,WAAA;GfohED;EerhED;IACE,oBAAA;GfuhED;EexhED;IACE,oBAAA;Gf0hED;Ee3hED;IACE,WAAA;Gf6hED;Ee9hED;IACE,oBAAA;GfgiED;EejiED;IACE,oBAAA;GfmiED;EepiED;IACE,WAAA;GfsiED;EeviED;IACE,oBAAA;GfyiED;Ee1iED;IACE,mBAAA;Gf4iED;EexiED;IACE,YAAA;Gf0iED;Ee1jED;IACE,WAAA;Gf4jED;Ee7jED;IACE,mBAAA;Gf+jED;EehkED;IACE,mBAAA;GfkkED;EenkED;IACE,UAAA;GfqkED;EetkED;IACE,mBAAA;GfwkED;EezkED;IACE,mBAAA;Gf2kED;Ee5kED;IACE,UAAA;Gf8kED;Ee/kED;IACE,mBAAA;GfilED;EellED;IACE,mBAAA;GfolED;EerlED;IACE,UAAA;GfulED;EexlED;IACE,mBAAA;Gf0lED;Ee3lED;IACE,kBAAA;Gf6lED;EezlED;IACE,WAAA;Gf2lED;Ee7kED;IACE,kBAAA;Gf+kED;EehlED;IACE,0BAAA;GfklED;EenlED;IACE,0BAAA;GfqlED;EetlED;IACE,iBAAA;GfwlED;EezlED;IACE,0BAAA;Gf2lED;Ee5lED;IACE,0BAAA;Gf8lED;Ee/lED;IACE,iBAAA;GfimED;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Eh4MD;EACE,yBAAA;ChEk4MD;AgE73MD;EAOA;IATI,iCAAA;GhEm4MD;CACF;AgE53MD;EACA;ICrLE,yBAAA;GjEojNC;CACF","file":"bootstrap.css","sourcesContent":["/*!\n * Bootstrap v3.3.7 (http://getbootstrap.com)\n * Copyright 2011-2016 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\nhtml {\n font-family: sans-serif;\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n}\nbody {\n margin: 0;\n}\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n display: block;\n}\naudio,\ncanvas,\nprogress,\nvideo {\n display: inline-block;\n vertical-align: baseline;\n}\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n[hidden],\ntemplate {\n display: none;\n}\na {\n background-color: transparent;\n}\na:active,\na:hover {\n outline: 0;\n}\nabbr[title] {\n border-bottom: 1px dotted;\n}\nb,\nstrong {\n font-weight: bold;\n}\ndfn {\n font-style: italic;\n}\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\nmark {\n background: #ff0;\n color: #000;\n}\nsmall {\n font-size: 80%;\n}\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsup {\n top: -0.5em;\n}\nsub {\n bottom: -0.25em;\n}\nimg {\n border: 0;\n}\nsvg:not(:root) {\n overflow: hidden;\n}\nfigure {\n margin: 1em 40px;\n}\nhr {\n box-sizing: content-box;\n height: 0;\n}\npre {\n overflow: auto;\n}\ncode,\nkbd,\npre,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n color: inherit;\n font: inherit;\n margin: 0;\n}\nbutton {\n overflow: visible;\n}\nbutton,\nselect {\n text-transform: none;\n}\nbutton,\nhtml input[type=\"button\"],\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button;\n cursor: pointer;\n}\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\ninput {\n line-height: normal;\n}\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box;\n padding: 0;\n}\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\ninput[type=\"search\"] {\n -webkit-appearance: textfield;\n box-sizing: content-box;\n}\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\nfieldset {\n border: 1px solid #c0c0c0;\n margin: 0 2px;\n padding: 0.35em 0.625em 0.75em;\n}\nlegend {\n border: 0;\n padding: 0;\n}\ntextarea {\n overflow: auto;\n}\noptgroup {\n font-weight: bold;\n}\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\ntd,\nth {\n padding: 0;\n}\n/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */\n@media print {\n *,\n *:before,\n *:after {\n background: transparent !important;\n color: #000 !important;\n box-shadow: none !important;\n text-shadow: none !important;\n }\n a,\n a:visited {\n text-decoration: underline;\n }\n a[href]:after {\n content: \" (\" attr(href) \")\";\n }\n abbr[title]:after {\n content: \" (\" attr(title) \")\";\n }\n a[href^=\"#\"]:after,\n a[href^=\"javascript:\"]:after {\n content: \"\";\n }\n pre,\n blockquote {\n border: 1px solid #999;\n page-break-inside: avoid;\n }\n thead {\n display: table-header-group;\n }\n tr,\n img {\n page-break-inside: avoid;\n }\n img {\n max-width: 100% !important;\n }\n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n h2,\n h3 {\n page-break-after: avoid;\n }\n .navbar {\n display: none;\n }\n .btn > .caret,\n .dropup > .btn > .caret {\n border-top-color: #000 !important;\n }\n .label {\n border: 1px solid #000;\n }\n .table {\n border-collapse: collapse !important;\n }\n .table td,\n .table th {\n background-color: #fff !important;\n }\n .table-bordered th,\n .table-bordered td {\n border: 1px solid #ddd !important;\n }\n}\n@font-face {\n font-family: 'Glyphicons Halflings';\n src: url('../fonts/glyphicons-halflings-regular.eot');\n src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');\n}\n.glyphicon {\n position: relative;\n top: 1px;\n display: inline-block;\n font-family: 'Glyphicons Halflings';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.glyphicon-asterisk:before {\n content: \"\\002a\";\n}\n.glyphicon-plus:before {\n content: \"\\002b\";\n}\n.glyphicon-euro:before,\n.glyphicon-eur:before {\n content: \"\\20ac\";\n}\n.glyphicon-minus:before {\n content: \"\\2212\";\n}\n.glyphicon-cloud:before {\n content: \"\\2601\";\n}\n.glyphicon-envelope:before {\n content: \"\\2709\";\n}\n.glyphicon-pencil:before {\n content: \"\\270f\";\n}\n.glyphicon-glass:before {\n content: \"\\e001\";\n}\n.glyphicon-music:before {\n content: \"\\e002\";\n}\n.glyphicon-search:before {\n content: \"\\e003\";\n}\n.glyphicon-heart:before {\n content: \"\\e005\";\n}\n.glyphicon-star:before {\n content: \"\\e006\";\n}\n.glyphicon-star-empty:before {\n content: \"\\e007\";\n}\n.glyphicon-user:before {\n content: \"\\e008\";\n}\n.glyphicon-film:before {\n content: \"\\e009\";\n}\n.glyphicon-th-large:before {\n content: \"\\e010\";\n}\n.glyphicon-th:before {\n content: \"\\e011\";\n}\n.glyphicon-th-list:before {\n content: \"\\e012\";\n}\n.glyphicon-ok:before {\n content: \"\\e013\";\n}\n.glyphicon-remove:before {\n content: \"\\e014\";\n}\n.glyphicon-zoom-in:before {\n content: \"\\e015\";\n}\n.glyphicon-zoom-out:before {\n content: \"\\e016\";\n}\n.glyphicon-off:before {\n content: \"\\e017\";\n}\n.glyphicon-signal:before {\n content: \"\\e018\";\n}\n.glyphicon-cog:before {\n content: \"\\e019\";\n}\n.glyphicon-trash:before {\n content: \"\\e020\";\n}\n.glyphicon-home:before {\n content: \"\\e021\";\n}\n.glyphicon-file:before {\n content: \"\\e022\";\n}\n.glyphicon-time:before {\n content: \"\\e023\";\n}\n.glyphicon-road:before {\n content: \"\\e024\";\n}\n.glyphicon-download-alt:before {\n content: \"\\e025\";\n}\n.glyphicon-download:before {\n content: \"\\e026\";\n}\n.glyphicon-upload:before {\n content: \"\\e027\";\n}\n.glyphicon-inbox:before {\n content: \"\\e028\";\n}\n.glyphicon-play-circle:before {\n content: \"\\e029\";\n}\n.glyphicon-repeat:before {\n content: \"\\e030\";\n}\n.glyphicon-refresh:before {\n content: \"\\e031\";\n}\n.glyphicon-list-alt:before {\n content: \"\\e032\";\n}\n.glyphicon-lock:before {\n content: \"\\e033\";\n}\n.glyphicon-flag:before {\n content: \"\\e034\";\n}\n.glyphicon-headphones:before {\n content: \"\\e035\";\n}\n.glyphicon-volume-off:before {\n content: \"\\e036\";\n}\n.glyphicon-volume-down:before {\n content: \"\\e037\";\n}\n.glyphicon-volume-up:before {\n content: \"\\e038\";\n}\n.glyphicon-qrcode:before {\n content: \"\\e039\";\n}\n.glyphicon-barcode:before {\n content: \"\\e040\";\n}\n.glyphicon-tag:before {\n content: \"\\e041\";\n}\n.glyphicon-tags:before {\n content: \"\\e042\";\n}\n.glyphicon-book:before {\n content: \"\\e043\";\n}\n.glyphicon-bookmark:before {\n content: \"\\e044\";\n}\n.glyphicon-print:before {\n content: \"\\e045\";\n}\n.glyphicon-camera:before {\n content: \"\\e046\";\n}\n.glyphicon-font:before {\n content: \"\\e047\";\n}\n.glyphicon-bold:before {\n content: \"\\e048\";\n}\n.glyphicon-italic:before {\n content: \"\\e049\";\n}\n.glyphicon-text-height:before {\n content: \"\\e050\";\n}\n.glyphicon-text-width:before {\n content: \"\\e051\";\n}\n.glyphicon-align-left:before {\n content: \"\\e052\";\n}\n.glyphicon-align-center:before {\n content: \"\\e053\";\n}\n.glyphicon-align-right:before {\n content: \"\\e054\";\n}\n.glyphicon-align-justify:before {\n content: \"\\e055\";\n}\n.glyphicon-list:before {\n content: \"\\e056\";\n}\n.glyphicon-indent-left:before {\n content: \"\\e057\";\n}\n.glyphicon-indent-right:before {\n content: \"\\e058\";\n}\n.glyphicon-facetime-video:before {\n content: \"\\e059\";\n}\n.glyphicon-picture:before {\n content: \"\\e060\";\n}\n.glyphicon-map-marker:before {\n content: \"\\e062\";\n}\n.glyphicon-adjust:before {\n content: \"\\e063\";\n}\n.glyphicon-tint:before {\n content: \"\\e064\";\n}\n.glyphicon-edit:before {\n content: \"\\e065\";\n}\n.glyphicon-share:before {\n content: \"\\e066\";\n}\n.glyphicon-check:before {\n content: \"\\e067\";\n}\n.glyphicon-move:before {\n content: \"\\e068\";\n}\n.glyphicon-step-backward:before {\n content: \"\\e069\";\n}\n.glyphicon-fast-backward:before {\n content: \"\\e070\";\n}\n.glyphicon-backward:before {\n content: \"\\e071\";\n}\n.glyphicon-play:before {\n content: \"\\e072\";\n}\n.glyphicon-pause:before {\n content: \"\\e073\";\n}\n.glyphicon-stop:before {\n content: \"\\e074\";\n}\n.glyphicon-forward:before {\n content: \"\\e075\";\n}\n.glyphicon-fast-forward:before {\n content: \"\\e076\";\n}\n.glyphicon-step-forward:before {\n content: \"\\e077\";\n}\n.glyphicon-eject:before {\n content: \"\\e078\";\n}\n.glyphicon-chevron-left:before {\n content: \"\\e079\";\n}\n.glyphicon-chevron-right:before {\n content: \"\\e080\";\n}\n.glyphicon-plus-sign:before {\n content: \"\\e081\";\n}\n.glyphicon-minus-sign:before {\n content: \"\\e082\";\n}\n.glyphicon-remove-sign:before {\n content: \"\\e083\";\n}\n.glyphicon-ok-sign:before {\n content: \"\\e084\";\n}\n.glyphicon-question-sign:before {\n content: \"\\e085\";\n}\n.glyphicon-info-sign:before {\n content: \"\\e086\";\n}\n.glyphicon-screenshot:before {\n content: \"\\e087\";\n}\n.glyphicon-remove-circle:before {\n content: \"\\e088\";\n}\n.glyphicon-ok-circle:before {\n content: \"\\e089\";\n}\n.glyphicon-ban-circle:before {\n content: \"\\e090\";\n}\n.glyphicon-arrow-left:before {\n content: \"\\e091\";\n}\n.glyphicon-arrow-right:before {\n content: \"\\e092\";\n}\n.glyphicon-arrow-up:before {\n content: \"\\e093\";\n}\n.glyphicon-arrow-down:before {\n content: \"\\e094\";\n}\n.glyphicon-share-alt:before {\n content: \"\\e095\";\n}\n.glyphicon-resize-full:before {\n content: \"\\e096\";\n}\n.glyphicon-resize-small:before {\n content: \"\\e097\";\n}\n.glyphicon-exclamation-sign:before {\n content: \"\\e101\";\n}\n.glyphicon-gift:before {\n content: \"\\e102\";\n}\n.glyphicon-leaf:before {\n content: \"\\e103\";\n}\n.glyphicon-fire:before {\n content: \"\\e104\";\n}\n.glyphicon-eye-open:before {\n content: \"\\e105\";\n}\n.glyphicon-eye-close:before {\n content: \"\\e106\";\n}\n.glyphicon-warning-sign:before {\n content: \"\\e107\";\n}\n.glyphicon-plane:before {\n content: \"\\e108\";\n}\n.glyphicon-calendar:before {\n content: \"\\e109\";\n}\n.glyphicon-random:before {\n content: \"\\e110\";\n}\n.glyphicon-comment:before {\n content: \"\\e111\";\n}\n.glyphicon-magnet:before {\n content: \"\\e112\";\n}\n.glyphicon-chevron-up:before {\n content: \"\\e113\";\n}\n.glyphicon-chevron-down:before {\n content: \"\\e114\";\n}\n.glyphicon-retweet:before {\n content: \"\\e115\";\n}\n.glyphicon-shopping-cart:before {\n content: \"\\e116\";\n}\n.glyphicon-folder-close:before {\n content: \"\\e117\";\n}\n.glyphicon-folder-open:before {\n content: \"\\e118\";\n}\n.glyphicon-resize-vertical:before {\n content: \"\\e119\";\n}\n.glyphicon-resize-horizontal:before {\n content: \"\\e120\";\n}\n.glyphicon-hdd:before {\n content: \"\\e121\";\n}\n.glyphicon-bullhorn:before {\n content: \"\\e122\";\n}\n.glyphicon-bell:before {\n content: \"\\e123\";\n}\n.glyphicon-certificate:before {\n content: \"\\e124\";\n}\n.glyphicon-thumbs-up:before {\n content: \"\\e125\";\n}\n.glyphicon-thumbs-down:before {\n content: \"\\e126\";\n}\n.glyphicon-hand-right:before {\n content: \"\\e127\";\n}\n.glyphicon-hand-left:before {\n content: \"\\e128\";\n}\n.glyphicon-hand-up:before {\n content: \"\\e129\";\n}\n.glyphicon-hand-down:before {\n content: \"\\e130\";\n}\n.glyphicon-circle-arrow-right:before {\n content: \"\\e131\";\n}\n.glyphicon-circle-arrow-left:before {\n content: \"\\e132\";\n}\n.glyphicon-circle-arrow-up:before {\n content: \"\\e133\";\n}\n.glyphicon-circle-arrow-down:before {\n content: \"\\e134\";\n}\n.glyphicon-globe:before {\n content: \"\\e135\";\n}\n.glyphicon-wrench:before {\n content: \"\\e136\";\n}\n.glyphicon-tasks:before {\n content: \"\\e137\";\n}\n.glyphicon-filter:before {\n content: \"\\e138\";\n}\n.glyphicon-briefcase:before {\n content: \"\\e139\";\n}\n.glyphicon-fullscreen:before {\n content: \"\\e140\";\n}\n.glyphicon-dashboard:before {\n content: \"\\e141\";\n}\n.glyphicon-paperclip:before {\n content: \"\\e142\";\n}\n.glyphicon-heart-empty:before {\n content: \"\\e143\";\n}\n.glyphicon-link:before {\n content: \"\\e144\";\n}\n.glyphicon-phone:before {\n content: \"\\e145\";\n}\n.glyphicon-pushpin:before {\n content: \"\\e146\";\n}\n.glyphicon-usd:before {\n content: \"\\e148\";\n}\n.glyphicon-gbp:before {\n content: \"\\e149\";\n}\n.glyphicon-sort:before {\n content: \"\\e150\";\n}\n.glyphicon-sort-by-alphabet:before {\n content: \"\\e151\";\n}\n.glyphicon-sort-by-alphabet-alt:before {\n content: \"\\e152\";\n}\n.glyphicon-sort-by-order:before {\n content: \"\\e153\";\n}\n.glyphicon-sort-by-order-alt:before {\n content: \"\\e154\";\n}\n.glyphicon-sort-by-attributes:before {\n content: \"\\e155\";\n}\n.glyphicon-sort-by-attributes-alt:before {\n content: \"\\e156\";\n}\n.glyphicon-unchecked:before {\n content: \"\\e157\";\n}\n.glyphicon-expand:before {\n content: \"\\e158\";\n}\n.glyphicon-collapse-down:before {\n content: \"\\e159\";\n}\n.glyphicon-collapse-up:before {\n content: \"\\e160\";\n}\n.glyphicon-log-in:before {\n content: \"\\e161\";\n}\n.glyphicon-flash:before {\n content: \"\\e162\";\n}\n.glyphicon-log-out:before {\n content: \"\\e163\";\n}\n.glyphicon-new-window:before {\n content: \"\\e164\";\n}\n.glyphicon-record:before {\n content: \"\\e165\";\n}\n.glyphicon-save:before {\n content: \"\\e166\";\n}\n.glyphicon-open:before {\n content: \"\\e167\";\n}\n.glyphicon-saved:before {\n content: \"\\e168\";\n}\n.glyphicon-import:before {\n content: \"\\e169\";\n}\n.glyphicon-export:before {\n content: \"\\e170\";\n}\n.glyphicon-send:before {\n content: \"\\e171\";\n}\n.glyphicon-floppy-disk:before {\n content: \"\\e172\";\n}\n.glyphicon-floppy-saved:before {\n content: \"\\e173\";\n}\n.glyphicon-floppy-remove:before {\n content: \"\\e174\";\n}\n.glyphicon-floppy-save:before {\n content: \"\\e175\";\n}\n.glyphicon-floppy-open:before {\n content: \"\\e176\";\n}\n.glyphicon-credit-card:before {\n content: \"\\e177\";\n}\n.glyphicon-transfer:before {\n content: \"\\e178\";\n}\n.glyphicon-cutlery:before {\n content: \"\\e179\";\n}\n.glyphicon-header:before {\n content: \"\\e180\";\n}\n.glyphicon-compressed:before {\n content: \"\\e181\";\n}\n.glyphicon-earphone:before {\n content: \"\\e182\";\n}\n.glyphicon-phone-alt:before {\n content: \"\\e183\";\n}\n.glyphicon-tower:before {\n content: \"\\e184\";\n}\n.glyphicon-stats:before {\n content: \"\\e185\";\n}\n.glyphicon-sd-video:before {\n content: \"\\e186\";\n}\n.glyphicon-hd-video:before {\n content: \"\\e187\";\n}\n.glyphicon-subtitles:before {\n content: \"\\e188\";\n}\n.glyphicon-sound-stereo:before {\n content: \"\\e189\";\n}\n.glyphicon-sound-dolby:before {\n content: \"\\e190\";\n}\n.glyphicon-sound-5-1:before {\n content: \"\\e191\";\n}\n.glyphicon-sound-6-1:before {\n content: \"\\e192\";\n}\n.glyphicon-sound-7-1:before {\n content: \"\\e193\";\n}\n.glyphicon-copyright-mark:before {\n content: \"\\e194\";\n}\n.glyphicon-registration-mark:before {\n content: \"\\e195\";\n}\n.glyphicon-cloud-download:before {\n content: \"\\e197\";\n}\n.glyphicon-cloud-upload:before {\n content: \"\\e198\";\n}\n.glyphicon-tree-conifer:before {\n content: \"\\e199\";\n}\n.glyphicon-tree-deciduous:before {\n content: \"\\e200\";\n}\n.glyphicon-cd:before {\n content: \"\\e201\";\n}\n.glyphicon-save-file:before {\n content: \"\\e202\";\n}\n.glyphicon-open-file:before {\n content: \"\\e203\";\n}\n.glyphicon-level-up:before {\n content: \"\\e204\";\n}\n.glyphicon-copy:before {\n content: \"\\e205\";\n}\n.glyphicon-paste:before {\n content: \"\\e206\";\n}\n.glyphicon-alert:before {\n content: \"\\e209\";\n}\n.glyphicon-equalizer:before {\n content: \"\\e210\";\n}\n.glyphicon-king:before {\n content: \"\\e211\";\n}\n.glyphicon-queen:before {\n content: \"\\e212\";\n}\n.glyphicon-pawn:before {\n content: \"\\e213\";\n}\n.glyphicon-bishop:before {\n content: \"\\e214\";\n}\n.glyphicon-knight:before {\n content: \"\\e215\";\n}\n.glyphicon-baby-formula:before {\n content: \"\\e216\";\n}\n.glyphicon-tent:before {\n content: \"\\26fa\";\n}\n.glyphicon-blackboard:before {\n content: \"\\e218\";\n}\n.glyphicon-bed:before {\n content: \"\\e219\";\n}\n.glyphicon-apple:before {\n content: \"\\f8ff\";\n}\n.glyphicon-erase:before {\n content: \"\\e221\";\n}\n.glyphicon-hourglass:before {\n content: \"\\231b\";\n}\n.glyphicon-lamp:before {\n content: \"\\e223\";\n}\n.glyphicon-duplicate:before {\n content: \"\\e224\";\n}\n.glyphicon-piggy-bank:before {\n content: \"\\e225\";\n}\n.glyphicon-scissors:before {\n content: \"\\e226\";\n}\n.glyphicon-bitcoin:before {\n content: \"\\e227\";\n}\n.glyphicon-btc:before {\n content: \"\\e227\";\n}\n.glyphicon-xbt:before {\n content: \"\\e227\";\n}\n.glyphicon-yen:before {\n content: \"\\00a5\";\n}\n.glyphicon-jpy:before {\n content: \"\\00a5\";\n}\n.glyphicon-ruble:before {\n content: \"\\20bd\";\n}\n.glyphicon-rub:before {\n content: \"\\20bd\";\n}\n.glyphicon-scale:before {\n content: \"\\e230\";\n}\n.glyphicon-ice-lolly:before {\n content: \"\\e231\";\n}\n.glyphicon-ice-lolly-tasted:before {\n content: \"\\e232\";\n}\n.glyphicon-education:before {\n content: \"\\e233\";\n}\n.glyphicon-option-horizontal:before {\n content: \"\\e234\";\n}\n.glyphicon-option-vertical:before {\n content: \"\\e235\";\n}\n.glyphicon-menu-hamburger:before {\n content: \"\\e236\";\n}\n.glyphicon-modal-window:before {\n content: \"\\e237\";\n}\n.glyphicon-oil:before {\n content: \"\\e238\";\n}\n.glyphicon-grain:before {\n content: \"\\e239\";\n}\n.glyphicon-sunglasses:before {\n content: \"\\e240\";\n}\n.glyphicon-text-size:before {\n content: \"\\e241\";\n}\n.glyphicon-text-color:before {\n content: \"\\e242\";\n}\n.glyphicon-text-background:before {\n content: \"\\e243\";\n}\n.glyphicon-object-align-top:before {\n content: \"\\e244\";\n}\n.glyphicon-object-align-bottom:before {\n content: \"\\e245\";\n}\n.glyphicon-object-align-horizontal:before {\n content: \"\\e246\";\n}\n.glyphicon-object-align-left:before {\n content: \"\\e247\";\n}\n.glyphicon-object-align-vertical:before {\n content: \"\\e248\";\n}\n.glyphicon-object-align-right:before {\n content: \"\\e249\";\n}\n.glyphicon-triangle-right:before {\n content: \"\\e250\";\n}\n.glyphicon-triangle-left:before {\n content: \"\\e251\";\n}\n.glyphicon-triangle-bottom:before {\n content: \"\\e252\";\n}\n.glyphicon-triangle-top:before {\n content: \"\\e253\";\n}\n.glyphicon-console:before {\n content: \"\\e254\";\n}\n.glyphicon-superscript:before {\n content: \"\\e255\";\n}\n.glyphicon-subscript:before {\n content: \"\\e256\";\n}\n.glyphicon-menu-left:before {\n content: \"\\e257\";\n}\n.glyphicon-menu-right:before {\n content: \"\\e258\";\n}\n.glyphicon-menu-down:before {\n content: \"\\e259\";\n}\n.glyphicon-menu-up:before {\n content: \"\\e260\";\n}\n* {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\n*:before,\n*:after {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\nhtml {\n font-size: 10px;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\nbody {\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n line-height: 1.42857143;\n color: #333333;\n background-color: #fff;\n}\ninput,\nbutton,\nselect,\ntextarea {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\na {\n color: #337ab7;\n text-decoration: none;\n}\na:hover,\na:focus {\n color: #23527c;\n text-decoration: underline;\n}\na:focus {\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\nfigure {\n margin: 0;\n}\nimg {\n vertical-align: middle;\n}\n.img-responsive,\n.thumbnail > img,\n.thumbnail a > img,\n.carousel-inner > .item > img,\n.carousel-inner > .item > a > img {\n display: block;\n max-width: 100%;\n height: auto;\n}\n.img-rounded {\n border-radius: 6px;\n}\n.img-thumbnail {\n padding: 4px;\n line-height: 1.42857143;\n background-color: #fff;\n border: 1px solid #ddd;\n border-radius: 4px;\n -webkit-transition: all 0.2s ease-in-out;\n -o-transition: all 0.2s ease-in-out;\n transition: all 0.2s ease-in-out;\n display: inline-block;\n max-width: 100%;\n height: auto;\n}\n.img-circle {\n border-radius: 50%;\n}\nhr {\n margin-top: 20px;\n margin-bottom: 20px;\n border: 0;\n border-top: 1px solid #eeeeee;\n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n}\n.sr-only-focusable:active,\n.sr-only-focusable:focus {\n position: static;\n width: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n clip: auto;\n}\n[role=\"button\"] {\n cursor: pointer;\n}\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n font-family: inherit;\n font-weight: 500;\n line-height: 1.1;\n color: inherit;\n}\nh1 small,\nh2 small,\nh3 small,\nh4 small,\nh5 small,\nh6 small,\n.h1 small,\n.h2 small,\n.h3 small,\n.h4 small,\n.h5 small,\n.h6 small,\nh1 .small,\nh2 .small,\nh3 .small,\nh4 .small,\nh5 .small,\nh6 .small,\n.h1 .small,\n.h2 .small,\n.h3 .small,\n.h4 .small,\n.h5 .small,\n.h6 .small {\n font-weight: normal;\n line-height: 1;\n color: #777777;\n}\nh1,\n.h1,\nh2,\n.h2,\nh3,\n.h3 {\n margin-top: 20px;\n margin-bottom: 10px;\n}\nh1 small,\n.h1 small,\nh2 small,\n.h2 small,\nh3 small,\n.h3 small,\nh1 .small,\n.h1 .small,\nh2 .small,\n.h2 .small,\nh3 .small,\n.h3 .small {\n font-size: 65%;\n}\nh4,\n.h4,\nh5,\n.h5,\nh6,\n.h6 {\n margin-top: 10px;\n margin-bottom: 10px;\n}\nh4 small,\n.h4 small,\nh5 small,\n.h5 small,\nh6 small,\n.h6 small,\nh4 .small,\n.h4 .small,\nh5 .small,\n.h5 .small,\nh6 .small,\n.h6 .small {\n font-size: 75%;\n}\nh1,\n.h1 {\n font-size: 36px;\n}\nh2,\n.h2 {\n font-size: 30px;\n}\nh3,\n.h3 {\n font-size: 24px;\n}\nh4,\n.h4 {\n font-size: 18px;\n}\nh5,\n.h5 {\n font-size: 14px;\n}\nh6,\n.h6 {\n font-size: 12px;\n}\np {\n margin: 0 0 10px;\n}\n.lead {\n margin-bottom: 20px;\n font-size: 16px;\n font-weight: 300;\n line-height: 1.4;\n}\n@media (min-width: 768px) {\n .lead {\n font-size: 21px;\n }\n}\nsmall,\n.small {\n font-size: 85%;\n}\nmark,\n.mark {\n background-color: #fcf8e3;\n padding: .2em;\n}\n.text-left {\n text-align: left;\n}\n.text-right {\n text-align: right;\n}\n.text-center {\n text-align: center;\n}\n.text-justify {\n text-align: justify;\n}\n.text-nowrap {\n white-space: nowrap;\n}\n.text-lowercase {\n text-transform: lowercase;\n}\n.text-uppercase {\n text-transform: uppercase;\n}\n.text-capitalize {\n text-transform: capitalize;\n}\n.text-muted {\n color: #777777;\n}\n.text-primary {\n color: #337ab7;\n}\na.text-primary:hover,\na.text-primary:focus {\n color: #286090;\n}\n.text-success {\n color: #3c763d;\n}\na.text-success:hover,\na.text-success:focus {\n color: #2b542c;\n}\n.text-info {\n color: #31708f;\n}\na.text-info:hover,\na.text-info:focus {\n color: #245269;\n}\n.text-warning {\n color: #8a6d3b;\n}\na.text-warning:hover,\na.text-warning:focus {\n color: #66512c;\n}\n.text-danger {\n color: #a94442;\n}\na.text-danger:hover,\na.text-danger:focus {\n color: #843534;\n}\n.bg-primary {\n color: #fff;\n background-color: #337ab7;\n}\na.bg-primary:hover,\na.bg-primary:focus {\n background-color: #286090;\n}\n.bg-success {\n background-color: #dff0d8;\n}\na.bg-success:hover,\na.bg-success:focus {\n background-color: #c1e2b3;\n}\n.bg-info {\n background-color: #d9edf7;\n}\na.bg-info:hover,\na.bg-info:focus {\n background-color: #afd9ee;\n}\n.bg-warning {\n background-color: #fcf8e3;\n}\na.bg-warning:hover,\na.bg-warning:focus {\n background-color: #f7ecb5;\n}\n.bg-danger {\n background-color: #f2dede;\n}\na.bg-danger:hover,\na.bg-danger:focus {\n background-color: #e4b9b9;\n}\n.page-header {\n padding-bottom: 9px;\n margin: 40px 0 20px;\n border-bottom: 1px solid #eeeeee;\n}\nul,\nol {\n margin-top: 0;\n margin-bottom: 10px;\n}\nul ul,\nol ul,\nul ol,\nol ol {\n margin-bottom: 0;\n}\n.list-unstyled {\n padding-left: 0;\n list-style: none;\n}\n.list-inline {\n padding-left: 0;\n list-style: none;\n margin-left: -5px;\n}\n.list-inline > li {\n display: inline-block;\n padding-left: 5px;\n padding-right: 5px;\n}\ndl {\n margin-top: 0;\n margin-bottom: 20px;\n}\ndt,\ndd {\n line-height: 1.42857143;\n}\ndt {\n font-weight: bold;\n}\ndd {\n margin-left: 0;\n}\n@media (min-width: 768px) {\n .dl-horizontal dt {\n float: left;\n width: 160px;\n clear: left;\n text-align: right;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .dl-horizontal dd {\n margin-left: 180px;\n }\n}\nabbr[title],\nabbr[data-original-title] {\n cursor: help;\n border-bottom: 1px dotted #777777;\n}\n.initialism {\n font-size: 90%;\n text-transform: uppercase;\n}\nblockquote {\n padding: 10px 20px;\n margin: 0 0 20px;\n font-size: 17.5px;\n border-left: 5px solid #eeeeee;\n}\nblockquote p:last-child,\nblockquote ul:last-child,\nblockquote ol:last-child {\n margin-bottom: 0;\n}\nblockquote footer,\nblockquote small,\nblockquote .small {\n display: block;\n font-size: 80%;\n line-height: 1.42857143;\n color: #777777;\n}\nblockquote footer:before,\nblockquote small:before,\nblockquote .small:before {\n content: '\\2014 \\00A0';\n}\n.blockquote-reverse,\nblockquote.pull-right {\n padding-right: 15px;\n padding-left: 0;\n border-right: 5px solid #eeeeee;\n border-left: 0;\n text-align: right;\n}\n.blockquote-reverse footer:before,\nblockquote.pull-right footer:before,\n.blockquote-reverse small:before,\nblockquote.pull-right small:before,\n.blockquote-reverse .small:before,\nblockquote.pull-right .small:before {\n content: '';\n}\n.blockquote-reverse footer:after,\nblockquote.pull-right footer:after,\n.blockquote-reverse small:after,\nblockquote.pull-right small:after,\n.blockquote-reverse .small:after,\nblockquote.pull-right .small:after {\n content: '\\00A0 \\2014';\n}\naddress {\n margin-bottom: 20px;\n font-style: normal;\n line-height: 1.42857143;\n}\ncode,\nkbd,\npre,\nsamp {\n font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\ncode {\n padding: 2px 4px;\n font-size: 90%;\n color: #c7254e;\n background-color: #f9f2f4;\n border-radius: 4px;\n}\nkbd {\n padding: 2px 4px;\n font-size: 90%;\n color: #fff;\n background-color: #333;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\nkbd kbd {\n padding: 0;\n font-size: 100%;\n font-weight: bold;\n box-shadow: none;\n}\npre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333333;\n background-color: #f5f5f5;\n border: 1px solid #ccc;\n border-radius: 4px;\n}\npre code {\n padding: 0;\n font-size: inherit;\n color: inherit;\n white-space: pre-wrap;\n background-color: transparent;\n border-radius: 0;\n}\n.pre-scrollable {\n max-height: 340px;\n overflow-y: scroll;\n}\n.container {\n margin-right: auto;\n margin-left: auto;\n padding-left: 15px;\n padding-right: 15px;\n}\n@media (min-width: 768px) {\n .container {\n width: 750px;\n }\n}\n@media (min-width: 992px) {\n .container {\n width: 970px;\n }\n}\n@media (min-width: 1200px) {\n .container {\n width: 1170px;\n }\n}\n.container-fluid {\n margin-right: auto;\n margin-left: auto;\n padding-left: 15px;\n padding-right: 15px;\n}\n.row {\n margin-left: -15px;\n margin-right: -15px;\n}\n.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {\n position: relative;\n min-height: 1px;\n padding-left: 15px;\n padding-right: 15px;\n}\n.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {\n float: left;\n}\n.col-xs-12 {\n width: 100%;\n}\n.col-xs-11 {\n width: 91.66666667%;\n}\n.col-xs-10 {\n width: 83.33333333%;\n}\n.col-xs-9 {\n width: 75%;\n}\n.col-xs-8 {\n width: 66.66666667%;\n}\n.col-xs-7 {\n width: 58.33333333%;\n}\n.col-xs-6 {\n width: 50%;\n}\n.col-xs-5 {\n width: 41.66666667%;\n}\n.col-xs-4 {\n width: 33.33333333%;\n}\n.col-xs-3 {\n width: 25%;\n}\n.col-xs-2 {\n width: 16.66666667%;\n}\n.col-xs-1 {\n width: 8.33333333%;\n}\n.col-xs-pull-12 {\n right: 100%;\n}\n.col-xs-pull-11 {\n right: 91.66666667%;\n}\n.col-xs-pull-10 {\n right: 83.33333333%;\n}\n.col-xs-pull-9 {\n right: 75%;\n}\n.col-xs-pull-8 {\n right: 66.66666667%;\n}\n.col-xs-pull-7 {\n right: 58.33333333%;\n}\n.col-xs-pull-6 {\n right: 50%;\n}\n.col-xs-pull-5 {\n right: 41.66666667%;\n}\n.col-xs-pull-4 {\n right: 33.33333333%;\n}\n.col-xs-pull-3 {\n right: 25%;\n}\n.col-xs-pull-2 {\n right: 16.66666667%;\n}\n.col-xs-pull-1 {\n right: 8.33333333%;\n}\n.col-xs-pull-0 {\n right: auto;\n}\n.col-xs-push-12 {\n left: 100%;\n}\n.col-xs-push-11 {\n left: 91.66666667%;\n}\n.col-xs-push-10 {\n left: 83.33333333%;\n}\n.col-xs-push-9 {\n left: 75%;\n}\n.col-xs-push-8 {\n left: 66.66666667%;\n}\n.col-xs-push-7 {\n left: 58.33333333%;\n}\n.col-xs-push-6 {\n left: 50%;\n}\n.col-xs-push-5 {\n left: 41.66666667%;\n}\n.col-xs-push-4 {\n left: 33.33333333%;\n}\n.col-xs-push-3 {\n left: 25%;\n}\n.col-xs-push-2 {\n left: 16.66666667%;\n}\n.col-xs-push-1 {\n left: 8.33333333%;\n}\n.col-xs-push-0 {\n left: auto;\n}\n.col-xs-offset-12 {\n margin-left: 100%;\n}\n.col-xs-offset-11 {\n margin-left: 91.66666667%;\n}\n.col-xs-offset-10 {\n margin-left: 83.33333333%;\n}\n.col-xs-offset-9 {\n margin-left: 75%;\n}\n.col-xs-offset-8 {\n margin-left: 66.66666667%;\n}\n.col-xs-offset-7 {\n margin-left: 58.33333333%;\n}\n.col-xs-offset-6 {\n margin-left: 50%;\n}\n.col-xs-offset-5 {\n margin-left: 41.66666667%;\n}\n.col-xs-offset-4 {\n margin-left: 33.33333333%;\n}\n.col-xs-offset-3 {\n margin-left: 25%;\n}\n.col-xs-offset-2 {\n margin-left: 16.66666667%;\n}\n.col-xs-offset-1 {\n margin-left: 8.33333333%;\n}\n.col-xs-offset-0 {\n margin-left: 0%;\n}\n@media (min-width: 768px) {\n .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {\n float: left;\n }\n .col-sm-12 {\n width: 100%;\n }\n .col-sm-11 {\n width: 91.66666667%;\n }\n .col-sm-10 {\n width: 83.33333333%;\n }\n .col-sm-9 {\n width: 75%;\n }\n .col-sm-8 {\n width: 66.66666667%;\n }\n .col-sm-7 {\n width: 58.33333333%;\n }\n .col-sm-6 {\n width: 50%;\n }\n .col-sm-5 {\n width: 41.66666667%;\n }\n .col-sm-4 {\n width: 33.33333333%;\n }\n .col-sm-3 {\n width: 25%;\n }\n .col-sm-2 {\n width: 16.66666667%;\n }\n .col-sm-1 {\n width: 8.33333333%;\n }\n .col-sm-pull-12 {\n right: 100%;\n }\n .col-sm-pull-11 {\n right: 91.66666667%;\n }\n .col-sm-pull-10 {\n right: 83.33333333%;\n }\n .col-sm-pull-9 {\n right: 75%;\n }\n .col-sm-pull-8 {\n right: 66.66666667%;\n }\n .col-sm-pull-7 {\n right: 58.33333333%;\n }\n .col-sm-pull-6 {\n right: 50%;\n }\n .col-sm-pull-5 {\n right: 41.66666667%;\n }\n .col-sm-pull-4 {\n right: 33.33333333%;\n }\n .col-sm-pull-3 {\n right: 25%;\n }\n .col-sm-pull-2 {\n right: 16.66666667%;\n }\n .col-sm-pull-1 {\n right: 8.33333333%;\n }\n .col-sm-pull-0 {\n right: auto;\n }\n .col-sm-push-12 {\n left: 100%;\n }\n .col-sm-push-11 {\n left: 91.66666667%;\n }\n .col-sm-push-10 {\n left: 83.33333333%;\n }\n .col-sm-push-9 {\n left: 75%;\n }\n .col-sm-push-8 {\n left: 66.66666667%;\n }\n .col-sm-push-7 {\n left: 58.33333333%;\n }\n .col-sm-push-6 {\n left: 50%;\n }\n .col-sm-push-5 {\n left: 41.66666667%;\n }\n .col-sm-push-4 {\n left: 33.33333333%;\n }\n .col-sm-push-3 {\n left: 25%;\n }\n .col-sm-push-2 {\n left: 16.66666667%;\n }\n .col-sm-push-1 {\n left: 8.33333333%;\n }\n .col-sm-push-0 {\n left: auto;\n }\n .col-sm-offset-12 {\n margin-left: 100%;\n }\n .col-sm-offset-11 {\n margin-left: 91.66666667%;\n }\n .col-sm-offset-10 {\n margin-left: 83.33333333%;\n }\n .col-sm-offset-9 {\n margin-left: 75%;\n }\n .col-sm-offset-8 {\n margin-left: 66.66666667%;\n }\n .col-sm-offset-7 {\n margin-left: 58.33333333%;\n }\n .col-sm-offset-6 {\n margin-left: 50%;\n }\n .col-sm-offset-5 {\n margin-left: 41.66666667%;\n }\n .col-sm-offset-4 {\n margin-left: 33.33333333%;\n }\n .col-sm-offset-3 {\n margin-left: 25%;\n }\n .col-sm-offset-2 {\n margin-left: 16.66666667%;\n }\n .col-sm-offset-1 {\n margin-left: 8.33333333%;\n }\n .col-sm-offset-0 {\n margin-left: 0%;\n }\n}\n@media (min-width: 992px) {\n .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {\n float: left;\n }\n .col-md-12 {\n width: 100%;\n }\n .col-md-11 {\n width: 91.66666667%;\n }\n .col-md-10 {\n width: 83.33333333%;\n }\n .col-md-9 {\n width: 75%;\n }\n .col-md-8 {\n width: 66.66666667%;\n }\n .col-md-7 {\n width: 58.33333333%;\n }\n .col-md-6 {\n width: 50%;\n }\n .col-md-5 {\n width: 41.66666667%;\n }\n .col-md-4 {\n width: 33.33333333%;\n }\n .col-md-3 {\n width: 25%;\n }\n .col-md-2 {\n width: 16.66666667%;\n }\n .col-md-1 {\n width: 8.33333333%;\n }\n .col-md-pull-12 {\n right: 100%;\n }\n .col-md-pull-11 {\n right: 91.66666667%;\n }\n .col-md-pull-10 {\n right: 83.33333333%;\n }\n .col-md-pull-9 {\n right: 75%;\n }\n .col-md-pull-8 {\n right: 66.66666667%;\n }\n .col-md-pull-7 {\n right: 58.33333333%;\n }\n .col-md-pull-6 {\n right: 50%;\n }\n .col-md-pull-5 {\n right: 41.66666667%;\n }\n .col-md-pull-4 {\n right: 33.33333333%;\n }\n .col-md-pull-3 {\n right: 25%;\n }\n .col-md-pull-2 {\n right: 16.66666667%;\n }\n .col-md-pull-1 {\n right: 8.33333333%;\n }\n .col-md-pull-0 {\n right: auto;\n }\n .col-md-push-12 {\n left: 100%;\n }\n .col-md-push-11 {\n left: 91.66666667%;\n }\n .col-md-push-10 {\n left: 83.33333333%;\n }\n .col-md-push-9 {\n left: 75%;\n }\n .col-md-push-8 {\n left: 66.66666667%;\n }\n .col-md-push-7 {\n left: 58.33333333%;\n }\n .col-md-push-6 {\n left: 50%;\n }\n .col-md-push-5 {\n left: 41.66666667%;\n }\n .col-md-push-4 {\n left: 33.33333333%;\n }\n .col-md-push-3 {\n left: 25%;\n }\n .col-md-push-2 {\n left: 16.66666667%;\n }\n .col-md-push-1 {\n left: 8.33333333%;\n }\n .col-md-push-0 {\n left: auto;\n }\n .col-md-offset-12 {\n margin-left: 100%;\n }\n .col-md-offset-11 {\n margin-left: 91.66666667%;\n }\n .col-md-offset-10 {\n margin-left: 83.33333333%;\n }\n .col-md-offset-9 {\n margin-left: 75%;\n }\n .col-md-offset-8 {\n margin-left: 66.66666667%;\n }\n .col-md-offset-7 {\n margin-left: 58.33333333%;\n }\n .col-md-offset-6 {\n margin-left: 50%;\n }\n .col-md-offset-5 {\n margin-left: 41.66666667%;\n }\n .col-md-offset-4 {\n margin-left: 33.33333333%;\n }\n .col-md-offset-3 {\n margin-left: 25%;\n }\n .col-md-offset-2 {\n margin-left: 16.66666667%;\n }\n .col-md-offset-1 {\n margin-left: 8.33333333%;\n }\n .col-md-offset-0 {\n margin-left: 0%;\n }\n}\n@media (min-width: 1200px) {\n .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {\n float: left;\n }\n .col-lg-12 {\n width: 100%;\n }\n .col-lg-11 {\n width: 91.66666667%;\n }\n .col-lg-10 {\n width: 83.33333333%;\n }\n .col-lg-9 {\n width: 75%;\n }\n .col-lg-8 {\n width: 66.66666667%;\n }\n .col-lg-7 {\n width: 58.33333333%;\n }\n .col-lg-6 {\n width: 50%;\n }\n .col-lg-5 {\n width: 41.66666667%;\n }\n .col-lg-4 {\n width: 33.33333333%;\n }\n .col-lg-3 {\n width: 25%;\n }\n .col-lg-2 {\n width: 16.66666667%;\n }\n .col-lg-1 {\n width: 8.33333333%;\n }\n .col-lg-pull-12 {\n right: 100%;\n }\n .col-lg-pull-11 {\n right: 91.66666667%;\n }\n .col-lg-pull-10 {\n right: 83.33333333%;\n }\n .col-lg-pull-9 {\n right: 75%;\n }\n .col-lg-pull-8 {\n right: 66.66666667%;\n }\n .col-lg-pull-7 {\n right: 58.33333333%;\n }\n .col-lg-pull-6 {\n right: 50%;\n }\n .col-lg-pull-5 {\n right: 41.66666667%;\n }\n .col-lg-pull-4 {\n right: 33.33333333%;\n }\n .col-lg-pull-3 {\n right: 25%;\n }\n .col-lg-pull-2 {\n right: 16.66666667%;\n }\n .col-lg-pull-1 {\n right: 8.33333333%;\n }\n .col-lg-pull-0 {\n right: auto;\n }\n .col-lg-push-12 {\n left: 100%;\n }\n .col-lg-push-11 {\n left: 91.66666667%;\n }\n .col-lg-push-10 {\n left: 83.33333333%;\n }\n .col-lg-push-9 {\n left: 75%;\n }\n .col-lg-push-8 {\n left: 66.66666667%;\n }\n .col-lg-push-7 {\n left: 58.33333333%;\n }\n .col-lg-push-6 {\n left: 50%;\n }\n .col-lg-push-5 {\n left: 41.66666667%;\n }\n .col-lg-push-4 {\n left: 33.33333333%;\n }\n .col-lg-push-3 {\n left: 25%;\n }\n .col-lg-push-2 {\n left: 16.66666667%;\n }\n .col-lg-push-1 {\n left: 8.33333333%;\n }\n .col-lg-push-0 {\n left: auto;\n }\n .col-lg-offset-12 {\n margin-left: 100%;\n }\n .col-lg-offset-11 {\n margin-left: 91.66666667%;\n }\n .col-lg-offset-10 {\n margin-left: 83.33333333%;\n }\n .col-lg-offset-9 {\n margin-left: 75%;\n }\n .col-lg-offset-8 {\n margin-left: 66.66666667%;\n }\n .col-lg-offset-7 {\n margin-left: 58.33333333%;\n }\n .col-lg-offset-6 {\n margin-left: 50%;\n }\n .col-lg-offset-5 {\n margin-left: 41.66666667%;\n }\n .col-lg-offset-4 {\n margin-left: 33.33333333%;\n }\n .col-lg-offset-3 {\n margin-left: 25%;\n }\n .col-lg-offset-2 {\n margin-left: 16.66666667%;\n }\n .col-lg-offset-1 {\n margin-left: 8.33333333%;\n }\n .col-lg-offset-0 {\n margin-left: 0%;\n }\n}\ntable {\n background-color: transparent;\n}\ncaption {\n padding-top: 8px;\n padding-bottom: 8px;\n color: #777777;\n text-align: left;\n}\nth {\n text-align: left;\n}\n.table {\n width: 100%;\n max-width: 100%;\n margin-bottom: 20px;\n}\n.table > thead > tr > th,\n.table > tbody > tr > th,\n.table > tfoot > tr > th,\n.table > thead > tr > td,\n.table > tbody > tr > td,\n.table > tfoot > tr > td {\n padding: 8px;\n line-height: 1.42857143;\n vertical-align: top;\n border-top: 1px solid #ddd;\n}\n.table > thead > tr > th {\n vertical-align: bottom;\n border-bottom: 2px solid #ddd;\n}\n.table > caption + thead > tr:first-child > th,\n.table > colgroup + thead > tr:first-child > th,\n.table > thead:first-child > tr:first-child > th,\n.table > caption + thead > tr:first-child > td,\n.table > colgroup + thead > tr:first-child > td,\n.table > thead:first-child > tr:first-child > td {\n border-top: 0;\n}\n.table > tbody + tbody {\n border-top: 2px solid #ddd;\n}\n.table .table {\n background-color: #fff;\n}\n.table-condensed > thead > tr > th,\n.table-condensed > tbody > tr > th,\n.table-condensed > tfoot > tr > th,\n.table-condensed > thead > tr > td,\n.table-condensed > tbody > tr > td,\n.table-condensed > tfoot > tr > td {\n padding: 5px;\n}\n.table-bordered {\n border: 1px solid #ddd;\n}\n.table-bordered > thead > tr > th,\n.table-bordered > tbody > tr > th,\n.table-bordered > tfoot > tr > th,\n.table-bordered > thead > tr > td,\n.table-bordered > tbody > tr > td,\n.table-bordered > tfoot > tr > td {\n border: 1px solid #ddd;\n}\n.table-bordered > thead > tr > th,\n.table-bordered > thead > tr > td {\n border-bottom-width: 2px;\n}\n.table-striped > tbody > tr:nth-of-type(odd) {\n background-color: #f9f9f9;\n}\n.table-hover > tbody > tr:hover {\n background-color: #f5f5f5;\n}\ntable col[class*=\"col-\"] {\n position: static;\n float: none;\n display: table-column;\n}\ntable td[class*=\"col-\"],\ntable th[class*=\"col-\"] {\n position: static;\n float: none;\n display: table-cell;\n}\n.table > thead > tr > td.active,\n.table > tbody > tr > td.active,\n.table > tfoot > tr > td.active,\n.table > thead > tr > th.active,\n.table > tbody > tr > th.active,\n.table > tfoot > tr > th.active,\n.table > thead > tr.active > td,\n.table > tbody > tr.active > td,\n.table > tfoot > tr.active > td,\n.table > thead > tr.active > th,\n.table > tbody > tr.active > th,\n.table > tfoot > tr.active > th {\n background-color: #f5f5f5;\n}\n.table-hover > tbody > tr > td.active:hover,\n.table-hover > tbody > tr > th.active:hover,\n.table-hover > tbody > tr.active:hover > td,\n.table-hover > tbody > tr:hover > .active,\n.table-hover > tbody > tr.active:hover > th {\n background-color: #e8e8e8;\n}\n.table > thead > tr > td.success,\n.table > tbody > tr > td.success,\n.table > tfoot > tr > td.success,\n.table > thead > tr > th.success,\n.table > tbody > tr > th.success,\n.table > tfoot > tr > th.success,\n.table > thead > tr.success > td,\n.table > tbody > tr.success > td,\n.table > tfoot > tr.success > td,\n.table > thead > tr.success > th,\n.table > tbody > tr.success > th,\n.table > tfoot > tr.success > th {\n background-color: #dff0d8;\n}\n.table-hover > tbody > tr > td.success:hover,\n.table-hover > tbody > tr > th.success:hover,\n.table-hover > tbody > tr.success:hover > td,\n.table-hover > tbody > tr:hover > .success,\n.table-hover > tbody > tr.success:hover > th {\n background-color: #d0e9c6;\n}\n.table > thead > tr > td.info,\n.table > tbody > tr > td.info,\n.table > tfoot > tr > td.info,\n.table > thead > tr > th.info,\n.table > tbody > tr > th.info,\n.table > tfoot > tr > th.info,\n.table > thead > tr.info > td,\n.table > tbody > tr.info > td,\n.table > tfoot > tr.info > td,\n.table > thead > tr.info > th,\n.table > tbody > tr.info > th,\n.table > tfoot > tr.info > th {\n background-color: #d9edf7;\n}\n.table-hover > tbody > tr > td.info:hover,\n.table-hover > tbody > tr > th.info:hover,\n.table-hover > tbody > tr.info:hover > td,\n.table-hover > tbody > tr:hover > .info,\n.table-hover > tbody > tr.info:hover > th {\n background-color: #c4e3f3;\n}\n.table > thead > tr > td.warning,\n.table > tbody > tr > td.warning,\n.table > tfoot > tr > td.warning,\n.table > thead > tr > th.warning,\n.table > tbody > tr > th.warning,\n.table > tfoot > tr > th.warning,\n.table > thead > tr.warning > td,\n.table > tbody > tr.warning > td,\n.table > tfoot > tr.warning > td,\n.table > thead > tr.warning > th,\n.table > tbody > tr.warning > th,\n.table > tfoot > tr.warning > th {\n background-color: #fcf8e3;\n}\n.table-hover > tbody > tr > td.warning:hover,\n.table-hover > tbody > tr > th.warning:hover,\n.table-hover > tbody > tr.warning:hover > td,\n.table-hover > tbody > tr:hover > .warning,\n.table-hover > tbody > tr.warning:hover > th {\n background-color: #faf2cc;\n}\n.table > thead > tr > td.danger,\n.table > tbody > tr > td.danger,\n.table > tfoot > tr > td.danger,\n.table > thead > tr > th.danger,\n.table > tbody > tr > th.danger,\n.table > tfoot > tr > th.danger,\n.table > thead > tr.danger > td,\n.table > tbody > tr.danger > td,\n.table > tfoot > tr.danger > td,\n.table > thead > tr.danger > th,\n.table > tbody > tr.danger > th,\n.table > tfoot > tr.danger > th {\n background-color: #f2dede;\n}\n.table-hover > tbody > tr > td.danger:hover,\n.table-hover > tbody > tr > th.danger:hover,\n.table-hover > tbody > tr.danger:hover > td,\n.table-hover > tbody > tr:hover > .danger,\n.table-hover > tbody > tr.danger:hover > th {\n background-color: #ebcccc;\n}\n.table-responsive {\n overflow-x: auto;\n min-height: 0.01%;\n}\n@media screen and (max-width: 767px) {\n .table-responsive {\n width: 100%;\n margin-bottom: 15px;\n overflow-y: hidden;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n border: 1px solid #ddd;\n }\n .table-responsive > .table {\n margin-bottom: 0;\n }\n .table-responsive > .table > thead > tr > th,\n .table-responsive > .table > tbody > tr > th,\n .table-responsive > .table > tfoot > tr > th,\n .table-responsive > .table > thead > tr > td,\n .table-responsive > .table > tbody > tr > td,\n .table-responsive > .table > tfoot > tr > td {\n white-space: nowrap;\n }\n .table-responsive > .table-bordered {\n border: 0;\n }\n .table-responsive > .table-bordered > thead > tr > th:first-child,\n .table-responsive > .table-bordered > tbody > tr > th:first-child,\n .table-responsive > .table-bordered > tfoot > tr > th:first-child,\n .table-responsive > .table-bordered > thead > tr > td:first-child,\n .table-responsive > .table-bordered > tbody > tr > td:first-child,\n .table-responsive > .table-bordered > tfoot > tr > td:first-child {\n border-left: 0;\n }\n .table-responsive > .table-bordered > thead > tr > th:last-child,\n .table-responsive > .table-bordered > tbody > tr > th:last-child,\n .table-responsive > .table-bordered > tfoot > tr > th:last-child,\n .table-responsive > .table-bordered > thead > tr > td:last-child,\n .table-responsive > .table-bordered > tbody > tr > td:last-child,\n .table-responsive > .table-bordered > tfoot > tr > td:last-child {\n border-right: 0;\n }\n .table-responsive > .table-bordered > tbody > tr:last-child > th,\n .table-responsive > .table-bordered > tfoot > tr:last-child > th,\n .table-responsive > .table-bordered > tbody > tr:last-child > td,\n .table-responsive > .table-bordered > tfoot > tr:last-child > td {\n border-bottom: 0;\n }\n}\nfieldset {\n padding: 0;\n margin: 0;\n border: 0;\n min-width: 0;\n}\nlegend {\n display: block;\n width: 100%;\n padding: 0;\n margin-bottom: 20px;\n font-size: 21px;\n line-height: inherit;\n color: #333333;\n border: 0;\n border-bottom: 1px solid #e5e5e5;\n}\nlabel {\n display: inline-block;\n max-width: 100%;\n margin-bottom: 5px;\n font-weight: bold;\n}\ninput[type=\"search\"] {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n margin: 4px 0 0;\n margin-top: 1px \\9;\n line-height: normal;\n}\ninput[type=\"file\"] {\n display: block;\n}\ninput[type=\"range\"] {\n display: block;\n width: 100%;\n}\nselect[multiple],\nselect[size] {\n height: auto;\n}\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\noutput {\n display: block;\n padding-top: 7px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555555;\n}\n.form-control {\n display: block;\n width: 100%;\n height: 34px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555555;\n background-color: #fff;\n background-image: none;\n border: 1px solid #ccc;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n}\n.form-control:focus {\n border-color: #66afe9;\n outline: 0;\n -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);\n box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);\n}\n.form-control::-moz-placeholder {\n color: #999;\n opacity: 1;\n}\n.form-control:-ms-input-placeholder {\n color: #999;\n}\n.form-control::-webkit-input-placeholder {\n color: #999;\n}\n.form-control::-ms-expand {\n border: 0;\n background-color: transparent;\n}\n.form-control[disabled],\n.form-control[readonly],\nfieldset[disabled] .form-control {\n background-color: #eeeeee;\n opacity: 1;\n}\n.form-control[disabled],\nfieldset[disabled] .form-control {\n cursor: not-allowed;\n}\ntextarea.form-control {\n height: auto;\n}\ninput[type=\"search\"] {\n -webkit-appearance: none;\n}\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n input[type=\"date\"].form-control,\n input[type=\"time\"].form-control,\n input[type=\"datetime-local\"].form-control,\n input[type=\"month\"].form-control {\n line-height: 34px;\n }\n input[type=\"date\"].input-sm,\n input[type=\"time\"].input-sm,\n input[type=\"datetime-local\"].input-sm,\n input[type=\"month\"].input-sm,\n .input-group-sm input[type=\"date\"],\n .input-group-sm input[type=\"time\"],\n .input-group-sm input[type=\"datetime-local\"],\n .input-group-sm input[type=\"month\"] {\n line-height: 30px;\n }\n input[type=\"date\"].input-lg,\n input[type=\"time\"].input-lg,\n input[type=\"datetime-local\"].input-lg,\n input[type=\"month\"].input-lg,\n .input-group-lg input[type=\"date\"],\n .input-group-lg input[type=\"time\"],\n .input-group-lg input[type=\"datetime-local\"],\n .input-group-lg input[type=\"month\"] {\n line-height: 46px;\n }\n}\n.form-group {\n margin-bottom: 15px;\n}\n.radio,\n.checkbox {\n position: relative;\n display: block;\n margin-top: 10px;\n margin-bottom: 10px;\n}\n.radio label,\n.checkbox label {\n min-height: 20px;\n padding-left: 20px;\n margin-bottom: 0;\n font-weight: normal;\n cursor: pointer;\n}\n.radio input[type=\"radio\"],\n.radio-inline input[type=\"radio\"],\n.checkbox input[type=\"checkbox\"],\n.checkbox-inline input[type=\"checkbox\"] {\n position: absolute;\n margin-left: -20px;\n margin-top: 4px \\9;\n}\n.radio + .radio,\n.checkbox + .checkbox {\n margin-top: -5px;\n}\n.radio-inline,\n.checkbox-inline {\n position: relative;\n display: inline-block;\n padding-left: 20px;\n margin-bottom: 0;\n vertical-align: middle;\n font-weight: normal;\n cursor: pointer;\n}\n.radio-inline + .radio-inline,\n.checkbox-inline + .checkbox-inline {\n margin-top: 0;\n margin-left: 10px;\n}\ninput[type=\"radio\"][disabled],\ninput[type=\"checkbox\"][disabled],\ninput[type=\"radio\"].disabled,\ninput[type=\"checkbox\"].disabled,\nfieldset[disabled] input[type=\"radio\"],\nfieldset[disabled] input[type=\"checkbox\"] {\n cursor: not-allowed;\n}\n.radio-inline.disabled,\n.checkbox-inline.disabled,\nfieldset[disabled] .radio-inline,\nfieldset[disabled] .checkbox-inline {\n cursor: not-allowed;\n}\n.radio.disabled label,\n.checkbox.disabled label,\nfieldset[disabled] .radio label,\nfieldset[disabled] .checkbox label {\n cursor: not-allowed;\n}\n.form-control-static {\n padding-top: 7px;\n padding-bottom: 7px;\n margin-bottom: 0;\n min-height: 34px;\n}\n.form-control-static.input-lg,\n.form-control-static.input-sm {\n padding-left: 0;\n padding-right: 0;\n}\n.input-sm {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\nselect.input-sm {\n height: 30px;\n line-height: 30px;\n}\ntextarea.input-sm,\nselect[multiple].input-sm {\n height: auto;\n}\n.form-group-sm .form-control {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\n.form-group-sm select.form-control {\n height: 30px;\n line-height: 30px;\n}\n.form-group-sm textarea.form-control,\n.form-group-sm select[multiple].form-control {\n height: auto;\n}\n.form-group-sm .form-control-static {\n height: 30px;\n min-height: 32px;\n padding: 6px 10px;\n font-size: 12px;\n line-height: 1.5;\n}\n.input-lg {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\nselect.input-lg {\n height: 46px;\n line-height: 46px;\n}\ntextarea.input-lg,\nselect[multiple].input-lg {\n height: auto;\n}\n.form-group-lg .form-control {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\n.form-group-lg select.form-control {\n height: 46px;\n line-height: 46px;\n}\n.form-group-lg textarea.form-control,\n.form-group-lg select[multiple].form-control {\n height: auto;\n}\n.form-group-lg .form-control-static {\n height: 46px;\n min-height: 38px;\n padding: 11px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n}\n.has-feedback {\n position: relative;\n}\n.has-feedback .form-control {\n padding-right: 42.5px;\n}\n.form-control-feedback {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 2;\n display: block;\n width: 34px;\n height: 34px;\n line-height: 34px;\n text-align: center;\n pointer-events: none;\n}\n.input-lg + .form-control-feedback,\n.input-group-lg + .form-control-feedback,\n.form-group-lg .form-control + .form-control-feedback {\n width: 46px;\n height: 46px;\n line-height: 46px;\n}\n.input-sm + .form-control-feedback,\n.input-group-sm + .form-control-feedback,\n.form-group-sm .form-control + .form-control-feedback {\n width: 30px;\n height: 30px;\n line-height: 30px;\n}\n.has-success .help-block,\n.has-success .control-label,\n.has-success .radio,\n.has-success .checkbox,\n.has-success .radio-inline,\n.has-success .checkbox-inline,\n.has-success.radio label,\n.has-success.checkbox label,\n.has-success.radio-inline label,\n.has-success.checkbox-inline label {\n color: #3c763d;\n}\n.has-success .form-control {\n border-color: #3c763d;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-success .form-control:focus {\n border-color: #2b542c;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;\n}\n.has-success .input-group-addon {\n color: #3c763d;\n border-color: #3c763d;\n background-color: #dff0d8;\n}\n.has-success .form-control-feedback {\n color: #3c763d;\n}\n.has-warning .help-block,\n.has-warning .control-label,\n.has-warning .radio,\n.has-warning .checkbox,\n.has-warning .radio-inline,\n.has-warning .checkbox-inline,\n.has-warning.radio label,\n.has-warning.checkbox label,\n.has-warning.radio-inline label,\n.has-warning.checkbox-inline label {\n color: #8a6d3b;\n}\n.has-warning .form-control {\n border-color: #8a6d3b;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-warning .form-control:focus {\n border-color: #66512c;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;\n}\n.has-warning .input-group-addon {\n color: #8a6d3b;\n border-color: #8a6d3b;\n background-color: #fcf8e3;\n}\n.has-warning .form-control-feedback {\n color: #8a6d3b;\n}\n.has-error .help-block,\n.has-error .control-label,\n.has-error .radio,\n.has-error .checkbox,\n.has-error .radio-inline,\n.has-error .checkbox-inline,\n.has-error.radio label,\n.has-error.checkbox label,\n.has-error.radio-inline label,\n.has-error.checkbox-inline label {\n color: #a94442;\n}\n.has-error .form-control {\n border-color: #a94442;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-error .form-control:focus {\n border-color: #843534;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;\n}\n.has-error .input-group-addon {\n color: #a94442;\n border-color: #a94442;\n background-color: #f2dede;\n}\n.has-error .form-control-feedback {\n color: #a94442;\n}\n.has-feedback label ~ .form-control-feedback {\n top: 25px;\n}\n.has-feedback label.sr-only ~ .form-control-feedback {\n top: 0;\n}\n.help-block {\n display: block;\n margin-top: 5px;\n margin-bottom: 10px;\n color: #737373;\n}\n@media (min-width: 768px) {\n .form-inline .form-group {\n display: inline-block;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .form-control {\n display: inline-block;\n width: auto;\n vertical-align: middle;\n }\n .form-inline .form-control-static {\n display: inline-block;\n }\n .form-inline .input-group {\n display: inline-table;\n vertical-align: middle;\n }\n .form-inline .input-group .input-group-addon,\n .form-inline .input-group .input-group-btn,\n .form-inline .input-group .form-control {\n width: auto;\n }\n .form-inline .input-group > .form-control {\n width: 100%;\n }\n .form-inline .control-label {\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .radio,\n .form-inline .checkbox {\n display: inline-block;\n margin-top: 0;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .radio label,\n .form-inline .checkbox label {\n padding-left: 0;\n }\n .form-inline .radio input[type=\"radio\"],\n .form-inline .checkbox input[type=\"checkbox\"] {\n position: relative;\n margin-left: 0;\n }\n .form-inline .has-feedback .form-control-feedback {\n top: 0;\n }\n}\n.form-horizontal .radio,\n.form-horizontal .checkbox,\n.form-horizontal .radio-inline,\n.form-horizontal .checkbox-inline {\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 7px;\n}\n.form-horizontal .radio,\n.form-horizontal .checkbox {\n min-height: 27px;\n}\n.form-horizontal .form-group {\n margin-left: -15px;\n margin-right: -15px;\n}\n@media (min-width: 768px) {\n .form-horizontal .control-label {\n text-align: right;\n margin-bottom: 0;\n padding-top: 7px;\n }\n}\n.form-horizontal .has-feedback .form-control-feedback {\n right: 15px;\n}\n@media (min-width: 768px) {\n .form-horizontal .form-group-lg .control-label {\n padding-top: 11px;\n font-size: 18px;\n }\n}\n@media (min-width: 768px) {\n .form-horizontal .form-group-sm .control-label {\n padding-top: 6px;\n font-size: 12px;\n }\n}\n.btn {\n display: inline-block;\n margin-bottom: 0;\n font-weight: normal;\n text-align: center;\n vertical-align: middle;\n touch-action: manipulation;\n cursor: pointer;\n background-image: none;\n border: 1px solid transparent;\n white-space: nowrap;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n border-radius: 4px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.btn:focus,\n.btn:active:focus,\n.btn.active:focus,\n.btn.focus,\n.btn:active.focus,\n.btn.active.focus {\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\n.btn:hover,\n.btn:focus,\n.btn.focus {\n color: #333;\n text-decoration: none;\n}\n.btn:active,\n.btn.active {\n outline: 0;\n background-image: none;\n -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn.disabled,\n.btn[disabled],\nfieldset[disabled] .btn {\n cursor: not-allowed;\n opacity: 0.65;\n filter: alpha(opacity=65);\n -webkit-box-shadow: none;\n box-shadow: none;\n}\na.btn.disabled,\nfieldset[disabled] a.btn {\n pointer-events: none;\n}\n.btn-default {\n color: #333;\n background-color: #fff;\n border-color: #ccc;\n}\n.btn-default:focus,\n.btn-default.focus {\n color: #333;\n background-color: #e6e6e6;\n border-color: #8c8c8c;\n}\n.btn-default:hover {\n color: #333;\n background-color: #e6e6e6;\n border-color: #adadad;\n}\n.btn-default:active,\n.btn-default.active,\n.open > .dropdown-toggle.btn-default {\n color: #333;\n background-color: #e6e6e6;\n border-color: #adadad;\n}\n.btn-default:active:hover,\n.btn-default.active:hover,\n.open > .dropdown-toggle.btn-default:hover,\n.btn-default:active:focus,\n.btn-default.active:focus,\n.open > .dropdown-toggle.btn-default:focus,\n.btn-default:active.focus,\n.btn-default.active.focus,\n.open > .dropdown-toggle.btn-default.focus {\n color: #333;\n background-color: #d4d4d4;\n border-color: #8c8c8c;\n}\n.btn-default:active,\n.btn-default.active,\n.open > .dropdown-toggle.btn-default {\n background-image: none;\n}\n.btn-default.disabled:hover,\n.btn-default[disabled]:hover,\nfieldset[disabled] .btn-default:hover,\n.btn-default.disabled:focus,\n.btn-default[disabled]:focus,\nfieldset[disabled] .btn-default:focus,\n.btn-default.disabled.focus,\n.btn-default[disabled].focus,\nfieldset[disabled] .btn-default.focus {\n background-color: #fff;\n border-color: #ccc;\n}\n.btn-default .badge {\n color: #fff;\n background-color: #333;\n}\n.btn-primary {\n color: #fff;\n background-color: #337ab7;\n border-color: #2e6da4;\n}\n.btn-primary:focus,\n.btn-primary.focus {\n color: #fff;\n background-color: #286090;\n border-color: #122b40;\n}\n.btn-primary:hover {\n color: #fff;\n background-color: #286090;\n border-color: #204d74;\n}\n.btn-primary:active,\n.btn-primary.active,\n.open > .dropdown-toggle.btn-primary {\n color: #fff;\n background-color: #286090;\n border-color: #204d74;\n}\n.btn-primary:active:hover,\n.btn-primary.active:hover,\n.open > .dropdown-toggle.btn-primary:hover,\n.btn-primary:active:focus,\n.btn-primary.active:focus,\n.open > .dropdown-toggle.btn-primary:focus,\n.btn-primary:active.focus,\n.btn-primary.active.focus,\n.open > .dropdown-toggle.btn-primary.focus {\n color: #fff;\n background-color: #204d74;\n border-color: #122b40;\n}\n.btn-primary:active,\n.btn-primary.active,\n.open > .dropdown-toggle.btn-primary {\n background-image: none;\n}\n.btn-primary.disabled:hover,\n.btn-primary[disabled]:hover,\nfieldset[disabled] .btn-primary:hover,\n.btn-primary.disabled:focus,\n.btn-primary[disabled]:focus,\nfieldset[disabled] .btn-primary:focus,\n.btn-primary.disabled.focus,\n.btn-primary[disabled].focus,\nfieldset[disabled] .btn-primary.focus {\n background-color: #337ab7;\n border-color: #2e6da4;\n}\n.btn-primary .badge {\n color: #337ab7;\n background-color: #fff;\n}\n.btn-success {\n color: #fff;\n background-color: #5cb85c;\n border-color: #4cae4c;\n}\n.btn-success:focus,\n.btn-success.focus {\n color: #fff;\n background-color: #449d44;\n border-color: #255625;\n}\n.btn-success:hover {\n color: #fff;\n background-color: #449d44;\n border-color: #398439;\n}\n.btn-success:active,\n.btn-success.active,\n.open > .dropdown-toggle.btn-success {\n color: #fff;\n background-color: #449d44;\n border-color: #398439;\n}\n.btn-success:active:hover,\n.btn-success.active:hover,\n.open > .dropdown-toggle.btn-success:hover,\n.btn-success:active:focus,\n.btn-success.active:focus,\n.open > .dropdown-toggle.btn-success:focus,\n.btn-success:active.focus,\n.btn-success.active.focus,\n.open > .dropdown-toggle.btn-success.focus {\n color: #fff;\n background-color: #398439;\n border-color: #255625;\n}\n.btn-success:active,\n.btn-success.active,\n.open > .dropdown-toggle.btn-success {\n background-image: none;\n}\n.btn-success.disabled:hover,\n.btn-success[disabled]:hover,\nfieldset[disabled] .btn-success:hover,\n.btn-success.disabled:focus,\n.btn-success[disabled]:focus,\nfieldset[disabled] .btn-success:focus,\n.btn-success.disabled.focus,\n.btn-success[disabled].focus,\nfieldset[disabled] .btn-success.focus {\n background-color: #5cb85c;\n border-color: #4cae4c;\n}\n.btn-success .badge {\n color: #5cb85c;\n background-color: #fff;\n}\n.btn-info {\n color: #fff;\n background-color: #5bc0de;\n border-color: #46b8da;\n}\n.btn-info:focus,\n.btn-info.focus {\n color: #fff;\n background-color: #31b0d5;\n border-color: #1b6d85;\n}\n.btn-info:hover {\n color: #fff;\n background-color: #31b0d5;\n border-color: #269abc;\n}\n.btn-info:active,\n.btn-info.active,\n.open > .dropdown-toggle.btn-info {\n color: #fff;\n background-color: #31b0d5;\n border-color: #269abc;\n}\n.btn-info:active:hover,\n.btn-info.active:hover,\n.open > .dropdown-toggle.btn-info:hover,\n.btn-info:active:focus,\n.btn-info.active:focus,\n.open > .dropdown-toggle.btn-info:focus,\n.btn-info:active.focus,\n.btn-info.active.focus,\n.open > .dropdown-toggle.btn-info.focus {\n color: #fff;\n background-color: #269abc;\n border-color: #1b6d85;\n}\n.btn-info:active,\n.btn-info.active,\n.open > .dropdown-toggle.btn-info {\n background-image: none;\n}\n.btn-info.disabled:hover,\n.btn-info[disabled]:hover,\nfieldset[disabled] .btn-info:hover,\n.btn-info.disabled:focus,\n.btn-info[disabled]:focus,\nfieldset[disabled] .btn-info:focus,\n.btn-info.disabled.focus,\n.btn-info[disabled].focus,\nfieldset[disabled] .btn-info.focus {\n background-color: #5bc0de;\n border-color: #46b8da;\n}\n.btn-info .badge {\n color: #5bc0de;\n background-color: #fff;\n}\n.btn-warning {\n color: #fff;\n background-color: #f0ad4e;\n border-color: #eea236;\n}\n.btn-warning:focus,\n.btn-warning.focus {\n color: #fff;\n background-color: #ec971f;\n border-color: #985f0d;\n}\n.btn-warning:hover {\n color: #fff;\n background-color: #ec971f;\n border-color: #d58512;\n}\n.btn-warning:active,\n.btn-warning.active,\n.open > .dropdown-toggle.btn-warning {\n color: #fff;\n background-color: #ec971f;\n border-color: #d58512;\n}\n.btn-warning:active:hover,\n.btn-warning.active:hover,\n.open > .dropdown-toggle.btn-warning:hover,\n.btn-warning:active:focus,\n.btn-warning.active:focus,\n.open > .dropdown-toggle.btn-warning:focus,\n.btn-warning:active.focus,\n.btn-warning.active.focus,\n.open > .dropdown-toggle.btn-warning.focus {\n color: #fff;\n background-color: #d58512;\n border-color: #985f0d;\n}\n.btn-warning:active,\n.btn-warning.active,\n.open > .dropdown-toggle.btn-warning {\n background-image: none;\n}\n.btn-warning.disabled:hover,\n.btn-warning[disabled]:hover,\nfieldset[disabled] .btn-warning:hover,\n.btn-warning.disabled:focus,\n.btn-warning[disabled]:focus,\nfieldset[disabled] .btn-warning:focus,\n.btn-warning.disabled.focus,\n.btn-warning[disabled].focus,\nfieldset[disabled] .btn-warning.focus {\n background-color: #f0ad4e;\n border-color: #eea236;\n}\n.btn-warning .badge {\n color: #f0ad4e;\n background-color: #fff;\n}\n.btn-danger {\n color: #fff;\n background-color: #d9534f;\n border-color: #d43f3a;\n}\n.btn-danger:focus,\n.btn-danger.focus {\n color: #fff;\n background-color: #c9302c;\n border-color: #761c19;\n}\n.btn-danger:hover {\n color: #fff;\n background-color: #c9302c;\n border-color: #ac2925;\n}\n.btn-danger:active,\n.btn-danger.active,\n.open > .dropdown-toggle.btn-danger {\n color: #fff;\n background-color: #c9302c;\n border-color: #ac2925;\n}\n.btn-danger:active:hover,\n.btn-danger.active:hover,\n.open > .dropdown-toggle.btn-danger:hover,\n.btn-danger:active:focus,\n.btn-danger.active:focus,\n.open > .dropdown-toggle.btn-danger:focus,\n.btn-danger:active.focus,\n.btn-danger.active.focus,\n.open > .dropdown-toggle.btn-danger.focus {\n color: #fff;\n background-color: #ac2925;\n border-color: #761c19;\n}\n.btn-danger:active,\n.btn-danger.active,\n.open > .dropdown-toggle.btn-danger {\n background-image: none;\n}\n.btn-danger.disabled:hover,\n.btn-danger[disabled]:hover,\nfieldset[disabled] .btn-danger:hover,\n.btn-danger.disabled:focus,\n.btn-danger[disabled]:focus,\nfieldset[disabled] .btn-danger:focus,\n.btn-danger.disabled.focus,\n.btn-danger[disabled].focus,\nfieldset[disabled] .btn-danger.focus {\n background-color: #d9534f;\n border-color: #d43f3a;\n}\n.btn-danger .badge {\n color: #d9534f;\n background-color: #fff;\n}\n.btn-link {\n color: #337ab7;\n font-weight: normal;\n border-radius: 0;\n}\n.btn-link,\n.btn-link:active,\n.btn-link.active,\n.btn-link[disabled],\nfieldset[disabled] .btn-link {\n background-color: transparent;\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.btn-link,\n.btn-link:hover,\n.btn-link:focus,\n.btn-link:active {\n border-color: transparent;\n}\n.btn-link:hover,\n.btn-link:focus {\n color: #23527c;\n text-decoration: underline;\n background-color: transparent;\n}\n.btn-link[disabled]:hover,\nfieldset[disabled] .btn-link:hover,\n.btn-link[disabled]:focus,\nfieldset[disabled] .btn-link:focus {\n color: #777777;\n text-decoration: none;\n}\n.btn-lg,\n.btn-group-lg > .btn {\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\n.btn-sm,\n.btn-group-sm > .btn {\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\n.btn-xs,\n.btn-group-xs > .btn {\n padding: 1px 5px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\n.btn-block {\n display: block;\n width: 100%;\n}\n.btn-block + .btn-block {\n margin-top: 5px;\n}\ninput[type=\"submit\"].btn-block,\ninput[type=\"reset\"].btn-block,\ninput[type=\"button\"].btn-block {\n width: 100%;\n}\n.fade {\n opacity: 0;\n -webkit-transition: opacity 0.15s linear;\n -o-transition: opacity 0.15s linear;\n transition: opacity 0.15s linear;\n}\n.fade.in {\n opacity: 1;\n}\n.collapse {\n display: none;\n}\n.collapse.in {\n display: block;\n}\ntr.collapse.in {\n display: table-row;\n}\ntbody.collapse.in {\n display: table-row-group;\n}\n.collapsing {\n position: relative;\n height: 0;\n overflow: hidden;\n -webkit-transition-property: height, visibility;\n transition-property: height, visibility;\n -webkit-transition-duration: 0.35s;\n transition-duration: 0.35s;\n -webkit-transition-timing-function: ease;\n transition-timing-function: ease;\n}\n.caret {\n display: inline-block;\n width: 0;\n height: 0;\n margin-left: 2px;\n vertical-align: middle;\n border-top: 4px dashed;\n border-top: 4px solid \\9;\n border-right: 4px solid transparent;\n border-left: 4px solid transparent;\n}\n.dropup,\n.dropdown {\n position: relative;\n}\n.dropdown-toggle:focus {\n outline: 0;\n}\n.dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 160px;\n padding: 5px 0;\n margin: 2px 0 0;\n list-style: none;\n font-size: 14px;\n text-align: left;\n background-color: #fff;\n border: 1px solid #ccc;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n background-clip: padding-box;\n}\n.dropdown-menu.pull-right {\n right: 0;\n left: auto;\n}\n.dropdown-menu .divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n}\n.dropdown-menu > li > a {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: 1.42857143;\n color: #333333;\n white-space: nowrap;\n}\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n text-decoration: none;\n color: #262626;\n background-color: #f5f5f5;\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n color: #fff;\n text-decoration: none;\n outline: 0;\n background-color: #337ab7;\n}\n.dropdown-menu > .disabled > a,\n.dropdown-menu > .disabled > a:hover,\n.dropdown-menu > .disabled > a:focus {\n color: #777777;\n}\n.dropdown-menu > .disabled > a:hover,\n.dropdown-menu > .disabled > a:focus {\n text-decoration: none;\n background-color: transparent;\n background-image: none;\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n cursor: not-allowed;\n}\n.open > .dropdown-menu {\n display: block;\n}\n.open > a {\n outline: 0;\n}\n.dropdown-menu-right {\n left: auto;\n right: 0;\n}\n.dropdown-menu-left {\n left: 0;\n right: auto;\n}\n.dropdown-header {\n display: block;\n padding: 3px 20px;\n font-size: 12px;\n line-height: 1.42857143;\n color: #777777;\n white-space: nowrap;\n}\n.dropdown-backdrop {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n z-index: 990;\n}\n.pull-right > .dropdown-menu {\n right: 0;\n left: auto;\n}\n.dropup .caret,\n.navbar-fixed-bottom .dropdown .caret {\n border-top: 0;\n border-bottom: 4px dashed;\n border-bottom: 4px solid \\9;\n content: \"\";\n}\n.dropup .dropdown-menu,\n.navbar-fixed-bottom .dropdown .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-bottom: 2px;\n}\n@media (min-width: 768px) {\n .navbar-right .dropdown-menu {\n left: auto;\n right: 0;\n }\n .navbar-right .dropdown-menu-left {\n left: 0;\n right: auto;\n }\n}\n.btn-group,\n.btn-group-vertical {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n}\n.btn-group > .btn,\n.btn-group-vertical > .btn {\n position: relative;\n float: left;\n}\n.btn-group > .btn:hover,\n.btn-group-vertical > .btn:hover,\n.btn-group > .btn:focus,\n.btn-group-vertical > .btn:focus,\n.btn-group > .btn:active,\n.btn-group-vertical > .btn:active,\n.btn-group > .btn.active,\n.btn-group-vertical > .btn.active {\n z-index: 2;\n}\n.btn-group .btn + .btn,\n.btn-group .btn + .btn-group,\n.btn-group .btn-group + .btn,\n.btn-group .btn-group + .btn-group {\n margin-left: -1px;\n}\n.btn-toolbar {\n margin-left: -5px;\n}\n.btn-toolbar .btn,\n.btn-toolbar .btn-group,\n.btn-toolbar .input-group {\n float: left;\n}\n.btn-toolbar > .btn,\n.btn-toolbar > .btn-group,\n.btn-toolbar > .input-group {\n margin-left: 5px;\n}\n.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {\n border-radius: 0;\n}\n.btn-group > .btn:first-child {\n margin-left: 0;\n}\n.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n}\n.btn-group > .btn:last-child:not(:first-child),\n.btn-group > .dropdown-toggle:not(:first-child) {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group > .btn-group {\n float: left;\n}\n.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n}\n.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group .dropdown-toggle:active,\n.btn-group.open .dropdown-toggle {\n outline: 0;\n}\n.btn-group > .btn + .dropdown-toggle {\n padding-left: 8px;\n padding-right: 8px;\n}\n.btn-group > .btn-lg + .dropdown-toggle {\n padding-left: 12px;\n padding-right: 12px;\n}\n.btn-group.open .dropdown-toggle {\n -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn-group.open .dropdown-toggle.btn-link {\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.btn .caret {\n margin-left: 0;\n}\n.btn-lg .caret {\n border-width: 5px 5px 0;\n border-bottom-width: 0;\n}\n.dropup .btn-lg .caret {\n border-width: 0 5px 5px;\n}\n.btn-group-vertical > .btn,\n.btn-group-vertical > .btn-group,\n.btn-group-vertical > .btn-group > .btn {\n display: block;\n float: none;\n width: 100%;\n max-width: 100%;\n}\n.btn-group-vertical > .btn-group > .btn {\n float: none;\n}\n.btn-group-vertical > .btn + .btn,\n.btn-group-vertical > .btn + .btn-group,\n.btn-group-vertical > .btn-group + .btn,\n.btn-group-vertical > .btn-group + .btn-group {\n margin-top: -1px;\n margin-left: 0;\n}\n.btn-group-vertical > .btn:not(:first-child):not(:last-child) {\n border-radius: 0;\n}\n.btn-group-vertical > .btn:first-child:not(:last-child) {\n border-top-right-radius: 4px;\n border-top-left-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.btn-group-vertical > .btn:last-child:not(:first-child) {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n border-bottom-right-radius: 4px;\n border-bottom-left-radius: 4px;\n}\n.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group-justified {\n display: table;\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n}\n.btn-group-justified > .btn,\n.btn-group-justified > .btn-group {\n float: none;\n display: table-cell;\n width: 1%;\n}\n.btn-group-justified > .btn-group .btn {\n width: 100%;\n}\n.btn-group-justified > .btn-group .dropdown-menu {\n left: auto;\n}\n[data-toggle=\"buttons\"] > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn input[type=\"checkbox\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"checkbox\"] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n pointer-events: none;\n}\n.input-group {\n position: relative;\n display: table;\n border-collapse: separate;\n}\n.input-group[class*=\"col-\"] {\n float: none;\n padding-left: 0;\n padding-right: 0;\n}\n.input-group .form-control {\n position: relative;\n z-index: 2;\n float: left;\n width: 100%;\n margin-bottom: 0;\n}\n.input-group .form-control:focus {\n z-index: 3;\n}\n.input-group-lg > .form-control,\n.input-group-lg > .input-group-addon,\n.input-group-lg > .input-group-btn > .btn {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\nselect.input-group-lg > .form-control,\nselect.input-group-lg > .input-group-addon,\nselect.input-group-lg > .input-group-btn > .btn {\n height: 46px;\n line-height: 46px;\n}\ntextarea.input-group-lg > .form-control,\ntextarea.input-group-lg > .input-group-addon,\ntextarea.input-group-lg > .input-group-btn > .btn,\nselect[multiple].input-group-lg > .form-control,\nselect[multiple].input-group-lg > .input-group-addon,\nselect[multiple].input-group-lg > .input-group-btn > .btn {\n height: auto;\n}\n.input-group-sm > .form-control,\n.input-group-sm > .input-group-addon,\n.input-group-sm > .input-group-btn > .btn {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\nselect.input-group-sm > .form-control,\nselect.input-group-sm > .input-group-addon,\nselect.input-group-sm > .input-group-btn > .btn {\n height: 30px;\n line-height: 30px;\n}\ntextarea.input-group-sm > .form-control,\ntextarea.input-group-sm > .input-group-addon,\ntextarea.input-group-sm > .input-group-btn > .btn,\nselect[multiple].input-group-sm > .form-control,\nselect[multiple].input-group-sm > .input-group-addon,\nselect[multiple].input-group-sm > .input-group-btn > .btn {\n height: auto;\n}\n.input-group-addon,\n.input-group-btn,\n.input-group .form-control {\n display: table-cell;\n}\n.input-group-addon:not(:first-child):not(:last-child),\n.input-group-btn:not(:first-child):not(:last-child),\n.input-group .form-control:not(:first-child):not(:last-child) {\n border-radius: 0;\n}\n.input-group-addon,\n.input-group-btn {\n width: 1%;\n white-space: nowrap;\n vertical-align: middle;\n}\n.input-group-addon {\n padding: 6px 12px;\n font-size: 14px;\n font-weight: normal;\n line-height: 1;\n color: #555555;\n text-align: center;\n background-color: #eeeeee;\n border: 1px solid #ccc;\n border-radius: 4px;\n}\n.input-group-addon.input-sm {\n padding: 5px 10px;\n font-size: 12px;\n border-radius: 3px;\n}\n.input-group-addon.input-lg {\n padding: 10px 16px;\n font-size: 18px;\n border-radius: 6px;\n}\n.input-group-addon input[type=\"radio\"],\n.input-group-addon input[type=\"checkbox\"] {\n margin-top: 0;\n}\n.input-group .form-control:first-child,\n.input-group-addon:first-child,\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group > .btn,\n.input-group-btn:first-child > .dropdown-toggle,\n.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n}\n.input-group-addon:first-child {\n border-right: 0;\n}\n.input-group .form-control:last-child,\n.input-group-addon:last-child,\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group > .btn,\n.input-group-btn:last-child > .dropdown-toggle,\n.input-group-btn:first-child > .btn:not(:first-child),\n.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n}\n.input-group-addon:last-child {\n border-left: 0;\n}\n.input-group-btn {\n position: relative;\n font-size: 0;\n white-space: nowrap;\n}\n.input-group-btn > .btn {\n position: relative;\n}\n.input-group-btn > .btn + .btn {\n margin-left: -1px;\n}\n.input-group-btn > .btn:hover,\n.input-group-btn > .btn:focus,\n.input-group-btn > .btn:active {\n z-index: 2;\n}\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group {\n margin-right: -1px;\n}\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group {\n z-index: 2;\n margin-left: -1px;\n}\n.nav {\n margin-bottom: 0;\n padding-left: 0;\n list-style: none;\n}\n.nav > li {\n position: relative;\n display: block;\n}\n.nav > li > a {\n position: relative;\n display: block;\n padding: 10px 15px;\n}\n.nav > li > a:hover,\n.nav > li > a:focus {\n text-decoration: none;\n background-color: #eeeeee;\n}\n.nav > li.disabled > a {\n color: #777777;\n}\n.nav > li.disabled > a:hover,\n.nav > li.disabled > a:focus {\n color: #777777;\n text-decoration: none;\n background-color: transparent;\n cursor: not-allowed;\n}\n.nav .open > a,\n.nav .open > a:hover,\n.nav .open > a:focus {\n background-color: #eeeeee;\n border-color: #337ab7;\n}\n.nav .nav-divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n}\n.nav > li > a > img {\n max-width: none;\n}\n.nav-tabs {\n border-bottom: 1px solid #ddd;\n}\n.nav-tabs > li {\n float: left;\n margin-bottom: -1px;\n}\n.nav-tabs > li > a {\n margin-right: 2px;\n line-height: 1.42857143;\n border: 1px solid transparent;\n border-radius: 4px 4px 0 0;\n}\n.nav-tabs > li > a:hover {\n border-color: #eeeeee #eeeeee #ddd;\n}\n.nav-tabs > li.active > a,\n.nav-tabs > li.active > a:hover,\n.nav-tabs > li.active > a:focus {\n color: #555555;\n background-color: #fff;\n border: 1px solid #ddd;\n border-bottom-color: transparent;\n cursor: default;\n}\n.nav-tabs.nav-justified {\n width: 100%;\n border-bottom: 0;\n}\n.nav-tabs.nav-justified > li {\n float: none;\n}\n.nav-tabs.nav-justified > li > a {\n text-align: center;\n margin-bottom: 5px;\n}\n.nav-tabs.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n}\n@media (min-width: 768px) {\n .nav-tabs.nav-justified > li {\n display: table-cell;\n width: 1%;\n }\n .nav-tabs.nav-justified > li > a {\n margin-bottom: 0;\n }\n}\n.nav-tabs.nav-justified > li > a {\n margin-right: 0;\n border-radius: 4px;\n}\n.nav-tabs.nav-justified > .active > a,\n.nav-tabs.nav-justified > .active > a:hover,\n.nav-tabs.nav-justified > .active > a:focus {\n border: 1px solid #ddd;\n}\n@media (min-width: 768px) {\n .nav-tabs.nav-justified > li > a {\n border-bottom: 1px solid #ddd;\n border-radius: 4px 4px 0 0;\n }\n .nav-tabs.nav-justified > .active > a,\n .nav-tabs.nav-justified > .active > a:hover,\n .nav-tabs.nav-justified > .active > a:focus {\n border-bottom-color: #fff;\n }\n}\n.nav-pills > li {\n float: left;\n}\n.nav-pills > li > a {\n border-radius: 4px;\n}\n.nav-pills > li + li {\n margin-left: 2px;\n}\n.nav-pills > li.active > a,\n.nav-pills > li.active > a:hover,\n.nav-pills > li.active > a:focus {\n color: #fff;\n background-color: #337ab7;\n}\n.nav-stacked > li {\n float: none;\n}\n.nav-stacked > li + li {\n margin-top: 2px;\n margin-left: 0;\n}\n.nav-justified {\n width: 100%;\n}\n.nav-justified > li {\n float: none;\n}\n.nav-justified > li > a {\n text-align: center;\n margin-bottom: 5px;\n}\n.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n}\n@media (min-width: 768px) {\n .nav-justified > li {\n display: table-cell;\n width: 1%;\n }\n .nav-justified > li > a {\n margin-bottom: 0;\n }\n}\n.nav-tabs-justified {\n border-bottom: 0;\n}\n.nav-tabs-justified > li > a {\n margin-right: 0;\n border-radius: 4px;\n}\n.nav-tabs-justified > .active > a,\n.nav-tabs-justified > .active > a:hover,\n.nav-tabs-justified > .active > a:focus {\n border: 1px solid #ddd;\n}\n@media (min-width: 768px) {\n .nav-tabs-justified > li > a {\n border-bottom: 1px solid #ddd;\n border-radius: 4px 4px 0 0;\n }\n .nav-tabs-justified > .active > a,\n .nav-tabs-justified > .active > a:hover,\n .nav-tabs-justified > .active > a:focus {\n border-bottom-color: #fff;\n }\n}\n.tab-content > .tab-pane {\n display: none;\n}\n.tab-content > .active {\n display: block;\n}\n.nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.navbar {\n position: relative;\n min-height: 50px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n}\n@media (min-width: 768px) {\n .navbar {\n border-radius: 4px;\n }\n}\n@media (min-width: 768px) {\n .navbar-header {\n float: left;\n }\n}\n.navbar-collapse {\n overflow-x: visible;\n padding-right: 15px;\n padding-left: 15px;\n border-top: 1px solid transparent;\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);\n -webkit-overflow-scrolling: touch;\n}\n.navbar-collapse.in {\n overflow-y: auto;\n}\n@media (min-width: 768px) {\n .navbar-collapse {\n width: auto;\n border-top: 0;\n box-shadow: none;\n }\n .navbar-collapse.collapse {\n display: block !important;\n height: auto !important;\n padding-bottom: 0;\n overflow: visible !important;\n }\n .navbar-collapse.in {\n overflow-y: visible;\n }\n .navbar-fixed-top .navbar-collapse,\n .navbar-static-top .navbar-collapse,\n .navbar-fixed-bottom .navbar-collapse {\n padding-left: 0;\n padding-right: 0;\n }\n}\n.navbar-fixed-top .navbar-collapse,\n.navbar-fixed-bottom .navbar-collapse {\n max-height: 340px;\n}\n@media (max-device-width: 480px) and (orientation: landscape) {\n .navbar-fixed-top .navbar-collapse,\n .navbar-fixed-bottom .navbar-collapse {\n max-height: 200px;\n }\n}\n.container > .navbar-header,\n.container-fluid > .navbar-header,\n.container > .navbar-collapse,\n.container-fluid > .navbar-collapse {\n margin-right: -15px;\n margin-left: -15px;\n}\n@media (min-width: 768px) {\n .container > .navbar-header,\n .container-fluid > .navbar-header,\n .container > .navbar-collapse,\n .container-fluid > .navbar-collapse {\n margin-right: 0;\n margin-left: 0;\n }\n}\n.navbar-static-top {\n z-index: 1000;\n border-width: 0 0 1px;\n}\n@media (min-width: 768px) {\n .navbar-static-top {\n border-radius: 0;\n }\n}\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n position: fixed;\n right: 0;\n left: 0;\n z-index: 1030;\n}\n@media (min-width: 768px) {\n .navbar-fixed-top,\n .navbar-fixed-bottom {\n border-radius: 0;\n }\n}\n.navbar-fixed-top {\n top: 0;\n border-width: 0 0 1px;\n}\n.navbar-fixed-bottom {\n bottom: 0;\n margin-bottom: 0;\n border-width: 1px 0 0;\n}\n.navbar-brand {\n float: left;\n padding: 15px 15px;\n font-size: 18px;\n line-height: 20px;\n height: 50px;\n}\n.navbar-brand:hover,\n.navbar-brand:focus {\n text-decoration: none;\n}\n.navbar-brand > img {\n display: block;\n}\n@media (min-width: 768px) {\n .navbar > .container .navbar-brand,\n .navbar > .container-fluid .navbar-brand {\n margin-left: -15px;\n }\n}\n.navbar-toggle {\n position: relative;\n float: right;\n margin-right: 15px;\n padding: 9px 10px;\n margin-top: 8px;\n margin-bottom: 8px;\n background-color: transparent;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n.navbar-toggle:focus {\n outline: 0;\n}\n.navbar-toggle .icon-bar {\n display: block;\n width: 22px;\n height: 2px;\n border-radius: 1px;\n}\n.navbar-toggle .icon-bar + .icon-bar {\n margin-top: 4px;\n}\n@media (min-width: 768px) {\n .navbar-toggle {\n display: none;\n }\n}\n.navbar-nav {\n margin: 7.5px -15px;\n}\n.navbar-nav > li > a {\n padding-top: 10px;\n padding-bottom: 10px;\n line-height: 20px;\n}\n@media (max-width: 767px) {\n .navbar-nav .open .dropdown-menu {\n position: static;\n float: none;\n width: auto;\n margin-top: 0;\n background-color: transparent;\n border: 0;\n box-shadow: none;\n }\n .navbar-nav .open .dropdown-menu > li > a,\n .navbar-nav .open .dropdown-menu .dropdown-header {\n padding: 5px 15px 5px 25px;\n }\n .navbar-nav .open .dropdown-menu > li > a {\n line-height: 20px;\n }\n .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-nav .open .dropdown-menu > li > a:focus {\n background-image: none;\n }\n}\n@media (min-width: 768px) {\n .navbar-nav {\n float: left;\n margin: 0;\n }\n .navbar-nav > li {\n float: left;\n }\n .navbar-nav > li > a {\n padding-top: 15px;\n padding-bottom: 15px;\n }\n}\n.navbar-form {\n margin-left: -15px;\n margin-right: -15px;\n padding: 10px 15px;\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);\n margin-top: 8px;\n margin-bottom: 8px;\n}\n@media (min-width: 768px) {\n .navbar-form .form-group {\n display: inline-block;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .navbar-form .form-control {\n display: inline-block;\n width: auto;\n vertical-align: middle;\n }\n .navbar-form .form-control-static {\n display: inline-block;\n }\n .navbar-form .input-group {\n display: inline-table;\n vertical-align: middle;\n }\n .navbar-form .input-group .input-group-addon,\n .navbar-form .input-group .input-group-btn,\n .navbar-form .input-group .form-control {\n width: auto;\n }\n .navbar-form .input-group > .form-control {\n width: 100%;\n }\n .navbar-form .control-label {\n margin-bottom: 0;\n vertical-align: middle;\n }\n .navbar-form .radio,\n .navbar-form .checkbox {\n display: inline-block;\n margin-top: 0;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .navbar-form .radio label,\n .navbar-form .checkbox label {\n padding-left: 0;\n }\n .navbar-form .radio input[type=\"radio\"],\n .navbar-form .checkbox input[type=\"checkbox\"] {\n position: relative;\n margin-left: 0;\n }\n .navbar-form .has-feedback .form-control-feedback {\n top: 0;\n }\n}\n@media (max-width: 767px) {\n .navbar-form .form-group {\n margin-bottom: 5px;\n }\n .navbar-form .form-group:last-child {\n margin-bottom: 0;\n }\n}\n@media (min-width: 768px) {\n .navbar-form {\n width: auto;\n border: 0;\n margin-left: 0;\n margin-right: 0;\n padding-top: 0;\n padding-bottom: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n}\n.navbar-nav > li > .dropdown-menu {\n margin-top: 0;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n margin-bottom: 0;\n border-top-right-radius: 4px;\n border-top-left-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.navbar-btn {\n margin-top: 8px;\n margin-bottom: 8px;\n}\n.navbar-btn.btn-sm {\n margin-top: 10px;\n margin-bottom: 10px;\n}\n.navbar-btn.btn-xs {\n margin-top: 14px;\n margin-bottom: 14px;\n}\n.navbar-text {\n margin-top: 15px;\n margin-bottom: 15px;\n}\n@media (min-width: 768px) {\n .navbar-text {\n float: left;\n margin-left: 15px;\n margin-right: 15px;\n }\n}\n@media (min-width: 768px) {\n .navbar-left {\n float: left !important;\n }\n .navbar-right {\n float: right !important;\n margin-right: -15px;\n }\n .navbar-right ~ .navbar-right {\n margin-right: 0;\n }\n}\n.navbar-default {\n background-color: #f8f8f8;\n border-color: #e7e7e7;\n}\n.navbar-default .navbar-brand {\n color: #777;\n}\n.navbar-default .navbar-brand:hover,\n.navbar-default .navbar-brand:focus {\n color: #5e5e5e;\n background-color: transparent;\n}\n.navbar-default .navbar-text {\n color: #777;\n}\n.navbar-default .navbar-nav > li > a {\n color: #777;\n}\n.navbar-default .navbar-nav > li > a:hover,\n.navbar-default .navbar-nav > li > a:focus {\n color: #333;\n background-color: transparent;\n}\n.navbar-default .navbar-nav > .active > a,\n.navbar-default .navbar-nav > .active > a:hover,\n.navbar-default .navbar-nav > .active > a:focus {\n color: #555;\n background-color: #e7e7e7;\n}\n.navbar-default .navbar-nav > .disabled > a,\n.navbar-default .navbar-nav > .disabled > a:hover,\n.navbar-default .navbar-nav > .disabled > a:focus {\n color: #ccc;\n background-color: transparent;\n}\n.navbar-default .navbar-toggle {\n border-color: #ddd;\n}\n.navbar-default .navbar-toggle:hover,\n.navbar-default .navbar-toggle:focus {\n background-color: #ddd;\n}\n.navbar-default .navbar-toggle .icon-bar {\n background-color: #888;\n}\n.navbar-default .navbar-collapse,\n.navbar-default .navbar-form {\n border-color: #e7e7e7;\n}\n.navbar-default .navbar-nav > .open > a,\n.navbar-default .navbar-nav > .open > a:hover,\n.navbar-default .navbar-nav > .open > a:focus {\n background-color: #e7e7e7;\n color: #555;\n}\n@media (max-width: 767px) {\n .navbar-default .navbar-nav .open .dropdown-menu > li > a {\n color: #777;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #333;\n background-color: transparent;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #555;\n background-color: #e7e7e7;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #ccc;\n background-color: transparent;\n }\n}\n.navbar-default .navbar-link {\n color: #777;\n}\n.navbar-default .navbar-link:hover {\n color: #333;\n}\n.navbar-default .btn-link {\n color: #777;\n}\n.navbar-default .btn-link:hover,\n.navbar-default .btn-link:focus {\n color: #333;\n}\n.navbar-default .btn-link[disabled]:hover,\nfieldset[disabled] .navbar-default .btn-link:hover,\n.navbar-default .btn-link[disabled]:focus,\nfieldset[disabled] .navbar-default .btn-link:focus {\n color: #ccc;\n}\n.navbar-inverse {\n background-color: #222;\n border-color: #080808;\n}\n.navbar-inverse .navbar-brand {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-brand:hover,\n.navbar-inverse .navbar-brand:focus {\n color: #fff;\n background-color: transparent;\n}\n.navbar-inverse .navbar-text {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-nav > li > a {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-nav > li > a:hover,\n.navbar-inverse .navbar-nav > li > a:focus {\n color: #fff;\n background-color: transparent;\n}\n.navbar-inverse .navbar-nav > .active > a,\n.navbar-inverse .navbar-nav > .active > a:hover,\n.navbar-inverse .navbar-nav > .active > a:focus {\n color: #fff;\n background-color: #080808;\n}\n.navbar-inverse .navbar-nav > .disabled > a,\n.navbar-inverse .navbar-nav > .disabled > a:hover,\n.navbar-inverse .navbar-nav > .disabled > a:focus {\n color: #444;\n background-color: transparent;\n}\n.navbar-inverse .navbar-toggle {\n border-color: #333;\n}\n.navbar-inverse .navbar-toggle:hover,\n.navbar-inverse .navbar-toggle:focus {\n background-color: #333;\n}\n.navbar-inverse .navbar-toggle .icon-bar {\n background-color: #fff;\n}\n.navbar-inverse .navbar-collapse,\n.navbar-inverse .navbar-form {\n border-color: #101010;\n}\n.navbar-inverse .navbar-nav > .open > a,\n.navbar-inverse .navbar-nav > .open > a:hover,\n.navbar-inverse .navbar-nav > .open > a:focus {\n background-color: #080808;\n color: #fff;\n}\n@media (max-width: 767px) {\n .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {\n border-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu .divider {\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {\n color: #9d9d9d;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #fff;\n background-color: transparent;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #fff;\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #444;\n background-color: transparent;\n }\n}\n.navbar-inverse .navbar-link {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-link:hover {\n color: #fff;\n}\n.navbar-inverse .btn-link {\n color: #9d9d9d;\n}\n.navbar-inverse .btn-link:hover,\n.navbar-inverse .btn-link:focus {\n color: #fff;\n}\n.navbar-inverse .btn-link[disabled]:hover,\nfieldset[disabled] .navbar-inverse .btn-link:hover,\n.navbar-inverse .btn-link[disabled]:focus,\nfieldset[disabled] .navbar-inverse .btn-link:focus {\n color: #444;\n}\n.breadcrumb {\n padding: 8px 15px;\n margin-bottom: 20px;\n list-style: none;\n background-color: #f5f5f5;\n border-radius: 4px;\n}\n.breadcrumb > li {\n display: inline-block;\n}\n.breadcrumb > li + li:before {\n content: \"/\\00a0\";\n padding: 0 5px;\n color: #ccc;\n}\n.breadcrumb > .active {\n color: #777777;\n}\n.pagination {\n display: inline-block;\n padding-left: 0;\n margin: 20px 0;\n border-radius: 4px;\n}\n.pagination > li {\n display: inline;\n}\n.pagination > li > a,\n.pagination > li > span {\n position: relative;\n float: left;\n padding: 6px 12px;\n line-height: 1.42857143;\n text-decoration: none;\n color: #337ab7;\n background-color: #fff;\n border: 1px solid #ddd;\n margin-left: -1px;\n}\n.pagination > li:first-child > a,\n.pagination > li:first-child > span {\n margin-left: 0;\n border-bottom-left-radius: 4px;\n border-top-left-radius: 4px;\n}\n.pagination > li:last-child > a,\n.pagination > li:last-child > span {\n border-bottom-right-radius: 4px;\n border-top-right-radius: 4px;\n}\n.pagination > li > a:hover,\n.pagination > li > span:hover,\n.pagination > li > a:focus,\n.pagination > li > span:focus {\n z-index: 2;\n color: #23527c;\n background-color: #eeeeee;\n border-color: #ddd;\n}\n.pagination > .active > a,\n.pagination > .active > span,\n.pagination > .active > a:hover,\n.pagination > .active > span:hover,\n.pagination > .active > a:focus,\n.pagination > .active > span:focus {\n z-index: 3;\n color: #fff;\n background-color: #337ab7;\n border-color: #337ab7;\n cursor: default;\n}\n.pagination > .disabled > span,\n.pagination > .disabled > span:hover,\n.pagination > .disabled > span:focus,\n.pagination > .disabled > a,\n.pagination > .disabled > a:hover,\n.pagination > .disabled > a:focus {\n color: #777777;\n background-color: #fff;\n border-color: #ddd;\n cursor: not-allowed;\n}\n.pagination-lg > li > a,\n.pagination-lg > li > span {\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n}\n.pagination-lg > li:first-child > a,\n.pagination-lg > li:first-child > span {\n border-bottom-left-radius: 6px;\n border-top-left-radius: 6px;\n}\n.pagination-lg > li:last-child > a,\n.pagination-lg > li:last-child > span {\n border-bottom-right-radius: 6px;\n border-top-right-radius: 6px;\n}\n.pagination-sm > li > a,\n.pagination-sm > li > span {\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n}\n.pagination-sm > li:first-child > a,\n.pagination-sm > li:first-child > span {\n border-bottom-left-radius: 3px;\n border-top-left-radius: 3px;\n}\n.pagination-sm > li:last-child > a,\n.pagination-sm > li:last-child > span {\n border-bottom-right-radius: 3px;\n border-top-right-radius: 3px;\n}\n.pager {\n padding-left: 0;\n margin: 20px 0;\n list-style: none;\n text-align: center;\n}\n.pager li {\n display: inline;\n}\n.pager li > a,\n.pager li > span {\n display: inline-block;\n padding: 5px 14px;\n background-color: #fff;\n border: 1px solid #ddd;\n border-radius: 15px;\n}\n.pager li > a:hover,\n.pager li > a:focus {\n text-decoration: none;\n background-color: #eeeeee;\n}\n.pager .next > a,\n.pager .next > span {\n float: right;\n}\n.pager .previous > a,\n.pager .previous > span {\n float: left;\n}\n.pager .disabled > a,\n.pager .disabled > a:hover,\n.pager .disabled > a:focus,\n.pager .disabled > span {\n color: #777777;\n background-color: #fff;\n cursor: not-allowed;\n}\n.label {\n display: inline;\n padding: .2em .6em .3em;\n font-size: 75%;\n font-weight: bold;\n line-height: 1;\n color: #fff;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n border-radius: .25em;\n}\na.label:hover,\na.label:focus {\n color: #fff;\n text-decoration: none;\n cursor: pointer;\n}\n.label:empty {\n display: none;\n}\n.btn .label {\n position: relative;\n top: -1px;\n}\n.label-default {\n background-color: #777777;\n}\n.label-default[href]:hover,\n.label-default[href]:focus {\n background-color: #5e5e5e;\n}\n.label-primary {\n background-color: #337ab7;\n}\n.label-primary[href]:hover,\n.label-primary[href]:focus {\n background-color: #286090;\n}\n.label-success {\n background-color: #5cb85c;\n}\n.label-success[href]:hover,\n.label-success[href]:focus {\n background-color: #449d44;\n}\n.label-info {\n background-color: #5bc0de;\n}\n.label-info[href]:hover,\n.label-info[href]:focus {\n background-color: #31b0d5;\n}\n.label-warning {\n background-color: #f0ad4e;\n}\n.label-warning[href]:hover,\n.label-warning[href]:focus {\n background-color: #ec971f;\n}\n.label-danger {\n background-color: #d9534f;\n}\n.label-danger[href]:hover,\n.label-danger[href]:focus {\n background-color: #c9302c;\n}\n.badge {\n display: inline-block;\n min-width: 10px;\n padding: 3px 7px;\n font-size: 12px;\n font-weight: bold;\n color: #fff;\n line-height: 1;\n vertical-align: middle;\n white-space: nowrap;\n text-align: center;\n background-color: #777777;\n border-radius: 10px;\n}\n.badge:empty {\n display: none;\n}\n.btn .badge {\n position: relative;\n top: -1px;\n}\n.btn-xs .badge,\n.btn-group-xs > .btn .badge {\n top: 0;\n padding: 1px 5px;\n}\na.badge:hover,\na.badge:focus {\n color: #fff;\n text-decoration: none;\n cursor: pointer;\n}\n.list-group-item.active > .badge,\n.nav-pills > .active > a > .badge {\n color: #337ab7;\n background-color: #fff;\n}\n.list-group-item > .badge {\n float: right;\n}\n.list-group-item > .badge + .badge {\n margin-right: 5px;\n}\n.nav-pills > li > a > .badge {\n margin-left: 3px;\n}\n.jumbotron {\n padding-top: 30px;\n padding-bottom: 30px;\n margin-bottom: 30px;\n color: inherit;\n background-color: #eeeeee;\n}\n.jumbotron h1,\n.jumbotron .h1 {\n color: inherit;\n}\n.jumbotron p {\n margin-bottom: 15px;\n font-size: 21px;\n font-weight: 200;\n}\n.jumbotron > hr {\n border-top-color: #d5d5d5;\n}\n.container .jumbotron,\n.container-fluid .jumbotron {\n border-radius: 6px;\n padding-left: 15px;\n padding-right: 15px;\n}\n.jumbotron .container {\n max-width: 100%;\n}\n@media screen and (min-width: 768px) {\n .jumbotron {\n padding-top: 48px;\n padding-bottom: 48px;\n }\n .container .jumbotron,\n .container-fluid .jumbotron {\n padding-left: 60px;\n padding-right: 60px;\n }\n .jumbotron h1,\n .jumbotron .h1 {\n font-size: 63px;\n }\n}\n.thumbnail {\n display: block;\n padding: 4px;\n margin-bottom: 20px;\n line-height: 1.42857143;\n background-color: #fff;\n border: 1px solid #ddd;\n border-radius: 4px;\n -webkit-transition: border 0.2s ease-in-out;\n -o-transition: border 0.2s ease-in-out;\n transition: border 0.2s ease-in-out;\n}\n.thumbnail > img,\n.thumbnail a > img {\n margin-left: auto;\n margin-right: auto;\n}\na.thumbnail:hover,\na.thumbnail:focus,\na.thumbnail.active {\n border-color: #337ab7;\n}\n.thumbnail .caption {\n padding: 9px;\n color: #333333;\n}\n.alert {\n padding: 15px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n.alert h4 {\n margin-top: 0;\n color: inherit;\n}\n.alert .alert-link {\n font-weight: bold;\n}\n.alert > p,\n.alert > ul {\n margin-bottom: 0;\n}\n.alert > p + p {\n margin-top: 5px;\n}\n.alert-dismissable,\n.alert-dismissible {\n padding-right: 35px;\n}\n.alert-dismissable .close,\n.alert-dismissible .close {\n position: relative;\n top: -2px;\n right: -21px;\n color: inherit;\n}\n.alert-success {\n background-color: #dff0d8;\n border-color: #d6e9c6;\n color: #3c763d;\n}\n.alert-success hr {\n border-top-color: #c9e2b3;\n}\n.alert-success .alert-link {\n color: #2b542c;\n}\n.alert-info {\n background-color: #d9edf7;\n border-color: #bce8f1;\n color: #31708f;\n}\n.alert-info hr {\n border-top-color: #a6e1ec;\n}\n.alert-info .alert-link {\n color: #245269;\n}\n.alert-warning {\n background-color: #fcf8e3;\n border-color: #faebcc;\n color: #8a6d3b;\n}\n.alert-warning hr {\n border-top-color: #f7e1b5;\n}\n.alert-warning .alert-link {\n color: #66512c;\n}\n.alert-danger {\n background-color: #f2dede;\n border-color: #ebccd1;\n color: #a94442;\n}\n.alert-danger hr {\n border-top-color: #e4b9c0;\n}\n.alert-danger .alert-link {\n color: #843534;\n}\n@-webkit-keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n@keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n.progress {\n overflow: hidden;\n height: 20px;\n margin-bottom: 20px;\n background-color: #f5f5f5;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.progress-bar {\n float: left;\n width: 0%;\n height: 100%;\n font-size: 12px;\n line-height: 20px;\n color: #fff;\n text-align: center;\n background-color: #337ab7;\n -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n -webkit-transition: width 0.6s ease;\n -o-transition: width 0.6s ease;\n transition: width 0.6s ease;\n}\n.progress-striped .progress-bar,\n.progress-bar-striped {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-size: 40px 40px;\n}\n.progress.active .progress-bar,\n.progress-bar.active {\n -webkit-animation: progress-bar-stripes 2s linear infinite;\n -o-animation: progress-bar-stripes 2s linear infinite;\n animation: progress-bar-stripes 2s linear infinite;\n}\n.progress-bar-success {\n background-color: #5cb85c;\n}\n.progress-striped .progress-bar-success {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-info {\n background-color: #5bc0de;\n}\n.progress-striped .progress-bar-info {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-warning {\n background-color: #f0ad4e;\n}\n.progress-striped .progress-bar-warning {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-danger {\n background-color: #d9534f;\n}\n.progress-striped .progress-bar-danger {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.media {\n margin-top: 15px;\n}\n.media:first-child {\n margin-top: 0;\n}\n.media,\n.media-body {\n zoom: 1;\n overflow: hidden;\n}\n.media-body {\n width: 10000px;\n}\n.media-object {\n display: block;\n}\n.media-object.img-thumbnail {\n max-width: none;\n}\n.media-right,\n.media > .pull-right {\n padding-left: 10px;\n}\n.media-left,\n.media > .pull-left {\n padding-right: 10px;\n}\n.media-left,\n.media-right,\n.media-body {\n display: table-cell;\n vertical-align: top;\n}\n.media-middle {\n vertical-align: middle;\n}\n.media-bottom {\n vertical-align: bottom;\n}\n.media-heading {\n margin-top: 0;\n margin-bottom: 5px;\n}\n.media-list {\n padding-left: 0;\n list-style: none;\n}\n.list-group {\n margin-bottom: 20px;\n padding-left: 0;\n}\n.list-group-item {\n position: relative;\n display: block;\n padding: 10px 15px;\n margin-bottom: -1px;\n background-color: #fff;\n border: 1px solid #ddd;\n}\n.list-group-item:first-child {\n border-top-right-radius: 4px;\n border-top-left-radius: 4px;\n}\n.list-group-item:last-child {\n margin-bottom: 0;\n border-bottom-right-radius: 4px;\n border-bottom-left-radius: 4px;\n}\na.list-group-item,\nbutton.list-group-item {\n color: #555;\n}\na.list-group-item .list-group-item-heading,\nbutton.list-group-item .list-group-item-heading {\n color: #333;\n}\na.list-group-item:hover,\nbutton.list-group-item:hover,\na.list-group-item:focus,\nbutton.list-group-item:focus {\n text-decoration: none;\n color: #555;\n background-color: #f5f5f5;\n}\nbutton.list-group-item {\n width: 100%;\n text-align: left;\n}\n.list-group-item.disabled,\n.list-group-item.disabled:hover,\n.list-group-item.disabled:focus {\n background-color: #eeeeee;\n color: #777777;\n cursor: not-allowed;\n}\n.list-group-item.disabled .list-group-item-heading,\n.list-group-item.disabled:hover .list-group-item-heading,\n.list-group-item.disabled:focus .list-group-item-heading {\n color: inherit;\n}\n.list-group-item.disabled .list-group-item-text,\n.list-group-item.disabled:hover .list-group-item-text,\n.list-group-item.disabled:focus .list-group-item-text {\n color: #777777;\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n z-index: 2;\n color: #fff;\n background-color: #337ab7;\n border-color: #337ab7;\n}\n.list-group-item.active .list-group-item-heading,\n.list-group-item.active:hover .list-group-item-heading,\n.list-group-item.active:focus .list-group-item-heading,\n.list-group-item.active .list-group-item-heading > small,\n.list-group-item.active:hover .list-group-item-heading > small,\n.list-group-item.active:focus .list-group-item-heading > small,\n.list-group-item.active .list-group-item-heading > .small,\n.list-group-item.active:hover .list-group-item-heading > .small,\n.list-group-item.active:focus .list-group-item-heading > .small {\n color: inherit;\n}\n.list-group-item.active .list-group-item-text,\n.list-group-item.active:hover .list-group-item-text,\n.list-group-item.active:focus .list-group-item-text {\n color: #c7ddef;\n}\n.list-group-item-success {\n color: #3c763d;\n background-color: #dff0d8;\n}\na.list-group-item-success,\nbutton.list-group-item-success {\n color: #3c763d;\n}\na.list-group-item-success .list-group-item-heading,\nbutton.list-group-item-success .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-success:hover,\nbutton.list-group-item-success:hover,\na.list-group-item-success:focus,\nbutton.list-group-item-success:focus {\n color: #3c763d;\n background-color: #d0e9c6;\n}\na.list-group-item-success.active,\nbutton.list-group-item-success.active,\na.list-group-item-success.active:hover,\nbutton.list-group-item-success.active:hover,\na.list-group-item-success.active:focus,\nbutton.list-group-item-success.active:focus {\n color: #fff;\n background-color: #3c763d;\n border-color: #3c763d;\n}\n.list-group-item-info {\n color: #31708f;\n background-color: #d9edf7;\n}\na.list-group-item-info,\nbutton.list-group-item-info {\n color: #31708f;\n}\na.list-group-item-info .list-group-item-heading,\nbutton.list-group-item-info .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-info:hover,\nbutton.list-group-item-info:hover,\na.list-group-item-info:focus,\nbutton.list-group-item-info:focus {\n color: #31708f;\n background-color: #c4e3f3;\n}\na.list-group-item-info.active,\nbutton.list-group-item-info.active,\na.list-group-item-info.active:hover,\nbutton.list-group-item-info.active:hover,\na.list-group-item-info.active:focus,\nbutton.list-group-item-info.active:focus {\n color: #fff;\n background-color: #31708f;\n border-color: #31708f;\n}\n.list-group-item-warning {\n color: #8a6d3b;\n background-color: #fcf8e3;\n}\na.list-group-item-warning,\nbutton.list-group-item-warning {\n color: #8a6d3b;\n}\na.list-group-item-warning .list-group-item-heading,\nbutton.list-group-item-warning .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-warning:hover,\nbutton.list-group-item-warning:hover,\na.list-group-item-warning:focus,\nbutton.list-group-item-warning:focus {\n color: #8a6d3b;\n background-color: #faf2cc;\n}\na.list-group-item-warning.active,\nbutton.list-group-item-warning.active,\na.list-group-item-warning.active:hover,\nbutton.list-group-item-warning.active:hover,\na.list-group-item-warning.active:focus,\nbutton.list-group-item-warning.active:focus {\n color: #fff;\n background-color: #8a6d3b;\n border-color: #8a6d3b;\n}\n.list-group-item-danger {\n color: #a94442;\n background-color: #f2dede;\n}\na.list-group-item-danger,\nbutton.list-group-item-danger {\n color: #a94442;\n}\na.list-group-item-danger .list-group-item-heading,\nbutton.list-group-item-danger .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-danger:hover,\nbutton.list-group-item-danger:hover,\na.list-group-item-danger:focus,\nbutton.list-group-item-danger:focus {\n color: #a94442;\n background-color: #ebcccc;\n}\na.list-group-item-danger.active,\nbutton.list-group-item-danger.active,\na.list-group-item-danger.active:hover,\nbutton.list-group-item-danger.active:hover,\na.list-group-item-danger.active:focus,\nbutton.list-group-item-danger.active:focus {\n color: #fff;\n background-color: #a94442;\n border-color: #a94442;\n}\n.list-group-item-heading {\n margin-top: 0;\n margin-bottom: 5px;\n}\n.list-group-item-text {\n margin-bottom: 0;\n line-height: 1.3;\n}\n.panel {\n margin-bottom: 20px;\n background-color: #fff;\n border: 1px solid transparent;\n border-radius: 4px;\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n}\n.panel-body {\n padding: 15px;\n}\n.panel-heading {\n padding: 10px 15px;\n border-bottom: 1px solid transparent;\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n}\n.panel-heading > .dropdown .dropdown-toggle {\n color: inherit;\n}\n.panel-title {\n margin-top: 0;\n margin-bottom: 0;\n font-size: 16px;\n color: inherit;\n}\n.panel-title > a,\n.panel-title > small,\n.panel-title > .small,\n.panel-title > small > a,\n.panel-title > .small > a {\n color: inherit;\n}\n.panel-footer {\n padding: 10px 15px;\n background-color: #f5f5f5;\n border-top: 1px solid #ddd;\n border-bottom-right-radius: 3px;\n border-bottom-left-radius: 3px;\n}\n.panel > .list-group,\n.panel > .panel-collapse > .list-group {\n margin-bottom: 0;\n}\n.panel > .list-group .list-group-item,\n.panel > .panel-collapse > .list-group .list-group-item {\n border-width: 1px 0;\n border-radius: 0;\n}\n.panel > .list-group:first-child .list-group-item:first-child,\n.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {\n border-top: 0;\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n}\n.panel > .list-group:last-child .list-group-item:last-child,\n.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {\n border-bottom: 0;\n border-bottom-right-radius: 3px;\n border-bottom-left-radius: 3px;\n}\n.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.panel-heading + .list-group .list-group-item:first-child {\n border-top-width: 0;\n}\n.list-group + .panel-footer {\n border-top-width: 0;\n}\n.panel > .table,\n.panel > .table-responsive > .table,\n.panel > .panel-collapse > .table {\n margin-bottom: 0;\n}\n.panel > .table caption,\n.panel > .table-responsive > .table caption,\n.panel > .panel-collapse > .table caption {\n padding-left: 15px;\n padding-right: 15px;\n}\n.panel > .table:first-child,\n.panel > .table-responsive:first-child > .table:first-child {\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {\n border-top-left-radius: 3px;\n border-top-right-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,\n.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {\n border-top-left-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,\n.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {\n border-top-right-radius: 3px;\n}\n.panel > .table:last-child,\n.panel > .table-responsive:last-child > .table:last-child {\n border-bottom-right-radius: 3px;\n border-bottom-left-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,\n.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {\n border-bottom-left-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,\n.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {\n border-bottom-right-radius: 3px;\n}\n.panel > .panel-body + .table,\n.panel > .panel-body + .table-responsive,\n.panel > .table + .panel-body,\n.panel > .table-responsive + .panel-body {\n border-top: 1px solid #ddd;\n}\n.panel > .table > tbody:first-child > tr:first-child th,\n.panel > .table > tbody:first-child > tr:first-child td {\n border-top: 0;\n}\n.panel > .table-bordered,\n.panel > .table-responsive > .table-bordered {\n border: 0;\n}\n.panel > .table-bordered > thead > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,\n.panel > .table-bordered > tbody > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,\n.panel > .table-bordered > tfoot > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,\n.panel > .table-bordered > thead > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,\n.panel > .table-bordered > tbody > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,\n.panel > .table-bordered > tfoot > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {\n border-left: 0;\n}\n.panel > .table-bordered > thead > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,\n.panel > .table-bordered > tbody > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,\n.panel > .table-bordered > tfoot > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,\n.panel > .table-bordered > thead > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,\n.panel > .table-bordered > tbody > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,\n.panel > .table-bordered > tfoot > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {\n border-right: 0;\n}\n.panel > .table-bordered > thead > tr:first-child > td,\n.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,\n.panel > .table-bordered > tbody > tr:first-child > td,\n.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,\n.panel > .table-bordered > thead > tr:first-child > th,\n.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,\n.panel > .table-bordered > tbody > tr:first-child > th,\n.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {\n border-bottom: 0;\n}\n.panel > .table-bordered > tbody > tr:last-child > td,\n.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,\n.panel > .table-bordered > tfoot > tr:last-child > td,\n.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,\n.panel > .table-bordered > tbody > tr:last-child > th,\n.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,\n.panel > .table-bordered > tfoot > tr:last-child > th,\n.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {\n border-bottom: 0;\n}\n.panel > .table-responsive {\n border: 0;\n margin-bottom: 0;\n}\n.panel-group {\n margin-bottom: 20px;\n}\n.panel-group .panel {\n margin-bottom: 0;\n border-radius: 4px;\n}\n.panel-group .panel + .panel {\n margin-top: 5px;\n}\n.panel-group .panel-heading {\n border-bottom: 0;\n}\n.panel-group .panel-heading + .panel-collapse > .panel-body,\n.panel-group .panel-heading + .panel-collapse > .list-group {\n border-top: 1px solid #ddd;\n}\n.panel-group .panel-footer {\n border-top: 0;\n}\n.panel-group .panel-footer + .panel-collapse .panel-body {\n border-bottom: 1px solid #ddd;\n}\n.panel-default {\n border-color: #ddd;\n}\n.panel-default > .panel-heading {\n color: #333333;\n background-color: #f5f5f5;\n border-color: #ddd;\n}\n.panel-default > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #ddd;\n}\n.panel-default > .panel-heading .badge {\n color: #f5f5f5;\n background-color: #333333;\n}\n.panel-default > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #ddd;\n}\n.panel-primary {\n border-color: #337ab7;\n}\n.panel-primary > .panel-heading {\n color: #fff;\n background-color: #337ab7;\n border-color: #337ab7;\n}\n.panel-primary > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #337ab7;\n}\n.panel-primary > .panel-heading .badge {\n color: #337ab7;\n background-color: #fff;\n}\n.panel-primary > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #337ab7;\n}\n.panel-success {\n border-color: #d6e9c6;\n}\n.panel-success > .panel-heading {\n color: #3c763d;\n background-color: #dff0d8;\n border-color: #d6e9c6;\n}\n.panel-success > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #d6e9c6;\n}\n.panel-success > .panel-heading .badge {\n color: #dff0d8;\n background-color: #3c763d;\n}\n.panel-success > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #d6e9c6;\n}\n.panel-info {\n border-color: #bce8f1;\n}\n.panel-info > .panel-heading {\n color: #31708f;\n background-color: #d9edf7;\n border-color: #bce8f1;\n}\n.panel-info > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #bce8f1;\n}\n.panel-info > .panel-heading .badge {\n color: #d9edf7;\n background-color: #31708f;\n}\n.panel-info > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #bce8f1;\n}\n.panel-warning {\n border-color: #faebcc;\n}\n.panel-warning > .panel-heading {\n color: #8a6d3b;\n background-color: #fcf8e3;\n border-color: #faebcc;\n}\n.panel-warning > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #faebcc;\n}\n.panel-warning > .panel-heading .badge {\n color: #fcf8e3;\n background-color: #8a6d3b;\n}\n.panel-warning > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #faebcc;\n}\n.panel-danger {\n border-color: #ebccd1;\n}\n.panel-danger > .panel-heading {\n color: #a94442;\n background-color: #f2dede;\n border-color: #ebccd1;\n}\n.panel-danger > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #ebccd1;\n}\n.panel-danger > .panel-heading .badge {\n color: #f2dede;\n background-color: #a94442;\n}\n.panel-danger > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #ebccd1;\n}\n.embed-responsive {\n position: relative;\n display: block;\n height: 0;\n padding: 0;\n overflow: hidden;\n}\n.embed-responsive .embed-responsive-item,\n.embed-responsive iframe,\n.embed-responsive embed,\n.embed-responsive object,\n.embed-responsive video {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n border: 0;\n}\n.embed-responsive-16by9 {\n padding-bottom: 56.25%;\n}\n.embed-responsive-4by3 {\n padding-bottom: 75%;\n}\n.well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: #f5f5f5;\n border: 1px solid #e3e3e3;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);\n}\n.well blockquote {\n border-color: #ddd;\n border-color: rgba(0, 0, 0, 0.15);\n}\n.well-lg {\n padding: 24px;\n border-radius: 6px;\n}\n.well-sm {\n padding: 9px;\n border-radius: 3px;\n}\n.close {\n float: right;\n font-size: 21px;\n font-weight: bold;\n line-height: 1;\n color: #000;\n text-shadow: 0 1px 0 #fff;\n opacity: 0.2;\n filter: alpha(opacity=20);\n}\n.close:hover,\n.close:focus {\n color: #000;\n text-decoration: none;\n cursor: pointer;\n opacity: 0.5;\n filter: alpha(opacity=50);\n}\nbutton.close {\n padding: 0;\n cursor: pointer;\n background: transparent;\n border: 0;\n -webkit-appearance: none;\n}\n.modal-open {\n overflow: hidden;\n}\n.modal {\n display: none;\n overflow: hidden;\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1050;\n -webkit-overflow-scrolling: touch;\n outline: 0;\n}\n.modal.fade .modal-dialog {\n -webkit-transform: translate(0, -25%);\n -ms-transform: translate(0, -25%);\n -o-transform: translate(0, -25%);\n transform: translate(0, -25%);\n -webkit-transition: -webkit-transform 0.3s ease-out;\n -moz-transition: -moz-transform 0.3s ease-out;\n -o-transition: -o-transform 0.3s ease-out;\n transition: transform 0.3s ease-out;\n}\n.modal.in .modal-dialog {\n -webkit-transform: translate(0, 0);\n -ms-transform: translate(0, 0);\n -o-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n.modal-open .modal {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.modal-dialog {\n position: relative;\n width: auto;\n margin: 10px;\n}\n.modal-content {\n position: relative;\n background-color: #fff;\n border: 1px solid #999;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 6px;\n -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);\n box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);\n background-clip: padding-box;\n outline: 0;\n}\n.modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1040;\n background-color: #000;\n}\n.modal-backdrop.fade {\n opacity: 0;\n filter: alpha(opacity=0);\n}\n.modal-backdrop.in {\n opacity: 0.5;\n filter: alpha(opacity=50);\n}\n.modal-header {\n padding: 15px;\n border-bottom: 1px solid #e5e5e5;\n}\n.modal-header .close {\n margin-top: -2px;\n}\n.modal-title {\n margin: 0;\n line-height: 1.42857143;\n}\n.modal-body {\n position: relative;\n padding: 15px;\n}\n.modal-footer {\n padding: 15px;\n text-align: right;\n border-top: 1px solid #e5e5e5;\n}\n.modal-footer .btn + .btn {\n margin-left: 5px;\n margin-bottom: 0;\n}\n.modal-footer .btn-group .btn + .btn {\n margin-left: -1px;\n}\n.modal-footer .btn-block + .btn-block {\n margin-left: 0;\n}\n.modal-scrollbar-measure {\n position: absolute;\n top: -9999px;\n width: 50px;\n height: 50px;\n overflow: scroll;\n}\n@media (min-width: 768px) {\n .modal-dialog {\n width: 600px;\n margin: 30px auto;\n }\n .modal-content {\n -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);\n }\n .modal-sm {\n width: 300px;\n }\n}\n@media (min-width: 992px) {\n .modal-lg {\n width: 900px;\n }\n}\n.tooltip {\n position: absolute;\n z-index: 1070;\n display: block;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n line-break: auto;\n line-height: 1.42857143;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n white-space: normal;\n word-break: normal;\n word-spacing: normal;\n word-wrap: normal;\n font-size: 12px;\n opacity: 0;\n filter: alpha(opacity=0);\n}\n.tooltip.in {\n opacity: 0.9;\n filter: alpha(opacity=90);\n}\n.tooltip.top {\n margin-top: -3px;\n padding: 5px 0;\n}\n.tooltip.right {\n margin-left: 3px;\n padding: 0 5px;\n}\n.tooltip.bottom {\n margin-top: 3px;\n padding: 5px 0;\n}\n.tooltip.left {\n margin-left: -3px;\n padding: 0 5px;\n}\n.tooltip-inner {\n max-width: 200px;\n padding: 3px 8px;\n color: #fff;\n text-align: center;\n background-color: #000;\n border-radius: 4px;\n}\n.tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n}\n.tooltip.top .tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n}\n.tooltip.top-left .tooltip-arrow {\n bottom: 0;\n right: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n}\n.tooltip.top-right .tooltip-arrow {\n bottom: 0;\n left: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n}\n.tooltip.right .tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -5px;\n border-width: 5px 5px 5px 0;\n border-right-color: #000;\n}\n.tooltip.left .tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -5px;\n border-width: 5px 0 5px 5px;\n border-left-color: #000;\n}\n.tooltip.bottom .tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n}\n.tooltip.bottom-left .tooltip-arrow {\n top: 0;\n right: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n}\n.tooltip.bottom-right .tooltip-arrow {\n top: 0;\n left: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n}\n.popover {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1060;\n display: none;\n max-width: 276px;\n padding: 1px;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n line-break: auto;\n line-height: 1.42857143;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n white-space: normal;\n word-break: normal;\n word-spacing: normal;\n word-wrap: normal;\n font-size: 14px;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ccc;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 6px;\n -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n}\n.popover.top {\n margin-top: -10px;\n}\n.popover.right {\n margin-left: 10px;\n}\n.popover.bottom {\n margin-top: 10px;\n}\n.popover.left {\n margin-left: -10px;\n}\n.popover-title {\n margin: 0;\n padding: 8px 14px;\n font-size: 14px;\n background-color: #f7f7f7;\n border-bottom: 1px solid #ebebeb;\n border-radius: 5px 5px 0 0;\n}\n.popover-content {\n padding: 9px 14px;\n}\n.popover > .arrow,\n.popover > .arrow:after {\n position: absolute;\n display: block;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n}\n.popover > .arrow {\n border-width: 11px;\n}\n.popover > .arrow:after {\n border-width: 10px;\n content: \"\";\n}\n.popover.top > .arrow {\n left: 50%;\n margin-left: -11px;\n border-bottom-width: 0;\n border-top-color: #999999;\n border-top-color: rgba(0, 0, 0, 0.25);\n bottom: -11px;\n}\n.popover.top > .arrow:after {\n content: \" \";\n bottom: 1px;\n margin-left: -10px;\n border-bottom-width: 0;\n border-top-color: #fff;\n}\n.popover.right > .arrow {\n top: 50%;\n left: -11px;\n margin-top: -11px;\n border-left-width: 0;\n border-right-color: #999999;\n border-right-color: rgba(0, 0, 0, 0.25);\n}\n.popover.right > .arrow:after {\n content: \" \";\n left: 1px;\n bottom: -10px;\n border-left-width: 0;\n border-right-color: #fff;\n}\n.popover.bottom > .arrow {\n left: 50%;\n margin-left: -11px;\n border-top-width: 0;\n border-bottom-color: #999999;\n border-bottom-color: rgba(0, 0, 0, 0.25);\n top: -11px;\n}\n.popover.bottom > .arrow:after {\n content: \" \";\n top: 1px;\n margin-left: -10px;\n border-top-width: 0;\n border-bottom-color: #fff;\n}\n.popover.left > .arrow {\n top: 50%;\n right: -11px;\n margin-top: -11px;\n border-right-width: 0;\n border-left-color: #999999;\n border-left-color: rgba(0, 0, 0, 0.25);\n}\n.popover.left > .arrow:after {\n content: \" \";\n right: 1px;\n border-right-width: 0;\n border-left-color: #fff;\n bottom: -10px;\n}\n.carousel {\n position: relative;\n}\n.carousel-inner {\n position: relative;\n overflow: hidden;\n width: 100%;\n}\n.carousel-inner > .item {\n display: none;\n position: relative;\n -webkit-transition: 0.6s ease-in-out left;\n -o-transition: 0.6s ease-in-out left;\n transition: 0.6s ease-in-out left;\n}\n.carousel-inner > .item > img,\n.carousel-inner > .item > a > img {\n line-height: 1;\n}\n@media all and (transform-3d), (-webkit-transform-3d) {\n .carousel-inner > .item {\n -webkit-transition: -webkit-transform 0.6s ease-in-out;\n -moz-transition: -moz-transform 0.6s ease-in-out;\n -o-transition: -o-transform 0.6s ease-in-out;\n transition: transform 0.6s ease-in-out;\n -webkit-backface-visibility: hidden;\n -moz-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-perspective: 1000px;\n -moz-perspective: 1000px;\n perspective: 1000px;\n }\n .carousel-inner > .item.next,\n .carousel-inner > .item.active.right {\n -webkit-transform: translate3d(100%, 0, 0);\n transform: translate3d(100%, 0, 0);\n left: 0;\n }\n .carousel-inner > .item.prev,\n .carousel-inner > .item.active.left {\n -webkit-transform: translate3d(-100%, 0, 0);\n transform: translate3d(-100%, 0, 0);\n left: 0;\n }\n .carousel-inner > .item.next.left,\n .carousel-inner > .item.prev.right,\n .carousel-inner > .item.active {\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n left: 0;\n }\n}\n.carousel-inner > .active,\n.carousel-inner > .next,\n.carousel-inner > .prev {\n display: block;\n}\n.carousel-inner > .active {\n left: 0;\n}\n.carousel-inner > .next,\n.carousel-inner > .prev {\n position: absolute;\n top: 0;\n width: 100%;\n}\n.carousel-inner > .next {\n left: 100%;\n}\n.carousel-inner > .prev {\n left: -100%;\n}\n.carousel-inner > .next.left,\n.carousel-inner > .prev.right {\n left: 0;\n}\n.carousel-inner > .active.left {\n left: -100%;\n}\n.carousel-inner > .active.right {\n left: 100%;\n}\n.carousel-control {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: 15%;\n opacity: 0.5;\n filter: alpha(opacity=50);\n font-size: 20px;\n color: #fff;\n text-align: center;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);\n background-color: rgba(0, 0, 0, 0);\n}\n.carousel-control.left {\n background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);\n}\n.carousel-control.right {\n left: auto;\n right: 0;\n background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);\n}\n.carousel-control:hover,\n.carousel-control:focus {\n outline: 0;\n color: #fff;\n text-decoration: none;\n opacity: 0.9;\n filter: alpha(opacity=90);\n}\n.carousel-control .icon-prev,\n.carousel-control .icon-next,\n.carousel-control .glyphicon-chevron-left,\n.carousel-control .glyphicon-chevron-right {\n position: absolute;\n top: 50%;\n margin-top: -10px;\n z-index: 5;\n display: inline-block;\n}\n.carousel-control .icon-prev,\n.carousel-control .glyphicon-chevron-left {\n left: 50%;\n margin-left: -10px;\n}\n.carousel-control .icon-next,\n.carousel-control .glyphicon-chevron-right {\n right: 50%;\n margin-right: -10px;\n}\n.carousel-control .icon-prev,\n.carousel-control .icon-next {\n width: 20px;\n height: 20px;\n line-height: 1;\n font-family: serif;\n}\n.carousel-control .icon-prev:before {\n content: '\\2039';\n}\n.carousel-control .icon-next:before {\n content: '\\203a';\n}\n.carousel-indicators {\n position: absolute;\n bottom: 10px;\n left: 50%;\n z-index: 15;\n width: 60%;\n margin-left: -30%;\n padding-left: 0;\n list-style: none;\n text-align: center;\n}\n.carousel-indicators li {\n display: inline-block;\n width: 10px;\n height: 10px;\n margin: 1px;\n text-indent: -999px;\n border: 1px solid #fff;\n border-radius: 10px;\n cursor: pointer;\n background-color: #000 \\9;\n background-color: rgba(0, 0, 0, 0);\n}\n.carousel-indicators .active {\n margin: 0;\n width: 12px;\n height: 12px;\n background-color: #fff;\n}\n.carousel-caption {\n position: absolute;\n left: 15%;\n right: 15%;\n bottom: 20px;\n z-index: 10;\n padding-top: 20px;\n padding-bottom: 20px;\n color: #fff;\n text-align: center;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);\n}\n.carousel-caption .btn {\n text-shadow: none;\n}\n@media screen and (min-width: 768px) {\n .carousel-control .glyphicon-chevron-left,\n .carousel-control .glyphicon-chevron-right,\n .carousel-control .icon-prev,\n .carousel-control .icon-next {\n width: 30px;\n height: 30px;\n margin-top: -10px;\n font-size: 30px;\n }\n .carousel-control .glyphicon-chevron-left,\n .carousel-control .icon-prev {\n margin-left: -10px;\n }\n .carousel-control .glyphicon-chevron-right,\n .carousel-control .icon-next {\n margin-right: -10px;\n }\n .carousel-caption {\n left: 20%;\n right: 20%;\n padding-bottom: 30px;\n }\n .carousel-indicators {\n bottom: 20px;\n }\n}\n.clearfix:before,\n.clearfix:after,\n.dl-horizontal dd:before,\n.dl-horizontal dd:after,\n.container:before,\n.container:after,\n.container-fluid:before,\n.container-fluid:after,\n.row:before,\n.row:after,\n.form-horizontal .form-group:before,\n.form-horizontal .form-group:after,\n.btn-toolbar:before,\n.btn-toolbar:after,\n.btn-group-vertical > .btn-group:before,\n.btn-group-vertical > .btn-group:after,\n.nav:before,\n.nav:after,\n.navbar:before,\n.navbar:after,\n.navbar-header:before,\n.navbar-header:after,\n.navbar-collapse:before,\n.navbar-collapse:after,\n.pager:before,\n.pager:after,\n.panel-body:before,\n.panel-body:after,\n.modal-header:before,\n.modal-header:after,\n.modal-footer:before,\n.modal-footer:after {\n content: \" \";\n display: table;\n}\n.clearfix:after,\n.dl-horizontal dd:after,\n.container:after,\n.container-fluid:after,\n.row:after,\n.form-horizontal .form-group:after,\n.btn-toolbar:after,\n.btn-group-vertical > .btn-group:after,\n.nav:after,\n.navbar:after,\n.navbar-header:after,\n.navbar-collapse:after,\n.pager:after,\n.panel-body:after,\n.modal-header:after,\n.modal-footer:after {\n clear: both;\n}\n.center-block {\n display: block;\n margin-left: auto;\n margin-right: auto;\n}\n.pull-right {\n float: right !important;\n}\n.pull-left {\n float: left !important;\n}\n.hide {\n display: none !important;\n}\n.show {\n display: block !important;\n}\n.invisible {\n visibility: hidden;\n}\n.text-hide {\n font: 0/0 a;\n color: transparent;\n text-shadow: none;\n background-color: transparent;\n border: 0;\n}\n.hidden {\n display: none !important;\n}\n.affix {\n position: fixed;\n}\n@-ms-viewport {\n width: device-width;\n}\n.visible-xs,\n.visible-sm,\n.visible-md,\n.visible-lg {\n display: none !important;\n}\n.visible-xs-block,\n.visible-xs-inline,\n.visible-xs-inline-block,\n.visible-sm-block,\n.visible-sm-inline,\n.visible-sm-inline-block,\n.visible-md-block,\n.visible-md-inline,\n.visible-md-inline-block,\n.visible-lg-block,\n.visible-lg-inline,\n.visible-lg-inline-block {\n display: none !important;\n}\n@media (max-width: 767px) {\n .visible-xs {\n display: block !important;\n }\n table.visible-xs {\n display: table !important;\n }\n tr.visible-xs {\n display: table-row !important;\n }\n th.visible-xs,\n td.visible-xs {\n display: table-cell !important;\n }\n}\n@media (max-width: 767px) {\n .visible-xs-block {\n display: block !important;\n }\n}\n@media (max-width: 767px) {\n .visible-xs-inline {\n display: inline !important;\n }\n}\n@media (max-width: 767px) {\n .visible-xs-inline-block {\n display: inline-block !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm {\n display: block !important;\n }\n table.visible-sm {\n display: table !important;\n }\n tr.visible-sm {\n display: table-row !important;\n }\n th.visible-sm,\n td.visible-sm {\n display: table-cell !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm-block {\n display: block !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm-inline {\n display: inline !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm-inline-block {\n display: inline-block !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md {\n display: block !important;\n }\n table.visible-md {\n display: table !important;\n }\n tr.visible-md {\n display: table-row !important;\n }\n th.visible-md,\n td.visible-md {\n display: table-cell !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md-block {\n display: block !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md-inline {\n display: inline !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md-inline-block {\n display: inline-block !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg {\n display: block !important;\n }\n table.visible-lg {\n display: table !important;\n }\n tr.visible-lg {\n display: table-row !important;\n }\n th.visible-lg,\n td.visible-lg {\n display: table-cell !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg-block {\n display: block !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg-inline {\n display: inline !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg-inline-block {\n display: inline-block !important;\n }\n}\n@media (max-width: 767px) {\n .hidden-xs {\n display: none !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .hidden-sm {\n display: none !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .hidden-md {\n display: none !important;\n }\n}\n@media (min-width: 1200px) {\n .hidden-lg {\n display: none !important;\n }\n}\n.visible-print {\n display: none !important;\n}\n@media print {\n .visible-print {\n display: block !important;\n }\n table.visible-print {\n display: table !important;\n }\n tr.visible-print {\n display: table-row !important;\n }\n th.visible-print,\n td.visible-print {\n display: table-cell !important;\n }\n}\n.visible-print-block {\n display: none !important;\n}\n@media print {\n .visible-print-block {\n display: block !important;\n }\n}\n.visible-print-inline {\n display: none !important;\n}\n@media print {\n .visible-print-inline {\n display: inline !important;\n }\n}\n.visible-print-inline-block {\n display: none !important;\n}\n@media print {\n .visible-print-inline-block {\n display: inline-block !important;\n }\n}\n@media print {\n .hidden-print {\n display: none !important;\n }\n}\n/*# sourceMappingURL=bootstrap.css.map */","/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n\n//\n// 1. Set default font family to sans-serif.\n// 2. Prevent iOS and IE text size adjust after device orientation change,\n// without disabling user zoom.\n//\n\nhtml {\n font-family: sans-serif; // 1\n -ms-text-size-adjust: 100%; // 2\n -webkit-text-size-adjust: 100%; // 2\n}\n\n//\n// Remove default margin.\n//\n\nbody {\n margin: 0;\n}\n\n// HTML5 display definitions\n// ==========================================================================\n\n//\n// Correct `block` display not defined for any HTML5 element in IE 8/9.\n// Correct `block` display not defined for `details` or `summary` in IE 10/11\n// and Firefox.\n// Correct `block` display not defined for `main` in IE 11.\n//\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n display: block;\n}\n\n//\n// 1. Correct `inline-block` display not defined in IE 8/9.\n// 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n//\n\naudio,\ncanvas,\nprogress,\nvideo {\n display: inline-block; // 1\n vertical-align: baseline; // 2\n}\n\n//\n// Prevent modern browsers from displaying `audio` without controls.\n// Remove excess height in iOS 5 devices.\n//\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\n//\n// Address `[hidden]` styling not present in IE 8/9/10.\n// Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n//\n\n[hidden],\ntemplate {\n display: none;\n}\n\n// Links\n// ==========================================================================\n\n//\n// Remove the gray background color from active links in IE 10.\n//\n\na {\n background-color: transparent;\n}\n\n//\n// Improve readability of focused elements when they are also in an\n// active/hover state.\n//\n\na:active,\na:hover {\n outline: 0;\n}\n\n// Text-level semantics\n// ==========================================================================\n\n//\n// Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n//\n\nabbr[title] {\n border-bottom: 1px dotted;\n}\n\n//\n// Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n//\n\nb,\nstrong {\n font-weight: bold;\n}\n\n//\n// Address styling not present in Safari and Chrome.\n//\n\ndfn {\n font-style: italic;\n}\n\n//\n// Address variable `h1` font-size and margin within `section` and `article`\n// contexts in Firefox 4+, Safari, and Chrome.\n//\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n//\n// Address styling not present in IE 8/9.\n//\n\nmark {\n background: #ff0;\n color: #000;\n}\n\n//\n// Address inconsistent and variable font size in all browsers.\n//\n\nsmall {\n font-size: 80%;\n}\n\n//\n// Prevent `sub` and `sup` affecting `line-height` in all browsers.\n//\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsup {\n top: -0.5em;\n}\n\nsub {\n bottom: -0.25em;\n}\n\n// Embedded content\n// ==========================================================================\n\n//\n// Remove border when inside `a` element in IE 8/9/10.\n//\n\nimg {\n border: 0;\n}\n\n//\n// Correct overflow not hidden in IE 9/10/11.\n//\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n// Grouping content\n// ==========================================================================\n\n//\n// Address margin not present in IE 8/9 and Safari.\n//\n\nfigure {\n margin: 1em 40px;\n}\n\n//\n// Address differences between Firefox and other browsers.\n//\n\nhr {\n box-sizing: content-box;\n height: 0;\n}\n\n//\n// Contain overflow in all browsers.\n//\n\npre {\n overflow: auto;\n}\n\n//\n// Address odd `em`-unit font size rendering in all browsers.\n//\n\ncode,\nkbd,\npre,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\n// Forms\n// ==========================================================================\n\n//\n// Known limitation: by default, Chrome and Safari on OS X allow very limited\n// styling of `select`, unless a `border` property is set.\n//\n\n//\n// 1. Correct color not being inherited.\n// Known issue: affects color of disabled elements.\n// 2. Correct font properties not being inherited.\n// 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n//\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n color: inherit; // 1\n font: inherit; // 2\n margin: 0; // 3\n}\n\n//\n// Address `overflow` set to `hidden` in IE 8/9/10/11.\n//\n\nbutton {\n overflow: visible;\n}\n\n//\n// Address inconsistent `text-transform` inheritance for `button` and `select`.\n// All other form control elements do not inherit `text-transform` values.\n// Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n// Correct `select` style inheritance in Firefox.\n//\n\nbutton,\nselect {\n text-transform: none;\n}\n\n//\n// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n// and `video` controls.\n// 2. Correct inability to style clickable `input` types in iOS.\n// 3. Improve usability and consistency of cursor style between image-type\n// `input` and others.\n//\n\nbutton,\nhtml input[type=\"button\"], // 1\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button; // 2\n cursor: pointer; // 3\n}\n\n//\n// Re-set default cursor for disabled elements.\n//\n\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\n\n//\n// Remove inner padding and border in Firefox 4+.\n//\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n//\n// Address Firefox 4+ setting `line-height` on `input` using `!important` in\n// the UA stylesheet.\n//\n\ninput {\n line-height: normal;\n}\n\n//\n// It's recommended that you don't attempt to style these elements.\n// Firefox's implementation doesn't respect box-sizing, padding, or width.\n//\n// 1. Address box sizing set to `content-box` in IE 8/9/10.\n// 2. Remove excess padding in IE 8/9/10.\n//\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box; // 1\n padding: 0; // 2\n}\n\n//\n// Fix the cursor style for Chrome's increment/decrement buttons. For certain\n// `font-size` values of the `input`, it causes the cursor style of the\n// decrement button to change from `default` to `text`.\n//\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n//\n// 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n// 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n//\n\ninput[type=\"search\"] {\n -webkit-appearance: textfield; // 1\n box-sizing: content-box; //2\n}\n\n//\n// Remove inner padding and search cancel button in Safari and Chrome on OS X.\n// Safari (but not Chrome) clips the cancel button when the search input has\n// padding (and `textfield` appearance).\n//\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n//\n// Define consistent border, margin, and padding.\n//\n\nfieldset {\n border: 1px solid #c0c0c0;\n margin: 0 2px;\n padding: 0.35em 0.625em 0.75em;\n}\n\n//\n// 1. Correct `color` not being inherited in IE 8/9/10/11.\n// 2. Remove padding so people aren't caught out if they zero out fieldsets.\n//\n\nlegend {\n border: 0; // 1\n padding: 0; // 2\n}\n\n//\n// Remove default vertical scrollbar in IE 8/9/10/11.\n//\n\ntextarea {\n overflow: auto;\n}\n\n//\n// Don't inherit the `font-weight` (applied by a rule above).\n// NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n//\n\noptgroup {\n font-weight: bold;\n}\n\n// Tables\n// ==========================================================================\n\n//\n// Remove most spacing between table cells.\n//\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\ntd,\nth {\n padding: 0;\n}\n","/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */\n\n// ==========================================================================\n// Print styles.\n// Inlined to avoid the additional HTTP request: h5bp.com/r\n// ==========================================================================\n\n@media print {\n *,\n *:before,\n *:after {\n background: transparent !important;\n color: #000 !important; // Black prints faster: h5bp.com/s\n box-shadow: none !important;\n text-shadow: none !important;\n }\n\n a,\n a:visited {\n text-decoration: underline;\n }\n\n a[href]:after {\n content: \" (\" attr(href) \")\";\n }\n\n abbr[title]:after {\n content: \" (\" attr(title) \")\";\n }\n\n // Don't show links that are fragment identifiers,\n // or use the `javascript:` pseudo protocol\n a[href^=\"#\"]:after,\n a[href^=\"javascript:\"]:after {\n content: \"\";\n }\n\n pre,\n blockquote {\n border: 1px solid #999;\n page-break-inside: avoid;\n }\n\n thead {\n display: table-header-group; // h5bp.com/t\n }\n\n tr,\n img {\n page-break-inside: avoid;\n }\n\n img {\n max-width: 100% !important;\n }\n\n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n\n h2,\n h3 {\n page-break-after: avoid;\n }\n\n // Bootstrap specific changes start\n\n // Bootstrap components\n .navbar {\n display: none;\n }\n .btn,\n .dropup > .btn {\n > .caret {\n border-top-color: #000 !important;\n }\n }\n .label {\n border: 1px solid #000;\n }\n\n .table {\n border-collapse: collapse !important;\n\n td,\n th {\n background-color: #fff !important;\n }\n }\n .table-bordered {\n th,\n td {\n border: 1px solid #ddd !important;\n }\n }\n\n // Bootstrap specific changes end\n}\n","//\n// Glyphicons for Bootstrap\n//\n// Since icons are fonts, they can be placed anywhere text is placed and are\n// thus automatically sized to match the surrounding child. To use, create an\n// inline element with the appropriate classes, like so:\n//\n//
      Star\n\n// Import the fonts\n@font-face {\n font-family: 'Glyphicons Halflings';\n src: url('@{icon-font-path}@{icon-font-name}.eot');\n src: url('@{icon-font-path}@{icon-font-name}.eot?#iefix') format('embedded-opentype'),\n url('@{icon-font-path}@{icon-font-name}.woff2') format('woff2'),\n url('@{icon-font-path}@{icon-font-name}.woff') format('woff'),\n url('@{icon-font-path}@{icon-font-name}.ttf') format('truetype'),\n url('@{icon-font-path}@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg');\n}\n\n// Catchall baseclass\n.glyphicon {\n position: relative;\n top: 1px;\n display: inline-block;\n font-family: 'Glyphicons Halflings';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n// Individual icons\n.glyphicon-asterisk { &:before { content: \"\\002a\"; } }\n.glyphicon-plus { &:before { content: \"\\002b\"; } }\n.glyphicon-euro,\n.glyphicon-eur { &:before { content: \"\\20ac\"; } }\n.glyphicon-minus { &:before { content: \"\\2212\"; } }\n.glyphicon-cloud { &:before { content: \"\\2601\"; } }\n.glyphicon-envelope { &:before { content: \"\\2709\"; } }\n.glyphicon-pencil { &:before { content: \"\\270f\"; } }\n.glyphicon-glass { &:before { content: \"\\e001\"; } }\n.glyphicon-music { &:before { content: \"\\e002\"; } }\n.glyphicon-search { &:before { content: \"\\e003\"; } }\n.glyphicon-heart { &:before { content: \"\\e005\"; } }\n.glyphicon-star { &:before { content: \"\\e006\"; } }\n.glyphicon-star-empty { &:before { content: \"\\e007\"; } }\n.glyphicon-user { &:before { content: \"\\e008\"; } }\n.glyphicon-film { &:before { content: \"\\e009\"; } }\n.glyphicon-th-large { &:before { content: \"\\e010\"; } }\n.glyphicon-th { &:before { content: \"\\e011\"; } }\n.glyphicon-th-list { &:before { content: \"\\e012\"; } }\n.glyphicon-ok { &:before { content: \"\\e013\"; } }\n.glyphicon-remove { &:before { content: \"\\e014\"; } }\n.glyphicon-zoom-in { &:before { content: \"\\e015\"; } }\n.glyphicon-zoom-out { &:before { content: \"\\e016\"; } }\n.glyphicon-off { &:before { content: \"\\e017\"; } }\n.glyphicon-signal { &:before { content: \"\\e018\"; } }\n.glyphicon-cog { &:before { content: \"\\e019\"; } }\n.glyphicon-trash { &:before { content: \"\\e020\"; } }\n.glyphicon-home { &:before { content: \"\\e021\"; } }\n.glyphicon-file { &:before { content: \"\\e022\"; } }\n.glyphicon-time { &:before { content: \"\\e023\"; } }\n.glyphicon-road { &:before { content: \"\\e024\"; } }\n.glyphicon-download-alt { &:before { content: \"\\e025\"; } }\n.glyphicon-download { &:before { content: \"\\e026\"; } }\n.glyphicon-upload { &:before { content: \"\\e027\"; } }\n.glyphicon-inbox { &:before { content: \"\\e028\"; } }\n.glyphicon-play-circle { &:before { content: \"\\e029\"; } }\n.glyphicon-repeat { &:before { content: \"\\e030\"; } }\n.glyphicon-refresh { &:before { content: \"\\e031\"; } }\n.glyphicon-list-alt { &:before { content: \"\\e032\"; } }\n.glyphicon-lock { &:before { content: \"\\e033\"; } }\n.glyphicon-flag { &:before { content: \"\\e034\"; } }\n.glyphicon-headphones { &:before { content: \"\\e035\"; } }\n.glyphicon-volume-off { &:before { content: \"\\e036\"; } }\n.glyphicon-volume-down { &:before { content: \"\\e037\"; } }\n.glyphicon-volume-up { &:before { content: \"\\e038\"; } }\n.glyphicon-qrcode { &:before { content: \"\\e039\"; } }\n.glyphicon-barcode { &:before { content: \"\\e040\"; } }\n.glyphicon-tag { &:before { content: \"\\e041\"; } }\n.glyphicon-tags { &:before { content: \"\\e042\"; } }\n.glyphicon-book { &:before { content: \"\\e043\"; } }\n.glyphicon-bookmark { &:before { content: \"\\e044\"; } }\n.glyphicon-print { &:before { content: \"\\e045\"; } }\n.glyphicon-camera { &:before { content: \"\\e046\"; } }\n.glyphicon-font { &:before { content: \"\\e047\"; } }\n.glyphicon-bold { &:before { content: \"\\e048\"; } }\n.glyphicon-italic { &:before { content: \"\\e049\"; } }\n.glyphicon-text-height { &:before { content: \"\\e050\"; } }\n.glyphicon-text-width { &:before { content: \"\\e051\"; } }\n.glyphicon-align-left { &:before { content: \"\\e052\"; } }\n.glyphicon-align-center { &:before { content: \"\\e053\"; } }\n.glyphicon-align-right { &:before { content: \"\\e054\"; } }\n.glyphicon-align-justify { &:before { content: \"\\e055\"; } }\n.glyphicon-list { &:before { content: \"\\e056\"; } }\n.glyphicon-indent-left { &:before { content: \"\\e057\"; } }\n.glyphicon-indent-right { &:before { content: \"\\e058\"; } }\n.glyphicon-facetime-video { &:before { content: \"\\e059\"; } }\n.glyphicon-picture { &:before { content: \"\\e060\"; } }\n.glyphicon-map-marker { &:before { content: \"\\e062\"; } }\n.glyphicon-adjust { &:before { content: \"\\e063\"; } }\n.glyphicon-tint { &:before { content: \"\\e064\"; } }\n.glyphicon-edit { &:before { content: \"\\e065\"; } }\n.glyphicon-share { &:before { content: \"\\e066\"; } }\n.glyphicon-check { &:before { content: \"\\e067\"; } }\n.glyphicon-move { &:before { content: \"\\e068\"; } }\n.glyphicon-step-backward { &:before { content: \"\\e069\"; } }\n.glyphicon-fast-backward { &:before { content: \"\\e070\"; } }\n.glyphicon-backward { &:before { content: \"\\e071\"; } }\n.glyphicon-play { &:before { content: \"\\e072\"; } }\n.glyphicon-pause { &:before { content: \"\\e073\"; } }\n.glyphicon-stop { &:before { content: \"\\e074\"; } }\n.glyphicon-forward { &:before { content: \"\\e075\"; } }\n.glyphicon-fast-forward { &:before { content: \"\\e076\"; } }\n.glyphicon-step-forward { &:before { content: \"\\e077\"; } }\n.glyphicon-eject { &:before { content: \"\\e078\"; } }\n.glyphicon-chevron-left { &:before { content: \"\\e079\"; } }\n.glyphicon-chevron-right { &:before { content: \"\\e080\"; } }\n.glyphicon-plus-sign { &:before { content: \"\\e081\"; } }\n.glyphicon-minus-sign { &:before { content: \"\\e082\"; } }\n.glyphicon-remove-sign { &:before { content: \"\\e083\"; } }\n.glyphicon-ok-sign { &:before { content: \"\\e084\"; } }\n.glyphicon-question-sign { &:before { content: \"\\e085\"; } }\n.glyphicon-info-sign { &:before { content: \"\\e086\"; } }\n.glyphicon-screenshot { &:before { content: \"\\e087\"; } }\n.glyphicon-remove-circle { &:before { content: \"\\e088\"; } }\n.glyphicon-ok-circle { &:before { content: \"\\e089\"; } }\n.glyphicon-ban-circle { &:before { content: \"\\e090\"; } }\n.glyphicon-arrow-left { &:before { content: \"\\e091\"; } }\n.glyphicon-arrow-right { &:before { content: \"\\e092\"; } }\n.glyphicon-arrow-up { &:before { content: \"\\e093\"; } }\n.glyphicon-arrow-down { &:before { content: \"\\e094\"; } }\n.glyphicon-share-alt { &:before { content: \"\\e095\"; } }\n.glyphicon-resize-full { &:before { content: \"\\e096\"; } }\n.glyphicon-resize-small { &:before { content: \"\\e097\"; } }\n.glyphicon-exclamation-sign { &:before { content: \"\\e101\"; } }\n.glyphicon-gift { &:before { content: \"\\e102\"; } }\n.glyphicon-leaf { &:before { content: \"\\e103\"; } }\n.glyphicon-fire { &:before { content: \"\\e104\"; } }\n.glyphicon-eye-open { &:before { content: \"\\e105\"; } }\n.glyphicon-eye-close { &:before { content: \"\\e106\"; } }\n.glyphicon-warning-sign { &:before { content: \"\\e107\"; } }\n.glyphicon-plane { &:before { content: \"\\e108\"; } }\n.glyphicon-calendar { &:before { content: \"\\e109\"; } }\n.glyphicon-random { &:before { content: \"\\e110\"; } }\n.glyphicon-comment { &:before { content: \"\\e111\"; } }\n.glyphicon-magnet { &:before { content: \"\\e112\"; } }\n.glyphicon-chevron-up { &:before { content: \"\\e113\"; } }\n.glyphicon-chevron-down { &:before { content: \"\\e114\"; } }\n.glyphicon-retweet { &:before { content: \"\\e115\"; } }\n.glyphicon-shopping-cart { &:before { content: \"\\e116\"; } }\n.glyphicon-folder-close { &:before { content: \"\\e117\"; } }\n.glyphicon-folder-open { &:before { content: \"\\e118\"; } }\n.glyphicon-resize-vertical { &:before { content: \"\\e119\"; } }\n.glyphicon-resize-horizontal { &:before { content: \"\\e120\"; } }\n.glyphicon-hdd { &:before { content: \"\\e121\"; } }\n.glyphicon-bullhorn { &:before { content: \"\\e122\"; } }\n.glyphicon-bell { &:before { content: \"\\e123\"; } }\n.glyphicon-certificate { &:before { content: \"\\e124\"; } }\n.glyphicon-thumbs-up { &:before { content: \"\\e125\"; } }\n.glyphicon-thumbs-down { &:before { content: \"\\e126\"; } }\n.glyphicon-hand-right { &:before { content: \"\\e127\"; } }\n.glyphicon-hand-left { &:before { content: \"\\e128\"; } }\n.glyphicon-hand-up { &:before { content: \"\\e129\"; } }\n.glyphicon-hand-down { &:before { content: \"\\e130\"; } }\n.glyphicon-circle-arrow-right { &:before { content: \"\\e131\"; } }\n.glyphicon-circle-arrow-left { &:before { content: \"\\e132\"; } }\n.glyphicon-circle-arrow-up { &:before { content: \"\\e133\"; } }\n.glyphicon-circle-arrow-down { &:before { content: \"\\e134\"; } }\n.glyphicon-globe { &:before { content: \"\\e135\"; } }\n.glyphicon-wrench { &:before { content: \"\\e136\"; } }\n.glyphicon-tasks { &:before { content: \"\\e137\"; } }\n.glyphicon-filter { &:before { content: \"\\e138\"; } }\n.glyphicon-briefcase { &:before { content: \"\\e139\"; } }\n.glyphicon-fullscreen { &:before { content: \"\\e140\"; } }\n.glyphicon-dashboard { &:before { content: \"\\e141\"; } }\n.glyphicon-paperclip { &:before { content: \"\\e142\"; } }\n.glyphicon-heart-empty { &:before { content: \"\\e143\"; } }\n.glyphicon-link { &:before { content: \"\\e144\"; } }\n.glyphicon-phone { &:before { content: \"\\e145\"; } }\n.glyphicon-pushpin { &:before { content: \"\\e146\"; } }\n.glyphicon-usd { &:before { content: \"\\e148\"; } }\n.glyphicon-gbp { &:before { content: \"\\e149\"; } }\n.glyphicon-sort { &:before { content: \"\\e150\"; } }\n.glyphicon-sort-by-alphabet { &:before { content: \"\\e151\"; } }\n.glyphicon-sort-by-alphabet-alt { &:before { content: \"\\e152\"; } }\n.glyphicon-sort-by-order { &:before { content: \"\\e153\"; } }\n.glyphicon-sort-by-order-alt { &:before { content: \"\\e154\"; } }\n.glyphicon-sort-by-attributes { &:before { content: \"\\e155\"; } }\n.glyphicon-sort-by-attributes-alt { &:before { content: \"\\e156\"; } }\n.glyphicon-unchecked { &:before { content: \"\\e157\"; } }\n.glyphicon-expand { &:before { content: \"\\e158\"; } }\n.glyphicon-collapse-down { &:before { content: \"\\e159\"; } }\n.glyphicon-collapse-up { &:before { content: \"\\e160\"; } }\n.glyphicon-log-in { &:before { content: \"\\e161\"; } }\n.glyphicon-flash { &:before { content: \"\\e162\"; } }\n.glyphicon-log-out { &:before { content: \"\\e163\"; } }\n.glyphicon-new-window { &:before { content: \"\\e164\"; } }\n.glyphicon-record { &:before { content: \"\\e165\"; } }\n.glyphicon-save { &:before { content: \"\\e166\"; } }\n.glyphicon-open { &:before { content: \"\\e167\"; } }\n.glyphicon-saved { &:before { content: \"\\e168\"; } }\n.glyphicon-import { &:before { content: \"\\e169\"; } }\n.glyphicon-export { &:before { content: \"\\e170\"; } }\n.glyphicon-send { &:before { content: \"\\e171\"; } }\n.glyphicon-floppy-disk { &:before { content: \"\\e172\"; } }\n.glyphicon-floppy-saved { &:before { content: \"\\e173\"; } }\n.glyphicon-floppy-remove { &:before { content: \"\\e174\"; } }\n.glyphicon-floppy-save { &:before { content: \"\\e175\"; } }\n.glyphicon-floppy-open { &:before { content: \"\\e176\"; } }\n.glyphicon-credit-card { &:before { content: \"\\e177\"; } }\n.glyphicon-transfer { &:before { content: \"\\e178\"; } }\n.glyphicon-cutlery { &:before { content: \"\\e179\"; } }\n.glyphicon-header { &:before { content: \"\\e180\"; } }\n.glyphicon-compressed { &:before { content: \"\\e181\"; } }\n.glyphicon-earphone { &:before { content: \"\\e182\"; } }\n.glyphicon-phone-alt { &:before { content: \"\\e183\"; } }\n.glyphicon-tower { &:before { content: \"\\e184\"; } }\n.glyphicon-stats { &:before { content: \"\\e185\"; } }\n.glyphicon-sd-video { &:before { content: \"\\e186\"; } }\n.glyphicon-hd-video { &:before { content: \"\\e187\"; } }\n.glyphicon-subtitles { &:before { content: \"\\e188\"; } }\n.glyphicon-sound-stereo { &:before { content: \"\\e189\"; } }\n.glyphicon-sound-dolby { &:before { content: \"\\e190\"; } }\n.glyphicon-sound-5-1 { &:before { content: \"\\e191\"; } }\n.glyphicon-sound-6-1 { &:before { content: \"\\e192\"; } }\n.glyphicon-sound-7-1 { &:before { content: \"\\e193\"; } }\n.glyphicon-copyright-mark { &:before { content: \"\\e194\"; } }\n.glyphicon-registration-mark { &:before { content: \"\\e195\"; } }\n.glyphicon-cloud-download { &:before { content: \"\\e197\"; } }\n.glyphicon-cloud-upload { &:before { content: \"\\e198\"; } }\n.glyphicon-tree-conifer { &:before { content: \"\\e199\"; } }\n.glyphicon-tree-deciduous { &:before { content: \"\\e200\"; } }\n.glyphicon-cd { &:before { content: \"\\e201\"; } }\n.glyphicon-save-file { &:before { content: \"\\e202\"; } }\n.glyphicon-open-file { &:before { content: \"\\e203\"; } }\n.glyphicon-level-up { &:before { content: \"\\e204\"; } }\n.glyphicon-copy { &:before { content: \"\\e205\"; } }\n.glyphicon-paste { &:before { content: \"\\e206\"; } }\n// The following 2 Glyphicons are omitted for the time being because\n// they currently use Unicode codepoints that are outside the\n// Basic Multilingual Plane (BMP). Older buggy versions of WebKit can't handle\n// non-BMP codepoints in CSS string escapes, and thus can't display these two icons.\n// Notably, the bug affects some older versions of the Android Browser.\n// More info: https://github.com/twbs/bootstrap/issues/10106\n// .glyphicon-door { &:before { content: \"\\1f6aa\"; } }\n// .glyphicon-key { &:before { content: \"\\1f511\"; } }\n.glyphicon-alert { &:before { content: \"\\e209\"; } }\n.glyphicon-equalizer { &:before { content: \"\\e210\"; } }\n.glyphicon-king { &:before { content: \"\\e211\"; } }\n.glyphicon-queen { &:before { content: \"\\e212\"; } }\n.glyphicon-pawn { &:before { content: \"\\e213\"; } }\n.glyphicon-bishop { &:before { content: \"\\e214\"; } }\n.glyphicon-knight { &:before { content: \"\\e215\"; } }\n.glyphicon-baby-formula { &:before { content: \"\\e216\"; } }\n.glyphicon-tent { &:before { content: \"\\26fa\"; } }\n.glyphicon-blackboard { &:before { content: \"\\e218\"; } }\n.glyphicon-bed { &:before { content: \"\\e219\"; } }\n.glyphicon-apple { &:before { content: \"\\f8ff\"; } }\n.glyphicon-erase { &:before { content: \"\\e221\"; } }\n.glyphicon-hourglass { &:before { content: \"\\231b\"; } }\n.glyphicon-lamp { &:before { content: \"\\e223\"; } }\n.glyphicon-duplicate { &:before { content: \"\\e224\"; } }\n.glyphicon-piggy-bank { &:before { content: \"\\e225\"; } }\n.glyphicon-scissors { &:before { content: \"\\e226\"; } }\n.glyphicon-bitcoin { &:before { content: \"\\e227\"; } }\n.glyphicon-btc { &:before { content: \"\\e227\"; } }\n.glyphicon-xbt { &:before { content: \"\\e227\"; } }\n.glyphicon-yen { &:before { content: \"\\00a5\"; } }\n.glyphicon-jpy { &:before { content: \"\\00a5\"; } }\n.glyphicon-ruble { &:before { content: \"\\20bd\"; } }\n.glyphicon-rub { &:before { content: \"\\20bd\"; } }\n.glyphicon-scale { &:before { content: \"\\e230\"; } }\n.glyphicon-ice-lolly { &:before { content: \"\\e231\"; } }\n.glyphicon-ice-lolly-tasted { &:before { content: \"\\e232\"; } }\n.glyphicon-education { &:before { content: \"\\e233\"; } }\n.glyphicon-option-horizontal { &:before { content: \"\\e234\"; } }\n.glyphicon-option-vertical { &:before { content: \"\\e235\"; } }\n.glyphicon-menu-hamburger { &:before { content: \"\\e236\"; } }\n.glyphicon-modal-window { &:before { content: \"\\e237\"; } }\n.glyphicon-oil { &:before { content: \"\\e238\"; } }\n.glyphicon-grain { &:before { content: \"\\e239\"; } }\n.glyphicon-sunglasses { &:before { content: \"\\e240\"; } }\n.glyphicon-text-size { &:before { content: \"\\e241\"; } }\n.glyphicon-text-color { &:before { content: \"\\e242\"; } }\n.glyphicon-text-background { &:before { content: \"\\e243\"; } }\n.glyphicon-object-align-top { &:before { content: \"\\e244\"; } }\n.glyphicon-object-align-bottom { &:before { content: \"\\e245\"; } }\n.glyphicon-object-align-horizontal{ &:before { content: \"\\e246\"; } }\n.glyphicon-object-align-left { &:before { content: \"\\e247\"; } }\n.glyphicon-object-align-vertical { &:before { content: \"\\e248\"; } }\n.glyphicon-object-align-right { &:before { content: \"\\e249\"; } }\n.glyphicon-triangle-right { &:before { content: \"\\e250\"; } }\n.glyphicon-triangle-left { &:before { content: \"\\e251\"; } }\n.glyphicon-triangle-bottom { &:before { content: \"\\e252\"; } }\n.glyphicon-triangle-top { &:before { content: \"\\e253\"; } }\n.glyphicon-console { &:before { content: \"\\e254\"; } }\n.glyphicon-superscript { &:before { content: \"\\e255\"; } }\n.glyphicon-subscript { &:before { content: \"\\e256\"; } }\n.glyphicon-menu-left { &:before { content: \"\\e257\"; } }\n.glyphicon-menu-right { &:before { content: \"\\e258\"; } }\n.glyphicon-menu-down { &:before { content: \"\\e259\"; } }\n.glyphicon-menu-up { &:before { content: \"\\e260\"; } }\n","//\n// Scaffolding\n// --------------------------------------------------\n\n\n// Reset the box-sizing\n//\n// Heads up! This reset may cause conflicts with some third-party widgets.\n// For recommendations on resolving such conflicts, see\n// http://getbootstrap.com/getting-started/#third-box-sizing\n* {\n .box-sizing(border-box);\n}\n*:before,\n*:after {\n .box-sizing(border-box);\n}\n\n\n// Body reset\n\nhtml {\n font-size: 10px;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n\nbody {\n font-family: @font-family-base;\n font-size: @font-size-base;\n line-height: @line-height-base;\n color: @text-color;\n background-color: @body-bg;\n}\n\n// Reset fonts for relevant elements\ninput,\nbutton,\nselect,\ntextarea {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n\n// Links\n\na {\n color: @link-color;\n text-decoration: none;\n\n &:hover,\n &:focus {\n color: @link-hover-color;\n text-decoration: @link-hover-decoration;\n }\n\n &:focus {\n .tab-focus();\n }\n}\n\n\n// Figures\n//\n// We reset this here because previously Normalize had no `figure` margins. This\n// ensures we don't break anyone's use of the element.\n\nfigure {\n margin: 0;\n}\n\n\n// Images\n\nimg {\n vertical-align: middle;\n}\n\n// Responsive images (ensure images don't scale beyond their parents)\n.img-responsive {\n .img-responsive();\n}\n\n// Rounded corners\n.img-rounded {\n border-radius: @border-radius-large;\n}\n\n// Image thumbnails\n//\n// Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`.\n.img-thumbnail {\n padding: @thumbnail-padding;\n line-height: @line-height-base;\n background-color: @thumbnail-bg;\n border: 1px solid @thumbnail-border;\n border-radius: @thumbnail-border-radius;\n .transition(all .2s ease-in-out);\n\n // Keep them at most 100% wide\n .img-responsive(inline-block);\n}\n\n// Perfect circle\n.img-circle {\n border-radius: 50%; // set radius in percents\n}\n\n\n// Horizontal rules\n\nhr {\n margin-top: @line-height-computed;\n margin-bottom: @line-height-computed;\n border: 0;\n border-top: 1px solid @hr-border;\n}\n\n\n// Only display content to screen readers\n//\n// See: http://a11yproject.com/posts/how-to-hide-content\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0,0,0,0);\n border: 0;\n}\n\n// Use in conjunction with .sr-only to only display content when it's focused.\n// Useful for \"Skip to main content\" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1\n// Credit: HTML5 Boilerplate\n\n.sr-only-focusable {\n &:active,\n &:focus {\n position: static;\n width: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n clip: auto;\n }\n}\n\n\n// iOS \"clickable elements\" fix for role=\"button\"\n//\n// Fixes \"clickability\" issue (and more generally, the firing of events such as focus as well)\n// for traditionally non-focusable elements with role=\"button\"\n// see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile\n\n[role=\"button\"] {\n cursor: pointer;\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They have been removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n -webkit-animation: @animation;\n -o-animation: @animation;\n animation: @animation;\n}\n.animation-name(@name) {\n -webkit-animation-name: @name;\n animation-name: @name;\n}\n.animation-duration(@duration) {\n -webkit-animation-duration: @duration;\n animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n -webkit-animation-timing-function: @timing-function;\n animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n -webkit-animation-delay: @delay;\n animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n -webkit-animation-iteration-count: @iteration-count;\n animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n -webkit-animation-direction: @direction;\n animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n -webkit-animation-fill-mode: @fill-mode;\n animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility) {\n -webkit-backface-visibility: @visibility;\n -moz-backface-visibility: @visibility;\n backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n -webkit-box-sizing: @boxmodel;\n -moz-box-sizing: @boxmodel;\n box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n -webkit-column-count: @column-count;\n -moz-column-count: @column-count;\n column-count: @column-count;\n -webkit-column-gap: @column-gap;\n -moz-column-gap: @column-gap;\n column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n word-wrap: break-word;\n -webkit-hyphens: @mode;\n -moz-hyphens: @mode;\n -ms-hyphens: @mode; // IE10+\n -o-hyphens: @mode;\n hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n // Firefox\n &::-moz-placeholder {\n color: @color;\n opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526\n }\n &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+\n &::-webkit-input-placeholder { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n -webkit-transform: scale(@ratio);\n -ms-transform: scale(@ratio); // IE9 only\n -o-transform: scale(@ratio);\n transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n -webkit-transform: scale(@ratioX, @ratioY);\n -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n -o-transform: scale(@ratioX, @ratioY);\n transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n -webkit-transform: scaleX(@ratio);\n -ms-transform: scaleX(@ratio); // IE9 only\n -o-transform: scaleX(@ratio);\n transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n -webkit-transform: scaleY(@ratio);\n -ms-transform: scaleY(@ratio); // IE9 only\n -o-transform: scaleY(@ratio);\n transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n -webkit-transform: skewX(@x) skewY(@y);\n -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n -o-transform: skewX(@x) skewY(@y);\n transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n -webkit-transform: translate(@x, @y);\n -ms-transform: translate(@x, @y); // IE9 only\n -o-transform: translate(@x, @y);\n transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n -webkit-transform: translate3d(@x, @y, @z);\n transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n -webkit-transform: rotate(@degrees);\n -ms-transform: rotate(@degrees); // IE9 only\n -o-transform: rotate(@degrees);\n transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n -webkit-transform: rotateX(@degrees);\n -ms-transform: rotateX(@degrees); // IE9 only\n -o-transform: rotateX(@degrees);\n transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n -webkit-transform: rotateY(@degrees);\n -ms-transform: rotateY(@degrees); // IE9 only\n -o-transform: rotateY(@degrees);\n transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n -webkit-perspective: @perspective;\n -moz-perspective: @perspective;\n perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n -webkit-perspective-origin: @perspective;\n -moz-perspective-origin: @perspective;\n perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n -webkit-transform-origin: @origin;\n -moz-transform-origin: @origin;\n -ms-transform-origin: @origin; // IE9 only\n transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n -webkit-transition: @transition;\n -o-transition: @transition;\n transition: @transition;\n}\n.transition-property(@transition-property) {\n -webkit-transition-property: @transition-property;\n transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n -webkit-transition-delay: @transition-delay;\n transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n -webkit-transition-duration: @transition-duration;\n transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n -webkit-transition-timing-function: @timing-function;\n transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n -webkit-transition: -webkit-transform @transition;\n -moz-transition: -moz-transform @transition;\n -o-transition: -o-transform @transition;\n transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n -webkit-user-select: @select;\n -moz-user-select: @select;\n -ms-user-select: @select; // IE10+\n user-select: @select;\n}\n","// WebKit-style focus\n\n.tab-focus() {\n // WebKit-specific. Other browsers will keep their default outline style.\n // (Initially tried to also force default via `outline: initial`,\n // but that seems to erroneously remove the outline in Firefox altogether.)\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\n","// Image Mixins\n// - Responsive image\n// - Retina image\n\n\n// Responsive image\n//\n// Keep images from scaling beyond the width of their parents.\n.img-responsive(@display: block) {\n display: @display;\n max-width: 100%; // Part 1: Set a maximum relative to the parent\n height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching\n}\n\n\n// Retina image\n//\n// Short retina mixin for setting background-image and -size. Note that the\n// spelling of `min--moz-device-pixel-ratio` is intentional.\n.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {\n background-image: url(\"@{file-1x}\");\n\n @media\n only screen and (-webkit-min-device-pixel-ratio: 2),\n only screen and ( min--moz-device-pixel-ratio: 2),\n only screen and ( -o-min-device-pixel-ratio: 2/1),\n only screen and ( min-device-pixel-ratio: 2),\n only screen and ( min-resolution: 192dpi),\n only screen and ( min-resolution: 2dppx) {\n background-image: url(\"@{file-2x}\");\n background-size: @width-1x @height-1x;\n }\n}\n","//\n// Typography\n// --------------------------------------------------\n\n\n// Headings\n// -------------------------\n\nh1, h2, h3, h4, h5, h6,\n.h1, .h2, .h3, .h4, .h5, .h6 {\n font-family: @headings-font-family;\n font-weight: @headings-font-weight;\n line-height: @headings-line-height;\n color: @headings-color;\n\n small,\n .small {\n font-weight: normal;\n line-height: 1;\n color: @headings-small-color;\n }\n}\n\nh1, .h1,\nh2, .h2,\nh3, .h3 {\n margin-top: @line-height-computed;\n margin-bottom: (@line-height-computed / 2);\n\n small,\n .small {\n font-size: 65%;\n }\n}\nh4, .h4,\nh5, .h5,\nh6, .h6 {\n margin-top: (@line-height-computed / 2);\n margin-bottom: (@line-height-computed / 2);\n\n small,\n .small {\n font-size: 75%;\n }\n}\n\nh1, .h1 { font-size: @font-size-h1; }\nh2, .h2 { font-size: @font-size-h2; }\nh3, .h3 { font-size: @font-size-h3; }\nh4, .h4 { font-size: @font-size-h4; }\nh5, .h5 { font-size: @font-size-h5; }\nh6, .h6 { font-size: @font-size-h6; }\n\n\n// Body text\n// -------------------------\n\np {\n margin: 0 0 (@line-height-computed / 2);\n}\n\n.lead {\n margin-bottom: @line-height-computed;\n font-size: floor((@font-size-base * 1.15));\n font-weight: 300;\n line-height: 1.4;\n\n @media (min-width: @screen-sm-min) {\n font-size: (@font-size-base * 1.5);\n }\n}\n\n\n// Emphasis & misc\n// -------------------------\n\n// Ex: (12px small font / 14px base font) * 100% = about 85%\nsmall,\n.small {\n font-size: floor((100% * @font-size-small / @font-size-base));\n}\n\nmark,\n.mark {\n background-color: @state-warning-bg;\n padding: .2em;\n}\n\n// Alignment\n.text-left { text-align: left; }\n.text-right { text-align: right; }\n.text-center { text-align: center; }\n.text-justify { text-align: justify; }\n.text-nowrap { white-space: nowrap; }\n\n// Transformation\n.text-lowercase { text-transform: lowercase; }\n.text-uppercase { text-transform: uppercase; }\n.text-capitalize { text-transform: capitalize; }\n\n// Contextual colors\n.text-muted {\n color: @text-muted;\n}\n.text-primary {\n .text-emphasis-variant(@brand-primary);\n}\n.text-success {\n .text-emphasis-variant(@state-success-text);\n}\n.text-info {\n .text-emphasis-variant(@state-info-text);\n}\n.text-warning {\n .text-emphasis-variant(@state-warning-text);\n}\n.text-danger {\n .text-emphasis-variant(@state-danger-text);\n}\n\n// Contextual backgrounds\n// For now we'll leave these alongside the text classes until v4 when we can\n// safely shift things around (per SemVer rules).\n.bg-primary {\n // Given the contrast here, this is the only class to have its color inverted\n // automatically.\n color: #fff;\n .bg-variant(@brand-primary);\n}\n.bg-success {\n .bg-variant(@state-success-bg);\n}\n.bg-info {\n .bg-variant(@state-info-bg);\n}\n.bg-warning {\n .bg-variant(@state-warning-bg);\n}\n.bg-danger {\n .bg-variant(@state-danger-bg);\n}\n\n\n// Page header\n// -------------------------\n\n.page-header {\n padding-bottom: ((@line-height-computed / 2) - 1);\n margin: (@line-height-computed * 2) 0 @line-height-computed;\n border-bottom: 1px solid @page-header-border-color;\n}\n\n\n// Lists\n// -------------------------\n\n// Unordered and Ordered lists\nul,\nol {\n margin-top: 0;\n margin-bottom: (@line-height-computed / 2);\n ul,\n ol {\n margin-bottom: 0;\n }\n}\n\n// List options\n\n// Unstyled keeps list items block level, just removes default browser padding and list-style\n.list-unstyled {\n padding-left: 0;\n list-style: none;\n}\n\n// Inline turns list items into inline-block\n.list-inline {\n .list-unstyled();\n margin-left: -5px;\n\n > li {\n display: inline-block;\n padding-left: 5px;\n padding-right: 5px;\n }\n}\n\n// Description Lists\ndl {\n margin-top: 0; // Remove browser default\n margin-bottom: @line-height-computed;\n}\ndt,\ndd {\n line-height: @line-height-base;\n}\ndt {\n font-weight: bold;\n}\ndd {\n margin-left: 0; // Undo browser default\n}\n\n// Horizontal description lists\n//\n// Defaults to being stacked without any of the below styles applied, until the\n// grid breakpoint is reached (default of ~768px).\n\n.dl-horizontal {\n dd {\n &:extend(.clearfix all); // Clear the floated `dt` if an empty `dd` is present\n }\n\n @media (min-width: @dl-horizontal-breakpoint) {\n dt {\n float: left;\n width: (@dl-horizontal-offset - 20);\n clear: left;\n text-align: right;\n .text-overflow();\n }\n dd {\n margin-left: @dl-horizontal-offset;\n }\n }\n}\n\n\n// Misc\n// -------------------------\n\n// Abbreviations and acronyms\nabbr[title],\n// Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257\nabbr[data-original-title] {\n cursor: help;\n border-bottom: 1px dotted @abbr-border-color;\n}\n.initialism {\n font-size: 90%;\n .text-uppercase();\n}\n\n// Blockquotes\nblockquote {\n padding: (@line-height-computed / 2) @line-height-computed;\n margin: 0 0 @line-height-computed;\n font-size: @blockquote-font-size;\n border-left: 5px solid @blockquote-border-color;\n\n p,\n ul,\n ol {\n &:last-child {\n margin-bottom: 0;\n }\n }\n\n // Note: Deprecated small and .small as of v3.1.0\n // Context: https://github.com/twbs/bootstrap/issues/11660\n footer,\n small,\n .small {\n display: block;\n font-size: 80%; // back to default font-size\n line-height: @line-height-base;\n color: @blockquote-small-color;\n\n &:before {\n content: '\\2014 \\00A0'; // em dash, nbsp\n }\n }\n}\n\n// Opposite alignment of blockquote\n//\n// Heads up: `blockquote.pull-right` has been deprecated as of v3.1.0.\n.blockquote-reverse,\nblockquote.pull-right {\n padding-right: 15px;\n padding-left: 0;\n border-right: 5px solid @blockquote-border-color;\n border-left: 0;\n text-align: right;\n\n // Account for citation\n footer,\n small,\n .small {\n &:before { content: ''; }\n &:after {\n content: '\\00A0 \\2014'; // nbsp, em dash\n }\n }\n}\n\n// Addresses\naddress {\n margin-bottom: @line-height-computed;\n font-style: normal;\n line-height: @line-height-base;\n}\n","// Typography\n\n.text-emphasis-variant(@color) {\n color: @color;\n a&:hover,\n a&:focus {\n color: darken(@color, 10%);\n }\n}\n","// Contextual backgrounds\n\n.bg-variant(@color) {\n background-color: @color;\n a&:hover,\n a&:focus {\n background-color: darken(@color, 10%);\n }\n}\n","// Text overflow\n// Requires inline-block or block for proper styling\n\n.text-overflow() {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n","//\n// Code (inline and block)\n// --------------------------------------------------\n\n\n// Inline and block code styles\ncode,\nkbd,\npre,\nsamp {\n font-family: @font-family-monospace;\n}\n\n// Inline code\ncode {\n padding: 2px 4px;\n font-size: 90%;\n color: @code-color;\n background-color: @code-bg;\n border-radius: @border-radius-base;\n}\n\n// User input typically entered via keyboard\nkbd {\n padding: 2px 4px;\n font-size: 90%;\n color: @kbd-color;\n background-color: @kbd-bg;\n border-radius: @border-radius-small;\n box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);\n\n kbd {\n padding: 0;\n font-size: 100%;\n font-weight: bold;\n box-shadow: none;\n }\n}\n\n// Blocks of code\npre {\n display: block;\n padding: ((@line-height-computed - 1) / 2);\n margin: 0 0 (@line-height-computed / 2);\n font-size: (@font-size-base - 1); // 14px to 13px\n line-height: @line-height-base;\n word-break: break-all;\n word-wrap: break-word;\n color: @pre-color;\n background-color: @pre-bg;\n border: 1px solid @pre-border-color;\n border-radius: @border-radius-base;\n\n // Account for some code outputs that place code tags in pre tags\n code {\n padding: 0;\n font-size: inherit;\n color: inherit;\n white-space: pre-wrap;\n background-color: transparent;\n border-radius: 0;\n }\n}\n\n// Enable scrollable blocks of code\n.pre-scrollable {\n max-height: @pre-scrollable-max-height;\n overflow-y: scroll;\n}\n","//\n// Grid system\n// --------------------------------------------------\n\n\n// Container widths\n//\n// Set the container width, and override it for fixed navbars in media queries.\n\n.container {\n .container-fixed();\n\n @media (min-width: @screen-sm-min) {\n width: @container-sm;\n }\n @media (min-width: @screen-md-min) {\n width: @container-md;\n }\n @media (min-width: @screen-lg-min) {\n width: @container-lg;\n }\n}\n\n\n// Fluid container\n//\n// Utilizes the mixin meant for fixed width containers, but without any defined\n// width for fluid, full width layouts.\n\n.container-fluid {\n .container-fixed();\n}\n\n\n// Row\n//\n// Rows contain and clear the floats of your columns.\n\n.row {\n .make-row();\n}\n\n\n// Columns\n//\n// Common styles for small and large grid columns\n\n.make-grid-columns();\n\n\n// Extra small grid\n//\n// Columns, offsets, pushes, and pulls for extra small devices like\n// smartphones.\n\n.make-grid(xs);\n\n\n// Small grid\n//\n// Columns, offsets, pushes, and pulls for the small device range, from phones\n// to tablets.\n\n@media (min-width: @screen-sm-min) {\n .make-grid(sm);\n}\n\n\n// Medium grid\n//\n// Columns, offsets, pushes, and pulls for the desktop device range.\n\n@media (min-width: @screen-md-min) {\n .make-grid(md);\n}\n\n\n// Large grid\n//\n// Columns, offsets, pushes, and pulls for the large desktop device range.\n\n@media (min-width: @screen-lg-min) {\n .make-grid(lg);\n}\n","// Grid system\n//\n// Generate semantic grid columns with these mixins.\n\n// Centered container element\n.container-fixed(@gutter: @grid-gutter-width) {\n margin-right: auto;\n margin-left: auto;\n padding-left: floor((@gutter / 2));\n padding-right: ceil((@gutter / 2));\n &:extend(.clearfix all);\n}\n\n// Creates a wrapper for a series of columns\n.make-row(@gutter: @grid-gutter-width) {\n margin-left: ceil((@gutter / -2));\n margin-right: floor((@gutter / -2));\n &:extend(.clearfix all);\n}\n\n// Generate the extra small columns\n.make-xs-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n float: left;\n width: percentage((@columns / @grid-columns));\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n}\n.make-xs-column-offset(@columns) {\n margin-left: percentage((@columns / @grid-columns));\n}\n.make-xs-column-push(@columns) {\n left: percentage((@columns / @grid-columns));\n}\n.make-xs-column-pull(@columns) {\n right: percentage((@columns / @grid-columns));\n}\n\n// Generate the small columns\n.make-sm-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n\n @media (min-width: @screen-sm-min) {\n float: left;\n width: percentage((@columns / @grid-columns));\n }\n}\n.make-sm-column-offset(@columns) {\n @media (min-width: @screen-sm-min) {\n margin-left: percentage((@columns / @grid-columns));\n }\n}\n.make-sm-column-push(@columns) {\n @media (min-width: @screen-sm-min) {\n left: percentage((@columns / @grid-columns));\n }\n}\n.make-sm-column-pull(@columns) {\n @media (min-width: @screen-sm-min) {\n right: percentage((@columns / @grid-columns));\n }\n}\n\n// Generate the medium columns\n.make-md-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n\n @media (min-width: @screen-md-min) {\n float: left;\n width: percentage((@columns / @grid-columns));\n }\n}\n.make-md-column-offset(@columns) {\n @media (min-width: @screen-md-min) {\n margin-left: percentage((@columns / @grid-columns));\n }\n}\n.make-md-column-push(@columns) {\n @media (min-width: @screen-md-min) {\n left: percentage((@columns / @grid-columns));\n }\n}\n.make-md-column-pull(@columns) {\n @media (min-width: @screen-md-min) {\n right: percentage((@columns / @grid-columns));\n }\n}\n\n// Generate the large columns\n.make-lg-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n\n @media (min-width: @screen-lg-min) {\n float: left;\n width: percentage((@columns / @grid-columns));\n }\n}\n.make-lg-column-offset(@columns) {\n @media (min-width: @screen-lg-min) {\n margin-left: percentage((@columns / @grid-columns));\n }\n}\n.make-lg-column-push(@columns) {\n @media (min-width: @screen-lg-min) {\n left: percentage((@columns / @grid-columns));\n }\n}\n.make-lg-column-pull(@columns) {\n @media (min-width: @screen-lg-min) {\n right: percentage((@columns / @grid-columns));\n }\n}\n","// Framework grid generation\n//\n// Used only by Bootstrap to generate the correct number of grid classes given\n// any value of `@grid-columns`.\n\n.make-grid-columns() {\n // Common styles for all sizes of grid columns, widths 1-12\n .col(@index) { // initial\n @item: ~\".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}\";\n .col((@index + 1), @item);\n }\n .col(@index, @list) when (@index =< @grid-columns) { // general; \"=<\" isn't a typo\n @item: ~\".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}\";\n .col((@index + 1), ~\"@{list}, @{item}\");\n }\n .col(@index, @list) when (@index > @grid-columns) { // terminal\n @{list} {\n position: relative;\n // Prevent columns from collapsing when empty\n min-height: 1px;\n // Inner gutter via padding\n padding-left: ceil((@grid-gutter-width / 2));\n padding-right: floor((@grid-gutter-width / 2));\n }\n }\n .col(1); // kickstart it\n}\n\n.float-grid-columns(@class) {\n .col(@index) { // initial\n @item: ~\".col-@{class}-@{index}\";\n .col((@index + 1), @item);\n }\n .col(@index, @list) when (@index =< @grid-columns) { // general\n @item: ~\".col-@{class}-@{index}\";\n .col((@index + 1), ~\"@{list}, @{item}\");\n }\n .col(@index, @list) when (@index > @grid-columns) { // terminal\n @{list} {\n float: left;\n }\n }\n .col(1); // kickstart it\n}\n\n.calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) {\n .col-@{class}-@{index} {\n width: percentage((@index / @grid-columns));\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = push) and (@index > 0) {\n .col-@{class}-push-@{index} {\n left: percentage((@index / @grid-columns));\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) {\n .col-@{class}-push-0 {\n left: auto;\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) {\n .col-@{class}-pull-@{index} {\n right: percentage((@index / @grid-columns));\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) {\n .col-@{class}-pull-0 {\n right: auto;\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = offset) {\n .col-@{class}-offset-@{index} {\n margin-left: percentage((@index / @grid-columns));\n }\n}\n\n// Basic looping in LESS\n.loop-grid-columns(@index, @class, @type) when (@index >= 0) {\n .calc-grid-column(@index, @class, @type);\n // next iteration\n .loop-grid-columns((@index - 1), @class, @type);\n}\n\n// Create grid for specific class\n.make-grid(@class) {\n .float-grid-columns(@class);\n .loop-grid-columns(@grid-columns, @class, width);\n .loop-grid-columns(@grid-columns, @class, pull);\n .loop-grid-columns(@grid-columns, @class, push);\n .loop-grid-columns(@grid-columns, @class, offset);\n}\n","//\n// Tables\n// --------------------------------------------------\n\n\ntable {\n background-color: @table-bg;\n}\ncaption {\n padding-top: @table-cell-padding;\n padding-bottom: @table-cell-padding;\n color: @text-muted;\n text-align: left;\n}\nth {\n text-align: left;\n}\n\n\n// Baseline styles\n\n.table {\n width: 100%;\n max-width: 100%;\n margin-bottom: @line-height-computed;\n // Cells\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n padding: @table-cell-padding;\n line-height: @line-height-base;\n vertical-align: top;\n border-top: 1px solid @table-border-color;\n }\n }\n }\n // Bottom align for column headings\n > thead > tr > th {\n vertical-align: bottom;\n border-bottom: 2px solid @table-border-color;\n }\n // Remove top border from thead by default\n > caption + thead,\n > colgroup + thead,\n > thead:first-child {\n > tr:first-child {\n > th,\n > td {\n border-top: 0;\n }\n }\n }\n // Account for multiple tbody instances\n > tbody + tbody {\n border-top: 2px solid @table-border-color;\n }\n\n // Nesting\n .table {\n background-color: @body-bg;\n }\n}\n\n\n// Condensed table w/ half padding\n\n.table-condensed {\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n padding: @table-condensed-cell-padding;\n }\n }\n }\n}\n\n\n// Bordered version\n//\n// Add borders all around the table and between all the columns.\n\n.table-bordered {\n border: 1px solid @table-border-color;\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n border: 1px solid @table-border-color;\n }\n }\n }\n > thead > tr {\n > th,\n > td {\n border-bottom-width: 2px;\n }\n }\n}\n\n\n// Zebra-striping\n//\n// Default zebra-stripe styles (alternating gray and transparent backgrounds)\n\n.table-striped {\n > tbody > tr:nth-of-type(odd) {\n background-color: @table-bg-accent;\n }\n}\n\n\n// Hover effect\n//\n// Placed here since it has to come after the potential zebra striping\n\n.table-hover {\n > tbody > tr:hover {\n background-color: @table-bg-hover;\n }\n}\n\n\n// Table cell sizing\n//\n// Reset default table behavior\n\ntable col[class*=\"col-\"] {\n position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)\n float: none;\n display: table-column;\n}\ntable {\n td,\n th {\n &[class*=\"col-\"] {\n position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)\n float: none;\n display: table-cell;\n }\n }\n}\n\n\n// Table backgrounds\n//\n// Exact selectors below required to override `.table-striped` and prevent\n// inheritance to nested tables.\n\n// Generate the contextual variants\n.table-row-variant(active; @table-bg-active);\n.table-row-variant(success; @state-success-bg);\n.table-row-variant(info; @state-info-bg);\n.table-row-variant(warning; @state-warning-bg);\n.table-row-variant(danger; @state-danger-bg);\n\n\n// Responsive tables\n//\n// Wrap your tables in `.table-responsive` and we'll make them mobile friendly\n// by enabling horizontal scrolling. Only applies <768px. Everything above that\n// will display normally.\n\n.table-responsive {\n overflow-x: auto;\n min-height: 0.01%; // Workaround for IE9 bug (see https://github.com/twbs/bootstrap/issues/14837)\n\n @media screen and (max-width: @screen-xs-max) {\n width: 100%;\n margin-bottom: (@line-height-computed * 0.75);\n overflow-y: hidden;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n border: 1px solid @table-border-color;\n\n // Tighten up spacing\n > .table {\n margin-bottom: 0;\n\n // Ensure the content doesn't wrap\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n white-space: nowrap;\n }\n }\n }\n }\n\n // Special overrides for the bordered tables\n > .table-bordered {\n border: 0;\n\n // Nuke the appropriate borders so that the parent can handle them\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th:first-child,\n > td:first-child {\n border-left: 0;\n }\n > th:last-child,\n > td:last-child {\n border-right: 0;\n }\n }\n }\n\n // Only nuke the last row's bottom-border in `tbody` and `tfoot` since\n // chances are there will be only one `tr` in a `thead` and that would\n // remove the border altogether.\n > tbody,\n > tfoot {\n > tr:last-child {\n > th,\n > td {\n border-bottom: 0;\n }\n }\n }\n\n }\n }\n}\n","// Tables\n\n.table-row-variant(@state; @background) {\n // Exact selectors below required to override `.table-striped` and prevent\n // inheritance to nested tables.\n .table > thead > tr,\n .table > tbody > tr,\n .table > tfoot > tr {\n > td.@{state},\n > th.@{state},\n &.@{state} > td,\n &.@{state} > th {\n background-color: @background;\n }\n }\n\n // Hover states for `.table-hover`\n // Note: this is not available for cells or rows within `thead` or `tfoot`.\n .table-hover > tbody > tr {\n > td.@{state}:hover,\n > th.@{state}:hover,\n &.@{state}:hover > td,\n &:hover > .@{state},\n &.@{state}:hover > th {\n background-color: darken(@background, 5%);\n }\n }\n}\n","//\n// Forms\n// --------------------------------------------------\n\n\n// Normalize non-controls\n//\n// Restyle and baseline non-control form elements.\n\nfieldset {\n padding: 0;\n margin: 0;\n border: 0;\n // Chrome and Firefox set a `min-width: min-content;` on fieldsets,\n // so we reset that to ensure it behaves more like a standard block element.\n // See https://github.com/twbs/bootstrap/issues/12359.\n min-width: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n padding: 0;\n margin-bottom: @line-height-computed;\n font-size: (@font-size-base * 1.5);\n line-height: inherit;\n color: @legend-color;\n border: 0;\n border-bottom: 1px solid @legend-border-color;\n}\n\nlabel {\n display: inline-block;\n max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141)\n margin-bottom: 5px;\n font-weight: bold;\n}\n\n\n// Normalize form controls\n//\n// While most of our form styles require extra classes, some basic normalization\n// is required to ensure optimum display with or without those classes to better\n// address browser inconsistencies.\n\n// Override content-box in Normalize (* isn't specific enough)\ninput[type=\"search\"] {\n .box-sizing(border-box);\n}\n\n// Position radios and checkboxes better\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n margin: 4px 0 0;\n margin-top: 1px \\9; // IE8-9\n line-height: normal;\n}\n\ninput[type=\"file\"] {\n display: block;\n}\n\n// Make range inputs behave like textual form controls\ninput[type=\"range\"] {\n display: block;\n width: 100%;\n}\n\n// Make multiple select elements height not fixed\nselect[multiple],\nselect[size] {\n height: auto;\n}\n\n// Focus for file, radio, and checkbox\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n .tab-focus();\n}\n\n// Adjust output element\noutput {\n display: block;\n padding-top: (@padding-base-vertical + 1);\n font-size: @font-size-base;\n line-height: @line-height-base;\n color: @input-color;\n}\n\n\n// Common form controls\n//\n// Shared size and type resets for form controls. Apply `.form-control` to any\n// of the following form controls:\n//\n// select\n// textarea\n// input[type=\"text\"]\n// input[type=\"password\"]\n// input[type=\"datetime\"]\n// input[type=\"datetime-local\"]\n// input[type=\"date\"]\n// input[type=\"month\"]\n// input[type=\"time\"]\n// input[type=\"week\"]\n// input[type=\"number\"]\n// input[type=\"email\"]\n// input[type=\"url\"]\n// input[type=\"search\"]\n// input[type=\"tel\"]\n// input[type=\"color\"]\n\n.form-control {\n display: block;\n width: 100%;\n height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)\n padding: @padding-base-vertical @padding-base-horizontal;\n font-size: @font-size-base;\n line-height: @line-height-base;\n color: @input-color;\n background-color: @input-bg;\n background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n border: 1px solid @input-border;\n border-radius: @input-border-radius; // Note: This has no effect on s in CSS.\n .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));\n .transition(~\"border-color ease-in-out .15s, box-shadow ease-in-out .15s\");\n\n // Customize the `:focus` state to imitate native WebKit styles.\n .form-control-focus();\n\n // Placeholder\n .placeholder();\n\n // Unstyle the caret on ``\n// element gets special love because it's special, and that's a fact!\n.input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {\n height: @input-height;\n padding: @padding-vertical @padding-horizontal;\n font-size: @font-size;\n line-height: @line-height;\n border-radius: @border-radius;\n\n select& {\n height: @input-height;\n line-height: @input-height;\n }\n\n textarea&,\n select[multiple]& {\n height: auto;\n }\n}\n","//\n// Buttons\n// --------------------------------------------------\n\n\n// Base styles\n// --------------------------------------------------\n\n.btn {\n display: inline-block;\n margin-bottom: 0; // For input.btn\n font-weight: @btn-font-weight;\n text-align: center;\n vertical-align: middle;\n touch-action: manipulation;\n cursor: pointer;\n background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n border: 1px solid transparent;\n white-space: nowrap;\n .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @btn-border-radius-base);\n .user-select(none);\n\n &,\n &:active,\n &.active {\n &:focus,\n &.focus {\n .tab-focus();\n }\n }\n\n &:hover,\n &:focus,\n &.focus {\n color: @btn-default-color;\n text-decoration: none;\n }\n\n &:active,\n &.active {\n outline: 0;\n background-image: none;\n .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n }\n\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n cursor: @cursor-disabled;\n .opacity(.65);\n .box-shadow(none);\n }\n\n a& {\n &.disabled,\n fieldset[disabled] & {\n pointer-events: none; // Future-proof disabling of clicks on `` elements\n }\n }\n}\n\n\n// Alternate buttons\n// --------------------------------------------------\n\n.btn-default {\n .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);\n}\n.btn-primary {\n .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);\n}\n// Success appears as green\n.btn-success {\n .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);\n}\n// Info appears as blue-green\n.btn-info {\n .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);\n}\n// Warning appears as orange\n.btn-warning {\n .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);\n}\n// Danger and error appear as red\n.btn-danger {\n .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);\n}\n\n\n// Link buttons\n// -------------------------\n\n// Make a button look and behave like a link\n.btn-link {\n color: @link-color;\n font-weight: normal;\n border-radius: 0;\n\n &,\n &:active,\n &.active,\n &[disabled],\n fieldset[disabled] & {\n background-color: transparent;\n .box-shadow(none);\n }\n &,\n &:hover,\n &:focus,\n &:active {\n border-color: transparent;\n }\n &:hover,\n &:focus {\n color: @link-hover-color;\n text-decoration: @link-hover-decoration;\n background-color: transparent;\n }\n &[disabled],\n fieldset[disabled] & {\n &:hover,\n &:focus {\n color: @btn-link-disabled-color;\n text-decoration: none;\n }\n }\n}\n\n\n// Button Sizes\n// --------------------------------------------------\n\n.btn-lg {\n // line-height: ensure even-numbered height of button next to large input\n .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @btn-border-radius-large);\n}\n.btn-sm {\n // line-height: ensure proper height of button next to small input\n .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small);\n}\n.btn-xs {\n .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small);\n}\n\n\n// Block button\n// --------------------------------------------------\n\n.btn-block {\n display: block;\n width: 100%;\n}\n\n// Vertically space out multiple block buttons\n.btn-block + .btn-block {\n margin-top: 5px;\n}\n\n// Specificity overrides\ninput[type=\"submit\"],\ninput[type=\"reset\"],\ninput[type=\"button\"] {\n &.btn-block {\n width: 100%;\n }\n}\n","// Button variants\n//\n// Easily pump out default styles, as well as :hover, :focus, :active,\n// and disabled options for all buttons\n\n.button-variant(@color; @background; @border) {\n color: @color;\n background-color: @background;\n border-color: @border;\n\n &:focus,\n &.focus {\n color: @color;\n background-color: darken(@background, 10%);\n border-color: darken(@border, 25%);\n }\n &:hover {\n color: @color;\n background-color: darken(@background, 10%);\n border-color: darken(@border, 12%);\n }\n &:active,\n &.active,\n .open > .dropdown-toggle& {\n color: @color;\n background-color: darken(@background, 10%);\n border-color: darken(@border, 12%);\n\n &:hover,\n &:focus,\n &.focus {\n color: @color;\n background-color: darken(@background, 17%);\n border-color: darken(@border, 25%);\n }\n }\n &:active,\n &.active,\n .open > .dropdown-toggle& {\n background-image: none;\n }\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n &:hover,\n &:focus,\n &.focus {\n background-color: @background;\n border-color: @border;\n }\n }\n\n .badge {\n color: @background;\n background-color: @color;\n }\n}\n\n// Button sizes\n.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {\n padding: @padding-vertical @padding-horizontal;\n font-size: @font-size;\n line-height: @line-height;\n border-radius: @border-radius;\n}\n","// Opacity\n\n.opacity(@opacity) {\n opacity: @opacity;\n // IE8 filter\n @opacity-ie: (@opacity * 100);\n filter: ~\"alpha(opacity=@{opacity-ie})\";\n}\n","//\n// Component animations\n// --------------------------------------------------\n\n// Heads up!\n//\n// We don't use the `.opacity()` mixin here since it causes a bug with text\n// fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552.\n\n.fade {\n opacity: 0;\n .transition(opacity .15s linear);\n &.in {\n opacity: 1;\n }\n}\n\n.collapse {\n display: none;\n\n &.in { display: block; }\n tr&.in { display: table-row; }\n tbody&.in { display: table-row-group; }\n}\n\n.collapsing {\n position: relative;\n height: 0;\n overflow: hidden;\n .transition-property(~\"height, visibility\");\n .transition-duration(.35s);\n .transition-timing-function(ease);\n}\n","//\n// Dropdown menus\n// --------------------------------------------------\n\n\n// Dropdown arrow/caret\n.caret {\n display: inline-block;\n width: 0;\n height: 0;\n margin-left: 2px;\n vertical-align: middle;\n border-top: @caret-width-base dashed;\n border-top: @caret-width-base solid ~\"\\9\"; // IE8\n border-right: @caret-width-base solid transparent;\n border-left: @caret-width-base solid transparent;\n}\n\n// The dropdown wrapper (div)\n.dropup,\n.dropdown {\n position: relative;\n}\n\n// Prevent the focus on the dropdown toggle when closing dropdowns\n.dropdown-toggle:focus {\n outline: 0;\n}\n\n// The dropdown menu (ul)\n.dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: @zindex-dropdown;\n display: none; // none by default, but block on \"open\" of the menu\n float: left;\n min-width: 160px;\n padding: 5px 0;\n margin: 2px 0 0; // override default ul\n list-style: none;\n font-size: @font-size-base;\n text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)\n background-color: @dropdown-bg;\n border: 1px solid @dropdown-fallback-border; // IE8 fallback\n border: 1px solid @dropdown-border;\n border-radius: @border-radius-base;\n .box-shadow(0 6px 12px rgba(0,0,0,.175));\n background-clip: padding-box;\n\n // Aligns the dropdown menu to right\n //\n // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`\n &.pull-right {\n right: 0;\n left: auto;\n }\n\n // Dividers (basically an hr) within the dropdown\n .divider {\n .nav-divider(@dropdown-divider-bg);\n }\n\n // Links within the dropdown menu\n > li > a {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: @line-height-base;\n color: @dropdown-link-color;\n white-space: nowrap; // prevent links from randomly breaking onto new lines\n }\n}\n\n// Hover/Focus state\n.dropdown-menu > li > a {\n &:hover,\n &:focus {\n text-decoration: none;\n color: @dropdown-link-hover-color;\n background-color: @dropdown-link-hover-bg;\n }\n}\n\n// Active state\n.dropdown-menu > .active > a {\n &,\n &:hover,\n &:focus {\n color: @dropdown-link-active-color;\n text-decoration: none;\n outline: 0;\n background-color: @dropdown-link-active-bg;\n }\n}\n\n// Disabled state\n//\n// Gray out text and ensure the hover/focus state remains gray\n\n.dropdown-menu > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @dropdown-link-disabled-color;\n }\n\n // Nuke hover/focus effects\n &:hover,\n &:focus {\n text-decoration: none;\n background-color: transparent;\n background-image: none; // Remove CSS gradient\n .reset-filter();\n cursor: @cursor-disabled;\n }\n}\n\n// Open state for the dropdown\n.open {\n // Show the menu\n > .dropdown-menu {\n display: block;\n }\n\n // Remove the outline when :focus is triggered\n > a {\n outline: 0;\n }\n}\n\n// Menu positioning\n//\n// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown\n// menu with the parent.\n.dropdown-menu-right {\n left: auto; // Reset the default from `.dropdown-menu`\n right: 0;\n}\n// With v3, we enabled auto-flipping if you have a dropdown within a right\n// aligned nav component. To enable the undoing of that, we provide an override\n// to restore the default dropdown menu alignment.\n//\n// This is only for left-aligning a dropdown menu within a `.navbar-right` or\n// `.pull-right` nav component.\n.dropdown-menu-left {\n left: 0;\n right: auto;\n}\n\n// Dropdown section headers\n.dropdown-header {\n display: block;\n padding: 3px 20px;\n font-size: @font-size-small;\n line-height: @line-height-base;\n color: @dropdown-header-color;\n white-space: nowrap; // as with > li > a\n}\n\n// Backdrop to catch body clicks on mobile, etc.\n.dropdown-backdrop {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n z-index: (@zindex-dropdown - 10);\n}\n\n// Right aligned dropdowns\n.pull-right > .dropdown-menu {\n right: 0;\n left: auto;\n}\n\n// Allow for dropdowns to go bottom up (aka, dropup-menu)\n//\n// Just add .dropup after the standard .dropdown class and you're set, bro.\n// TODO: abstract this so that the navbar fixed styles are not placed here?\n\n.dropup,\n.navbar-fixed-bottom .dropdown {\n // Reverse the caret\n .caret {\n border-top: 0;\n border-bottom: @caret-width-base dashed;\n border-bottom: @caret-width-base solid ~\"\\9\"; // IE8\n content: \"\";\n }\n // Different positioning for bottom up menu\n .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-bottom: 2px;\n }\n}\n\n\n// Component alignment\n//\n// Reiterate per navbar.less and the modified component alignment there.\n\n@media (min-width: @grid-float-breakpoint) {\n .navbar-right {\n .dropdown-menu {\n .dropdown-menu-right();\n }\n // Necessary for overrides of the default right aligned menu.\n // Will remove come v4 in all likelihood.\n .dropdown-menu-left {\n .dropdown-menu-left();\n }\n }\n}\n","// Horizontal dividers\n//\n// Dividers (basically an hr) within dropdowns and nav lists\n\n.nav-divider(@color: #e5e5e5) {\n height: 1px;\n margin: ((@line-height-computed / 2) - 1) 0;\n overflow: hidden;\n background-color: @color;\n}\n","// Reset filters for IE\n//\n// When you need to remove a gradient background, do not forget to use this to reset\n// the IE filter for IE9 and below.\n\n.reset-filter() {\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(enabled = false)\"));\n}\n","//\n// Button groups\n// --------------------------------------------------\n\n// Make the div behave like a button\n.btn-group,\n.btn-group-vertical {\n position: relative;\n display: inline-block;\n vertical-align: middle; // match .btn alignment given font-size hack above\n > .btn {\n position: relative;\n float: left;\n // Bring the \"active\" button to the front\n &:hover,\n &:focus,\n &:active,\n &.active {\n z-index: 2;\n }\n }\n}\n\n// Prevent double borders when buttons are next to each other\n.btn-group {\n .btn + .btn,\n .btn + .btn-group,\n .btn-group + .btn,\n .btn-group + .btn-group {\n margin-left: -1px;\n }\n}\n\n// Optional: Group multiple button groups together for a toolbar\n.btn-toolbar {\n margin-left: -5px; // Offset the first child's margin\n &:extend(.clearfix all);\n\n .btn,\n .btn-group,\n .input-group {\n float: left;\n }\n > .btn,\n > .btn-group,\n > .input-group {\n margin-left: 5px;\n }\n}\n\n.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {\n border-radius: 0;\n}\n\n// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match\n.btn-group > .btn:first-child {\n margin-left: 0;\n &:not(:last-child):not(.dropdown-toggle) {\n .border-right-radius(0);\n }\n}\n// Need .dropdown-toggle since :last-child doesn't apply, given that a .dropdown-menu is used immediately after it\n.btn-group > .btn:last-child:not(:first-child),\n.btn-group > .dropdown-toggle:not(:first-child) {\n .border-left-radius(0);\n}\n\n// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)\n.btn-group > .btn-group {\n float: left;\n}\n.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group > .btn-group:first-child:not(:last-child) {\n > .btn:last-child,\n > .dropdown-toggle {\n .border-right-radius(0);\n }\n}\n.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {\n .border-left-radius(0);\n}\n\n// On active and open, don't show outline\n.btn-group .dropdown-toggle:active,\n.btn-group.open .dropdown-toggle {\n outline: 0;\n}\n\n\n// Sizing\n//\n// Remix the default button sizing classes into new ones for easier manipulation.\n\n.btn-group-xs > .btn { &:extend(.btn-xs); }\n.btn-group-sm > .btn { &:extend(.btn-sm); }\n.btn-group-lg > .btn { &:extend(.btn-lg); }\n\n\n// Split button dropdowns\n// ----------------------\n\n// Give the line between buttons some depth\n.btn-group > .btn + .dropdown-toggle {\n padding-left: 8px;\n padding-right: 8px;\n}\n.btn-group > .btn-lg + .dropdown-toggle {\n padding-left: 12px;\n padding-right: 12px;\n}\n\n// The clickable button for toggling the menu\n// Remove the gradient and set the same inset shadow as the :active state\n.btn-group.open .dropdown-toggle {\n .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n\n // Show no shadow for `.btn-link` since it has no other button styles.\n &.btn-link {\n .box-shadow(none);\n }\n}\n\n\n// Reposition the caret\n.btn .caret {\n margin-left: 0;\n}\n// Carets in other button sizes\n.btn-lg .caret {\n border-width: @caret-width-large @caret-width-large 0;\n border-bottom-width: 0;\n}\n// Upside down carets for .dropup\n.dropup .btn-lg .caret {\n border-width: 0 @caret-width-large @caret-width-large;\n}\n\n\n// Vertical button groups\n// ----------------------\n\n.btn-group-vertical {\n > .btn,\n > .btn-group,\n > .btn-group > .btn {\n display: block;\n float: none;\n width: 100%;\n max-width: 100%;\n }\n\n // Clear floats so dropdown menus can be properly placed\n > .btn-group {\n &:extend(.clearfix all);\n > .btn {\n float: none;\n }\n }\n\n > .btn + .btn,\n > .btn + .btn-group,\n > .btn-group + .btn,\n > .btn-group + .btn-group {\n margin-top: -1px;\n margin-left: 0;\n }\n}\n\n.btn-group-vertical > .btn {\n &:not(:first-child):not(:last-child) {\n border-radius: 0;\n }\n &:first-child:not(:last-child) {\n .border-top-radius(@btn-border-radius-base);\n .border-bottom-radius(0);\n }\n &:last-child:not(:first-child) {\n .border-top-radius(0);\n .border-bottom-radius(@btn-border-radius-base);\n }\n}\n.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group-vertical > .btn-group:first-child:not(:last-child) {\n > .btn:last-child,\n > .dropdown-toggle {\n .border-bottom-radius(0);\n }\n}\n.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {\n .border-top-radius(0);\n}\n\n\n// Justified button groups\n// ----------------------\n\n.btn-group-justified {\n display: table;\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n > .btn,\n > .btn-group {\n float: none;\n display: table-cell;\n width: 1%;\n }\n > .btn-group .btn {\n width: 100%;\n }\n\n > .btn-group .dropdown-menu {\n left: auto;\n }\n}\n\n\n// Checkbox and radio options\n//\n// In order to support the browser's form validation feedback, powered by the\n// `required` attribute, we have to \"hide\" the inputs via `clip`. We cannot use\n// `display: none;` or `visibility: hidden;` as that also hides the popover.\n// Simply visually hiding the inputs via `opacity` would leave them clickable in\n// certain cases which is prevented by using `clip` and `pointer-events`.\n// This way, we ensure a DOM element is visible to position the popover from.\n//\n// See https://github.com/twbs/bootstrap/pull/12794 and\n// https://github.com/twbs/bootstrap/pull/14559 for more information.\n\n[data-toggle=\"buttons\"] {\n > .btn,\n > .btn-group > .btn {\n input[type=\"radio\"],\n input[type=\"checkbox\"] {\n position: absolute;\n clip: rect(0,0,0,0);\n pointer-events: none;\n }\n }\n}\n","// Single side border-radius\n\n.border-top-radius(@radius) {\n border-top-right-radius: @radius;\n border-top-left-radius: @radius;\n}\n.border-right-radius(@radius) {\n border-bottom-right-radius: @radius;\n border-top-right-radius: @radius;\n}\n.border-bottom-radius(@radius) {\n border-bottom-right-radius: @radius;\n border-bottom-left-radius: @radius;\n}\n.border-left-radius(@radius) {\n border-bottom-left-radius: @radius;\n border-top-left-radius: @radius;\n}\n","//\n// Input groups\n// --------------------------------------------------\n\n// Base styles\n// -------------------------\n.input-group {\n position: relative; // For dropdowns\n display: table;\n border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table\n\n // Undo padding and float of grid classes\n &[class*=\"col-\"] {\n float: none;\n padding-left: 0;\n padding-right: 0;\n }\n\n .form-control {\n // Ensure that the input is always above the *appended* addon button for\n // proper border colors.\n position: relative;\n z-index: 2;\n\n // IE9 fubars the placeholder attribute in text inputs and the arrows on\n // select elements in input groups. To fix it, we float the input. Details:\n // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855\n float: left;\n\n width: 100%;\n margin-bottom: 0;\n\n &:focus {\n z-index: 3;\n }\n }\n}\n\n// Sizing options\n//\n// Remix the default form control sizing classes into new ones for easier\n// manipulation.\n\n.input-group-lg > .form-control,\n.input-group-lg > .input-group-addon,\n.input-group-lg > .input-group-btn > .btn {\n .input-lg();\n}\n.input-group-sm > .form-control,\n.input-group-sm > .input-group-addon,\n.input-group-sm > .input-group-btn > .btn {\n .input-sm();\n}\n\n\n// Display as table-cell\n// -------------------------\n.input-group-addon,\n.input-group-btn,\n.input-group .form-control {\n display: table-cell;\n\n &:not(:first-child):not(:last-child) {\n border-radius: 0;\n }\n}\n// Addon and addon wrapper for buttons\n.input-group-addon,\n.input-group-btn {\n width: 1%;\n white-space: nowrap;\n vertical-align: middle; // Match the inputs\n}\n\n// Text input groups\n// -------------------------\n.input-group-addon {\n padding: @padding-base-vertical @padding-base-horizontal;\n font-size: @font-size-base;\n font-weight: normal;\n line-height: 1;\n color: @input-color;\n text-align: center;\n background-color: @input-group-addon-bg;\n border: 1px solid @input-group-addon-border-color;\n border-radius: @input-border-radius;\n\n // Sizing\n &.input-sm {\n padding: @padding-small-vertical @padding-small-horizontal;\n font-size: @font-size-small;\n border-radius: @input-border-radius-small;\n }\n &.input-lg {\n padding: @padding-large-vertical @padding-large-horizontal;\n font-size: @font-size-large;\n border-radius: @input-border-radius-large;\n }\n\n // Nuke default margins from checkboxes and radios to vertically center within.\n input[type=\"radio\"],\n input[type=\"checkbox\"] {\n margin-top: 0;\n }\n}\n\n// Reset rounded corners\n.input-group .form-control:first-child,\n.input-group-addon:first-child,\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group > .btn,\n.input-group-btn:first-child > .dropdown-toggle,\n.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {\n .border-right-radius(0);\n}\n.input-group-addon:first-child {\n border-right: 0;\n}\n.input-group .form-control:last-child,\n.input-group-addon:last-child,\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group > .btn,\n.input-group-btn:last-child > .dropdown-toggle,\n.input-group-btn:first-child > .btn:not(:first-child),\n.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {\n .border-left-radius(0);\n}\n.input-group-addon:last-child {\n border-left: 0;\n}\n\n// Button input groups\n// -------------------------\n.input-group-btn {\n position: relative;\n // Jankily prevent input button groups from wrapping with `white-space` and\n // `font-size` in combination with `inline-block` on buttons.\n font-size: 0;\n white-space: nowrap;\n\n // Negative margin for spacing, position for bringing hovered/focused/actived\n // element above the siblings.\n > .btn {\n position: relative;\n + .btn {\n margin-left: -1px;\n }\n // Bring the \"active\" button to the front\n &:hover,\n &:focus,\n &:active {\n z-index: 2;\n }\n }\n\n // Negative margin to only have a 1px border between the two\n &:first-child {\n > .btn,\n > .btn-group {\n margin-right: -1px;\n }\n }\n &:last-child {\n > .btn,\n > .btn-group {\n z-index: 2;\n margin-left: -1px;\n }\n }\n}\n","//\n// Navs\n// --------------------------------------------------\n\n\n// Base class\n// --------------------------------------------------\n\n.nav {\n margin-bottom: 0;\n padding-left: 0; // Override default ul/ol\n list-style: none;\n &:extend(.clearfix all);\n\n > li {\n position: relative;\n display: block;\n\n > a {\n position: relative;\n display: block;\n padding: @nav-link-padding;\n &:hover,\n &:focus {\n text-decoration: none;\n background-color: @nav-link-hover-bg;\n }\n }\n\n // Disabled state sets text to gray and nukes hover/tab effects\n &.disabled > a {\n color: @nav-disabled-link-color;\n\n &:hover,\n &:focus {\n color: @nav-disabled-link-hover-color;\n text-decoration: none;\n background-color: transparent;\n cursor: @cursor-disabled;\n }\n }\n }\n\n // Open dropdowns\n .open > a {\n &,\n &:hover,\n &:focus {\n background-color: @nav-link-hover-bg;\n border-color: @link-color;\n }\n }\n\n // Nav dividers (deprecated with v3.0.1)\n //\n // This should have been removed in v3 with the dropping of `.nav-list`, but\n // we missed it. We don't currently support this anywhere, but in the interest\n // of maintaining backward compatibility in case you use it, it's deprecated.\n .nav-divider {\n .nav-divider();\n }\n\n // Prevent IE8 from misplacing imgs\n //\n // See https://github.com/h5bp/html5-boilerplate/issues/984#issuecomment-3985989\n > li > a > img {\n max-width: none;\n }\n}\n\n\n// Tabs\n// -------------------------\n\n// Give the tabs something to sit on\n.nav-tabs {\n border-bottom: 1px solid @nav-tabs-border-color;\n > li {\n float: left;\n // Make the list-items overlay the bottom border\n margin-bottom: -1px;\n\n // Actual tabs (as links)\n > a {\n margin-right: 2px;\n line-height: @line-height-base;\n border: 1px solid transparent;\n border-radius: @border-radius-base @border-radius-base 0 0;\n &:hover {\n border-color: @nav-tabs-link-hover-border-color @nav-tabs-link-hover-border-color @nav-tabs-border-color;\n }\n }\n\n // Active state, and its :hover to override normal :hover\n &.active > a {\n &,\n &:hover,\n &:focus {\n color: @nav-tabs-active-link-hover-color;\n background-color: @nav-tabs-active-link-hover-bg;\n border: 1px solid @nav-tabs-active-link-hover-border-color;\n border-bottom-color: transparent;\n cursor: default;\n }\n }\n }\n // pulling this in mainly for less shorthand\n &.nav-justified {\n .nav-justified();\n .nav-tabs-justified();\n }\n}\n\n\n// Pills\n// -------------------------\n.nav-pills {\n > li {\n float: left;\n\n // Links rendered as pills\n > a {\n border-radius: @nav-pills-border-radius;\n }\n + li {\n margin-left: 2px;\n }\n\n // Active state\n &.active > a {\n &,\n &:hover,\n &:focus {\n color: @nav-pills-active-link-hover-color;\n background-color: @nav-pills-active-link-hover-bg;\n }\n }\n }\n}\n\n\n// Stacked pills\n.nav-stacked {\n > li {\n float: none;\n + li {\n margin-top: 2px;\n margin-left: 0; // no need for this gap between nav items\n }\n }\n}\n\n\n// Nav variations\n// --------------------------------------------------\n\n// Justified nav links\n// -------------------------\n\n.nav-justified {\n width: 100%;\n\n > li {\n float: none;\n > a {\n text-align: center;\n margin-bottom: 5px;\n }\n }\n\n > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n\n @media (min-width: @screen-sm-min) {\n > li {\n display: table-cell;\n width: 1%;\n > a {\n margin-bottom: 0;\n }\n }\n }\n}\n\n// Move borders to anchors instead of bottom of list\n//\n// Mixin for adding on top the shared `.nav-justified` styles for our tabs\n.nav-tabs-justified {\n border-bottom: 0;\n\n > li > a {\n // Override margin from .nav-tabs\n margin-right: 0;\n border-radius: @border-radius-base;\n }\n\n > .active > a,\n > .active > a:hover,\n > .active > a:focus {\n border: 1px solid @nav-tabs-justified-link-border-color;\n }\n\n @media (min-width: @screen-sm-min) {\n > li > a {\n border-bottom: 1px solid @nav-tabs-justified-link-border-color;\n border-radius: @border-radius-base @border-radius-base 0 0;\n }\n > .active > a,\n > .active > a:hover,\n > .active > a:focus {\n border-bottom-color: @nav-tabs-justified-active-link-border-color;\n }\n }\n}\n\n\n// Tabbable tabs\n// -------------------------\n\n// Hide tabbable panes to start, show them when `.active`\n.tab-content {\n > .tab-pane {\n display: none;\n }\n > .active {\n display: block;\n }\n}\n\n\n// Dropdowns\n// -------------------------\n\n// Specific dropdowns\n.nav-tabs .dropdown-menu {\n // make dropdown border overlap tab border\n margin-top: -1px;\n // Remove the top rounded corners here since there is a hard edge above the menu\n .border-top-radius(0);\n}\n","//\n// Navbars\n// --------------------------------------------------\n\n\n// Wrapper and base class\n//\n// Provide a static navbar from which we expand to create full-width, fixed, and\n// other navbar variations.\n\n.navbar {\n position: relative;\n min-height: @navbar-height; // Ensure a navbar always shows (e.g., without a .navbar-brand in collapsed mode)\n margin-bottom: @navbar-margin-bottom;\n border: 1px solid transparent;\n\n // Prevent floats from breaking the navbar\n &:extend(.clearfix all);\n\n @media (min-width: @grid-float-breakpoint) {\n border-radius: @navbar-border-radius;\n }\n}\n\n\n// Navbar heading\n//\n// Groups `.navbar-brand` and `.navbar-toggle` into a single component for easy\n// styling of responsive aspects.\n\n.navbar-header {\n &:extend(.clearfix all);\n\n @media (min-width: @grid-float-breakpoint) {\n float: left;\n }\n}\n\n\n// Navbar collapse (body)\n//\n// Group your navbar content into this for easy collapsing and expanding across\n// various device sizes. By default, this content is collapsed when <768px, but\n// will expand past that for a horizontal display.\n//\n// To start (on mobile devices) the navbar links, forms, and buttons are stacked\n// vertically and include a `max-height` to overflow in case you have too much\n// content for the user's viewport.\n\n.navbar-collapse {\n overflow-x: visible;\n padding-right: @navbar-padding-horizontal;\n padding-left: @navbar-padding-horizontal;\n border-top: 1px solid transparent;\n box-shadow: inset 0 1px 0 rgba(255,255,255,.1);\n &:extend(.clearfix all);\n -webkit-overflow-scrolling: touch;\n\n &.in {\n overflow-y: auto;\n }\n\n @media (min-width: @grid-float-breakpoint) {\n width: auto;\n border-top: 0;\n box-shadow: none;\n\n &.collapse {\n display: block !important;\n height: auto !important;\n padding-bottom: 0; // Override default setting\n overflow: visible !important;\n }\n\n &.in {\n overflow-y: visible;\n }\n\n // Undo the collapse side padding for navbars with containers to ensure\n // alignment of right-aligned contents.\n .navbar-fixed-top &,\n .navbar-static-top &,\n .navbar-fixed-bottom & {\n padding-left: 0;\n padding-right: 0;\n }\n }\n}\n\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n .navbar-collapse {\n max-height: @navbar-collapse-max-height;\n\n @media (max-device-width: @screen-xs-min) and (orientation: landscape) {\n max-height: 200px;\n }\n }\n}\n\n\n// Both navbar header and collapse\n//\n// When a container is present, change the behavior of the header and collapse.\n\n.container,\n.container-fluid {\n > .navbar-header,\n > .navbar-collapse {\n margin-right: -@navbar-padding-horizontal;\n margin-left: -@navbar-padding-horizontal;\n\n @media (min-width: @grid-float-breakpoint) {\n margin-right: 0;\n margin-left: 0;\n }\n }\n}\n\n\n//\n// Navbar alignment options\n//\n// Display the navbar across the entirety of the page or fixed it to the top or\n// bottom of the page.\n\n// Static top (unfixed, but 100% wide) navbar\n.navbar-static-top {\n z-index: @zindex-navbar;\n border-width: 0 0 1px;\n\n @media (min-width: @grid-float-breakpoint) {\n border-radius: 0;\n }\n}\n\n// Fix the top/bottom navbars when screen real estate supports it\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n position: fixed;\n right: 0;\n left: 0;\n z-index: @zindex-navbar-fixed;\n\n // Undo the rounded corners\n @media (min-width: @grid-float-breakpoint) {\n border-radius: 0;\n }\n}\n.navbar-fixed-top {\n top: 0;\n border-width: 0 0 1px;\n}\n.navbar-fixed-bottom {\n bottom: 0;\n margin-bottom: 0; // override .navbar defaults\n border-width: 1px 0 0;\n}\n\n\n// Brand/project name\n\n.navbar-brand {\n float: left;\n padding: @navbar-padding-vertical @navbar-padding-horizontal;\n font-size: @font-size-large;\n line-height: @line-height-computed;\n height: @navbar-height;\n\n &:hover,\n &:focus {\n text-decoration: none;\n }\n\n > img {\n display: block;\n }\n\n @media (min-width: @grid-float-breakpoint) {\n .navbar > .container &,\n .navbar > .container-fluid & {\n margin-left: -@navbar-padding-horizontal;\n }\n }\n}\n\n\n// Navbar toggle\n//\n// Custom button for toggling the `.navbar-collapse`, powered by the collapse\n// JavaScript plugin.\n\n.navbar-toggle {\n position: relative;\n float: right;\n margin-right: @navbar-padding-horizontal;\n padding: 9px 10px;\n .navbar-vertical-align(34px);\n background-color: transparent;\n background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n border: 1px solid transparent;\n border-radius: @border-radius-base;\n\n // We remove the `outline` here, but later compensate by attaching `:hover`\n // styles to `:focus`.\n &:focus {\n outline: 0;\n }\n\n // Bars\n .icon-bar {\n display: block;\n width: 22px;\n height: 2px;\n border-radius: 1px;\n }\n .icon-bar + .icon-bar {\n margin-top: 4px;\n }\n\n @media (min-width: @grid-float-breakpoint) {\n display: none;\n }\n}\n\n\n// Navbar nav links\n//\n// Builds on top of the `.nav` components with its own modifier class to make\n// the nav the full height of the horizontal nav (above 768px).\n\n.navbar-nav {\n margin: (@navbar-padding-vertical / 2) -@navbar-padding-horizontal;\n\n > li > a {\n padding-top: 10px;\n padding-bottom: 10px;\n line-height: @line-height-computed;\n }\n\n @media (max-width: @grid-float-breakpoint-max) {\n // Dropdowns get custom display when collapsed\n .open .dropdown-menu {\n position: static;\n float: none;\n width: auto;\n margin-top: 0;\n background-color: transparent;\n border: 0;\n box-shadow: none;\n > li > a,\n .dropdown-header {\n padding: 5px 15px 5px 25px;\n }\n > li > a {\n line-height: @line-height-computed;\n &:hover,\n &:focus {\n background-image: none;\n }\n }\n }\n }\n\n // Uncollapse the nav\n @media (min-width: @grid-float-breakpoint) {\n float: left;\n margin: 0;\n\n > li {\n float: left;\n > a {\n padding-top: @navbar-padding-vertical;\n padding-bottom: @navbar-padding-vertical;\n }\n }\n }\n}\n\n\n// Navbar form\n//\n// Extension of the `.form-inline` with some extra flavor for optimum display in\n// our navbars.\n\n.navbar-form {\n margin-left: -@navbar-padding-horizontal;\n margin-right: -@navbar-padding-horizontal;\n padding: 10px @navbar-padding-horizontal;\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n @shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);\n .box-shadow(@shadow);\n\n // Mixin behavior for optimum display\n .form-inline();\n\n .form-group {\n @media (max-width: @grid-float-breakpoint-max) {\n margin-bottom: 5px;\n\n &:last-child {\n margin-bottom: 0;\n }\n }\n }\n\n // Vertically center in expanded, horizontal navbar\n .navbar-vertical-align(@input-height-base);\n\n // Undo 100% width for pull classes\n @media (min-width: @grid-float-breakpoint) {\n width: auto;\n border: 0;\n margin-left: 0;\n margin-right: 0;\n padding-top: 0;\n padding-bottom: 0;\n .box-shadow(none);\n }\n}\n\n\n// Dropdown menus\n\n// Menu position and menu carets\n.navbar-nav > li > .dropdown-menu {\n margin-top: 0;\n .border-top-radius(0);\n}\n// Menu position and menu caret support for dropups via extra dropup class\n.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n margin-bottom: 0;\n .border-top-radius(@navbar-border-radius);\n .border-bottom-radius(0);\n}\n\n\n// Buttons in navbars\n//\n// Vertically center a button within a navbar (when *not* in a form).\n\n.navbar-btn {\n .navbar-vertical-align(@input-height-base);\n\n &.btn-sm {\n .navbar-vertical-align(@input-height-small);\n }\n &.btn-xs {\n .navbar-vertical-align(22);\n }\n}\n\n\n// Text in navbars\n//\n// Add a class to make any element properly align itself vertically within the navbars.\n\n.navbar-text {\n .navbar-vertical-align(@line-height-computed);\n\n @media (min-width: @grid-float-breakpoint) {\n float: left;\n margin-left: @navbar-padding-horizontal;\n margin-right: @navbar-padding-horizontal;\n }\n}\n\n\n// Component alignment\n//\n// Repurpose the pull utilities as their own navbar utilities to avoid specificity\n// issues with parents and chaining. Only do this when the navbar is uncollapsed\n// though so that navbar contents properly stack and align in mobile.\n//\n// Declared after the navbar components to ensure more specificity on the margins.\n\n@media (min-width: @grid-float-breakpoint) {\n .navbar-left { .pull-left(); }\n .navbar-right {\n .pull-right();\n margin-right: -@navbar-padding-horizontal;\n\n ~ .navbar-right {\n margin-right: 0;\n }\n }\n}\n\n\n// Alternate navbars\n// --------------------------------------------------\n\n// Default navbar\n.navbar-default {\n background-color: @navbar-default-bg;\n border-color: @navbar-default-border;\n\n .navbar-brand {\n color: @navbar-default-brand-color;\n &:hover,\n &:focus {\n color: @navbar-default-brand-hover-color;\n background-color: @navbar-default-brand-hover-bg;\n }\n }\n\n .navbar-text {\n color: @navbar-default-color;\n }\n\n .navbar-nav {\n > li > a {\n color: @navbar-default-link-color;\n\n &:hover,\n &:focus {\n color: @navbar-default-link-hover-color;\n background-color: @navbar-default-link-hover-bg;\n }\n }\n > .active > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-default-link-active-color;\n background-color: @navbar-default-link-active-bg;\n }\n }\n > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-default-link-disabled-color;\n background-color: @navbar-default-link-disabled-bg;\n }\n }\n }\n\n .navbar-toggle {\n border-color: @navbar-default-toggle-border-color;\n &:hover,\n &:focus {\n background-color: @navbar-default-toggle-hover-bg;\n }\n .icon-bar {\n background-color: @navbar-default-toggle-icon-bar-bg;\n }\n }\n\n .navbar-collapse,\n .navbar-form {\n border-color: @navbar-default-border;\n }\n\n // Dropdown menu items\n .navbar-nav {\n // Remove background color from open dropdown\n > .open > a {\n &,\n &:hover,\n &:focus {\n background-color: @navbar-default-link-active-bg;\n color: @navbar-default-link-active-color;\n }\n }\n\n @media (max-width: @grid-float-breakpoint-max) {\n // Dropdowns get custom display when collapsed\n .open .dropdown-menu {\n > li > a {\n color: @navbar-default-link-color;\n &:hover,\n &:focus {\n color: @navbar-default-link-hover-color;\n background-color: @navbar-default-link-hover-bg;\n }\n }\n > .active > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-default-link-active-color;\n background-color: @navbar-default-link-active-bg;\n }\n }\n > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-default-link-disabled-color;\n background-color: @navbar-default-link-disabled-bg;\n }\n }\n }\n }\n }\n\n\n // Links in navbars\n //\n // Add a class to ensure links outside the navbar nav are colored correctly.\n\n .navbar-link {\n color: @navbar-default-link-color;\n &:hover {\n color: @navbar-default-link-hover-color;\n }\n }\n\n .btn-link {\n color: @navbar-default-link-color;\n &:hover,\n &:focus {\n color: @navbar-default-link-hover-color;\n }\n &[disabled],\n fieldset[disabled] & {\n &:hover,\n &:focus {\n color: @navbar-default-link-disabled-color;\n }\n }\n }\n}\n\n// Inverse navbar\n\n.navbar-inverse {\n background-color: @navbar-inverse-bg;\n border-color: @navbar-inverse-border;\n\n .navbar-brand {\n color: @navbar-inverse-brand-color;\n &:hover,\n &:focus {\n color: @navbar-inverse-brand-hover-color;\n background-color: @navbar-inverse-brand-hover-bg;\n }\n }\n\n .navbar-text {\n color: @navbar-inverse-color;\n }\n\n .navbar-nav {\n > li > a {\n color: @navbar-inverse-link-color;\n\n &:hover,\n &:focus {\n color: @navbar-inverse-link-hover-color;\n background-color: @navbar-inverse-link-hover-bg;\n }\n }\n > .active > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-inverse-link-active-color;\n background-color: @navbar-inverse-link-active-bg;\n }\n }\n > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-inverse-link-disabled-color;\n background-color: @navbar-inverse-link-disabled-bg;\n }\n }\n }\n\n // Darken the responsive nav toggle\n .navbar-toggle {\n border-color: @navbar-inverse-toggle-border-color;\n &:hover,\n &:focus {\n background-color: @navbar-inverse-toggle-hover-bg;\n }\n .icon-bar {\n background-color: @navbar-inverse-toggle-icon-bar-bg;\n }\n }\n\n .navbar-collapse,\n .navbar-form {\n border-color: darken(@navbar-inverse-bg, 7%);\n }\n\n // Dropdowns\n .navbar-nav {\n > .open > a {\n &,\n &:hover,\n &:focus {\n background-color: @navbar-inverse-link-active-bg;\n color: @navbar-inverse-link-active-color;\n }\n }\n\n @media (max-width: @grid-float-breakpoint-max) {\n // Dropdowns get custom display\n .open .dropdown-menu {\n > .dropdown-header {\n border-color: @navbar-inverse-border;\n }\n .divider {\n background-color: @navbar-inverse-border;\n }\n > li > a {\n color: @navbar-inverse-link-color;\n &:hover,\n &:focus {\n color: @navbar-inverse-link-hover-color;\n background-color: @navbar-inverse-link-hover-bg;\n }\n }\n > .active > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-inverse-link-active-color;\n background-color: @navbar-inverse-link-active-bg;\n }\n }\n > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-inverse-link-disabled-color;\n background-color: @navbar-inverse-link-disabled-bg;\n }\n }\n }\n }\n }\n\n .navbar-link {\n color: @navbar-inverse-link-color;\n &:hover {\n color: @navbar-inverse-link-hover-color;\n }\n }\n\n .btn-link {\n color: @navbar-inverse-link-color;\n &:hover,\n &:focus {\n color: @navbar-inverse-link-hover-color;\n }\n &[disabled],\n fieldset[disabled] & {\n &:hover,\n &:focus {\n color: @navbar-inverse-link-disabled-color;\n }\n }\n }\n}\n","// Navbar vertical align\n//\n// Vertically center elements in the navbar.\n// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.\n\n.navbar-vertical-align(@element-height) {\n margin-top: ((@navbar-height - @element-height) / 2);\n margin-bottom: ((@navbar-height - @element-height) / 2);\n}\n","//\n// Utility classes\n// --------------------------------------------------\n\n\n// Floats\n// -------------------------\n\n.clearfix {\n .clearfix();\n}\n.center-block {\n .center-block();\n}\n.pull-right {\n float: right !important;\n}\n.pull-left {\n float: left !important;\n}\n\n\n// Toggling content\n// -------------------------\n\n// Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1\n.hide {\n display: none !important;\n}\n.show {\n display: block !important;\n}\n.invisible {\n visibility: hidden;\n}\n.text-hide {\n .text-hide();\n}\n\n\n// Hide from screenreaders and browsers\n//\n// Credit: HTML5 Boilerplate\n\n.hidden {\n display: none !important;\n}\n\n\n// For Affix plugin\n// -------------------------\n\n.affix {\n position: fixed;\n}\n","//\n// Breadcrumbs\n// --------------------------------------------------\n\n\n.breadcrumb {\n padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal;\n margin-bottom: @line-height-computed;\n list-style: none;\n background-color: @breadcrumb-bg;\n border-radius: @border-radius-base;\n\n > li {\n display: inline-block;\n\n + li:before {\n content: \"@{breadcrumb-separator}\\00a0\"; // Unicode space added since inline-block means non-collapsing white-space\n padding: 0 5px;\n color: @breadcrumb-color;\n }\n }\n\n > .active {\n color: @breadcrumb-active-color;\n }\n}\n","//\n// Pagination (multiple pages)\n// --------------------------------------------------\n.pagination {\n display: inline-block;\n padding-left: 0;\n margin: @line-height-computed 0;\n border-radius: @border-radius-base;\n\n > li {\n display: inline; // Remove list-style and block-level defaults\n > a,\n > span {\n position: relative;\n float: left; // Collapse white-space\n padding: @padding-base-vertical @padding-base-horizontal;\n line-height: @line-height-base;\n text-decoration: none;\n color: @pagination-color;\n background-color: @pagination-bg;\n border: 1px solid @pagination-border;\n margin-left: -1px;\n }\n &:first-child {\n > a,\n > span {\n margin-left: 0;\n .border-left-radius(@border-radius-base);\n }\n }\n &:last-child {\n > a,\n > span {\n .border-right-radius(@border-radius-base);\n }\n }\n }\n\n > li > a,\n > li > span {\n &:hover,\n &:focus {\n z-index: 2;\n color: @pagination-hover-color;\n background-color: @pagination-hover-bg;\n border-color: @pagination-hover-border;\n }\n }\n\n > .active > a,\n > .active > span {\n &,\n &:hover,\n &:focus {\n z-index: 3;\n color: @pagination-active-color;\n background-color: @pagination-active-bg;\n border-color: @pagination-active-border;\n cursor: default;\n }\n }\n\n > .disabled {\n > span,\n > span:hover,\n > span:focus,\n > a,\n > a:hover,\n > a:focus {\n color: @pagination-disabled-color;\n background-color: @pagination-disabled-bg;\n border-color: @pagination-disabled-border;\n cursor: @cursor-disabled;\n }\n }\n}\n\n// Sizing\n// --------------------------------------------------\n\n// Large\n.pagination-lg {\n .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);\n}\n\n// Small\n.pagination-sm {\n .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);\n}\n","// Pagination\n\n.pagination-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {\n > li {\n > a,\n > span {\n padding: @padding-vertical @padding-horizontal;\n font-size: @font-size;\n line-height: @line-height;\n }\n &:first-child {\n > a,\n > span {\n .border-left-radius(@border-radius);\n }\n }\n &:last-child {\n > a,\n > span {\n .border-right-radius(@border-radius);\n }\n }\n }\n}\n","//\n// Pager pagination\n// --------------------------------------------------\n\n\n.pager {\n padding-left: 0;\n margin: @line-height-computed 0;\n list-style: none;\n text-align: center;\n &:extend(.clearfix all);\n li {\n display: inline;\n > a,\n > span {\n display: inline-block;\n padding: 5px 14px;\n background-color: @pager-bg;\n border: 1px solid @pager-border;\n border-radius: @pager-border-radius;\n }\n\n > a:hover,\n > a:focus {\n text-decoration: none;\n background-color: @pager-hover-bg;\n }\n }\n\n .next {\n > a,\n > span {\n float: right;\n }\n }\n\n .previous {\n > a,\n > span {\n float: left;\n }\n }\n\n .disabled {\n > a,\n > a:hover,\n > a:focus,\n > span {\n color: @pager-disabled-color;\n background-color: @pager-bg;\n cursor: @cursor-disabled;\n }\n }\n}\n","//\n// Labels\n// --------------------------------------------------\n\n.label {\n display: inline;\n padding: .2em .6em .3em;\n font-size: 75%;\n font-weight: bold;\n line-height: 1;\n color: @label-color;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n border-radius: .25em;\n\n // Add hover effects, but only for links\n a& {\n &:hover,\n &:focus {\n color: @label-link-hover-color;\n text-decoration: none;\n cursor: pointer;\n }\n }\n\n // Empty labels collapse automatically (not available in IE8)\n &:empty {\n display: none;\n }\n\n // Quick fix for labels in buttons\n .btn & {\n position: relative;\n top: -1px;\n }\n}\n\n// Colors\n// Contextual variations (linked labels get darker on :hover)\n\n.label-default {\n .label-variant(@label-default-bg);\n}\n\n.label-primary {\n .label-variant(@label-primary-bg);\n}\n\n.label-success {\n .label-variant(@label-success-bg);\n}\n\n.label-info {\n .label-variant(@label-info-bg);\n}\n\n.label-warning {\n .label-variant(@label-warning-bg);\n}\n\n.label-danger {\n .label-variant(@label-danger-bg);\n}\n","// Labels\n\n.label-variant(@color) {\n background-color: @color;\n\n &[href] {\n &:hover,\n &:focus {\n background-color: darken(@color, 10%);\n }\n }\n}\n","//\n// Badges\n// --------------------------------------------------\n\n\n// Base class\n.badge {\n display: inline-block;\n min-width: 10px;\n padding: 3px 7px;\n font-size: @font-size-small;\n font-weight: @badge-font-weight;\n color: @badge-color;\n line-height: @badge-line-height;\n vertical-align: middle;\n white-space: nowrap;\n text-align: center;\n background-color: @badge-bg;\n border-radius: @badge-border-radius;\n\n // Empty badges collapse automatically (not available in IE8)\n &:empty {\n display: none;\n }\n\n // Quick fix for badges in buttons\n .btn & {\n position: relative;\n top: -1px;\n }\n\n .btn-xs &,\n .btn-group-xs > .btn & {\n top: 0;\n padding: 1px 5px;\n }\n\n // Hover state, but only for links\n a& {\n &:hover,\n &:focus {\n color: @badge-link-hover-color;\n text-decoration: none;\n cursor: pointer;\n }\n }\n\n // Account for badges in navs\n .list-group-item.active > &,\n .nav-pills > .active > a > & {\n color: @badge-active-color;\n background-color: @badge-active-bg;\n }\n\n .list-group-item > & {\n float: right;\n }\n\n .list-group-item > & + & {\n margin-right: 5px;\n }\n\n .nav-pills > li > a > & {\n margin-left: 3px;\n }\n}\n","//\n// Jumbotron\n// --------------------------------------------------\n\n\n.jumbotron {\n padding-top: @jumbotron-padding;\n padding-bottom: @jumbotron-padding;\n margin-bottom: @jumbotron-padding;\n color: @jumbotron-color;\n background-color: @jumbotron-bg;\n\n h1,\n .h1 {\n color: @jumbotron-heading-color;\n }\n\n p {\n margin-bottom: (@jumbotron-padding / 2);\n font-size: @jumbotron-font-size;\n font-weight: 200;\n }\n\n > hr {\n border-top-color: darken(@jumbotron-bg, 10%);\n }\n\n .container &,\n .container-fluid & {\n border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container\n padding-left: (@grid-gutter-width / 2);\n padding-right: (@grid-gutter-width / 2);\n }\n\n .container {\n max-width: 100%;\n }\n\n @media screen and (min-width: @screen-sm-min) {\n padding-top: (@jumbotron-padding * 1.6);\n padding-bottom: (@jumbotron-padding * 1.6);\n\n .container &,\n .container-fluid & {\n padding-left: (@jumbotron-padding * 2);\n padding-right: (@jumbotron-padding * 2);\n }\n\n h1,\n .h1 {\n font-size: @jumbotron-heading-font-size;\n }\n }\n}\n","//\n// Thumbnails\n// --------------------------------------------------\n\n\n// Mixin and adjust the regular image class\n.thumbnail {\n display: block;\n padding: @thumbnail-padding;\n margin-bottom: @line-height-computed;\n line-height: @line-height-base;\n background-color: @thumbnail-bg;\n border: 1px solid @thumbnail-border;\n border-radius: @thumbnail-border-radius;\n .transition(border .2s ease-in-out);\n\n > img,\n a > img {\n &:extend(.img-responsive);\n margin-left: auto;\n margin-right: auto;\n }\n\n // Add a hover state for linked versions only\n a&:hover,\n a&:focus,\n a&.active {\n border-color: @link-color;\n }\n\n // Image captions\n .caption {\n padding: @thumbnail-caption-padding;\n color: @thumbnail-caption-color;\n }\n}\n","//\n// Alerts\n// --------------------------------------------------\n\n\n// Base styles\n// -------------------------\n\n.alert {\n padding: @alert-padding;\n margin-bottom: @line-height-computed;\n border: 1px solid transparent;\n border-radius: @alert-border-radius;\n\n // Headings for larger alerts\n h4 {\n margin-top: 0;\n // Specified for the h4 to prevent conflicts of changing @headings-color\n color: inherit;\n }\n\n // Provide class for links that match alerts\n .alert-link {\n font-weight: @alert-link-font-weight;\n }\n\n // Improve alignment and spacing of inner content\n > p,\n > ul {\n margin-bottom: 0;\n }\n\n > p + p {\n margin-top: 5px;\n }\n}\n\n// Dismissible alerts\n//\n// Expand the right padding and account for the close button's positioning.\n\n.alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0.\n.alert-dismissible {\n padding-right: (@alert-padding + 20);\n\n // Adjust close link position\n .close {\n position: relative;\n top: -2px;\n right: -21px;\n color: inherit;\n }\n}\n\n// Alternate styles\n//\n// Generate contextual modifier classes for colorizing the alert.\n\n.alert-success {\n .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text);\n}\n\n.alert-info {\n .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text);\n}\n\n.alert-warning {\n .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text);\n}\n\n.alert-danger {\n .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text);\n}\n","// Alerts\n\n.alert-variant(@background; @border; @text-color) {\n background-color: @background;\n border-color: @border;\n color: @text-color;\n\n hr {\n border-top-color: darken(@border, 5%);\n }\n .alert-link {\n color: darken(@text-color, 10%);\n }\n}\n","//\n// Progress bars\n// --------------------------------------------------\n\n\n// Bar animations\n// -------------------------\n\n// WebKit\n@-webkit-keyframes progress-bar-stripes {\n from { background-position: 40px 0; }\n to { background-position: 0 0; }\n}\n\n// Spec and IE10+\n@keyframes progress-bar-stripes {\n from { background-position: 40px 0; }\n to { background-position: 0 0; }\n}\n\n\n// Bar itself\n// -------------------------\n\n// Outer container\n.progress {\n overflow: hidden;\n height: @line-height-computed;\n margin-bottom: @line-height-computed;\n background-color: @progress-bg;\n border-radius: @progress-border-radius;\n .box-shadow(inset 0 1px 2px rgba(0,0,0,.1));\n}\n\n// Bar of progress\n.progress-bar {\n float: left;\n width: 0%;\n height: 100%;\n font-size: @font-size-small;\n line-height: @line-height-computed;\n color: @progress-bar-color;\n text-align: center;\n background-color: @progress-bar-bg;\n .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));\n .transition(width .6s ease);\n}\n\n// Striped bars\n//\n// `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the\n// `.progress-bar-striped` class, which you just add to an existing\n// `.progress-bar`.\n.progress-striped .progress-bar,\n.progress-bar-striped {\n #gradient > .striped();\n background-size: 40px 40px;\n}\n\n// Call animation for the active one\n//\n// `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the\n// `.progress-bar.active` approach.\n.progress.active .progress-bar,\n.progress-bar.active {\n .animation(progress-bar-stripes 2s linear infinite);\n}\n\n\n// Variations\n// -------------------------\n\n.progress-bar-success {\n .progress-bar-variant(@progress-bar-success-bg);\n}\n\n.progress-bar-info {\n .progress-bar-variant(@progress-bar-info-bg);\n}\n\n.progress-bar-warning {\n .progress-bar-variant(@progress-bar-warning-bg);\n}\n\n.progress-bar-danger {\n .progress-bar-variant(@progress-bar-danger-bg);\n}\n","// Gradients\n\n#gradient {\n\n // Horizontal gradient, from left to right\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n // Vertical gradient, from top to bottom\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {\n background-repeat: repeat-x;\n background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12\n background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n }\n .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .radial(@inner-color: #555; @outer-color: #333) {\n background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);\n background-image: radial-gradient(circle, @inner-color, @outer-color);\n background-repeat: no-repeat;\n }\n .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {\n background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n }\n}\n","// Progress bars\n\n.progress-bar-variant(@color) {\n background-color: @color;\n\n // Deprecated parent class requirement as of v3.2.0\n .progress-striped & {\n #gradient > .striped();\n }\n}\n",".media {\n // Proper spacing between instances of .media\n margin-top: 15px;\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n.media,\n.media-body {\n zoom: 1;\n overflow: hidden;\n}\n\n.media-body {\n width: 10000px;\n}\n\n.media-object {\n display: block;\n\n // Fix collapse in webkit from max-width: 100% and display: table-cell.\n &.img-thumbnail {\n max-width: none;\n }\n}\n\n.media-right,\n.media > .pull-right {\n padding-left: 10px;\n}\n\n.media-left,\n.media > .pull-left {\n padding-right: 10px;\n}\n\n.media-left,\n.media-right,\n.media-body {\n display: table-cell;\n vertical-align: top;\n}\n\n.media-middle {\n vertical-align: middle;\n}\n\n.media-bottom {\n vertical-align: bottom;\n}\n\n// Reset margins on headings for tighter default spacing\n.media-heading {\n margin-top: 0;\n margin-bottom: 5px;\n}\n\n// Media list variation\n//\n// Undo default ul/ol styles\n.media-list {\n padding-left: 0;\n list-style: none;\n}\n","//\n// List groups\n// --------------------------------------------------\n\n\n// Base class\n//\n// Easily usable on