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

com.kero.security.lang.lexems.RoleLexem Maven / Gradle / Ivy

package com.kero.security.lang.lexems;

import com.kero.security.lang.tokens.RoleToken;

public class RoleLexem extends KsdlLexemBase {

	public RoleLexem() {
		super("[+-][A-Za-z][A-Za-z_0-9]*");
		
	}

	@Override
	public RoleToken tokenize(String data) {
		
		char accessibleChar = data.charAt(0);
		
		boolean accessible = accessibleChar == '+';
		
		String roleName = data.substring(1);
		
		return new RoleToken(accessible, roleName);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy