com.kero.security.lang.provider.TextualProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kero-security Show documentation
Show all versions of kero-security Show documentation
Kero-Security is a library for statically controlling access to properties of objects / classes.
package com.kero.security.lang.provider;
import com.kero.security.lang.KsdlLexer;
import com.kero.security.lang.KsdlParser;
import com.kero.security.lang.collections.RootNodeList;
import com.kero.security.lang.collections.TokenSequence;
import com.kero.security.lang.provider.resource.KsdlTextResource;
public class TextualProvider extends KsdlProviderBase {
private KsdlTextResource resource;
public TextualProvider(KsdlTextResource resource) {
this.resource = resource;
}
@Override
public RootNodeList getRoots() {
String text = resource.getRawText();
TokenSequence tokens = KsdlLexer.getInstance().tokenize(text);
RootNodeList roots = KsdlParser.getInstance().parse(tokens);
return roots;
}
}