~ Methods **************************************************************************************************************************************
430068
@Override
    public Response toResponse(IllegalArgumentException ex) {
        return Response.status(Status.BAD_REQUEST).entity(new ErrorMessage(Status.BAD_REQUEST.getStatusCode(), ex.getMessage())).type(
            MediaType.APPLICATION_JSON_TYPE).build();
    }
314729
public function init()
    {
        /* @var SeoBehavior $behavior */
        $behavior = $this->controller->asa('seo');

        if ($behavior !== null && $behavior->title !== null)
            $this->_title = $behavior->title;
        else if ($this->defaultTitle !== null)
            $this->_title = $this->defaultTitle;

        if ($behavior !== null && $behavior->metaDescription !== null)
            $this->_description = $behavior->metaDescription;
        else if ($this->defaultDescription !== null)
            $this->_description = $this->defaultDescription;

        if ($behavior !== null && $behavior->metaKeywords !== null)
            $this->_keywords = $behavior->metaKeywords;
        else if ($this->defaultKeywords !== null)
            $this->_keywords = $this->defaultKeywords;

        if ($behavior !== null)
            $this->_properties = array_merge($behavior->metaProperties, $this->defaultProperties);
        else
            $this->_properties = $this->defaultProperties;

        if ($behavior !== null && $behavior->canonical !== null)
            $this->_canonical = $behavior->canonical;
    }
362130
public function process()
    {
        parent::process();

        $data = &$this->getForm()->getFormData();

        if (!isset($data[$this->id])) {
            return;
        }

        $this->value = $data[$this->id];
        $length = $this->getValueLength();

        if ($length === 0) {
            $this->value = null;
        }

        if ($this->required && $length === 0) {
            $message = $this->getValidationMessage('required');
            $this->addMessage($message);
        } elseif ($this->maxlength !== null && $length > $this->maxlength) {
            $message = $this->getValidationMessage('too-long');
            $message->primary_content = sprintf(
                $message->primary_content,
                $this->maxlength
            );

            $this->addMessage($message);
        }
    }
505820
public function onBeforePublish()
    {
        /**
         * @var DBDatetime $publishDate
         */
        $publishDate = $this->dbObject('PublishDate');

        if (!$publishDate->getValue()) {
            $this->PublishDate = DBDatetime::now()->getValue();
            $this->write();
        }
    }
369377
private void init() {
        writers.put(Boolean.class, new BooleanDataWriter());
        writers.put(Calendar.class, new CalendarDataWriter());
        writers.put(Date.class, new DateDataWriter());
        writers.put(Enum.class, new EnumDataWriter());
        writers.put(Number.class, new NumberDataWriter());
        writers.put(String.class, new StringDataWriter());
    }
3394
void firePropertyDataChanged(TreeDataEvent event) {
		if (this.nodeListeners != null) {
			for (final TreeNodeListener listener : this.nodeListeners) {
				if (listener != null) {
					listener.treeNodeDataChanged(event);
				}
			}
		}
		final N parent = getParentNode();
		if (parent != null) {
			parent.firePropertyDataChanged(event);
		}
	}
996166
public function execute()
    {
        if (!$this->isEmpty()) {
            $this->table->delete($this->context + $this->where)->run();
        }

        parent::execute();
    }
1126843
@Override
    public void onInteractionEvent(final InteractionEvent event) {
        QName id = event.getId();
        QName source = (QName)event.getSource();

        final Set<Procedure> collection = procedures.get(id);
        Procedure execution = null;

        if(collection!=null)
        {
            for(Procedure consumer : collection) {

                // TODO: This isn't optimal (creation of new resource with every comparison)
                Resource<ResourceType> resource = new Resource<ResourceType>(id, ResourceType.Interaction);
                resource.setSource(source);

                boolean justified = consumer.getJustification() == null
                        || source.equals(consumer.getJustification());

                if(consumer.doesConsume(resource) && justified)
                {
                    execution = consumer;
                    break;
                }
            }
        }

        if(null==execution)
        {
            Window.alert("No procedure for " + event);
            Log.warn("No procedure for " + event);
        }
        else if(execution.getPrecondition().isMet(getStatementContext(source)))   // guarded
        {
            try {
                execution.getCommand().execute(InteractionCoordinator.this.dialog, event.getPayload());
            } catch (Throwable e) {
                Log.error("Failed to execute procedure "+execution, e);
            }
        }

    }
766791
@Override
    public void onEvent(EventIterator events) {
        try {
            // this resolver should be the only one (for this handling thread)
            ResourceResolver resolver = getResolver();
            if (resolver != null) {
                try {
                    Session session = resolver.adaptTo(Session.class);
                    String serviceUserId = getServiceUserId();
                    // collect changed nodes
                    ChangeCollection changedNodes = new ChangeCollection();
                    while (events.hasNext()) {
                        Event event = events.nextEvent();
                        if (ignoreEvent(event)) continue;
                        try {
                            String path = event.getPath();
                            String user = event.getUserID();
                            // if the service user is the initiator this is a self initiated event - ignore it
                            if (!serviceUserId.equals(user)) {
                                Calendar time = Calendar.getInstance();
                                time.setTime(new Date(event.getDate()));
                                int type = event.getType();
                                if (isPropertyEvent(type)) {
                                    if (getPropertyPathFilter().accept(path)) {
                                        changedNodes.registerChange(session, resolver, path, time, user);
                                    }
                                } else {
                                    if (getNodePathFilter().accept(path)) {
                                        changedNodes.registerChange(session, resolver, path, time, user);
                                    }
                                }
                            }
                        } catch (RepositoryException rex) {
                            LOG.error(rex.getMessage(), rex);
                        }
                    }
                    // handle change actions on the detected nodes
                    if (changedNodes.size() > 0) {
                        for (ChangedResource change : changedNodes.values()) {
                            try {
                                doOnChange(resolver, change);
                            } catch (RepositoryException ex) {
                                LOG.error(ex.getMessage(), ex);
                            }
                        }
                        changedNodes.clear();
                        resolver.commit();
                    }
                } catch (PersistenceException ex) {
                    LOG.error(ex.getMessage(), ex);
                } finally {
                    resolver.close();
                }
            }
        } catch (LoginException ex) {
            LOG.error(ex.getMessage(), ex);
        }
    }
1374179
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        $float_value = $this->getNumericValue($this->value);

        if ($float_value === null) {
            $this->addMessage($this->getValidationMessage('float'));
        } else {
            $this->value = $float_value;
        }
    }
242448
@Override
    public void visitMethod(Method obj) {
        methodSignatureIsConstrained = false;
        String methodName = obj.getName();

        if (!Values.CONSTRUCTOR.equals(methodName) && !Values.STATIC_INITIALIZER.equals(methodName)) {

            String methodSig = obj.getSignature();

            methodSignatureIsConstrained = methodIsSpecial(methodName, methodSig)
                    || methodHasSyntheticTwin(methodName, methodSig);

            if (!methodSignatureIsConstrained) {
                for (AnnotationEntry entry : obj.getAnnotationEntries()) {
                    if (CONVERSION_ANNOTATIONS.contains(entry.getAnnotationType())) {
                        methodSignatureIsConstrained = true;
                        break;
                    }
                }
            }
            if (!methodSignatureIsConstrained) {
                String parms = methodSig.split("\\(|\\)")[1];
                if (parms.indexOf(Values.SIG_QUALIFIED_CLASS_SUFFIX_CHAR) >= 0) {

                    outer: for (JavaClass constrainCls : constrainingClasses) {
                        Method[] methods = constrainCls.getMethods();
                        for (Method m : methods) {
                            if (methodName.equals(m.getName()) && methodSig.equals(m.getSignature())) {
                                methodSignatureIsConstrained = true;
                                break outer;
                            }
                        }
                    }
                }
            }
        }
    }
734008
public function execute()
    {
        $this->insertID = $this->table->insertOne($this->context + $this->data);
        parent::execute();
    }
810577
public function execute()
    {
        $this->addFromDeleteRels();

        $this->getModelsToDelete()->byRepo(function (Repo $repo, Models $models) {
            $repo->deleteModels($models);
        });

        $this->addFromInsertRels();

        $this->getModelsToInsert()->assertValid()->byRepo(function (Repo $repo, Models $models) {
            $repo->insertModels($models);
        });

        $this->addFromUpdateRels();

        $this->getModelsToUpdate()->assertValid()->byRepo(function (Repo $repo, Models $models) {
            $repo->updateModels($models);
        });
    }
661535
public function process()
    {
        $this->initializeStorageNode($this->storageNodeNodePath, $this->storageNodeTitle);
        $this->initializeNodeTemplates();

        $nodeTemplate = new NodeTemplate();
        $this->processBatch($nodeTemplate);
    }
275250
public function rewind()
    {
        parent::rewind();
        $this->_values->rewind();
        $this->_validValues = $this->_values->valid();
    }
1346618
public function forceEndDocument(): void
    {
        if (empty($this->stack)) {
            return;
        }

        $key = $this->keys;
        for ($i = $this->level - 1; $i > 0; --$i) {
            $value = array_pop($this->stack);
            //value
            $obj = array_pop($this->stack);
            if (!empty($key[$i])) {
                $obj[$key[$i]] = $value;
                $key[$i] = null;
            } else {
                $obj[] = $value;
            }
            if ($i > 1) {
                $this->stack[] = $obj;
            } else {
                $this->json = $obj;
            }
        }
    }
868903
private void createQueryFutureMethod(JavaClass jClass,
                                       Method method)
  {
    Class<?> []parameterTypes = method.getParameterTypes();
    Annotation [][]parameterAnns = method.getParameterAnnotations();

    int paramLength = parameterTypes.length;
    
    addMethod(method);
    
    CodeWriterAttribute code = createMethodHeader(jClass, method);
    
    code.setMaxLocals(1 + 2 * parameterTypes.length);
    code.setMaxStack(10 + 2 * parameterTypes.length);
    
    code.pushObjectVar(0);
    code.getField(jClass.getThisClass(),
                  "_messageFactory",
                  MessageFactoryAmp.class);
    
    // code.pushObjectVar(getLength(parameterTypes, resultOffset) + 1);
    
    Timeout timeoutAnn = method.getAnnotation(Timeout.class);
    
    if (timeoutAnn != null) {
      long timeout = timeoutAnn.unit().toMillis(timeoutAnn.value());
      code.pushConstant(timeout);
    }
    
    
    code.pushObjectVar(0);
    code.getField(jClass.getThisClass(),
                  "_serviceRef",
                  ServiceRefAmp.class);
    
    code.pushObjectVar(0);
    code.getField(jClass.getThisClass(),
                  fieldName(method),
                  MethodAmp.class);
    
    partitionMethod(code, parameterTypes, parameterAnns);
    
    pushParameters(code, parameterTypes, parameterAnns,
                   1, 0, paramLength, -1);

    if (timeoutAnn != null) {
      code.invokeInterface(MessageFactoryAmp.class,
                           "queryFuture",
                           Object.class, // QueryWithResultMessage.class,
                           long.class,
                           ServiceRefAmp.class,
                           MethodAmp.class,
                           Object[].class);
    }
    else {
      code.invokeInterface(MessageFactoryAmp.class,
                           "queryFuture",
                           Object.class, // QueryWithResultMessage.class,
                           ServiceRefAmp.class,
                           MethodAmp.class,
                           Object[].class);
    }

    popReturn(code, method.getReturnType());

    code.close();
  }