WebObjects 5.1

com.webobjects.eoapplication
Class EOXMLUnarchiver

java.lang.Object
  |
  +--com.webobjects.eoapplication.EOXMLUnarchiver

public class EOXMLUnarchiver
extends Object

EOXMLUnarchivers are used to unarchive objects (controllers and actions) from an XML description. Instances of EOXMLUnarchiver are passed to constructors of the objects to unarchive and can be used to retrieve the XML arguments.


Field Summary
static String ActionKeyParameter
           
static String ActionNameParameter
           
static String ActionPriorityParameter
           
static String ActionWidgetPositionParameter
           
static String AlignmentParameter
           
static String AlignmentWidthParameter
           
static String AlignsComponentsParameter
           
static String AllowsMultipleSelectionParameter
           
static String ArchiveNameParameter
           
static String BorderTypeParameter
           
static String ButtonPositionParameter
           
static String CategoryNameParameter
           
static String CategoryPriorityParameter
           
static String ClassNameParameter
           
static String ColorParameter
           
static String DescriptionPathParameter
           
static String DisabledActionNamesParameter
           
static String DisplayGroupProviderMethodNameParameter
           
static String DisplaysLabelInWidgetParameter
           
static String DisposeIfDeactivatedParameter
           
static String EditabilityParameter
           
static String EditingContextProviderMethodNameParameter
           
static String EnabledDisplayGroupProviderMethodNameParameter
           
static String EnabledKeyParameter
           
static String EntityParameter
           
static String FontParameter
           
static String FormatAllowedParameter
           
static String FormatClassParameter
           
static String FormatPatternParameter
           
static String HighlightParameter
           
static String HorizontalBorderParameter
           
static String HorizontallyResizableParameter
           
static String IconNameParameter
           
static String IconURLParameter
           
static String ImageScalingParameter
           
static String IsQueryWidgetParameter
           
static String LabelAlignmentParameter
           
static String LabelComponentPositionParameter
           
static String LabelParameter
           
static String MandatoryRelationshipPathsParameter
           
static String MaximumValueKeyParameter
           
static String MenuAcceleratorParameter
           
static String MinimumHeightParameter
           
static String MinimumValueKeyParameter
           
static String MinimumWidthParameter
           
static String MultipleWindowsAvailableParameter
           
static String PrefersIconOnlyParameter
           
static String QuickTimeCanvasResizingParameter
           
static String RelationshipPathParameter
           
static String RunsConfirmDialogForEmptyQualifiers
           
static String ScalingHintsParameter
           
static String SendsActionToAllControllersParameter
           
static String SharedIdentifierParameter
           
static String ShortDescriptionParameter
           
static String SmallIconNameParameter
           
static String SmallIconURLParameter
           
static String SortsByColumnOrderParameter
           
static String TaskParameter
           
static String TitleKeysParameter
           
static String TitlePositionParameter
           
static String TitlesDisplayGroupProviderMethodNameParameter
           
static String TitlesEntityParameter
           
static String TransientParameter
           
static String TypeNameParameter
           
static String URLKeyParameter
           
static String UsesActionParameter
           
static String UsesButtonParameter
           
static String UsesHorizontalLayoutParameter
           
static String UsesLabelComponentParameter
           
static String UsesLargeButtonRepresentationParameter
           
static String UsesTableLabelsParameter
           
static String UsesTitledBorderParameter
           
static String UsesUserDefaultsWindowLocationParameter
           
static String UsesUserDefaultsWindowSizeParameter
           
static String ValueKeyParameter
           
static String VerticalBorderParameter
           
static String VerticallyResizableParameter
           
static String WindowPositionParameter
           
 
Constructor Summary
EOXMLUnarchiver(NSDictionary values)
          Creates a new EOXMLUnarchiver.
 
Method Summary
 int decodeAlignmentForKey(String key)
          Returns an alignment (JTextField.LEFT, JTextField.CENTER, or JTextField.RIGHT) for the key XML attribute.
 int decodeAlignmentForKey(String key, int defaultValueIfNotAvailable)
          Returns an alignment (JTextField.LEFT, JTextField.CENTER, or JTextField.RIGHT) for the key XML attribute.
 NSArray decodeArrayForKey(String key)
          Returns an NSArray specified as child in the XML with the name key or null if key is not specified in the XML.
 NSArray decodeArrayForKey(String key, NSArray defaultValueIfNotAvailable)
          Returns an NSArray specified as child in the XML with the name key or defaultValueIfNotAvailable if key is not specified in the XML.
 boolean decodeBooleanForKey(String key)
          Returns a boolean for the key XML attribute.
 boolean decodeBooleanForKey(String key, boolean defaultValueIfNotAvailable)
          Returns a boolean for the key XML attribute.
 NSArray decodeChildren()
          Returns an array containing the objects decoded as the receiver's children.
 Class decodeClassForKey(String key)
          Returns a Class specified by name as the XML attribute key or null if key is not specified in the XML.
 Class decodeClassForKey(String key, Class defaultValueIfNotAvailable)
          Returns a Class specified by name as the XML attribute key or defaultValueIfNotAvailable if key is not specified in the XML.
 Color decodeColorForKey(String key)
          Returns a Color for the key XML attribute.
 Color decodeColorForKey(String key, Color defaultValueIfNotAvailable)
          Returns a Color for the key XML attribute.
 NSDictionary decodeDictionaryForKey(String key)
          Returns an NSDictionary specified as child in the XML with the name key or null if key is not specified in the XML.
 NSDictionary decodeDictionaryForKey(String key, NSDictionary defaultValueIfNotAvailable)
          Returns an NSDictionary specified as child in the XML with the name key or defaultValueIfNotAvailable if key is not specified in the XML.
 int decodeEditabilityForKey(String key)
          Returns a editability specification (EOEditable.IfSupercontrollerEditable, EOEditable.AlwaysEditable, or EOEditable.NeverEditable) for the key XML attribute.
 int decodeEditabilityForKey(String key, int defaultValueIfNotAvailable)
          Returns a editability specification (EOEditable.IfSupercontrollerEditable, EOEditable.AlwaysEditable, or EOEditable.NeverEditable) for the key XML attribute.
 Font decodeFontForKey(String key)
          Returns a Font for the key XML attribute.
 Font decodeFontForKey(String key, Font defaultValueIfNotAvailable)
          Returns a Font for the key XML attribute.
 int decodeIntForKey(String key)
          Returns an integer for the key XML attribute.
 int decodeIntForKey(String key, int defaultValueIfNotAvailable)
          Returns an integer for the key XML attribute.
 int decodePositionForKey(String key)
          Returns a position (EOComponentController.Top, EOComponentController.Bottom, EOComponentController.Left, EOComponentController.Right, EOComponentController.TopLeft, EOComponentController.TopRight, EOComponentController.BottomLeft, or EOComponentController.BottomRight) for the key XML attribute.
 int decodePositionForKey(String key, int defaultValueIfNotAvailable)
          Returns a position (EOComponentController.Top, EOComponentController.Bottom, EOComponentController.Left, EOComponentController.Right, EOComponentController.TopLeft, EOComponentController.TopRight, EOComponentController.BottomLeft, or EOComponentController.BottomRight) for the key XML attribute.
static Object decodeRootObject(NSDictionary rootObjectValues)
          Decodes the top object in an XML description, which is represented by an NSDictionary.
 String decodeStringForKey(String key)
          Returns a String for the key XML attribute.
 String decodeStringForKey(String key, String defaultValueIfNotAvailable)
          Returns a String for the key XML attribute.
 Object decodeValueForKey(String key)
          Returns an Object for the key XML attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ActionKeyParameter

public static final String ActionKeyParameter

ActionNameParameter

public static final String ActionNameParameter

ActionPriorityParameter

public static final String ActionPriorityParameter

ActionWidgetPositionParameter

public static final String ActionWidgetPositionParameter

AlignmentParameter

public static final String AlignmentParameter

AlignmentWidthParameter

public static final String AlignmentWidthParameter

AlignsComponentsParameter

public static final String AlignsComponentsParameter

AllowsMultipleSelectionParameter

public static final String AllowsMultipleSelectionParameter

ArchiveNameParameter

public static final String ArchiveNameParameter

BorderTypeParameter

public static final String BorderTypeParameter

ButtonPositionParameter

public static final String ButtonPositionParameter

CategoryNameParameter

public static final String CategoryNameParameter

CategoryPriorityParameter

public static final String CategoryPriorityParameter

ClassNameParameter

public static final String ClassNameParameter

ColorParameter

public static final String ColorParameter

DescriptionPathParameter

public static final String DescriptionPathParameter

DisabledActionNamesParameter

public static final String DisabledActionNamesParameter

DisplayGroupProviderMethodNameParameter

public static final String DisplayGroupProviderMethodNameParameter

DisplaysLabelInWidgetParameter

public static final String DisplaysLabelInWidgetParameter

DisposeIfDeactivatedParameter

public static final String DisposeIfDeactivatedParameter

EditabilityParameter

public static final String EditabilityParameter

EditingContextProviderMethodNameParameter

public static final String EditingContextProviderMethodNameParameter

EnabledDisplayGroupProviderMethodNameParameter

public static final String EnabledDisplayGroupProviderMethodNameParameter

EnabledKeyParameter

public static final String EnabledKeyParameter

EntityParameter

public static final String EntityParameter

FontParameter

public static final String FontParameter

FormatAllowedParameter

public static final String FormatAllowedParameter

FormatClassParameter

public static final String FormatClassParameter

FormatPatternParameter

public static final String FormatPatternParameter

HighlightParameter

public static final String HighlightParameter

HorizontalBorderParameter

public static final String HorizontalBorderParameter

HorizontallyResizableParameter

public static final String HorizontallyResizableParameter

IconNameParameter

public static final String IconNameParameter

IconURLParameter

public static final String IconURLParameter

ImageScalingParameter

public static final String ImageScalingParameter

IsQueryWidgetParameter

public static final String IsQueryWidgetParameter

LabelAlignmentParameter

public static final String LabelAlignmentParameter

LabelComponentPositionParameter

public static final String LabelComponentPositionParameter

LabelParameter

public static final String LabelParameter

MandatoryRelationshipPathsParameter

public static final String MandatoryRelationshipPathsParameter

MaximumValueKeyParameter

public static final String MaximumValueKeyParameter

MenuAcceleratorParameter

public static final String MenuAcceleratorParameter

MinimumHeightParameter

public static final String MinimumHeightParameter

MinimumValueKeyParameter

public static final String MinimumValueKeyParameter

MinimumWidthParameter

public static final String MinimumWidthParameter

MultipleWindowsAvailableParameter

public static final String MultipleWindowsAvailableParameter

PrefersIconOnlyParameter

public static final String PrefersIconOnlyParameter

QuickTimeCanvasResizingParameter

public static final String QuickTimeCanvasResizingParameter

RelationshipPathParameter

public static final String RelationshipPathParameter

RunsConfirmDialogForEmptyQualifiers

public static final String RunsConfirmDialogForEmptyQualifiers

ScalingHintsParameter

public static final String ScalingHintsParameter

SendsActionToAllControllersParameter

public static final String SendsActionToAllControllersParameter

SharedIdentifierParameter

public static final String SharedIdentifierParameter

ShortDescriptionParameter

public static final String ShortDescriptionParameter

SmallIconNameParameter

public static final String SmallIconNameParameter

SmallIconURLParameter

public static final String SmallIconURLParameter

SortsByColumnOrderParameter

public static final String SortsByColumnOrderParameter

TaskParameter

public static final String TaskParameter

TitleKeysParameter

public static final String TitleKeysParameter

TitlePositionParameter

public static final String TitlePositionParameter

TitlesDisplayGroupProviderMethodNameParameter

public static final String TitlesDisplayGroupProviderMethodNameParameter

TitlesEntityParameter

public static final String TitlesEntityParameter

TransientParameter

public static final String TransientParameter

TypeNameParameter

public static final String TypeNameParameter

URLKeyParameter

public static final String URLKeyParameter

UsesActionParameter

public static final String UsesActionParameter

UsesButtonParameter

public static final String UsesButtonParameter

UsesHorizontalLayoutParameter

public static final String UsesHorizontalLayoutParameter

UsesLabelComponentParameter

public static final String UsesLabelComponentParameter

UsesLargeButtonRepresentationParameter

public static final String UsesLargeButtonRepresentationParameter

UsesTableLabelsParameter

public static final String UsesTableLabelsParameter

UsesTitledBorderParameter

public static final String UsesTitledBorderParameter

UsesUserDefaultsWindowLocationParameter

public static final String UsesUserDefaultsWindowLocationParameter

UsesUserDefaultsWindowSizeParameter

public static final String UsesUserDefaultsWindowSizeParameter

ValueKeyParameter

public static final String ValueKeyParameter

VerticalBorderParameter

public static final String VerticalBorderParameter

VerticallyResizableParameter

public static final String VerticallyResizableParameter

WindowPositionParameter

public static final String WindowPositionParameter
Constructor Detail

EOXMLUnarchiver

public EOXMLUnarchiver(NSDictionary values)
Creates a new EOXMLUnarchiver.
Parameters:
values - the XML attributes as a dictionary
Method Detail

decodeAlignmentForKey

public int decodeAlignmentForKey(String key)
Returns an alignment (JTextField.LEFT, JTextField.CENTER, or JTextField.RIGHT) for the key XML attribute. If no value for key is specified, returns JTextField.LEFT. The alignment can be specified as "Center", "Left", or "Right".
Parameters:
key - the name of the XML attribute to look up
Returns:
the alignment specified in the XML for the key or JTextField.LEFT if the key is not specified at all

decodeAlignmentForKey

public int decodeAlignmentForKey(String key,
                                 int defaultValueIfNotAvailable)
Returns an alignment (JTextField.LEFT, JTextField.CENTER, or JTextField.RIGHT) for the key XML attribute. If no value for key is specified, returns defaultValueIfNotAvailable. The alignment can be specified as "Center", "Left", or "Right".
Parameters:
key - the name of the XML attribute to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the alignment specified in the XML for the key or the default value if the key is not specified at all

decodeArrayForKey

public NSArray decodeArrayForKey(String key)
Returns an NSArray specified as child in the XML with the name key or null if key is not specified in the XML.
Parameters:
key - the name of the array to look up
Returns:
the array specified in the XML with the key or null if the key is not specified at all

decodeArrayForKey

public NSArray decodeArrayForKey(String key,
                                 NSArray defaultValueIfNotAvailable)
Returns an NSArray specified as child in the XML with the name key or defaultValueIfNotAvailable if key is not specified in the XML.
Parameters:
key - the name of the array to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the array specified in the XML with the key or the default value if the key is not specified at all

decodeBooleanForKey

public boolean decodeBooleanForKey(String key)
Returns a boolean for the key XML attribute. If no value for key is specified, returns false.
Parameters:
key - the name of the XML attribute to look up
Returns:
the boolean specified in the XML for the key or false if the key is not specified at all

decodeBooleanForKey

public boolean decodeBooleanForKey(String key,
                                   boolean defaultValueIfNotAvailable)
Returns a boolean for the key XML attribute. If no value for key is specified, returns defaultValueIfNotAvailable.
Parameters:
key - the name of the XML attribute to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the boolean specified in the XML for the key or the default value if the key is not specified at all

decodeChildren

public NSArray decodeChildren()
Returns an array containing the objects decoded as the receiver's children. The children are the objects created from XML tags contained in the receiver's XML description.
Returns:
the array of children

decodeClassForKey

public Class decodeClassForKey(String key)
Returns a Class specified by name as the XML attribute key or null if key is not specified in the XML.
Parameters:
key - the name of the XML attribute to look up
Returns:
the Class specified in the XML for the key or null if the key is not specified at all

decodeClassForKey

public Class decodeClassForKey(String key,
                               Class defaultValueIfNotAvailable)
Returns a Class specified by name as the XML attribute key or defaultValueIfNotAvailable if key is not specified in the XML.
Parameters:
key - the name of the XML attribute to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the Class specified in the XML for the key or the default value if the key is not specified at all

decodeColorForKey

public Color decodeColorForKey(String key)
Returns a Color for the key XML attribute. If no value for key is specified, returns null. The color can be specified either as "red,green,blue" with red, green and blue being integers between 0 and 255 or as "#RRGGBB" with RR, GG, BB being hexadecimal values between 00 and FF.
Parameters:
key - the name of the XML attribute to look up
Returns:
the Color specified in the XML for the key or null if the key is not specified at all

decodeColorForKey

public Color decodeColorForKey(String key,
                               Color defaultValueIfNotAvailable)
Returns a Color for the key XML attribute. If no value for key is specified, returns defaultValueIfNotAvailable. The color can be specified either as "red,green,blue" with red, green and blue being integers between 0 and 255 or as "#RRGGBB" with RR, GG, BB being hexadecimal values between 00 and FF.
Parameters:
key - the name of the XML attribute to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the Color specified in the XML for the key or the default value if the key is not specified at all

decodeDictionaryForKey

public NSDictionary decodeDictionaryForKey(String key)
Returns an NSDictionary specified as child in the XML with the name key or null if key is not specified in the XML.
Parameters:
key - the name of the dictionary to look up
Returns:
the dictionary specified in the XML with the key or null if the key is not specified at all

decodeDictionaryForKey

public NSDictionary decodeDictionaryForKey(String key,
                                           NSDictionary defaultValueIfNotAvailable)
Returns an NSDictionary specified as child in the XML with the name key or defaultValueIfNotAvailable if key is not specified in the XML.
Parameters:
key - the name of the dictionary to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the dictionary specified in the XML with the key or the default value if the key is not specified at all

decodeEditabilityForKey

public int decodeEditabilityForKey(String key)
Returns a editability specification (EOEditable.IfSupercontrollerEditable, EOEditable.AlwaysEditable, or EOEditable.NeverEditable) for the key XML attribute. If no value for key is specified, returns EOEditable.IfSupercontrollerEditable. The editability can be specified as "Never", "Always", or "IfSupercontroller".
Parameters:
key - the name of the XML attribute to look up
Returns:
the editability specified in the XML for the key or EOEditable.IfSupercontrollerEditable if the key is not specified at all

decodeEditabilityForKey

public int decodeEditabilityForKey(String key,
                                   int defaultValueIfNotAvailable)
Returns a editability specification (EOEditable.IfSupercontrollerEditable, EOEditable.AlwaysEditable, or EOEditable.NeverEditable) for the key XML attribute. If no value for key is specified, returns defaultValueIfNotAvailable. The editability can be specified as "Never", "Always", or "IfSupercontroller".
Parameters:
key - the name of the XML attribute to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the editability specified in the XML for the key or the default value if the key is not specified at all

decodeFontForKey

public Font decodeFontForKey(String key)
Returns a Font for the key XML attribute. If no value for key is specified, returns null. The font can be specified as a String "size[,style][:font_name]" with size being an absolute integer or a relative value like "+4", "-2" or "12", the style being one of the values "Plain", "Bold", "Italic", or "BoldItalic", and font_name being the name of the font. style and font_name are optional.
Parameters:
key - the name of the XML attribute to look up
Returns:
the Font specified in the XML for the key or null if the key is not specified at all

decodeFontForKey

public Font decodeFontForKey(String key,
                             Font defaultValueIfNotAvailable)
Returns a Font for the key XML attribute. If no value for key is specified, returns defaultValueIfNotAvailable. The font can be specified as a String "size[,style][:font_name]" with size being an absolute integer or a relative value like "+4", "-2" or "12", the style being one of the values "Plain", "Bold", "Italic", or "BoldItalic", and font_name being the name of the font. style and font_name are optional.
Parameters:
key - the name of the XML attribute to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified and also the base font if the name is not specified explicitly
Returns:
the Font specified in the XML for the key or the default value if the key is not specified at all

decodeIntForKey

public int decodeIntForKey(String key)
Returns an integer for the key XML attribute. If no value for key is specified, returns 0.
Parameters:
key - the name of the XML attribute to look up
Returns:
the integer specified in the XML for the key or 0 if the key is not specified at all

decodeIntForKey

public int decodeIntForKey(String key,
                           int defaultValueIfNotAvailable)
Returns an integer for the key XML attribute. If no value for key is specified, returns defaultValueIfNotAvailable.
Parameters:
key - the name of the XML attribute to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the integer specified in the XML for the key or the default value if the key is not specified at all

decodePositionForKey

public int decodePositionForKey(String key)
Returns a position (EOComponentController.Top, EOComponentController.Bottom, EOComponentController.Left, EOComponentController.Right, EOComponentController.TopLeft, EOComponentController.TopRight, EOComponentController.BottomLeft, or EOComponentController.BottomRight) for the key XML attribute. If no value for key is specified, returns EOComponentController.Center. The position can be specified as "Center", "Top", "Bottom", "Left", "Right", "TopLeft", "TopRight", "BottomLeft", or "BottomRight".
Parameters:
key - the name of the XML attribute to look up
Returns:
the position specified in the XML for the key or EOComponentController.Center if the key is not specified at all

decodePositionForKey

public int decodePositionForKey(String key,
                                int defaultValueIfNotAvailable)
Returns a position (EOComponentController.Top, EOComponentController.Bottom, EOComponentController.Left, EOComponentController.Right, EOComponentController.TopLeft, EOComponentController.TopRight, EOComponentController.BottomLeft, or EOComponentController.BottomRight) for the key XML attribute. If no value for key is specified, returns defaultValueIfNotAvailable. The position can be specified as "Center", "Top", "Bottom", "Left", "Right", "TopLeft", "TopRight", "BottomLeft", or "BottomRight".
Parameters:
key - the name of the XML attribute to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the position specified in the XML for the key or the default value if the key is not specified at all

decodeRootObject

public static Object decodeRootObject(NSDictionary rootObjectValues)
Decodes the top object in an XML description, which is represented by an NSDictionary.
Parameters:
rootObjectValues - the XML description as a dictionary
Returns:
the root object unarchived from the XML

decodeStringForKey

public String decodeStringForKey(String key)
Returns a String for the key XML attribute. If no value for key is specified, returns null.
Parameters:
key - the name of the XML attribute to look up
Returns:
the String specified in the XML for the key or null if the key is not specified at all

decodeStringForKey

public String decodeStringForKey(String key,
                                 String defaultValueIfNotAvailable)
Returns a String for the key XML attribute. If no value for key is specified, returns defaultValueIfNotAvailable.
Parameters:
key - the name of the XML attribute to look up
defaultValueIfNotAvailable - the default value if the XML attribute is not specified
Returns:
the String specified in the XML for the key or the default value if the key is not specified at all

decodeValueForKey

public Object decodeValueForKey(String key)
Returns an Object for the key XML attribute. If no value for key is specified, returns null.
Parameters:
key - the name of the XML attribute to look up
Returns:
the value specified in the XML for the key or null if the key is not specified at all

Last updated Thu Jan 10 18:10:21 PST 2002.

Copyright © 2002 Apple Computer, Inc.