Class DocumentOrderingWrapper
java.lang.Object
com.sun.faces.config.manager.documents.DocumentOrderingWrapper
public class DocumentOrderingWrapper extends Object
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
Constructors Constructor Description DocumentOrderingWrapper(DocumentInfo document)Constructs a newDocumentOrderingWrapperfor the specifiedDocument. -
Method Summary
Modifier and Type Method Description static <K, V extends Comparable<? super V>>
Map<K,V>descendingByValue(Map<K,V> map)static booleandone(DocumentOrderingWrapper[] documents, LinkedList<String> ids)String[]getAfterIds()String[]getBeforeIds()DocumentInfogetDocument()static HashMap<String,DocumentOrderingWrapper>getDocumentHashMap(DocumentOrderingWrapper[] documents)StringgetDocumentId()static LinkedList<String>getIds(DocumentOrderingWrapper[] documents)static intinnerSort(DocumentOrderingWrapper[] documents)booleanisAfter(String id)booleanisAfterOrdered()booleanisAfterOthers()booleanisBefore(String id)booleanisBeforeOrdered()booleanisBeforeOthers()booleanisOrdered()static 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.StringtoString()
-
Constructor Details
-
DocumentOrderingWrapper
Constructs a newDocumentOrderingWrapperfor the specifiedDocument.
-
-
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
- Returns:
trueif this document is before the specifiedid, otherwisefalse
-
isAfter
- 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. -
done
-
getIds
-
innerSort
-
getDocumentHashMap
public static HashMap<String,DocumentOrderingWrapper> getDocumentHashMap(DocumentOrderingWrapper[] documents) -
preSort
-
descendingByValue
-