|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.day.jcr.vault.util.DocViewProperty
public class DocViewProperty
Helper class that represents a (jcr) property in the document view format.
It contains formatting and parsing methods for writing/reading enhanced
docview properties.
prop:= [ "{" type "}" ] ( value | "[" [ value { "," value } ] "]" )
| Field Summary | |
|---|---|
boolean |
isMulti
indicates a MV property |
String |
name
name of the property |
int |
type
type of this property (can be undefined) |
String[] |
values
value(s) of the property. |
| Constructor Summary | |
|---|---|
DocViewProperty(String name,
String[] values,
boolean multi,
int type)
Creates a new property. |
|
| Method Summary | |
|---|---|
boolean |
apply(Node node)
Sets this property on the given node |
protected static void |
escape(StringBuffer buf,
String value,
boolean isMulti)
Escapes the value |
static String |
format(Property prop)
Formats the given jcr property to the enhanced docview syntax. |
static String |
format(Property prop,
boolean sort)
Formats the given jcr property to the enhanced docview syntax. |
static boolean |
isAmbiguous(Property prop)
Checks if the type of the given property is ambiguous in respect to it's property definition. |
static DocViewProperty |
parse(String name,
String value)
Parses a enhanced docview property string and returns the property. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final String name
public final String[] values
public final boolean isMulti
public final int type
| Constructor Detail |
|---|
public DocViewProperty(String name,
String[] values,
boolean multi,
int type)
name - name of the propertyvalues - values.multi - multiple flagtype - type of the property
IllegalArgumentException - if single value property and not
exactly 1 value is given.| Method Detail |
|---|
public static DocViewProperty parse(String name,
String value)
name - name of the propertyvalue - (attribute) value
public static String format(Property prop)
throws RepositoryException
prop - the jcr property
RepositoryException - if a repository error occurs
public static String format(Property prop,
boolean sort)
throws RepositoryException
prop - the jcr propertysort - if true multivalue properties are sorted
RepositoryException - if a repository error occurs
protected static void escape(StringBuffer buf,
String value,
boolean isMulti)
buf - buffer to append tovalue - value to escapeisMulti - indicates multi value property
public static boolean isAmbiguous(Property prop)
throws RepositoryException
prop - the property
RepositoryException - if a repository error occurs
public boolean apply(Node node)
throws RepositoryException
node - the node
true if the value was modified.
RepositoryException - if a repository error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||