Khaled Abdelmohsen | 7c56df6 | 2019-10-31 16:59:43 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.server.integrity.parser; |
| 18 | |
Song Pan | 75147d5 | 2019-11-19 00:57:46 +0000 | [diff] [blame] | 19 | import android.content.integrity.Rule; |
Khaled Abdelmohsen | 7c56df6 | 2019-10-31 16:59:43 +0000 | [diff] [blame] | 20 | |
| 21 | import java.io.InputStream; |
Khaled Abdelmohsen | 216109e | 2019-11-04 17:49:18 +0000 | [diff] [blame] | 22 | import java.util.List; |
Khaled Abdelmohsen | 7c56df6 | 2019-10-31 16:59:43 +0000 | [diff] [blame] | 23 | |
| 24 | /** A helper class to parse rules into the {@link Rule} model. */ |
| 25 | public interface RuleParser { |
| 26 | |
| 27 | /** Parse rules from a string. */ |
Khaled Abdelmohsen | 21a9605 | 2019-11-06 12:23:22 +0000 | [diff] [blame] | 28 | List<Rule> parse(String ruleText) throws RuleParseException; |
Khaled Abdelmohsen | 7c56df6 | 2019-10-31 16:59:43 +0000 | [diff] [blame] | 29 | |
| 30 | /** Parse rules from an input stream. */ |
Khaled Abdelmohsen | 21a9605 | 2019-11-06 12:23:22 +0000 | [diff] [blame] | 31 | List<Rule> parse(InputStream inputStream) throws RuleParseException; |
Khaled Abdelmohsen | 7c56df6 | 2019-10-31 16:59:43 +0000 | [diff] [blame] | 32 | } |