BrightSide Workbench Full Report + Source Code
org.turro.vcard.properties.Property Class Reference

Public Member Functions

 Property (PropertyTag tag, VCard vcard)
 
 Property (PropertyTag tag, VCard vcard, String value)
 
String getValue ()
 
String getValue (int index)
 
String[] getValues ()
 
void setValue (String value)
 
void setValues (String[] values)
 
PropertyTag getTag ()
 
List< String > getTypes ()
 
void addType (String type)
 
void renderProperty (StringBuilder sb)
 

Static Public Member Functions

static Property getInstance (VCard vcard, PropertyTag tag, String l)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 28 of file Property.java.

Constructor & Destructor Documentation

◆ Property() [1/2]

org.turro.vcard.properties.Property.Property ( PropertyTag  tag,
VCard  vcard 
)

Definition at line 47 of file Property.java.

47  {
48  this(tag, vcard, null);
49  }
Here is the caller graph for this function:

◆ Property() [2/2]

org.turro.vcard.properties.Property.Property ( PropertyTag  tag,
VCard  vcard,
String  value 
)

Definition at line 51 of file Property.java.

51  {
52  this.tag = tag;
53  this.vcard = vcard;
54  this.value = value;
55  }

Member Function Documentation

◆ addType()

void org.turro.vcard.properties.Property.addType ( String  type)

Definition at line 93 of file Property.java.

93  {
94  types.add(type);
95  }

◆ getInstance()

static Property org.turro.vcard.properties.Property.getInstance ( VCard  vcard,
PropertyTag  tag,
String  l 
)
static

Definition at line 35 of file Property.java.

35  {
36  int p = l.indexOf(":");
37  if(p == -1) return null;
38 
39  Property property = new Property(tag, vcard);
40 
41  vcard.getVersion().readTypes(l.substring(tag.getTag().length(), p), property.getTypes());
42  property.setValue(l.substring(p + 1));
43 
44  return property;
45  }
Version getVersion()
Definition: VCard.java:41
Property(PropertyTag tag, VCard vcard)
Definition: Property.java:47
void readTypes(String s, List< String > types)
Definition: Version.java:70
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTag()

PropertyTag org.turro.vcard.properties.Property.getTag ( )

Definition at line 85 of file Property.java.

85  {
86  return tag;
87  }

◆ getTypes()

List<String> org.turro.vcard.properties.Property.getTypes ( )

Definition at line 89 of file Property.java.

89  {
90  return types;
91  }

◆ getValue() [1/2]

String org.turro.vcard.properties.Property.getValue ( )

Definition at line 57 of file Property.java.

57  {
58  return value;
59  }

◆ getValue() [2/2]

String org.turro.vcard.properties.Property.getValue ( int  index)

Definition at line 61 of file Property.java.

61  {
62  String v[] = value.split(";");
63  return v.length <= index ? "" : v[index];
64  }

◆ getValues()

String [] org.turro.vcard.properties.Property.getValues ( )

Definition at line 66 of file Property.java.

66  {
67  return value.split(";");
68  }

◆ renderProperty()

void org.turro.vcard.properties.Property.renderProperty ( StringBuilder  sb)

Definition at line 97 of file Property.java.

97  {
98  sb.append(tag.getTag());
99  vcard.getVersion().renderTypes(sb, types);
100  sb.append(":" + value + "\n");
101  }
void renderTypes(StringBuilder sb, List< String > types)
Definition: Version.java:46
Here is the call graph for this function:

◆ setValue()

void org.turro.vcard.properties.Property.setValue ( String  value)

Definition at line 70 of file Property.java.

70  {
71  this.value = value;
72  }

◆ setValues()

void org.turro.vcard.properties.Property.setValues ( String[]  values)

Definition at line 74 of file Property.java.

74  {
75  this.value = null;
76  for(String v : values) {
77  if(value == null) {
78  value = v;
79  } else {
80  value += ";" + v;
81  }
82  }
83  }

The documentation for this class was generated from the following file: