blob: 4e1f9141c8edf6133a29e3bb701a743808251064 [file] [log] [blame]
Khaled Abdelmohsen7c56df62019-10-31 16:59:43 +00001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server.integrity.parser;
18
Song Pan75147d52019-11-19 00:57:46 +000019import android.content.integrity.Rule;
Khaled Abdelmohsen7c56df62019-10-31 16:59:43 +000020
21import java.io.InputStream;
Khaled Abdelmohsen216109e2019-11-04 17:49:18 +000022import java.util.List;
Khaled Abdelmohsen7c56df62019-10-31 16:59:43 +000023
24/** A helper class to parse rules into the {@link Rule} model. */
25public interface RuleParser {
26
27 /** Parse rules from a string. */
Khaled Abdelmohsen21a96052019-11-06 12:23:22 +000028 List<Rule> parse(String ruleText) throws RuleParseException;
Khaled Abdelmohsen7c56df62019-10-31 16:59:43 +000029
30 /** Parse rules from an input stream. */
Khaled Abdelmohsen21a96052019-11-06 12:23:22 +000031 List<Rule> parse(InputStream inputStream) throws RuleParseException;
Khaled Abdelmohsen7c56df62019-10-31 16:59:43 +000032}