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 orderfaces-configdocuments found on the classpath or configured explicitly via thejakarta.faces.CONFIG_FILEScontext init parameter.
-
-
Constructor Summary
Constructors Constructor Description DocumentOrderingWrapper(DocumentInfo document)Constructs a newDocumentOrderingWrapperfor the specifiedDocument.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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 Detail
-
DocumentOrderingWrapper
public DocumentOrderingWrapper(DocumentInfo document)
Constructs a newDocumentOrderingWrapperfor the specifiedDocument.- Parameters:
document- the document info
-
-
Method Detail
-
getDocument
public DocumentInfo getDocument()
- Returns:
- the wrapped
Document
-
getDocumentId
public String getDocumentId()
- Returns:
- this
Document's ID, if any
-
getBeforeIds
public String[] getBeforeIds()
- Returns:
- this
Document's before IDs, if any
-
getAfterIds
public String[] 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
public boolean isBefore(String id)
- Parameters:
id- the id to search for- Returns:
trueif this document is before the specifiedid, otherwisefalse
-
isAfter
public boolean isAfter(String id)
- 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
-
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
public static void sort(DocumentOrderingWrapper[] documents)
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
public static boolean done(DocumentOrderingWrapper[] documents, LinkedList<String> ids)
-
getIds
public static LinkedList<String> getIds(DocumentOrderingWrapper[] documents)
-
innerSort
public static int innerSort(DocumentOrderingWrapper[] documents)
-
getDocumentHashMap
public static HashMap<String,DocumentOrderingWrapper> getDocumentHashMap(DocumentOrderingWrapper[] documents)
-
preSort
public static void preSort(DocumentOrderingWrapper[] documents)
-
descendingByValue
public static <K,V extends Comparable<? super V>> Map<K,V> descendingByValue(Map<K,V> map)
-
-