public class PropertyBuilder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
PropertyBuilder.MethodComparator
The method comparator.
|
Constructor and Description |
---|
PropertyBuilder()
The default constructor.
|
PropertyBuilder(Property p)
Create the object by schema property descriptor.
|
Modifier and Type | Method and Description |
---|---|
void |
createValue(XSDContextIF ctx,
java.util.Properties props)
Get the property value.
|
java.lang.String |
evaluateFileAttr(XSDContextIF ctx,
java.lang.String pVal,
java.lang.String fileAttr)
Evaluate the file attribute.
|
java.lang.String |
getInterpreter()
Retrieve the name of the scripting interpreter or null, if there is no script defined.
|
java.lang.String |
getName()
Get the name of the property.
|
boolean |
isTrim()
Retrieve the boolean whether the property value should be trimmed.
|
static void |
main(java.lang.String[] args) |
protected void |
parseFunction(XSDContextIF ctx,
java.util.Properties props)
Parse a function
|
protected void |
putAll(java.lang.String prefix,
java.util.Properties props,
java.util.Properties add,
boolean trim)
Put all properties from the second properties object to the first properties object
by adding the keyword prefix coming with the prefix parameter.
|
protected java.lang.String |
readValueFromFile(java.lang.String filename)
Read a text value from file.
|
protected java.lang.String |
readValueFromURL(java.lang.String urlName)
Read a text value from url.
|
protected void |
runGroovyScript(XSDContextIF ctx,
java.util.Properties props,
java.lang.String name)
Run the groovy script.
|
void |
setProperty(Property p)
Set the property values.
|
public PropertyBuilder()
public PropertyBuilder(Property p)
p
- the property descriptor.public void setProperty(Property p)
p
- the property value.public java.lang.String getName()
public java.lang.String getInterpreter()
public boolean isTrim()
public void createValue(XSDContextIF ctx, java.util.Properties props) throws ExecutableException, java.io.FileNotFoundException, java.io.IOException
ctx
- the context.properties
- the property object that receives the value.java.io.FileNotFoundException
java.io.IOException
ExecutableException
public java.lang.String evaluateFileAttr(XSDContextIF ctx, java.lang.String pVal, java.lang.String fileAttr) throws java.io.IOException
ctx
- the xsd context.pVal
- the property value.fileAttr
- the file attribute value.java.io.IOException
protected java.lang.String readValueFromFile(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
filename
- the name of the file to be read.java.io.FileNotFoundException
java.io.IOException
protected java.lang.String readValueFromURL(java.lang.String urlName) throws java.io.FileNotFoundException, java.io.IOException
filename
- the name of the file to be read.java.io.FileNotFoundException
java.io.IOException
protected void putAll(java.lang.String prefix, java.util.Properties props, java.util.Properties add, boolean trim)
prefix
- the keyword prefix, may be null.
If the last character of the prefix is not element of \p{Punct}
the method will append a dot '.'.props
- the destination properties object.add
- the source properties object.trim
- trim the values before add it to central map.protected void parseFunction(XSDContextIF ctx, java.util.Properties props) throws ExecutableException
ctx
- the context.props
- the properties.ExecutableException
protected void runGroovyScript(XSDContextIF ctx, java.util.Properties props, java.lang.String name) throws ExecutableException
ctx
- the xsd context.props
- the actual properties.name
- the name of the property that should be evaluate as script.ExecutableException
- if grovy execution fails.public static void main(java.lang.String[] args) throws java.lang.Throwable
java.lang.Throwable