com.ptc.windchill.structconf
Class PropertyInfo

java.lang.Object
  extended bycom.ptc.windchill.structconf.PropertyInfo

public class PropertyInfo
extends Object

Summary of information for a particular property.


Field Summary
private  Object actualValue_
           
private  ArrayList comments_
           
private  boolean DEBUG
           
private  int declarationCount_
           
private  HashSet declaringSourceFileLocations_
           
private  Object defaultValue_
           
private  PropertyDocumentation documentation_
           
private static boolean fullDiagnostics__
           
private  boolean includeComments_
           
private  boolean isServiceOrResourceEntry_
           
private  File lastTargetFile_
           
private  String multiValuedDelimiter_
           
private  boolean overridable_
           
private  String propertyName_
           
private  Object siteOverride_
           
private  HashSet specifyingSourceFileLocations_
           
private  HashSet targetFiles_
           
private  HashMap valueLocatorMap_
           
 
Constructor Summary
PropertyInfo(String property_name, boolean overridable, String multi_valued_delimiter)
           
 
Method Summary
(package private)  void addComment(String comment)
           
(package private)  void addMultiValuePropertyVals(String value, ParseLocator locator, boolean is_declaration)
           
(package private)  void addTargetFile(File target_file)
           
 boolean areMultipleDeclarationsAllowed()
          Deprecated. use isDeclaredAsMultiValued() instead
private  void dumpState(String action, Object context)
           
private  boolean fullDiagnostics()
           
private  String[] getAsMultiVals(String raw_value)
           
 ArrayList getComments()
           
 int getDeclarationCount()
           
 ParseLocator[] getDeclaringFileLocations()
           
 PropertyDocumentation getDocumentation()
           
 File getLastTargetFile()
           
 String getMultiValuedDelimiter()
           
private  ArrayList getMultiValuePropertyList(ParseLocator locator, boolean is_declaration)
          Returns non null list that's appropriate for the current mode.
 String getPropertyName()
           
 ParseLocator[] getSpecifyingFileLocations()
           
 int getTargetFileCount()
           
 File[] getTargetFiles()
           
 String[] getValues()
           
 boolean hasOverrides()
          Property is declared and/or site-specified more than once.
 boolean hasSiteOverride()
          Property has a site-specific value.
(package private)  boolean includeComments()
          Whether or not comments should be included when this property's value is added the the generated property file.
private  void incrementPropertyDeclCount()
           
 boolean isDeclaredAsMultiValued()
           
 boolean isOverridable()
           
 boolean isServiceOrResourceEntry()
           
 ParseLocator locatorForValue(String value)
          Return the last location in which this value was specified in for this property IFF this is a multi-valued property, null otherwise.
private  void mapMultiValueToLocation(String value, ParseLocator locator)
           
(package private)  int recordDeclaringSourceFile(ParseLocator locator)
           
(package private)  int recordSpecifyingSourceFile(ParseLocator locator)
           
(package private)  void removeMultiValuePropertyVals(String value, ParseLocator locator, boolean is_declaration)
           
(package private)  void resetSiteValueToDefault(ParseLocator locator)
           
(package private)  void setDefaultValue(String default_value, ParseLocator locator)
           
(package private)  void setDocumentation(PropertyDocumentation documentation)
           
(package private)  void setIncludeComments(boolean include_comments)
          Change whether or not comments should be included when this property's value is added the the generated property file.
(package private)  void setIsResourceOrServiceEntry()
           
(package private)  void setSiteValue_(String site_override_value, Object context)
           
(package private)  void setSiteValue(String site_override_value, ParseLocator locator)
           
 void setSiteValue(String site_override_value, PropagationAction caller)
           
private  Object toProperValueObject(String value)
           
(package private)  void undefineSiteValue(ParseLocator locator)
           
 boolean valuesHaveBeenSetAsAMultiValuedProperty()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private boolean DEBUG

includeComments_

private boolean includeComments_

multiValuedDelimiter_

private String multiValuedDelimiter_

propertyName_

private String propertyName_

overridable_

private boolean overridable_

isServiceOrResourceEntry_

private boolean isServiceOrResourceEntry_

defaultValue_

private Object defaultValue_

siteOverride_

private Object siteOverride_

actualValue_

private Object actualValue_

comments_

private ArrayList comments_

documentation_

private PropertyDocumentation documentation_

declarationCount_

private int declarationCount_

targetFiles_

private HashSet targetFiles_

lastTargetFile_

private File lastTargetFile_

declaringSourceFileLocations_

private HashSet declaringSourceFileLocations_

specifyingSourceFileLocations_

private HashSet specifyingSourceFileLocations_

valueLocatorMap_

private HashMap valueLocatorMap_

fullDiagnostics__

private static boolean fullDiagnostics__
Constructor Detail

PropertyInfo

public PropertyInfo(String property_name,
                    boolean overridable,
                    String multi_valued_delimiter)
Method Detail

fullDiagnostics

private boolean fullDiagnostics()

setIncludeComments

void setIncludeComments(boolean include_comments)
Change whether or not comments should be included when this property's value is added the the generated property file. By default, comments will be included.


includeComments

boolean includeComments()
Whether or not comments should be included when this property's value is added the the generated property file.


isOverridable

public boolean isOverridable()

addTargetFile

void addTargetFile(File target_file)
             throws SAXException
Parameters:
target_file - should be a canonicalized file
Throws:
SAXException

setIsResourceOrServiceEntry

void setIsResourceOrServiceEntry()

isServiceOrResourceEntry

public boolean isServiceOrResourceEntry()

areMultipleDeclarationsAllowed

public boolean areMultipleDeclarationsAllowed()
Deprecated. use isDeclaredAsMultiValued() instead


isDeclaredAsMultiValued

public boolean isDeclaredAsMultiValued()

getMultiValuedDelimiter

public String getMultiValuedDelimiter()

getDocumentation

public PropertyDocumentation getDocumentation()
Returns:
null if there is no accompanying documentation

setDocumentation

void setDocumentation(PropertyDocumentation documentation)

getPropertyName

public String getPropertyName()

getAsMultiVals

private String[] getAsMultiVals(String raw_value)

dumpState

private void dumpState(String action,
                       Object context)

getMultiValuePropertyList

private ArrayList getMultiValuePropertyList(ParseLocator locator,
                                            boolean is_declaration)
Returns non null list that's appropriate for the current mode. If this is the first site setting then the contents of the default/declared will be cloned to establish the baseline contents of the site override list.


addMultiValuePropertyVals

void addMultiValuePropertyVals(String value,
                               ParseLocator locator,
                               boolean is_declaration)
                         throws SAXException
Throws:
SAXException

removeMultiValuePropertyVals

void removeMultiValuePropertyVals(String value,
                                  ParseLocator locator,
                                  boolean is_declaration)
                            throws SAXException
Throws:
SAXException

toProperValueObject

private Object toProperValueObject(String value)

setDefaultValue

void setDefaultValue(String default_value,
                     ParseLocator locator)
               throws SAXException
Throws:
SAXException

setSiteValue

public void setSiteValue(String site_override_value,
                         PropagationAction caller)

setSiteValue_

void setSiteValue_(String site_override_value,
                   Object context)

setSiteValue

void setSiteValue(String site_override_value,
                  ParseLocator locator)
            throws SAXException
Throws:
SAXException

undefineSiteValue

void undefineSiteValue(ParseLocator locator)
                 throws SAXException
Throws:
SAXException

resetSiteValueToDefault

void resetSiteValueToDefault(ParseLocator locator)
                       throws SAXException
Throws:
SAXException

addComment

void addComment(String comment)

hasSiteOverride

public boolean hasSiteOverride()
Property has a site-specific value.


hasOverrides

public boolean hasOverrides()
Property is declared and/or site-specified more than once.


getValues

public String[] getValues()

valuesHaveBeenSetAsAMultiValuedProperty

public boolean valuesHaveBeenSetAsAMultiValuedProperty()
Returns:
true if the property's values have been set using multi-valued property methods regardless of whether the property has been declared as multiple valued

getComments

public ArrayList getComments()

recordDeclaringSourceFile

int recordDeclaringSourceFile(ParseLocator locator)

recordSpecifyingSourceFile

int recordSpecifyingSourceFile(ParseLocator locator)

getDeclaringFileLocations

public ParseLocator[] getDeclaringFileLocations()

getSpecifyingFileLocations

public ParseLocator[] getSpecifyingFileLocations()

incrementPropertyDeclCount

private void incrementPropertyDeclCount()

getDeclarationCount

public int getDeclarationCount()

getTargetFileCount

public int getTargetFileCount()

getTargetFiles

public File[] getTargetFiles()
Returns:
a possibly empty, but non-null array of canonicalized files

getLastTargetFile

public File getLastTargetFile()
Returns:
possibly null value or the last target file added

mapMultiValueToLocation

private void mapMultiValueToLocation(String value,
                                     ParseLocator locator)

locatorForValue

public ParseLocator locatorForValue(String value)
Return the last location in which this value was specified in for this property IFF this is a multi-valued property, null otherwise.

Returns:
possibly null locator