001    // License: GPL. For details, see LICENSE file.
002    package org.openstreetmap.josm.gui.mappaint.mapcss;
003    
004    public class MapCSSException extends RuntimeException {
005    
006        protected String specialmessage;
007        protected Integer line;
008        protected Integer column;
009        
010        public MapCSSException(String specialmessage) {
011            this.specialmessage = specialmessage;
012        }
013    
014        public void setColumn(int column) {
015            this.column = column;
016        }
017    
018        public void setLine(int line) {
019            this.line = line;
020        }
021        
022        @Override
023        public String getMessage() {
024            if (line == null || column == null)
025                return specialmessage;
026            return String.format("Error at line %s, column %s: %s", line, column, specialmessage);
027        }
028    }