Class GroupTree
- java.lang.Object
-
- org.eclipse.aether.internal.impl.filter.ruletree.GroupTree
-
public class GroupTree extends java.lang.Object
Group tree for Maven groupIDs. This class parses a text file that has a directive on each line. Directive examples:- ignored/formatting - each line starting with
'#'(hash) or being empty/blank is ignored. - modifier
!is negation (disallow; by def entry allows). If present must be first character. - modifier
=is limiter (to given G; by def is "G and below"). If present, must be first character. If negation present, must be second character. - a valid Maven groupID ie "org.apache.maven".
org.apache.mavenmeans "alloworg.apache.mavenG and all Gs below (soorg.apache.maven.pluginsetc. are all allowed). There is one special entry"*"(asterisk) that means "root" and defines the default acceptance:"*"means "by default accept" and"!*"means "by default deny" (same effect as when this character is not present in file). Use of limiter modifier on "root" like"=*"has no effect, is simply ignored.Examples:
File meaning: "allow all# this is my group filter list org.apache.maven !=org.apache.maven.foo !org.apache.maven.indexer =org.apache.barorg.apache.mavenand below", "disalloworg.apache.maven.foogroupId ONLY" (henceorg.apache.maven.foo.baris allowed due first line), "disalloworg.apache.maven.indexerand below" and "alloworg.apache.bargroupID ONLY".In case of conflicting rules, parsing happens by "last wins", so line closer to last line in file "wins", and conflicting line value is lost.
- ignored/formatting - each line starting with
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptedGroupId(java.lang.String groupId)static GroupTreecreate(java.lang.String name)Creates root, that is special: accept is never null.voiddump(java.lang.String prefix)java.lang.StringgetName()booleanisLeaf()booleanloadNode(java.lang.String line)intloadNodes(java.util.stream.Stream<java.lang.String> linesStream)java.lang.StringtoString()
-
-
-
Method Detail
-
create
public static GroupTree create(java.lang.String name)
Creates root, that is special: accept is never null.
-
loadNodes
public int loadNodes(java.util.stream.Stream<java.lang.String> linesStream)
-
loadNode
public boolean loadNode(java.lang.String line)
-
acceptedGroupId
public boolean acceptedGroupId(java.lang.String groupId)
-
toString
public java.lang.String toString()
-
dump
public void dump(java.lang.String prefix)
-
getName
public java.lang.String getName()
-
isLeaf
public boolean isLeaf()
-
-