public class Property extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Property.Type |
Modifier and Type | Field and Description |
---|---|
private boolean |
display |
private static Pattern |
FORMATTING |
private PropertyIndexation |
indexation
Pre-parsed values to use for the search queries.
|
private String |
key
The key, in UTF-8
|
static String |
KEY_CATEGORY
An arbitraty property when importing from Excel or external
|
static String |
KEY_FORMATTING
The property which stores the formatting for this type of requirement
|
static String |
KEY_TYPE
The property which stores the type of requirement
|
private String |
searchUrl
The search url (without the context path) if one wants to search by this property.
|
private Property.Type |
type
All our properties are currently in AUTO mode
|
private static Pattern |
UNACCEPTABLE_CHARS_IN_SEARCHABLE_PROPERTY_KEY
As determined in Search.g4, this is the list of non-acceptable characters in
a @property syntax.
|
private String |
value
Value, as HTML.
|
Constructor and Description |
---|
Property() |
Property(Property.Type type,
String key,
String value) |
Property(Property.Type type,
String keyXml,
String value,
String indexationJson)
Constructor for a Property.
|
Modifier and Type | Method and Description |
---|---|
static String |
cleanKey(String key)
Encode a key, truncated at 200 characters.
|
static String |
cleanValue(com.atlassian.confluence.content.render.xhtml.RenderedContentCleaner antiSamy,
String value) |
static org.apache.commons.lang3.tuple.Pair<String,Boolean> |
convertToCss(Property formatting) |
static Property |
find(List<Property> properties,
String key) |
PropertyIndexation |
getIndexation() |
String |
getKey()
The (unescpaed) key.
|
String |
getSearchUrl() |
Property.Type |
getType() |
String |
getValue() |
boolean |
isDisplay() |
private static String |
quotePropertyKey(String key)
Based on a UTF-8 key, create the @property search syntax
|
void |
setDisplay(boolean display) |
void |
setKey(String key)
The key.
|
void |
setSearchUrl(Requirement requirement)
A "simple property" has a key:
- single word
- Only letters and numbers
- <80 characters
- A value between 1 and 100 characters
and a non-blank value.
|
void |
setType(Property.Type type) |
void |
setValue(String value) |
String |
toString() |
public static final String KEY_TYPE
public static final String KEY_FORMATTING
public static final String KEY_CATEGORY
private static final Pattern UNACCEPTABLE_CHARS_IN_SEARCHABLE_PROPERTY_KEY
private static final Pattern FORMATTING
private Property.Type type
private String key
private String value
private String searchUrl
private boolean display
@Internal private PropertyIndexation indexation
public Property()
public Property(Property.Type type, String key, String value)
public Property(Property.Type type, String keyXml, String value, String indexationJson)
type
- use Type.AUTO. We haven't implemented custom properties.keyXml
- the key. It is expected to be xml-encoded because this constructor generally takes data coming from
AOProperty; and the constructor will decode it to set the internal 'key' property in UTF-8.value
- the value, HTML-encoded. It is cleaned from any script/vulnerability before being stored in the DB.indexationJson
- a json string representing a PropertyIndexation object, or null if unset.public Property.Type getType()
public void setType(Property.Type type)
public String getKey()
public void setKey(String key)
public String getValue()
public void setValue(String value)
public String getSearchUrl()
public void setSearchUrl(Requirement requirement)
private static String quotePropertyKey(String key)
public boolean isDisplay()
public void setDisplay(boolean display)
public static org.apache.commons.lang3.tuple.Pair<String,Boolean> convertToCss(Property formatting)
public static String cleanKey(String key)
public static String cleanValue(com.atlassian.confluence.content.render.xhtml.RenderedContentCleaner antiSamy, String value)
public PropertyIndexation getIndexation()
Copyright © 2020 Play SQL. All rights reserved.