Package archmapper.main.model.stylemapping

Examples of archmapper.main.model.stylemapping.ClassType


            if (classDef != null) {
              String classTypeName = classDef.getType();
              if (classTypeName != null) {
                ComponentTypeMapping typeMapping = mappingHelper.getComponentTypeMapping(compName);
                if (typeMapping != null) {
                  ClassType classType = typeMapping.getClassType(classTypeName);
                  if (classType != null) {
                    if (classType.isSingleton()) {
                      generateResultsForASTNode(history, creation, resource, "The singleton "+
                          binding.getName() + " should only be created by the Spring configuration");
                    }
                  }
                }
View Full Code Here


        if (binding.getSuperclass() != null &&
            binding.getSuperclass() != type.getAST().resolveWellKnownType("java.lang.Object")) {
          // Check Restriction.noSuperClass
          ImplementationArtifactType artifactType = mappingHelper.getTypeOf(artifactDef);
          if (artifactType != null && artifactType instanceof ClassType) {
            ClassType classType = (ClassType) artifactType;
            if (classType.getRestrictions().contains(ClassTypeRestriction.noSuperclass)) {
              generateResultsForASTNode(history, type, resource,
                  "The type "+ binding.getQualifiedName() + " should "+
                  "not have a superclass according to the style mapping.");
            }
          }
View Full Code Here

   
    if (classDef.getParent() instanceof ComponentMapping) {
      String compType = getComponentTypeOf((ComponentMapping) classDef.getParent());
      ComponentTypeMapping compTypeMapping = styleMapping.getComponentType(compType);
      if (compTypeMapping != null) {
        ClassType type = compTypeMapping.getClassType(classDef.getType());
       
        if (type == null) {
          throw new ArchMapperException("The class type "+ classDef.getType() +
              " of class "+ classDef.getClassName() + " is not defined!");
        }
        return (type.isSingleton() == Boolean.TRUE);
      }
    } else {
      String connType = getConnectorTypeOf((ConnectorMapping) classDef.getParent());
      ConnectorTypeMapping connTypeMapping = styleMapping.getConnectorTypeMapping(connType);
      if (connTypeMapping != null) {
        ClassType type = connTypeMapping.getClassType(classDef.getType());
       
        if (type == null) {
          throw new ArchMapperException("The class type "+ classDef.getType() +
              " of class "+ classDef.getClassName() + " is not defined!");
        }
        return (type.isSingleton() == Boolean.TRUE);
      }
    }
   
    return false;
  }
View Full Code Here

    ComponentTypeMapping compT2Mapping = new ComponentTypeMapping();
    compT2Mapping.setTypeName("CompType2");
    styleMapping.getComponentTypeMapping().add(compT2Mapping);
    compT2Mapping.setExternal(false);

    ClassType classType = new ClassType();
    compT2Mapping.getClassTypes().add(classType);
    classType.setTypeName("ClassType2");
    classType.setSingleton(true);
   
    PortTypeMapping ptMapping = new PortTypeMapping();
    styleMapping.getPortTypeMapping().add(ptMapping);
    ptMapping.setTypeName("PortType2");
    ptMapping.getExportedTypes().add(classType);
View Full Code Here

TOP

Related Classes of archmapper.main.model.stylemapping.ClassType

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.