Examples of Model


Examples of org.apache.qpid.server.model.Model

    public void testConfiguredObjectWithChildAndDepth1()
    {
        final String childAttributeName = "childattribute";
        final String childAttributeValue = "childvalue";

        Model model = createTestModel();
        _converter.setModel(model);

        TestChild mockChild = mock(TestChild.class);
        configureMockToReturnOneAttribute(mockChild, childAttributeName, childAttributeValue);
        when(_configuredObject.getChildren(TestChild.class)).thenReturn(Arrays.asList(mockChild));
View Full Code Here

Examples of org.apache.roller.ui.rendering.model.Model

           
            // ick, gotta load pre-3.0 model stuff as well :(
            ModelLoader.loadOldModels(model, request, response, pageContext, pageRequest);
           
            // manually add search model again to support pre-3.0 weblogs
            Model searchModel = new SearchResultsModel();
            searchModel.init(initData);
            model.put("searchResults", searchModel);
           
        } catch (RollerException ex) {
            log.error("Error loading model objects for page", ex);
           
View Full Code Here

Examples of org.apache.roller.weblogger.ui.rendering.model.Model

           
            // ick, gotta load pre-3.0 model stuff as well :(
            ModelLoader.loadOldModels(model, request, response, pageContext, pageRequest, WebloggerFactory.getWeblogger().getUrlStrategy());
           
            // manually add search model again to support pre-3.0 weblogs
            Model searchModel = new SearchResultsModel();
            searchModel.init(initData);
            model.put("searchResults", searchModel);
           
        } catch (WebloggerException ex) {
            log.error("Error loading model objects for page", ex);
           
View Full Code Here

Examples of org.apache.sling.models.annotations.Model

                while (classUrls.hasMoreElements()) {
                    URL url = classUrls.nextElement();
                    String className = toClassName(url);
                    try {
                        Class<?> implType = bundle.loadClass(className);
                        Model annotation = implType.getAnnotation(Model.class);
                        if (annotation != null) {
                           
                            // get list of adapters from annotation - if not given use annotated class itself
                            Class<?>[] adapterTypes = annotation.adapters();
                            if (adapterTypes.length == 0) {
                                adapterTypes = new Class<?>[] { implType };
                            }
                            // register adapter only if given adapters are valid
                            if (validateAdapterClasses(implType, adapterTypes)) {
                                for (Class<?> adapterType : adapterTypes) {
                                    if (adapterType != implType) {
                                        adapterImplementations.add(adapterType, implType);
                                    }
                                }
                                ServiceRegistration reg = registerAdapterFactory(adapterTypes, annotation.adaptables(), implType, annotation.condition());
                                regs.add(reg);
                            }
                        }
                    } catch (ClassNotFoundException e) {
                        log.warn("Unable to load class", e);
View Full Code Here

Examples of org.apache.sling.provisioning.model.Model

     * Read all model files from the directory in alphabetical order
     * @param logger
     */
    private static Model readLocalModel(final File systemsDirectory, final MavenProject project, final MavenSession session, final Logger logger)
    throws MojoExecutionException {
        final Model result = new Model();
        final List<String> candidates = new ArrayList<String>();
        if ( systemsDirectory != null && systemsDirectory.exists() ) {
            for(final File f : systemsDirectory.listFiles() ) {
                if ( f.isFile() && f.getName().endsWith(".txt") && !f.getName().startsWith(".") ) {
                    candidates.add(f.getName());
                }
            }
            Collections.sort(candidates);
        }
        if ( candidates.size() == 0 ) {
            throw new MojoExecutionException("No model files found in " + systemsDirectory);
        }
        for(final String name : candidates) {
            logger.debug("Reading model " + name + " in project " + project.getId());
            try {
                final File f = new File(systemsDirectory, name);
                final FileReader reader = new FileReader(f);
                try {
                    final Model current = ModelReader.read(reader, f.getAbsolutePath());
                    final Map<Traceable, String> errors = ModelUtility.validate(current);
                    if (errors != null ) {
                        throw new MojoExecutionException("Invalid model at " + name + " : " + errors);
                    }
                    ModelUtility.merge(result, current);
View Full Code Here

Examples of org.apache.wicket.model.Model

    */
   public FormInputBorder(String id, String label, FormComponent component, IModel model, boolean ajaxValidate, Class modelClass, String propertyExpression)
   {
      super(id);
      this.ajaxValidate = ajaxValidate;
      labelModel = new Model(label);
      component.setLabel(labelModel);
      if (component.isRequired())
      {
         label += ":*";
      }
View Full Code Here

Examples of org.apdplat.platform.model.Model

        for(ModelInfo modelInfo : modelInfos){
            if(modelInfo.getModelEnglish().toUpperCase().equals(modelName.toUpperCase())){
                String modelClzz=modelInfo.getModelPackage()+"."+modelInfo.getModelEnglish();
                try {
                    Class clazz = Class.forName(modelClzz);
                    Model model=(Model)clazz.newInstance();
                    if(model!=null){
                        Generator.setActionModelMap(actions, model);
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                    System.out.println("请再重新运行命令一次");
                    return;
                }
            }
            if(modelInfo.getModelEnglish().toUpperCase().equals(modelName1.toUpperCase())){
                String modelClzz=modelInfo.getModelPackage()+"."+modelInfo.getModelEnglish();
                try {
                    Class clazz = Class.forName(modelClzz);
                    Model model=(Model)clazz.newInstance();
                    if(model!=null){
                        Generator.setActionModelMap(actions1, model);
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                    System.out.println("请再重新运行命令一次");
                    return;
                }
            }
            if(modelInfo.getModelEnglish().toUpperCase().equals(modelName2.toUpperCase())){
                String modelClzz=modelInfo.getModelPackage()+"."+modelInfo.getModelEnglish();
                try {
                    Class clazz = Class.forName(modelClzz);
                    Model model=(Model)clazz.newInstance();
                    if(model!=null){
                        Generator.setActionModelMap(actions2, model);
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                    System.out.println("请再重新运行命令一次");
                    return;
                }
            }
            if(modelInfo.getModelEnglish().toUpperCase().equals(modelName3.toUpperCase())){
                String modelClzz=modelInfo.getModelPackage()+"."+modelInfo.getModelEnglish();
                try {
                    Class clazz = Class.forName(modelClzz);
                    Model model=(Model)clazz.newInstance();
                    if(model!=null){
                        Generator.setActionModelMap(actions3, model);
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                    System.out.println("请再重新运行命令一次");
                    return;
                }
            }
            if(modelInfo.getModelEnglish().toUpperCase().equals(modelName4.toUpperCase())){
                String modelClzz=modelInfo.getModelPackage()+"."+modelInfo.getModelEnglish();
                try {
                    Class clazz = Class.forName(modelClzz);
                    Model model=(Model)clazz.newInstance();
                    if(model!=null){
                        Generator.setActionModelMap(actions4, model);
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
View Full Code Here

Examples of org.applause.lang.applauseDsl.Model

 
  private Entity entity(final CharSequence input, final String entityName) {
    try {
      Entity _xblockexpression = null;
      {
        final Model model = this._parseHelper.parse(input);
        EList<NamedElement> _elements = model.getElements();
        Iterable<Entity> _filter = Iterables.<Entity>filter(_elements, Entity.class);
        final Function1<Entity,Boolean> _function = new Function1<Entity,Boolean>() {
          public Boolean apply(final Entity it) {
            String _name = it.getName();
            boolean _equals = Objects.equal(_name, entityName);
View Full Code Here

Examples of org.auraframework.instance.Model

     */
    // TODO: W-1478576 Must consolidate such methods in a util.
    protected Model getJavaModelByQualifiedName(String qualifiedName) throws Exception {
        ModelDef javaModelDef = definitionService.getDefinition(qualifiedName, ModelDef.class);
        assertTrue(javaModelDef instanceof JavaModelDefImpl);
        Model model = javaModelDef.newInstance();
        assertNotNull("Failed to retrieve model instance of " + qualifiedName, model);
        return model;
    }
View Full Code Here

Examples of org.biopax.paxtools.model.Model

    this.pathways = pathways;
  }

  public void run()
  {
    Model model = main.getOwlModel();

    if (model == null)
    {
      MessageDialog.openError(main.getShell(), "Error!",
        "Load or query a BioPAX model first.");

      return;
    }

    List<String> allNames = new ArrayList<String>(main.getAllPathwayNames());
    Map<String, PathwayHolder> nameToPathwayMap = main.getRootGraph().getNameToPathwayMap();

    assert allNames.size() == nameToPathwayMap.size() : "Sizes do not match!";

    if (allNames.isEmpty())
    {
      String message = model.getObjects().isEmpty() ? "BioPAX model is empty!" :
        "There is no pathway defined in this BioPAX model.\n" +
          "You can create one using \"Pathway > Create\" menu.";

      MessageDialog.openInformation(main.getShell(), "No Pathway!", message);
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.