| パッケージ | flashx.textLayout.conversion |
| クラス | public class PlainTextExporter |
| 継承 | PlainTextExporter ConverterBase Object |
| 実装 | IPlainTextExporter |
| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
TextConverter.export() 静的メソッドの代わりになります。PlainTextExporter クラスの export() メソッドの結果が TextConverter.export() 静的メソッドと同じ出力ストリングになるのは、PlainTextExporter クラスの PARAGRAPH_SEPARATOR_PROPERTY および STRIP_DISCRETIONARY_HYPHENS_PROPERTY という 2 つのプロパティに、それぞれのデフォルト値である "¥n" と true が含まれている場合です。
パブリックプロパティ
| プロパティ | 定義元 | ||
|---|---|---|---|
![]() | constructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。 | Object | |
![]() | errors : Vector.<String> [読み取り専用] 解析中にエラーが発生しました。 | ConverterBase | |
| paragraphSeparator : String 段落を区切る文字を指定します(テキストフローのプレーンテキスト内)。 | PlainTextExporter | ||
| stripDiscretionaryHyphens : Boolean このプロパティは、書き出し処理でテキストの任意ハイフンを取り除くかどうかを示します。 | PlainTextExporter | ||
![]() | throwOnError : Boolean | ConverterBase | |
![]() | useClipboardAnnotations : Boolean | ConverterBase | |
パブリックメソッド
| メソッド | 定義元 | ||
|---|---|---|---|
コンストラクター
| PlainTextExporter | ||
TextFlow インスタンスのテキストコンテンツを String 形式、XML 形式、またはユーザー定義の形式で書き出します。 | PlainTextExporter | ||
![]() |
オブジェクトに指定されたプロパティが定義されているかどうかを示します。 | Object | |
![]() |
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。 | Object | |
![]() |
指定されたプロパティが存在し、列挙できるかどうかを示します。 | Object | |
![]() |
ループ処理に対するダイナミックプロパティの可用性を設定します。 | Object | |
![]() |
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのプリミティブな値を返します。 | Object | |
パブリック定数
プロパティの詳細
paragraphSeparator | プロパティ |
paragraphSeparator:String| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
段落を区切る文字を指定します(テキストフローのプレーンテキスト内)。段落の区切り記号は、最後の段落の後には追加されません。
このプロパティは、PLAIN_TEXT_FORMAT エクスポーターに適用されます。
デフォルト値は "¥n" です。
実装
public function get paragraphSeparator():String public function set paragraphSeparator(value:String):voidstripDiscretionaryHyphens | プロパティ |
stripDiscretionaryHyphens:Boolean| 言語バージョン: | ActionScript 3.0- |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
このプロパティは、書き出し処理でテキストの任意ハイフンを取り除くかどうかを示します。任意ハイフンは、「ソフトハイフン」とも呼ばれており、語を 2 つの行に分割する必要がある場合に、どこで語を分断するかを示します。任意ハイフンを表す Unicode 文字は、¥u00AD です。
このプロパティに true を設定した場合、元のテキスト内にある任意ハイフンは、元のテキストの一部であっても、書き出されたテキストに現れません。 false の場合、任意ハイフンは書き出されたテキストに現れます。
実装
public function get stripDiscretionaryHyphens():Boolean public function set stripDiscretionaryHyphens(value:Boolean):voidコンストラクターの詳細
PlainTextExporter | () | コンストラクター |
public function PlainTextExporter()| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
コンストラクター
メソッドの詳細
export | () | メソッド |
public function export(source:flashx.textLayout.elements:TextFlow, conversionType:String):ObjectTextFlow インスタンスのテキストコンテンツを String 形式、XML 形式、またはユーザー定義の形式で書き出します。
conversionType パラメーターを次の値のいずれか、またはユーザー定義のエクスポーターのユーザー定義の形式に設定します。
flashx.textLayout.conversion.ConversionType.STRING_TYPEflashx.textLayout.conversion.ConversionType.XML_TYPE
パラメーター
source:flashx.textLayout.elements:TextFlow — エクスポートする TextFlow
| |
conversionType:String — String (STRING_TYPE)、XML (XML_TYPE)、またはユーザー定義の形式を返します。
|
Object — Object。エクスポートされたコンテンツ
|
例 この例の使用方法
PlainTextExporter_example.as
package flashx.textLayout.conversion.examples
{
import flash.display.Sprite;
import flashx.textLayout.conversion.ConversionType;
import flashx.textLayout.conversion.PlainTextExporter;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.elements.TextFlow;
public class PlainTextExporter_example extends Sprite
{
public function PlainTextExporter_example()
{
var markup:String = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'>" +
"<p><span>Hello, World!</span></p>" +
"<p><span>Hello, Hemi" + "\u00AD" + "sphere! </span></p>" +
"<p><span>Hello, Hello Continent!</span></p>" +
"</TextFlow>";
var textFlow:TextFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
// first export, using the PlainTextExporter class
var textExporter:PlainTextExporter = new PlainTextExporter();
var exportedText:String = textExporter.export(textFlow, flashx.textLayout.conversion.ConversionType.STRING_TYPE) as String;
// second export, using TextConverter.export() static method is same as first export with default settings
var exportedTextTextConverter:String = TextConverter.export(textFlow,TextConverter.PLAIN_TEXT_FORMAT, ConversionType.STRING_TYPE) as String;
// use of PlainTextExporter class allows for custom control of paragraph separators and hyphen interpretation
// third export, we change the paragraph separator to a carriage return and linefeed combination
textExporter.paragraphSeparator = "\r\n";
exportedText = textExporter.export(textFlow, flashx.textLayout.conversion.ConversionType.STRING_TYPE) as String;
// Discretionary hyphen characters are stripped by default.
// fourth export, we retain discretionary hyphens by setting the stripDiscretionaryHyphens property to false
textExporter.stripDiscretionaryHyphens = false;
var exportedTextWithHyphens:String = textExporter.export(textFlow, flashx.textLayout.conversion.ConversionType.STRING_TYPE) as String;
// The following should report false after setting stripDiscretionaryHyphens to false
var bothExportStringsHaveHyphens:Boolean = (exportedText == exportedTextWithHyphens);
}
}
}
Tue Jun 12 2018, 10:34 AM Z
継承されるパブリックプロパティを隠す
継承されるパブリックプロパティを表示