org.apache.felix.scrplugin
Class PropertyHandler

java.lang.Object
  extended by org.apache.felix.scrplugin.PropertyHandler

public class PropertyHandler
extends java.lang.Object

Utility class for handling the properties.


Nested Class Summary
protected static class PropertyHandler.PropertyDescription
           
 
Constructor Summary
PropertyHandler(Component c, OCD o)
           
 
Method Summary
protected  java.lang.String getPropertyName(JavaTag tag, JavaField field)
          Return the name of the property.
protected  java.lang.String[] getPropertyValueRef(JavaTag tag, Property prop, java.lang.String valueRef)
           
 void handleField(JavaField javaField, boolean isInspectedClass)
           
 void processProperties()
          Process all found properties for the component.
protected  void processProperty(JavaTag tag, java.lang.String name, JavaField javaField)
          Process a property.
protected  void setPropertyValueRef(JavaTag tag, Property property, java.lang.String valueRef)
           
 void testProperty(JavaTag property, JavaField field, boolean isInspectedClass)
          Test if there is already a property with the same name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyHandler

public PropertyHandler(Component c,
                       OCD o)
Method Detail

processProperty

protected void processProperty(JavaTag tag,
                               java.lang.String name,
                               JavaField javaField)
                        throws org.apache.maven.plugin.MojoExecutionException
Process a property.

Parameters:
tag - The property tag.
name - The name of the property.
javaField - The corresponding java field or null.
Throws:
org.apache.maven.plugin.MojoExecutionException

getPropertyName

protected java.lang.String getPropertyName(JavaTag tag,
                                           JavaField field)
Return the name of the property.

Parameters:
property - The property tag.
field - The corresponding field if the property is a tag of a field.
Returns:
The name of the property or the defaultName

setPropertyValueRef

protected void setPropertyValueRef(JavaTag tag,
                                   Property property,
                                   java.lang.String valueRef)
                            throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getPropertyValueRef

protected java.lang.String[] getPropertyValueRef(JavaTag tag,
                                                 Property prop,
                                                 java.lang.String valueRef)
                                          throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

testProperty

public void testProperty(JavaTag property,
                         JavaField field,
                         boolean isInspectedClass)
                  throws org.apache.maven.plugin.MojoExecutionException
Test if there is already a property with the same name.

Parameters:
property - The tag.
field -
isInspectedClass -
Throws:
org.apache.maven.plugin.MojoExecutionException

handleField

public void handleField(JavaField javaField,
                        boolean isInspectedClass)
                 throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

processProperties

public void processProperties()
                       throws org.apache.maven.plugin.MojoExecutionException
Process all found properties for the component.

Throws:
org.apache.maven.plugin.MojoExecutionException