Class Util
java.lang.Object
org.joox.Util
DOM utilities
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumThe states in the state machine for splitting strings into lists -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PatternA pattern for the dd.mm.yyyy formatprivate static final PatternA pattern for various yyyy-mm-dd formatsprivate static booleanA flag indicating whether xalan extensions have been loadedprivate static XPathFunctionResolverThe xalan extensionsXPathFunctionResolverif availableprivate static NamespaceContextThe xalan extensionsNamespaceContextif available -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static final StringGet an attribute value if it exists, ornull(package private) static final StringGet an attribute value if it exists, ornull(package private) static final ContextCreate a context object(package private) static final Contextcontext(Element match, int matchIndex, int matchSize, Element element, int elementIndex, int elementSize) Create a context object(package private) static final DocumentFragmentcreateContent(Document doc, String text) Create some content in the context of a given document(package private) static final StringdefaultIfEmpty(String string, String defaultString) (package private) static final Element[]private static final DategetDate(int year, int month, int day, int hour, int minute, int second, int millisecond) (package private) static final StringgetNamespace(String tagName) importOrDetach(Document document, Element... elements) Make a list of elements available in a document.(package private) static final StringReturnstringor""ifstringisnull(package private) static final DateParse any date format(package private) static final StringReturn an path expression describing an elementprivate static final intsiblingIndex(Element element) Find the index among siblings of the same tag nameSplit a string into values(package private) static final StringstripNamespace(String tagName) (package private) static final booleantextNodesOnly(NodeList list) Check whether there are any element nodes in aNodeList(package private) static final StringTransform anElementinto aString.(package private) static final voidxalanExtensionAware(XPath xpath) Make a givenXPathobject "xalan-extension aware", if Xalan is on the classpath.(package private) static final StringReturn an XPath expression describing an element
-
Field Details
-
xalanExtensionLoaded
private static volatile boolean xalanExtensionLoadedA flag indicating whether xalan extensions have been loaded -
xalanNamespaceContext
The xalan extensionsNamespaceContextif available -
xalanFunctionResolver
The xalan extensionsXPathFunctionResolverif available -
PATTERN_DD_MM_YYYY
A pattern for the dd.mm.yyyy format -
PATTERN_YYYY_MM_DD
A pattern for various yyyy-mm-dd formats
-
-
Constructor Details
-
Util
Util()
-
-
Method Details
-
createContent
Create some content in the context of a given document- Returns:
- A
DocumentFragmentiftextis well-formed. null, iftextis plain text or not well formed
- A
-
attr
-
attr
-
importOrDetach
Make a list of elements available in a document.- Any element that is already in the document will be detached from its parent
- Any element that is not already in the document will be deep-imported
- Parameters:
document- The document to import elements intoelements- The elements that are made available to a document.- Returns:
- Elements that are all in the supplied document, but detached.
-
elements
-
toString
-
textNodesOnly
-
xpath
-
path
-
siblingIndex
Find the index among siblings of the same tag name -
context
-
context
-
nonNull
-
split
-
xalanExtensionAware
-
parseDate
-
getDate
private static final Date getDate(int year, int month, int day, int hour, int minute, int second, int millisecond) -
defaultIfEmpty
-
getNamespace
-
stripNamespace
-