Package org.omegat.util
Class MagicComment
- java.lang.Object
-
- org.omegat.util.MagicComment
-
public class MagicComment extends java.lang.Object
Utility for parsing "magic comments": a leading line in a file that contains metadata or settings like# -*- coding: utf-8; mode: java; tab-width: 4 -*-
-
-
Constructor Summary
Constructors Constructor Description MagicComment()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.String>
parse(java.io.File file)
Extract the first line of the file and parse with#parse(String)
static java.util.Map<java.lang.String,java.lang.String>
parse(java.lang.String str)
Parse magic comment
-
-
-
Method Detail
-
parse
public static java.util.Map<java.lang.String,java.lang.String> parse(java.io.File file) throws java.io.IOException
Extract the first line of the file and parse with#parse(String)
- Parameters:
file
-- Returns:
- Throws:
java.io.IOException
-
parse
public static java.util.Map<java.lang.String,java.lang.String> parse(java.lang.String str)
Parse magic comment- Parameters:
str
- input string.- Returns:
- Key-Value map of String.
-
-