<TextField xmlns="flash.text.*" autoSize="{TextFieldAutoSize.CENTER}" />
private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, "_MyOwnFlexFrameworkTest_TextField1", _MyOwnFlexFrameworkTest_TextField1); return temp; } // binding mgmt private function _MyOwnFlexFrameworkTest_bindingsSetup():Array { var result:Array = []; result[0] = new mx.binding.Binding(this, function():String { var result:* = (TextFieldAutoSize.CENTER); return (result == undefined ? null : String(result)); }, null, "_MyOwnFlexFrameworkTest_TextField1.autoSize" ); return result; }
<TextField xmlns="flash.text.*" autoSize="${TextFieldAutoSize.CENTER}" />
package flex2.compiler.mxml.rep; public class ExactValueExpression { /** The source expression for this value */ private String exactValue; public ExactValueExpression(String exactValueExpression) { this.exactValue = exactValueExpression; } public String getValueExpression() { return exactValue; } }
/** * @param s the string to be parsed * @return ExactValueExpression or null */ protected ExactValueExpression parseExactValueExpression(String s) { int dollarIdx; int openBraceIdx = -1; dollarIdx = StringUtils.findNextUnescaped('$', 0, s); if (dollarIdx == -1) { // String doesn't start with "$" return null; } openBraceIdx = StringUtils.findNextUnescaped('{', dollarIdx + 1, s); if (openBraceIdx != dollarIdx + 1) { // open bracet not in place return null; } int closeBraceIdx = StringUtils.findClosingToken('{', '}', s, openBraceIdx); if (closeBraceIdx == -1) { return null; } String contents = s.substring(openBraceIdx + 1, closeBraceIdx); if (contents.length() == 0) { // Convert ${} to null contents = "null"; } //Don't include the braces (or parens since they will just get stripped). return new ExactValueExpression( contents ); }
protected Object parse(String text, Type type, Type arrayElementType, int flags) { if (!inCDATA(flags)) { ExactValueExpression exactValueExpression = parseExactValueExpression(text); if(exactValueExpression != null) { return exactValueExpression; } // binding? if (!ignoreBinding(flags)) { BindingExpression result = parseBindingExpression(text); if (result != null) { return result; } else { text = cleanupBindingEscapes(text); } }
if(value instanceof ExactValueExpression) { return ((ExactValueExpression) value).getValueExpression(); }
<TextField xmlns="flash.text.*" autoSize="${TextFieldAutoSize.CENTER}" />
private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); temp.autoSize = TextFieldAutoSize.CENTER; _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, "_MyOwnFlexFrameworkTest_TextField1", _MyOwnFlexFrameworkTest_TextField1); return temp; }
Source: https://habr.com/ru/post/131434/