Examples of TypeTree


Examples of info.ata4.unity.asset.struct.TypeTree

        }
    }

    public void split() throws IOException {
        List<ObjectPath> pathTable = asset.getPaths();
        TypeTree typeTree = asset.getTypeTree();

        // assets with just one object can't be split any further
        if (pathTable.size() == 1) {
            L.warning("Asset doesn't contain sub-assets!");
            return;
        }
       
        for (ObjectPath path : pathTable) {
            // skip filtered classes
            if (cf != null && !cf.accept(path)) {
                continue;
            }

            String className = ClassID.getNameForID(path.getClassID(), true);
           
            AssetFile subAsset = new AssetFile();
            subAsset.getHeader().setFormat(asset.getHeader().getFormat());
           
            ObjectPath subFieldPath = new ObjectPath();
            subFieldPath.setClassID1(path.getClassID1());
            subFieldPath.setClassID2(path.getClassID2());
            subFieldPath.setLength(path.getLength());
            subFieldPath.setOffset(0);
            subFieldPath.setPathID(1);
            subAsset.getPaths().add(subFieldPath);
           
            TypeTree subTypeTree = subAsset.getTypeTree();
            subTypeTree.setEngineVersion(typeTree.getEngineVersion());
            subTypeTree.setVersion(-2);
            subTypeTree.setFormat(typeTree.getFormat());
            subTypeTree.getFields().put(path.getClassID(), typeTree.getFields().get(path.getClassID()));

            subAsset.setDataBuffer(asset.getPathBuffer(path));
           
            Path subAssetDir = outputDir.resolve(className);
            if (Files.notExists(subAssetDir)) {
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeTree

       
        indentLevel--;
    }
   
    public void dumpStruct() throws IOException {
        TypeTree typeTree = asset.getTypeTree();
       
        if (typeTree.getFields().isEmpty()) {
            L.info("No type tree available");
            return;
        }
       
        Set<Integer> classIDs = asset.getClassIDs();
       
        for (Integer classID : classIDs) {
            TypeField classField = typeTree.getFields().get(classID);
           
            // skip filtered classes
            if (cf != null && !cf.accept(classID)) {
                continue;
            }
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeTree

    @Override
    public void processAsset(AssetFile asset) throws IOException {
        List<ObjectPath> paths = asset.getPaths();
        List<AssetRef> refTable = asset.getReferences();
        AssetHeader header = asset.getHeader();
        TypeTree typeTree = asset.getTypeTree();
       
        ps.println("Header");
        ps.println("  File size: " + StringUtils.humanReadableByteCount(header.getFileSize(), true));
        ps.println("  Tree size: " + StringUtils.humanReadableByteCount(header.getTreeSize(), true));
        ps.println("  Format: " + header.getFormat());
        ps.println("  Data offset: " + header.getDataOffset());
        ps.println();
       
        ps.println("Serialized data");
        ps.println("  Revision: " + typeTree.getEngineVersion());
        ps.println("  Version: " + typeTree.getVersion());
        ps.println("  Type tree: " + BooleanUtils.toStringYesNo(!typeTree.getFields().isEmpty()));
        ps.println("  Objects: " + paths.size());
        ps.println();
       
        if (!refTable.isEmpty()) {
            ps.println("External references");
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeTree

            L.log(Level.SEVERE, "Can't write struct database", ex);
        }
    }
   
    public void fill(AssetFile asset) {
        TypeTree typeTree = asset.getTypeTree();
        Set<Integer> classIDs = asset.getClassIDs();
       
        fixRevision(asset, typeTree);
       
        if (typeTree.getEngineVersion() == null) {
            L.warning("Revision = null");
            return;
        }
       
        for (Integer classID : classIDs) {
            TypeField ft = ftm.get(classID, typeTree.getEngineVersion(), false);
            if (ft != null) {
                typeTree.getFields().put(classID, ft);
            }
        }
    }
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeTree

            }
        }
    }
   
    public int learn(AssetFile asset) {
        TypeTree typeTree = asset.getTypeTree();
        Set<Integer> classIDs = asset.getClassIDs();
       
        if (typeTree.getFields().isEmpty()) {
            L.info("No type tree available");
            return 0;
        }
       
        fixRevision(asset, typeTree);
       
        if (typeTree.getEngineVersion() == null) {
            L.warning("Revision = null");
            return 0;
        }
       
        int learnedNew = 0;
       
        // merge the TypeTree map with the database field map
        for (Integer classID : classIDs) {
            TypeField fieldType = typeTree.getFields().get(classID);
            String fieldClassName = ClassID.getNameForID(classID);

            if (fieldType == null) {
                continue;
            }
           
            TypeField fieldTypeMapped = ftm.get(classID, typeTree.getEngineVersion());

            if (fieldTypeMapped == null) {
                fieldTypeMapped = fieldType;
                L.log(Level.INFO, "New: {0} ({1})", new Object[]{classID, fieldClassName});
                ftm.add(classID, typeTree.getEngineVersion(), fieldTypeMapped);
                learnedNew++;
            }

            // check the hashes, they must be identical at this point
            int hash1 = fieldType.hashCode();
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeTree

    public void load(ByteBuffer bb) throws IOException {
        DataInputReader in = DataInputReader.newReader(bb);
        in.readStruct(header);
        in.setSwap(true);
       
        typeTree = new TypeTree();
        objTable = new ObjectPathTable();
        refTable = new AssetRefTable();
       
        typeTree.setFormat(header.getFormat());
       
View Full Code Here

Examples of org.apache.tuscany.sca.binding.corba.impl.types.TypeTree

            try {
                // invocation and sending result
                Object result = invocationProxy.invoke(operationName, inputInstances);
                OutputStream out = rh.createReply();
                if (types.getOutputType() != null) {
                    TypeTree tree = types.getOutputType();
                    TypeHelpersProxy.write(tree.getRootNode(), out, result);
                }
                return out;
            } catch (InvocationException ie) {
                // handling user exception
                try {
                    OutputStream out = rh.createExceptionReply();
                    Class<?> exceptionClass = ie.getTargetException().getClass();
                    TypeTree tree = TypeTreeCreator.createTypeTree(exceptionClass, null);
                    String exceptionId = Utils.getTypeId(exceptionClass);
                    out.write_string(exceptionId);
                    TypeHelpersProxy.write(tree.getRootNode(), out, ie.getTargetException());
                    return out;
                } catch (Exception e) {
                    logger.log(Level.WARNING, "Exception during handling invocation exception", e);
                }
            } catch (Exception e) {
View Full Code Here

Examples of org.apache.tuscany.sca.binding.corba.impl.types.TypeTree

                List<TypeTree> inputInstances = new ArrayList<TypeTree>();
                // cache output type tree
                if (operation.getOutputType() != null && operation.getOutputType().getPhysical() != null
                    && !operation.getOutputType().getPhysical().equals(void.class)) {
                    Annotation[] notes = operationMethodMapping.get(operation).getAnnotations();
                    TypeTree outputType =
                        TypeTreeCreator.createTypeTree(operation.getOutputType().getPhysical(), notes);
                    operationTypes.setOutputType(outputType);
                }
                // cache input types trees
                if (operation.getInputType() != null) {
                    Method method = operationMethodMapping.get(operation);
                    Annotation[][] notes = method.getParameterAnnotations();
                    int i = 0;
                    for (DataType<List<DataType<?>>> type : operation.getInputType().getLogical()) {
                        Class<?> forClass = type.getPhysical();
                        TypeTree inputType = TypeTreeCreator.createTypeTree(forClass, notes[i]);
                        inputInstances.add(inputType);
                        i++;
                    }

                }
View Full Code Here

Examples of org.apache.tuscany.sca.binding.corba.impl.types.TypeTree

     * Adds operation argument - stores arguments and caches its TypeTree
     *
     * @param argument
     */
    public void addArgument(java.lang.Object argument, Annotation[] notes) throws RequestConfigurationException {
        TypeTree tree = TypeTreeCreator.createTypeTree(argument.getClass(), notes);
        argumentsTypes.add(tree);
        arguments.add(argument);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.binding.corba.impl.types.TypeTree

     * @param outputStream
     * @throws RequestConfigurationException
     */
    private void passArguments(OutputStream outputStream) throws RequestConfigurationException {
        for (int i = 0; i < arguments.size(); i++) {
            TypeTree tree = argumentsTypes.get(i);
            TypeHelpersProxy.write(tree.getRootNode(), outputStream, arguments.get(i));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.