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 newDocumentOrderingWrapper
for 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 boolean
done(DocumentOrderingWrapper[] documents, LinkedList<String> ids)
String[]
getAfterIds()
String[]
getBeforeIds()
DocumentInfo
getDocument()
static HashMap<String,DocumentOrderingWrapper>
getDocumentHashMap(DocumentOrderingWrapper[] documents)
String
getDocumentId()
static LinkedList<String>
getIds(DocumentOrderingWrapper[] documents)
static int
innerSort(DocumentOrderingWrapper[] documents)
boolean
isAfter(String id)
boolean
isAfterOrdered()
boolean
isAfterOthers()
boolean
isBefore(String id)
boolean
isBeforeOrdered()
boolean
isBeforeOthers()
boolean
isOrdered()
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.String
toString()
-
Constructor Details
-
DocumentOrderingWrapper
Constructs a newDocumentOrderingWrapper
for 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:
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
- Returns:
true
if this document is before the specifiedid
, otherwisefalse
-
isAfter
- 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. -
done
-
getIds
-
innerSort
-
getDocumentHashMap
public static HashMap<String,DocumentOrderingWrapper> getDocumentHashMap(DocumentOrderingWrapper[] documents) -
preSort
-
descendingByValue
-