Examples of TypeDefinition


Examples of com.strobel.assembler.metadata.TypeDefinition

            if (name != null) {
                return name;
            }

            if (!nameSource.isDefinition()) {
                final TypeDefinition resolvedType = nameSource.resolve();

                if (resolvedType != null) {
                    nameSource = resolvedType;
                }
            }
View Full Code Here

Examples of com.volantis.mcs.build.themes.definitions.TypeDefinition

     * @param typeDefName The name of thr property to find.
     * @return The type definition with the specified name, or null if it
     * could not be found.
     */
    public TypeDefinition getTypeDef(String typeDefName) {
        TypeDefinition typeDef = (TypeDefinition) typeDefs.get(typeDefName);
        return typeDef;
    }
View Full Code Here

Examples of com.volantis.mcs.build.themes.definitions.TypeDefinition

            addProperty(property);

        } else if (name.equals("typeDefinition")) {

            // Create a new type definition.
            TypeDefinition typeDef = definitionsFactory.createTypeDefinition();
            TypeList typeList = new TypeList();
            pushObject(typeList);
            pushObject(typeDef);

            processThemePropertyChildren(element);

            popObject();
            popObject();

            if (!typeList.getList().isEmpty()) {
                typeDef.setType((Type) typeList.getList().get(0));
            }

            // Add the type definition into the map for looking up later.
            addTypeDef(typeDef);

        } else if (name.equals("name")) {

            // Set the name of the containing named object.
            Named named = (Named) findObject(Named.class);
            named.setName(element.getText());

        } else if (name.equals("description")) {
            // Ignore description elements and their contents, they have no
            // effect on code generation.
        } else if (name.equals("initialValue")) {

            processInitialValue(element);

        } else if (name.equals("integerValue")) {
            String valStr = element.getText();
            try {
                int intVal = Integer.parseInt(valStr);
                IntegerValue value = definitionsFactory.createIntegerValue();
                value.setInteger(intVal);
                ValueContainer container =
                        (ValueContainer) findObject(ValueContainer.class);
                container.addValue(value);
            } catch (NumberFormatException nfe) {
                System.out.println("Invalid number: '" + valStr + "'");
            }
        } else if (name.equals("lengthValue")) {
            String valStr = element.getText();
            try {
                int intVal = Integer.parseInt(valStr);
                LengthValue value = definitionsFactory.createLengthValue();
                value.setInteger(intVal);
                value.setUnits(element.getAttributeValue("units"));
                ValueContainer container =
                        (ValueContainer) findObject(ValueContainer.class);
                container.addValue(value);
            } catch (NumberFormatException nfe) {
                System.out.println("Invalid number: '" + valStr + "'");
            }
        } else if (name.equals("angleValue")) {
            String valStr = element.getText();

            try {
                double doubleVal = Double.parseDouble(valStr);
                String units = element.getAttributeValue("units");
                ValueContainer container =
                        (ValueContainer) findObject(ValueContainer.class);
                AngleValue value = definitionsFactory.createAngleValue();
                value.setAngle(doubleVal);
                value.setUnits(units);
                container.addValue(value);
            } catch (NumberFormatException nfe) {
                System.out.println("Invalid angle: '" + valStr + "'");
            }
        } else if (name.equals("stringValue")) {
            ValueContainer container =
                    (ValueContainer) findObject(ValueContainer.class);
            StringValue value = definitionsFactory.createStringValue();
            value.setString(element.getText());
            container.addValue(value);
        } else if (name.equals("colorValue")) {
            ValueContainer container =
                    (ValueContainer) findObject(ValueContainer.class);
            ColorValue value = definitionsFactory.createColorValue();
            value.setColorName(element.getText());
            container.addValue(value);
        } else if (name.equals("inheritValue")) {
            ValueContainer container =
                    (ValueContainer) findObject(ValueContainer.class);
            InheritValue value = definitionsFactory.createInheritValue();
            container.addValue(value);
        } else if (name.equals("percentageValue")) {
            String valStr = element.getText();
            try {
                double percentVal = Double.parseDouble(valStr);
                PercentageValue value =
                        definitionsFactory.createPercentageValue();
                value.setPercentage(percentVal);
                ValueContainer container =
                        (ValueContainer) findObject(ValueContainer.class);
                container.addValue(value);
            } catch (NumberFormatException nfe) {
                System.out.println("Invalid percentage: '" + valStr + "'");
            }
        } else if (name.equals("timeValue")) {
            String valStr = element.getText();

            try {
                double doubleVal = Double.parseDouble(valStr);
                String units = element.getAttributeValue("units");
                ValueContainer container =
                        (ValueContainer) findObject(ValueContainer.class);
                TimeValue value = definitionsFactory.createTimeValue();
                value.setTime(doubleVal);
                value.setUnits(units);
                container.addValue(value);
            } catch (NumberFormatException nfe) {
                System.out.println("Invalid time: '" + valStr + "'");
            }
        } else if (name.equals("pairValue")) {
            PairValueContainer pair = new PairValueContainer();

            pushObject(pair);
            processThemePropertyChildren(element);
            popObject();

            PairValue value = definitionsFactory.createPairValue();
            value.setFirst(pair.getFirst());
            value.setSecond(pair.getSecond());

            ValueContainer container =
                    (ValueContainer) findObject(ValueContainer.class);
            container.addValue(value);
        } else if (name.equals("listValue")) {
            ListValueContainer pair = new ListValueContainer();

            pushObject(pair);
            processThemePropertyChildren(element);
            popObject();

            ListValue value = definitionsFactory.createListValue();
            Value next = null;
            while((next = pair.getNext())!=null){
                value.setNext(next);
            }
           
            ValueContainer container =
                    (ValueContainer) findObject(ValueContainer.class);
            container.addValue(value);
        } else if (name.equals("frequencyValue")) {
            String valStr = element.getText();

            try {
                double doubleVal = Double.parseDouble(valStr);
                String units = element.getAttributeValue("units");
                ValueContainer container =
                        (ValueContainer) findObject(ValueContainer.class);
                FrequencyValue value = definitionsFactory.createFrequencyValue();
                value.setNumber(doubleVal);
                value.setUnits(units);
                container.addValue(value);
            } catch (NumberFormatException nfe) {
                System.out.println("Invalid frequency: '" + valStr + "'");
            }
        } else if (name.equals("fractionValue")) {
            PairValueContainer pair = new PairValueContainer();

            pushObject(pair);
            processThemePropertyChildren(element);
            popObject();

            FractionValue value = definitionsFactory.createFractionValue();
            value.setNumerator(pair.getFirst());
            value.setDenominator(pair.getSecond());

            ValueContainer container =
                    (ValueContainer) findObject(ValueContainer.class);
            container.addValue(value);
        } else if (name.equals("keywordRef")) {

            // Resolve the keyword reference to the keyword (must come before)
            // and then create a representation.
            ValueContainer container =
                    (ValueContainer) findObject(ValueContainer.class);
            String keywordName = element.getText();

            // Get the keyword from the property's type.
            Property property = (Property) findObject(Property.class);
            Type type = property.getType();
            if (type != null) {
                KeywordSearchContainer keywordCont =
                        new KeywordSearchContainer();
                keywordCont.setKeywordName(keywordName);
                TypeVisitor keywordFinder = new AbstractTypeVisitor() {
                    public void visitKeywords(Keywords visitee, Object obj) {
                        KeywordSearchContainer ksc =
                                (KeywordSearchContainer) obj;
                        Keyword keyword =
                                visitee.getKeyword(ksc.getKeywordName());
                        if (keyword != null) {
                            ksc.setKeyword(keyword);
                        }
                    }

                    public void visitTypeRef(TypeRef visitee, Object obj) {
                        TypeDefinition td = getTypeDef(visitee.getReference());
                        if (td != null) {
                            Type t = td.getType();
                            if (t != null) {
                                t.accept(this, obj);
                            }
                        }
                    }
View Full Code Here

Examples of jnr.ffi.annotations.TypeDefinition

        return type;
    }
   
    private static Type lookupAliasedType(jnr.ffi.Runtime runtime, Collection<Annotation> annotations) {
        for (Annotation a : annotations) {
            TypeDefinition typedef = a.annotationType().getAnnotation(TypeDefinition.class);
            if (typedef != null) {
                return runtime.findType(typedef.alias());
            }
        }

        return null;
    }
View Full Code Here

Examples of org.alfresco.service.cmr.dictionary.TypeDefinition

    List<JsonModelEntry> model = new ArrayList<JsonModelEntry>();
    for (String type : spaceTypes) {
      try {
        ServiceRegistry serviceRegistry = AlfrescoUtil.getServiceRegistry();
        QName qName = QName.createQName(type, serviceRegistry.getNamespaceService());
        TypeDefinition td = serviceRegistry.getDictionaryService().getType(qName);
        if (td != null) {
          String title = td.getTitle();
          if (StringUtils.isEmpty(title)) {
            title = type;
          }
          model.add(new JsonModelEntry(type, title));
        } else {
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.TypeDefinition

            }
        });
    }

    public ObjectType getTypeDefinition(String typeId) {
        TypeDefinition typeDefinition = getBinding().getRepositoryService().getTypeDefinition(getRepositoryId(),
                typeId, null);
        return objectFactory.convertTypeDefinition(typeDefinition);
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.TypeDefinition

            throw new CmisInvalidArgumentException("Property '" + PropertyIds.OBJECT_TYPE_ID + "' must be set!");
        }

        // get the type
        String objectTypeId = obbjectTypeIdProperty.getFirstValue().toString();
        TypeDefinition type = getTypeDefinition(repositoryId, objectTypeId, null);

        // create object
        String newId = null;
        switch (type.getBaseTypeId()) {
        case CMIS_DOCUMENT:
            newId = createDocument(repositoryId, properties, folderId, contentStream, versioningState, policies, null,
                    null, extension);
            break;
        case CMIS_FOLDER:
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.TypeDefinition

        queryObject = new QueryObject(typeManager);
        ParseTreeWalker<XPathBuilder> parseTreeWalker = new ParseTreeWalker<XPathBuilder>(evaluator);
        CmisQueryWalker walker = queryUtil.traverseStatementAndCatchExc(statement, queryObject, parseTreeWalker);
        walker.setDoFullTextParse(false);
        XPathBuilder parseResult = parseTreeWalker.getResult();
        TypeDefinition fromType = getFromName(queryObject);

        String pathExpression = buildPathExpression(fromType, getFolderPredicate(parseResult));
        String elementTest = buildElementTest(fromType);
        String predicates = buildPredicates(fromType, getCondition(parseResult));
        String orderByClause = buildOrderByClause(fromType, queryObject.getOrderBys());
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.TypeDefinition

        if (type.getBaseTypeId() == null) {
            return false;
        }

        // find base type
        TypeDefinition baseType = null;
        if (type.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) {
            baseType = copyTypeDefintion(types.get(DOCUMENT_TYPE_ID).getTypeDefinition());
        } else if (type.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) {
            baseType = copyTypeDefintion(types.get(FOLDER_TYPE_ID).getTypeDefinition());
        } else if (type.getBaseTypeId() == BaseTypeId.CMIS_RELATIONSHIP) {
            baseType = copyTypeDefintion(types.get(RELATIONSHIP_TYPE_ID).getTypeDefinition());
        } else if (type.getBaseTypeId() == BaseTypeId.CMIS_POLICY) {
            baseType = copyTypeDefintion(types.get(POLICY_TYPE_ID).getTypeDefinition());
        } else {
            return false;
        }

        AbstractTypeDefinition newType = (AbstractTypeDefinition) copyTypeDefintion(type);

        // copy property definition
        for (PropertyDefinition<?> propDef : baseType.getPropertyDefinitions().values()) {
            ((AbstractPropertyDefinition<?>) propDef).setIsInherited(true);
            newType.addPropertyDefinition(propDef);
        }

        // add it
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.definitions.TypeDefinition

     */
    private TypeDefinitionContainer getTypesDescendants(int depth, TypeDefinitionContainer tc,
            boolean includePropertyDefinitions) {
        TypeDefinitionContainerImpl result = new TypeDefinitionContainerImpl();

        TypeDefinition type = copyTypeDefintion(tc.getTypeDefinition());
        if (!includePropertyDefinitions) {
            type.getPropertyDefinitions().clear();
        }

        result.setTypeDefinition(type);

        if (depth != 0) {
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.