Package net.revelc.code.formatter.java
Class JavaFormatter
java.lang.Object
net.revelc.code.formatter.AbstractCacheableFormatter
net.revelc.code.formatter.java.JavaFormatter
- All Implemented Interfaces:
Formatter
public class JavaFormatter extends AbstractCacheableFormatter implements Formatter
-
Field Summary
Fields inherited from class net.revelc.code.formatter.AbstractCacheableFormatter
encoding, log
-
Constructor Summary
Constructors Constructor Description JavaFormatter()
-
Method Summary
Modifier and Type Method Description String
doFormat(String code, LineEnding ending)
protected static org.eclipse.jface.text.IRegion[]
getRegions(String code, Pattern exclusionPattern)
void
init(Map<String,String> options, ConfigurationSource cfg)
Initialize theCodeFormatter
instance to be used by this component.boolean
isInitialized()
return true if this formatter have been initializedvoid
setExclusionPattern(String ep)
Methods inherited from class net.revelc.code.formatter.AbstractCacheableFormatter
formatFile, initCfg
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.revelc.code.formatter.Formatter
formatFile
-
Constructor Details
-
JavaFormatter
public JavaFormatter()
-
-
Method Details
-
init
Description copied from interface:Formatter
Initialize theCodeFormatter
instance to be used by this component.- Specified by:
init
in interfaceFormatter
- Specified by:
init
in classAbstractCacheableFormatter
-
doFormat
public String doFormat(String code, LineEnding ending) throws IOException, org.eclipse.jface.text.BadLocationException- Specified by:
doFormat
in classAbstractCacheableFormatter
- Throws:
IOException
org.eclipse.jface.text.BadLocationException
-
isInitialized
public boolean isInitialized()Description copied from interface:Formatter
return true if this formatter have been initialized- Specified by:
isInitialized
in interfaceFormatter
-
setExclusionPattern
-
getRegions
-