Package jade.content.abs

Examples of jade.content.abs.AbsPrimitive


  public Object internalizeSpecialType(AbsObject abs, ObjectSchema schema, Class javaClass, Ontology referenceOnto) throws OntologyException {
    if (!javaClass.isEnum()) {
      throw new NotASpecialType();
    }

    AbsPrimitive absEnumValue = (AbsPrimitive)abs.getAbsObject(ENUM_SLOT_NAME);
    String strEnumValue = absEnumValue.getString();
    return Enum.valueOf(javaClass, strEnumValue);
  }
View Full Code Here


  /**
   */
  protected Object toObject(AbsObject abs, String lcType, Ontology globalOnto) throws UnknownSchemaException, UngroundedException, OntologyException {
    if (SERIALIZABLE.equals(abs.getTypeName())) {
      try {
        AbsPrimitive absValue = (AbsPrimitive) abs.getAbsObject(SERIALIZABLE_VALUE);
        String stringValue = absValue.getString();
        byte[] value = Base64.decodeBase64(stringValue.getBytes("US-ASCII"));
        ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(value)) {
          protected Class resolveClass(ObjectStreamClass v) throws IOException, ClassNotFoundException {
            if (myClassLoader != null) {
              // FIXME: Manage primitive class fields. Refactor with AgentMobilityService
View Full Code Here

  public void validate(AbsObject value, Ontology onto) throws OntologyException {
    if (!(value instanceof AbsPrimitive)) {
      throw new OntologyException(value+" is not an AbsPrimitive");
    }
   
    AbsPrimitive absPrimitive = (AbsPrimitive) value;
    Object absValue = absPrimitive.getObject();
    if (absValue != null && permittedValues != null) {
      for (int i=0; i<permittedValues.length; i++) {
        if (absValue.equals(permittedValues[i])) {
          return;
        }
View Full Code Here

  public void validate(AbsObject value, Ontology onto) throws OntologyException {
    if (!(value instanceof AbsPrimitive)) {
      throw new OntologyException(value+" is not an AbsPrimitive");
    }
   
    AbsPrimitive absPrimitive = (AbsPrimitive) value;
    Object absValue = absPrimitive.getObject();
    if (absValue != null) {
      if (!absValue.toString().matches(regex)) {
        throw new OntologyException(value+" not match the regular expression "+regex);
      }
    }
View Full Code Here

TOP

Related Classes of jade.content.abs.AbsPrimitive

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.