Class YangParserTestUtils
java.lang.Object
org.opendaylight.yangtools.yang.test.util.YangParserTestUtils
Utility class which provides convenience methods for producing effective schema context based on the supplied
YANG/YIN sources or paths to these sources.
-
Method Summary
Modifier and TypeMethodDescriptionstatic EffectiveModelContext
parseSources
(YangParserConfiguration config, Set<QName> supportedFeatures, Collection<? extends SchemaSourceRepresentation> sources) static EffectiveModelContext
Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangFiles
(File... files) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangFiles
(Collection<File> files) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangFiles
(Set<QName> supportedFeatures, File... files) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangFiles
(Set<QName> supportedFeatures, Collection<File> files) static EffectiveModelContext
parseYangFiles
(Set<QName> supportedFeatures, YangParserConfiguration config, File... files) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangFiles
(Set<QName> supportedFeatures, YangParserConfiguration config, Collection<File> files) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangFiles
(YangParserConfiguration config, File... files) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangFiles
(YangParserConfiguration config, Collection<File> files) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangResource
(String resource) Creates a new effective schema context containing the specified YANG source.static EffectiveModelContext
parseYangResource
(String resource, Set<QName> supportedFeatures) Creates a new effective schema context containing the specified YANG source.static EffectiveModelContext
parseYangResource
(String resource, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG source.static EffectiveModelContext
parseYangResource
(String resource, YangParserConfiguration config, Set<QName> supportedFeatures) Creates a new effective schema context containing the specified YANG source.static EffectiveModelContext
parseYangResourceDirectory
(String resourcePath) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangResourceDirectory
(String resourcePath, Set<QName> supportedFeatures) Creates a new effective schema context containing the specified YANG sources.static @NonNull EffectiveModelContext
parseYangResourceDirectory
(String resourcePath, Set<QName> supportedFeatures, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangResourceDirectory
(String resourcePath, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangResources
(Class<?> clazz, String... resources) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangResources
(Class<?> clazz, Collection<String> resources) static EffectiveModelContext
Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangResources
(List<String> yangResourceDirs, List<String> yangResources, Set<QName> supportedFeatures, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangResources
(List<String> yangResourceDirs, List<String> yangResources, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG sources.static EffectiveModelContext
parseYangSources
(YangParserConfiguration config, Set<QName> supportedFeatures, YangTextSchemaSource... sources)
-
Method Details
-
parseYangResource
Creates a new effective schema context containing the specified YANG source. Statement parser mode is set to default mode and all YANG features are supported.- Parameters:
resource
- relative path to the YANG file to be parsed- Returns:
- effective schema context
-
parseYangResource
public static EffectiveModelContext parseYangResource(String resource, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG source. All YANG features are supported.- Parameters:
resource
- relative path to the YANG file to be parsedconfig
- parser configuration- Returns:
- effective schema context
-
parseYangResource
public static EffectiveModelContext parseYangResource(String resource, Set<QName> supportedFeatures) Creates a new effective schema context containing the specified YANG source. Statement parser mode is set to default mode.- Parameters:
resource
- relative path to the YANG file to be parsedsupportedFeatures
- set of supported features based on which all if-feature statements in the parsed YANG model are resolved- Returns:
- effective schema context
-
parseYangResource
public static EffectiveModelContext parseYangResource(String resource, YangParserConfiguration config, Set<QName> supportedFeatures) Creates a new effective schema context containing the specified YANG source.- Parameters:
resource
- relative path to the YANG file to be parsedsupportedFeatures
- set of supported features based on which all if-feature statements in the parsed YANG model are resolvedconfig
- parser configuration- Returns:
- effective schema context
-
parseYangFiles
Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to default mode and all YANG features are supported.- Parameters:
files
- YANG files to be parsed- Returns:
- effective schema context
-
parseYangFiles
Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to default mode and all YANG features are supported.- Parameters:
files
- collection of YANG files to be parsed- Returns:
- effective schema context
-
parseYangFiles
Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to default mode.- Parameters:
supportedFeatures
- set of supported features based on which all if-feature statements in the parsed YANG models are resolvedfiles
- YANG files to be parsed- Returns:
- effective schema context
-
parseYangFiles
public static EffectiveModelContext parseYangFiles(Set<QName> supportedFeatures, Collection<File> files) -
parseYangFiles
Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.- Parameters:
config
- parser configurationfiles
- YANG files to be parsed- Returns:
- effective schema context
-
parseYangFiles
public static EffectiveModelContext parseYangFiles(YangParserConfiguration config, Collection<File> files) Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.- Parameters:
config
- parser configurationfiles
- collection of YANG files to be parsed- Returns:
- effective schema context
-
parseYangFiles
public static EffectiveModelContext parseYangFiles(Set<QName> supportedFeatures, YangParserConfiguration config, File... files) Creates a new effective schema context containing the specified YANG sources.- Parameters:
supportedFeatures
- set of supported features based on which all if-feature statements in the parsed YANG models are resolvedconfig
- parser configurationfiles
- YANG files to be parsed- Returns:
- effective schema context
-
parseYangFiles
public static EffectiveModelContext parseYangFiles(Set<QName> supportedFeatures, YangParserConfiguration config, Collection<File> files) Creates a new effective schema context containing the specified YANG sources.- Parameters:
supportedFeatures
- set of supported features based on which all if-feature statements in the parsed YANG models are resolvedconfig
- parser configurationfiles
- YANG files to be parsed- Returns:
- effective schema context
-
parseYangResourceDirectory
Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to default mode and all YANG features are supported.- Parameters:
resourcePath
- relative path to the directory with YANG files to be parsed- Returns:
- effective schema context
-
parseYangResourceDirectory
public static EffectiveModelContext parseYangResourceDirectory(String resourcePath, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.- Parameters:
resourcePath
- relative path to the directory with YANG files to be parsedconfig
- parser configuration- Returns:
- effective schema context
-
parseYangResourceDirectory
public static EffectiveModelContext parseYangResourceDirectory(String resourcePath, Set<QName> supportedFeatures) Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to default mode.- Parameters:
resourcePath
- relative path to the directory with YANG files to be parsedsupportedFeatures
- set of supported features based on which all if-feature statements in the parsed YANG models are resolved- Returns:
- effective schema context
-
parseYangResourceDirectory
public static @NonNull EffectiveModelContext parseYangResourceDirectory(String resourcePath, Set<QName> supportedFeatures, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG sources.- Parameters:
resourcePath
- relative path to the directory with YANG files to be parsedsupportedFeatures
- set of supported features based on which all if-feature statements in the parsed YANG models are resolvedconfig
- parser configuration- Returns:
- effective schema context
-
parseYangResources
Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to default mode and all YANG features are supported.- Parameters:
clazz
- Resource lookup baseresources
- Resource names to be looked up- Returns:
- effective schema context
-
parseYangResources
public static EffectiveModelContext parseYangResources(Class<?> clazz, Collection<String> resources) -
parseYangResources
public static EffectiveModelContext parseYangResources(List<String> yangDirs, List<String> yangFiles, Set<QName> supportedFeatures) Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to default mode.- Parameters:
yangDirs
- relative paths to the directories containing YANG files to be parsedyangFiles
- relative paths to the YANG files to be parsedsupportedFeatures
- set of supported features based on which all if-feature statements in the parsed YANG models are resolved- Returns:
- effective schema context
-
parseYangResources
public static EffectiveModelContext parseYangResources(List<String> yangResourceDirs, List<String> yangResources, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG sources. All YANG features are supported.- Parameters:
yangResourceDirs
- relative paths to the directories containing YANG files to be parsedyangResources
- relative paths to the YANG files to be parsedconfig
- parser configuration- Returns:
- effective schema context
-
parseYangResources
public static EffectiveModelContext parseYangResources(List<String> yangResourceDirs, List<String> yangResources, Set<QName> supportedFeatures, YangParserConfiguration config) Creates a new effective schema context containing the specified YANG sources.- Parameters:
yangResourceDirs
- relative paths to the directories containing YANG files to be parsedyangResources
- relative paths to the YANG files to be parsedsupportedFeatures
- set of supported features based on which all if-feature statements in the parsed YANG models are resolvedconfig
- parser configuration- Returns:
- effective schema context
-
parseYangSources
public static EffectiveModelContext parseYangSources(YangParserConfiguration config, Set<QName> supportedFeatures, YangTextSchemaSource... sources) -
parseSources
public static EffectiveModelContext parseSources(YangParserConfiguration config, Set<QName> supportedFeatures, Collection<? extends SchemaSourceRepresentation> sources) -
parseYang
Creates a new effective schema context containing the specified YANG sources.- Parameters:
sources
- list of yang sources in plain string- Returns:
- effective schema context
-