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
ConstructorsConstructorDescriptionDocumentOrderingWrapper(DocumentInfo document) Constructs a newDocumentOrderingWrapperfor the specifiedDocument. -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V extends Comparable<? super V>>
Map<K, V> descendingByValue(Map<K, V> map) static booleandone(DocumentOrderingWrapper[] documents, LinkedList<String> ids) String[]String[]static HashMap<String, DocumentOrderingWrapper> getDocumentHashMap(DocumentOrderingWrapper[] documents) static LinkedList<String> getIds(DocumentOrderingWrapper[] documents) static intinnerSort(DocumentOrderingWrapper[] documents) booleanbooleanbooleanbooleanbooleanbooleanbooleanstatic voidpreSort(DocumentOrderingWrapper[] documents) static voidsort(DocumentOrderingWrapper[] documents) Sort the provided array ofDocuments per the requirements of the 2.0 specification.static DocumentOrderingWrapper[]sort(DocumentOrderingWrapper[] documents, List<String> absoluteOrder) Sort the provided array ofDocuments per the order specified in the List represented by absoluteOrder.toString()
-
Constructor Details
-
DocumentOrderingWrapper
Constructs a newDocumentOrderingWrapperfor 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:
trueif any before IDs are present, otherwisefalse
-
isAfterOrdered
public boolean isAfterOrdered()- Returns:
trueif any after IDs are present, otherwise,false
-
isOrdered
public boolean isOrdered()- Returns:
trueif this document has any before or after IDs, otherwisefalse
-
isBefore
- Parameters:
id- the id to search for- Returns:
trueif this document is before the specifiedid, otherwisefalse
-
isAfter
- Parameters:
id- the id to search for- Returns:
trueif this document is after the specifiedid, otherwisefalse
-
isAfterOthers
public boolean isAfterOthers()- Returns:
trueif this document is after others, otherwisefalse
-
isBeforeOthers
public boolean isBeforeOthers()- Returns:
trueif this document is before others, otherwisefalse
-
toString
-
sort
public static DocumentOrderingWrapper[] sort(DocumentOrderingWrapper[] documents, List<String> absoluteOrder) Sort the provided array ofDocuments 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 ofDocuments 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
-