Package ceylon.language.serialization

Examples of ceylon.language.serialization.Deconstructor


    @Override
    public void $serialize$(Callable<? extends Deconstructor> deconstructor) {
        // Don't call super.$serialize$() since our runtime super class is
        // an implementation detail
        Generic myTd = (TypeDescriptor.Generic)$getType$();
        Deconstructor dtor = deconstructor.$call$(ceylon.language.meta.typeLiteral_.typeLiteral(myTd));
       
        TypeDescriptor reifiedElement = myTd.getTypeArguments()[0];
        TypeDescriptor reifiedFirst = myTd.getTypeArguments()[1];
        TypeDescriptor reifiedRest = myTd.getTypeArguments()[2];
       
        dtor.putTypeArgument(
                ((GenericDeclaration)Metamodel.getOrCreateMetamodel(Tuple.class)).getTypeParameterDeclaration("Element"),
                Metamodel.getAppliedMetamodel(reifiedElement));
       
        dtor.putTypeArgument(
                ((GenericDeclaration)Metamodel.getOrCreateMetamodel(Tuple.class)).getTypeParameterDeclaration("First"),
                Metamodel.getAppliedMetamodel(reifiedFirst));
       
        dtor.putTypeArgument(
                ((GenericDeclaration)Metamodel.getOrCreateMetamodel(Tuple.class)).getTypeParameterDeclaration("Rest"),
                Metamodel.getAppliedMetamodel(reifiedRest));
       
        ValueDeclaration firstAttribute = (ValueDeclaration)((ClassDeclaration)Metamodel.getOrCreateMetamodel(Tuple.class)).getMemberDeclaration(ValueDeclaration.$TypeDescriptor$, "first");
        dtor.putValue(reifiedFirst, firstAttribute, getFirst());
       
        ValueDeclaration restAttribute = (ValueDeclaration)((ClassDeclaration)Metamodel.getOrCreateMetamodel(Tuple.class)).getMemberDeclaration(ValueDeclaration.$TypeDescriptor$, "rest");
        dtor.putValue(reifiedRest, restAttribute, getRest());
    }
View Full Code Here


   
    @Ignore
    @Override
    public void $serialize$(Callable<? extends Deconstructor> deconstructor) {
        //super.$serialize$(deconstructor);
        Deconstructor dtor = deconstructor.$call$(ceylon.language.meta.typeLiteral_.typeLiteral($getType$()));
       
        ceylon.language.meta.declaration.TypeParameter elementTypeParameter = ((GenericDeclaration)Metamodel.getOrCreateMetamodel(Array.class)).getTypeParameterDeclaration("Element");
        dtor.putTypeArgument(elementTypeParameter, Metamodel.getAppliedMetamodel(this.$reifiedElement));
       
        ValueDeclaration sizeAttribute = (ValueDeclaration)((ClassDeclaration)Metamodel.getOrCreateMetamodel(Array.class)).getMemberDeclaration(ceylon.language.meta.declaration.ValueDeclaration.$TypeDescriptor$, "size");
       
        dtor.putValue(Integer.$TypeDescriptor$,
                sizeAttribute,
                Integer.instance(getSize()));
       
        for (int ii = 0; ii < getSize(); ii++) {
            dtor.<Element>putElement(this.$reifiedElement, ii, unsafeItem(ii));
        }
    }
View Full Code Here

TOP

Related Classes of ceylon.language.serialization.Deconstructor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.