/* Copyright 2008-2014 Fraunhofer IGD, http://www.igd.fraunhofer.de Fraunhofer-Gesellschaft - Institute for Computer Graphics Research See the NOTICE file distributed with this work for additional information regarding copyright ownership Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.universAAL.ontology.asor; import org.universAAL.middleware.owl.ManagedIndividual; /** * Ontological representation of Script in the asor ontology. Methods included * in this class are the mandatory ones for representing an ontological concept * in Java classes for the universAAL platform. In addition getters and setters * for properties are included. * * @author * @author Generated by the OntologyUML2Java transformation of AAL Studio */ public class Script extends ManagedIndividual { public static final String MY_URI = AsorOntology.NAMESPACE + "Script"; public static final String PROP_WRITTEN_IN = AsorOntology.NAMESPACE + "writtenIn"; public static final String PROP_CONTENT = AsorOntology.NAMESPACE + "content"; public static final String PROP_IS_RUNNING = AsorOntology.NAMESPACE + "isRunning"; public static final String PROP_IS_PERSISTENT = AsorOntology.NAMESPACE + "isPersistent"; public static final String PROP_NAME = AsorOntology.NAMESPACE + "name"; // public static final String PROP_RETURN_VALUE = AsorOntology.NAMESPACE // + "returnValue"; public static final String FILE_PREFIX = "urn:file:"; public Script() { super(); } public Script(String uri) { super(uri); } /** * Helper method to create a {@link Script} instance from a filename. The * URI of this instance will be a common prefix {@link #FILE_PREFIX} with * the given filename. If a script is added through a service request, the * provider (callee) should return a valid URI. * * @param filename * the file name of the script. * @return */ public static Script create(String filename) { return new Script(FILE_PREFIX + filename); } public String getClassURI() { return MY_URI; } public int getPropSerializationType(String propURI) { if (PROP_WRITTEN_IN.equals(propURI)) return PROP_SERIALIZATION_FULL; if (PROP_CONTENT.equals(propURI)) return PROP_SERIALIZATION_FULL; if (PROP_IS_RUNNING.equals(propURI)) return PROP_SERIALIZATION_FULL; if (PROP_IS_PERSISTENT.equals(propURI)) return PROP_SERIALIZATION_FULL; if (PROP_NAME.equals(propURI)) return PROP_SERIALIZATION_FULL; return PROP_SERIALIZATION_FULL; } public boolean isWellFormed() { return super.isWellFormed() && hasProperty(PROP_WRITTEN_IN) && hasProperty(PROP_CONTENT) && hasProperty(PROP_IS_RUNNING) && hasProperty(PROP_IS_PERSISTENT) && hasProperty(PROP_NAME); } public String getName() { return (String) getProperty(PROP_NAME); } public void setName(String newPropValue) { if (newPropValue != null) changeProperty(PROP_NAME, newPropValue); } public LanguageClassifier getWrittenIn() { return (LanguageClassifier) getProperty(PROP_WRITTEN_IN); } public void setWrittenIn(LanguageClassifier newPropValue) { if (newPropValue != null) changeProperty(PROP_WRITTEN_IN, newPropValue); } public boolean isRunning() { Boolean b = (Boolean) getProperty(PROP_IS_RUNNING); return (b == null) ? false : b.booleanValue(); } public void setRunning(boolean newPropValue) { props.put(PROP_IS_RUNNING, Boolean.valueOf(newPropValue)); } public String getContent() { return (String) getProperty(PROP_CONTENT); } public void setContent(String newPropValue) { if (newPropValue != null) props.put(PROP_CONTENT, newPropValue); } public boolean isPersistent() { Boolean b = (Boolean) getProperty(PROP_IS_PERSISTENT); return (b == null) ? true : b.booleanValue(); } public void setPersistent(boolean newPropValue) { props.put(PROP_IS_PERSISTENT, Boolean.valueOf(newPropValue)); } }