java.lang.Object
com.sun.faces.config.manager.documents.DocumentOrderingWrapper
This class is used by the config system to order
faces-config
documents found on the classpath or
configured explicitly via the jakarta.faces.CONFIG_FILES
context init parameter.-
Constructor Summary
ConstructorDescriptionDocumentOrderingWrapper
(DocumentInfo document) Constructs a newDocumentOrderingWrapper
for the specifiedDocument
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V extends Comparable<? super V>>
Map<K, V> descendingByValue
(Map<K, V> map) static boolean
done
(DocumentOrderingWrapper[] documents, LinkedList<String> ids) String[]
String[]
static HashMap
<String, DocumentOrderingWrapper> getDocumentHashMap
(DocumentOrderingWrapper[] documents) static LinkedList
<String> getIds
(DocumentOrderingWrapper[] documents) static int
innerSort
(DocumentOrderingWrapper[] documents) boolean
boolean
boolean
boolean
boolean
boolean
boolean
static void
preSort
(DocumentOrderingWrapper[] documents) static void
sort
(DocumentOrderingWrapper[] documents) Sort the provided array ofDocument
s per the requirements of the 2.0 specification.static DocumentOrderingWrapper[]
sort
(DocumentOrderingWrapper[] documents, List<String> absoluteOrder) Sort the provided array ofDocument
s per the order specified in the List represented by absoluteOrder.toString()
-
Constructor Details
-
DocumentOrderingWrapper
Constructs a newDocumentOrderingWrapper
for the specifiedDocument
.- Parameters:
document
- the document info
-
-
Method Details
-
getDocument
- Returns:
- the wrapped
Document
-
getDocumentId
- Returns:
- this
Document
's ID, if any
-
getBeforeIds
- Returns:
- this
Document
's before IDs, if any
-
getAfterIds
- Returns:
- this
Document
's after IDs, if any
-
isBeforeOrdered
public boolean isBeforeOrdered()- Returns:
true
if any before IDs are present, otherwisefalse
-
isAfterOrdered
public boolean isAfterOrdered()- Returns:
true
if any after IDs are present, otherwise,false
-
isOrdered
public boolean isOrdered()- Returns:
true
if this document has any before or after IDs, otherwisefalse
-
isBefore
- Parameters:
id
- the id to search for- Returns:
true
if this document is before the specifiedid
, otherwisefalse
-
isAfter
- Parameters:
id
- the id to search for- Returns:
true
if this document is after the specifiedid
, otherwisefalse
-
isAfterOthers
public boolean isAfterOthers()- Returns:
true
if this document is after others, otherwisefalse
-
isBeforeOthers
public boolean isBeforeOthers()- Returns:
true
if this document is before others, otherwisefalse
-
toString
-
sort
public static DocumentOrderingWrapper[] sort(DocumentOrderingWrapper[] documents, List<String> absoluteOrder) Sort the provided array ofDocument
s per the order specified in the List represented by absoluteOrder.- Parameters:
documents
- Documents to sortabsoluteOrder
- the absolute order as specified in the /WEB-INF/faces-config.xml- Returns:
- an array of DocumentOrderingWrappers that may be smaller than the input array of wrappers.
-
sort
Sort the provided array ofDocument
s per the requirements of the 2.0 specification. Note, that this method only provides partial ordering and not absolute ordering.- Parameters:
documents
- the documents to sort
-
done
-
getIds
-
innerSort
-
getDocumentHashMap
public static HashMap<String,DocumentOrderingWrapper> getDocumentHashMap(DocumentOrderingWrapper[] documents) -
preSort
-
descendingByValue
-