Package com.pd4ml.pdf.cos.path
Class COSPathEvaluator
- java.lang.Object
-
- com.pd4ml.pdf.cos.path.COSPathEvaluator
-
public final class COSPathEvaluator extends java.lang.ObjectResolves aCOSPathagainst aCOSDocument(or an arbitrary startingCOSBasenode), auto-dereferencing indirect references at every step so callers never see a bareCOSObject.Two evaluation styles are offered: the lenient
evaluate(...)methods returnCOSNull.NULLfor any path that can't be followed to the end (a missing key, an out-of-range index, a step applied to the wrong kind of node), which is usually the more convenient behavior for exploratory lookups; theevaluateStrict(...)methods instead throw aCOSPathExceptionthat names exactly which step failed and why.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static COSBaseevaluate(COSDocument document, COSPath path)static COSBaseevaluate(COSDocument document, java.lang.String pathExpression)static COSBaseevaluateFrom(COSBase startNode, java.util.List<COSPathSegment> segments)static COSBaseevaluateFromStrict(COSBase startNode, java.util.List<COSPathSegment> segments)static COSBaseevaluateStrict(COSDocument document, COSPath path)static COSBaseevaluateStrict(COSDocument document, java.lang.String pathExpression)
-
-
-
Method Detail
-
evaluate
public static COSBase evaluate(COSDocument document, java.lang.String pathExpression) throws COSPathException
- Throws:
COSPathException
-
evaluate
public static COSBase evaluate(COSDocument document, COSPath path)
-
evaluateFrom
public static COSBase evaluateFrom(COSBase startNode, java.util.List<COSPathSegment> segments)
-
evaluateStrict
public static COSBase evaluateStrict(COSDocument document, java.lang.String pathExpression) throws COSPathException
- Throws:
COSPathException
-
evaluateStrict
public static COSBase evaluateStrict(COSDocument document, COSPath path) throws COSPathException
- Throws:
COSPathException
-
evaluateFromStrict
public static COSBase evaluateFromStrict(COSBase startNode, java.util.List<COSPathSegment> segments) throws COSPathException
- Throws:
COSPathException
-
-