Class: ReferenceElement

Inherits:
ValueElement show all
Defined in:
lib/fxmlloader/real_elts.rb

Overview

Element representing a reference

Instance Attribute Summary collapse

Attributes inherited from ValueElement

#fx_id

Attributes inherited from Element

#current, #eventHandlerAttributes, #instancePropertyAttributes, #lineNumber, #loadListener, #parent, #parentLoader, #staticPropertyAttributes, #staticPropertyElements, #value, #valueAdapter, #xmlStreamReader

Instance Method Summary collapse

Methods inherited from ValueElement

#getListValue, #processCharacters, #processEndElement, #processStartElement, #processValue

Methods inherited from Element

#add, #addEventHandler, #applyProperty, #callz, #getProperties, #getValueAdapter, #initialize, #isBidirectionalBindingExpression, #isBindingExpression, #isCollection, #isTyped, #populateArrayFromString, #populateListFromString, #processCharacters, #processEndElement, #processEventHandlerAttributes, #processInstancePropertyAttributes, #processPropertyAttribute, #processStartElement, #processValue3, #resolvePrefixedValue, #set, #staticLoad, #updateValue, #warnDeprecatedEscapeSequence

Constructor Details

This class inherits a constructor from Element

Instance Attribute Details

#sourceObject

Returns the value of attribute source.



283
284
285
# File 'lib/fxmlloader/real_elts.rb', line 283

def source
  @source
end

Instance Method Details

#constructValueObject



301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/fxmlloader/real_elts.rb', line 301

def constructValue()
  if (source == nil)
    raise LoadException.new(FXL::REFERENCE_SOURCE_ATTRIBUTE + " is required.");
  end

  path = KeyPath.parse(source);
  if (!Expression.isDefined(parentLoader.namespace, path))
    raise LoadException.new("Value \"" + source + "\" does not exist.");
  end

  return Expression.get(parentLoader.namespace, path);
end

#processAttribute(prefix, localName, value) ⇒ Object



286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/fxmlloader/real_elts.rb', line 286

def processAttribute(prefix, localName, value)
  if (prefix == nil)
    if (localName == (FXL::REFERENCE_SOURCE_ATTRIBUTE))
      if (loadListener != nil)
        loadListener.readInternalAttribute(localName, value);
      end
      @source = value;
    else
      super(prefix, localName, value);
    end
  else
    super(prefix, localName, value);
  end
end