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)
           
protected  JavaField getReferencedField(JavaTag tag, java.lang.String ref)
           
 void handleField(JavaField javaField, boolean isInspectedClass)
           
 void processProperties(java.util.Map globalProperties)
          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)
                                    throws org.apache.maven.plugin.MojoExecutionException
Return the name of the property. The name of the property is derived by:
  1. looking at the attribute Constants.PROPERTY_NAME
  2. looking at the attribute Constants.PROPERTY_NAME_REF
  3. if the property is specified at a filed and the field is of type string the init value is used.

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
Throws:
org.apache.maven.plugin.MojoExecutionException

setPropertyValueRef

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

getReferencedField

protected JavaField getReferencedField(JavaTag tag,
                                       java.lang.String ref)
                                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(java.util.Map globalProperties)
                       throws org.apache.maven.plugin.MojoExecutionException
Process all found properties for the component.

Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.