semanticwfs  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 SimpleStyleFormatter, MapCSSFormatter, KMLStyleFormatter, GeoJSONCSSFormatter, CartoCSSFormatter, and SLDFormatter.

Referenced by GeoJSONFormatter.formatJSONObject(), GeoJSONFormatter.formatJSONStreaming(), and KMLFormatter.formatter().

◆ 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 SLDFormatter, SimpleStyleFormatter, MapCSSFormatter, KMLStyleFormatter, GeoJSONCSSFormatter, and CartoCSSFormatter.

◆ 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
31  {
32  formatString=formatString.toLowerCase();
33  if(resultMap.containsKey(formatString)) {
34  return resultMap.get(formatString);
35  }
36  formatString=formatString.replace("+","");
37  if(formatString.contains("mapcss")) {
38  return resultMap.get("mapcss");
39  }
40  if(formatString.contains("geojsoncss")) {
41  return resultMap.get("geojsoncss");
42  }
43  if(formatString.contains("sld")) {
44  return resultMap.get("sld");
45  }
46  return null;
47  }
static Map< String, ResultStyleFormatter > resultMap
Definition: ResultStyleFormatter.java:16

Member Data Documentation

◆ exposedType

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

Referenced by SLDFormatter.formatter().

◆ lastQueriedElemCount

Integer lastQueriedElemCount =0

◆ mimeType

String mimeType ="text/plain"

◆ resultMap

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

◆ styleAttribute