firethorn

changeset 4220:72e7738243aa 2.1.29-stv-tap-fix

Added BitFormatter in VOTable Generator
author Stelios <stv@roe.ac.uk>
date Thu May 09 18:19:42 2019 +0300 (2019-05-09)
parents 536388343d14
children e85c79f225d2
files firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/BaseTableVOTableController.java
line diff
     1.1 --- a/firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/BaseTableVOTableController.java	Thu May 09 18:15:35 2019 +0300
     1.2 +++ b/firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/BaseTableVOTableController.java	Thu May 09 18:19:42 2019 +0300
     1.3 @@ -176,6 +176,33 @@
     1.4              }
     1.5          }
     1.6      
     1.7 +    
     1.8 +    public static class BitFormatter
     1.9 +    extends AbstractFormatter
    1.10 +        {
    1.11 +        public BitFormatter(final BaseColumn<?> column)
    1.12 +            {
    1.13 +            super(
    1.14 +                column
    1.15 +                );
    1.16 +            }
    1.17 +
    1.18 +        @Override
    1.19 +        public String format(final ResultSet results)
    1.20 +        throws SQLException
    1.21 +            {
    1.22 +        		System.out.println(results.getString(index()));
    1.23 +        		System.out.println(String.valueOf(results.getInt(index())));
    1.24 +
    1.25 +	    		if (results.getObject(index())!=null){
    1.26 +	    			return  results.getString(index());
    1.27 +	    		} else {
    1.28 +	    			return "";
    1.29 +	    		}
    1.30 +	        	
    1.31 +            }
    1.32 +        }
    1.33 +    
    1.34      @Override
    1.35      public void head(final PrintWriter writer, final BaseTable<?,?> table)
    1.36      throws ProtectionException
    1.37 @@ -438,6 +465,10 @@
    1.38                  return new ByteFormatter(
    1.39                      column
    1.40                      );
    1.41 +            case BIT:
    1.42 +                return new BitFormatter(
    1.43 +                    column
    1.44 +                    );
    1.45              case DATE :
    1.46              case TIME:
    1.47              case DATETIME :