kokorin / astream Goto Github PK
View Code? Open in Web Editor NEWXML to Object (and vice versa) mapping library written in AS3. Compatible with XStream.
License: Apache License 2.0
XML to Object (and vice versa) mapping library written in AS3. Compatible with XStream.
License: Apache License 2.0
In NO_REFERENCE mode AStream should throw exception
In several places spicefactory's Map is used. It simply compares keys one by one.
Possibly it would be faster to compute hash of key for every getValue() and put() methods call.
Objects can be wrote to ByteArray to get byte sequence.
There is ArrayElementType metadata in Flex.
Simular metadata would be usefull for IList.
Add processing of collection's item type to MetadataProcessor
Java arrays and maps have no corresponding types in AStream yet.
Java | XML | AS3 |
---|---|---|
byte[] | byte-array | ByteArray |
String[] | string-array | Vector.<String> |
java.util.ArrayList | list | org.spicefactory.lib.collection.List |
java.util.HashMap | map | org.spicefactory.lib.collection.Map |
Some characters does'n always get escaped in generated XML.
"Quot " Apos ' amp & lt < gt > Me!" becomes
Quot " Apos ' amp & lt < gt > Me!
"[Fault] exception, information=ReferenceError: Specified ApplicationDomain does not contain the class vector-Item"
@
public function fromXML(xml:XML):Object {
reset();
const mapper:Mapper = registry.getMapper(xml.localName());
var result:Object;
try {
result = mapper.fromXML(xml, ref);
} finally {
ref.clear();
}
return result;
}
Worked before I swapped to the latest build.
Here is the XML I am reading in...
<vector-Item>
<Item id="Data_Spawn">
<Paths>
<Path type="Text" path="assets/data/spawndata.xml"/>
</Paths>
</Item>
</vector-Item>
If auto detection of metadata is enabled, we can get stackoverflow with cycle- of crossreferences
An application hangs while Parsing big XML. Async variants of functions can help in this case.
Possibly we need to add to and form String converters.
If custom mapper is registered on property AND property is set to subclass of declared type, than custom mapper won't be used!
[AStreamMapper("MyMapper")]
public var property:MyClass = new MySubClass();
In XStream implicit collections with null item are serialized like this:
<Parent>
<child>...</child>
<null/>
<child>...</child>
</Parent>
Currently in AStream Error is thrown:
Error: Instance must not be null
at org.spicefactory.lib.reflect::ClassInfo$/forInstance()[D:\Projects\AStream\Spicelib-Reflect\src\main\org\spicefactory\lib\reflect\ClassInfo.as:126]
at ru.kokorin.astream.ref::NoRef/addValue()[D:\Projects\AStream\AStream\src\ru\kokorin\astream\ref\NoRef.as:13]
at ru.kokorin.astream.mapper::ComplexMapper/fillXML()[D:\Projects\AStream\AStream\src\ru\kokorin\astream\mapper\ComplexMapper.as:89]
at Function/()[D:\Projects\AStream\AStream\src\ru\kokorin\astream\mapper\ComplexMapper.as:219]
at Array$/_forEach()
at Array/http://adobe.com/AS3/2006/builtin::forEach()
at ru.kokorin.astream.util::TypeUtil$/forEachInCollection()[D:\Projects\AStream\AStream\src\ru\kokorin\astream\util\TypeUtil.as:106]
at ImplicitCollectionHandler/toXML()[D:\Projects\AStream\AStream\src\ru\kokorin\astream\mapper\ComplexMapper.as:217]
Object and other dynamic classes can have properies set.
object["propertyName"] = propertyValue;
In AS3 describeType can return properties in wrong order.
It can lead to wrong deserialization if no AStreamOrder metadata is specified.
Currently id references are always used.
Add XPath relative and absolute references support. (http://xstream.codehaus.org/graphs.html)
Found in all the areas that require the "List" structure.
I solved it by making the reference absolute:
org.spicefactory.lib.collection.List
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.