public class SourceCodeResource extends ServerResource
DocumentDescriptor
source code.
By default uses Jygments to format the source code, but custom formatters can be plugged in instead.
Before using this resource, make sure to configure a valid list of document
sources in the application's Context
as
com.threecrickets.prudence.SourceCodeResource.documentSources
.
Summary of settings configured via the application's Context
:
com.threecrickets.prudence.SourceCodeResource.documentFormatter:
DocumentFormatter
. Defaults to a JygmentsDocumentFormatter
.
com.threecrickets.prudence.SourceCodeResource.documentSources:
an Iterable
of DocumentSource
. Required."Restlet" is a registered trademark of Restlet S.A.S..
Modifier and Type | Field and Description |
---|---|
static String |
DOCUMENT
Constant.
|
static String |
HIGHLIGHT
Constant.
|
Constructor and Description |
---|
SourceCodeResource() |
Modifier and Type | Method and Description |
---|---|
Representation |
getFormattedSourceCodeRepresentation() |
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getDescription, getInfo, getInfo, getName, getOnSent, getPreferredVariant, getRole, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, patch, patch, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDescription, setDimensions, setExisting, setLocationRef, setLocationRef, setName, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions
doError, doInit, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toString
public static final String DOCUMENT
public static final String HIGHLIGHT
@Get(value="html") public Representation getFormattedSourceCodeRepresentation() throws ResourceException
ResourceException
Copyright © 2009-2016 Three Crickets LLC.