All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.unlaxer.parser.LazyParserChildrenSpecifier Maven / Gradle / Ivy

package org.unlaxer.parser;

import java.util.List;
import java.util.Optional;

import org.unlaxer.RecursiveMode;
import org.unlaxer.reducer.TagBasedReducer.NodeKind;

public interface LazyParserChildrenSpecifier extends LazyInstance{
	
	public List getLazyParsers();

	@Override
	public default void prepareChildren(List childrenContainer) {
		
		if(childrenContainer.isEmpty()){
			List lazyParsers = getLazyParsers();
			childrenContainer.addAll(lazyParsers);
			
			Optional notAstNodeSpecifier = getNotAstNodeSpecifier();
			notAstNodeSpecifier.ifPresent(recursiveMode->{
				if(recursiveMode.isContainsRoot()){
					addTag(NodeKind.notNode.getTag());
				}
				addTagRecurciveChildrenOnly(NodeKind.notNode.getTag());
			});
		}
	}
	
	public Optional getNotAstNodeSpecifier();
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy