Package ftbsc.lll.mapper.impl
Class SRGMapper
- java.lang.Object
-
- ftbsc.lll.mapper.impl.SRGMapper
-
- All Implemented Interfaces:
IMappingFormat
@AutoService(IMappingFormat.class) public class SRGMapper extends java.lang.Object implements IMappingFormat
AIMappingFormat
capable of parsing SRG mappings.
-
-
Constructor Summary
Constructors Constructor Description SRGMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Mapper
buildMapper(java.util.List<java.lang.String> lines, boolean ignoreErrors, boolean inverted)
Builds the two mappers, and returns one of the two depending on the flag.boolean
claim(java.util.List<java.lang.String> lines)
Checks whether this mapper can process the given lines.Mapper
getInvertedMapper(java.util.List<java.lang.String> lines, boolean ignoreErrors)
Creates aMapper
given the lines, ignoring errors depending on the given flag, and returns its inverted form.Mapper
getMapper(java.util.List<java.lang.String> lines, boolean ignoreErrors)
Creates aMapper
given the lines, ignoring errors depending on the given flag.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ftbsc.lll.mapper.IMappingFormat
priority
-
-
-
-
Method Detail
-
claim
public boolean claim(java.util.List<java.lang.String> lines)
Description copied from interface:IMappingFormat
Checks whether this mapper can process the given lines.- Specified by:
claim
in interfaceIMappingFormat
- Parameters:
lines
- the lines to read- Returns:
- whether this type of mapper can process these lines
-
buildMapper
protected Mapper buildMapper(java.util.List<java.lang.String> lines, boolean ignoreErrors, boolean inverted) throws MalformedMappingsException
Builds the two mappers, and returns one of the two depending on the flag. Since the SRG format contains descriptor mappings, it's possible to process this right away.- Parameters:
lines
- the lines to readignoreErrors
- try to ignore errors and keep goinginverted
- whether it should return the inverted one- Returns:
- the
Mapper
, inverted depending on the flag - Throws:
MalformedMappingsException
- if an error is encountered and ignoreErrors is false
-
getMapper
public Mapper getMapper(java.util.List<java.lang.String> lines, boolean ignoreErrors) throws MalformedMappingsException
Description copied from interface:IMappingFormat
Creates aMapper
given the lines, ignoring errors depending on the given flag.- Specified by:
getMapper
in interfaceIMappingFormat
- Parameters:
lines
- the lines to readignoreErrors
- try to ignore errors and keep going- Returns:
- the
Mapper
- Throws:
MalformedMappingsException
- if an error is encountered and ignoreErrors is false
-
getInvertedMapper
public Mapper getInvertedMapper(java.util.List<java.lang.String> lines, boolean ignoreErrors)
Description copied from interface:IMappingFormat
Creates aMapper
given the lines, ignoring errors depending on the given flag, and returns its inverted form.- Specified by:
getInvertedMapper
in interfaceIMappingFormat
- Parameters:
lines
- the lines to readignoreErrors
- try to ignore errors and keep going- Returns:
- the inverted
Mapper
-
-