GeoPubby  Version 0.1.0.0
ResultStyleFormatter Class Referenceabstract

Abstract class to describe a class applying a style to a downlifted dataset. More...

Inheritance diagram for ResultStyleFormatter:
Collaboration diagram for ResultStyleFormatter:

Public Member Functions

abstract String formatter (ResultSet results, String featuretype) throws XMLStreamException
 
String formatHeader ()
 
String formatFooter ()
 
abstract String formatGeometry (String geometrytype, StyleObject styleobj)
 Formats a geometry according to a given geometrytype using information from a given styleobj. More...
 

Static Public Member Functions

static ResultStyleFormatter getFormatter (String formatString)
 Gets a style formatter for a chosen style type. More...
 

Public Attributes

Integer lastQueriedElemCount =0
 
String mimeType ="text/plain"
 
String exposedType ="application/vnd.geo+json"
 
String styleAttribute =""
 

Static Public Attributes

static Map< String, ResultStyleFormatterresultMap =new TreeMap<String, ResultStyleFormatter>()
 

Static Package Functions

 [static initializer]
 

Detailed Description

Abstract class to describe a class applying a style to a downlifted dataset.

Member Function Documentation

◆ [static initializer]()

[static initializer]
staticpackage

◆ formatFooter()

String formatFooter ( )
78  {
79  return "";
80  }

◆ formatGeometry()

abstract String formatGeometry ( String  geometrytype,
StyleObject  styleobj 
)
abstract

Formats a geometry according to a given geometrytype using information from a given styleobj.

Parameters
geometrytypethe geometry
styleobjthe styleobject to use for formatting
Returns
the formatString to use for styling

Reimplemented in KMLStyleFormatter, and GeoJSONCSSFormatter.

Referenced by KMLWriter.write().

◆ formatHeader()

String formatHeader ( )
74  {
75  return "";
76  }

◆ formatter()

abstract String formatter ( ResultSet  results,
String  featuretype 
) throws XMLStreamException
abstract
Parameters
results
featuretype
Returns
Exceptions
XMLStreamException

Reimplemented in KMLStyleFormatter, and GeoJSONCSSFormatter.

◆ getFormatter()

static ResultStyleFormatter getFormatter ( String  formatString)
static

Gets a style formatter for a chosen style type.

Parameters
formatStringthe formatString indicating a given style type
Returns
a ResultStyleFormatter generating the chosen style type
33  {
34  formatString=formatString.toLowerCase();
35  if(resultMap.containsKey(formatString)) {
36  return resultMap.get(formatString);
37  }
38  formatString=formatString.replace("+","");
39  if(formatString.contains("mapcss")) {
40  return resultMap.get("mapcss");
41  }
42  if(formatString.contains("geojsoncss")) {
43  return resultMap.get("geojsoncss");
44  }
45  if(formatString.contains("sld")) {
46  return resultMap.get("sld");
47  }
48  return null;
49  }
static Map< String, ResultStyleFormatter > resultMap
Definition: ResultStyleFormatter.java:18

Member Data Documentation

◆ exposedType

String exposedType ="application/vnd.geo+json"

◆ lastQueriedElemCount

Integer lastQueriedElemCount =0

◆ mimeType

String mimeType ="text/plain"

◆ resultMap

Map<String,ResultStyleFormatter> resultMap =new TreeMap<String, ResultStyleFormatter>()
static

◆ styleAttribute

String styleAttribute =""