Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
SIX OVAL - http://code.google.com/p/six-oval/ Copyright (C) 2010 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number: H22PRO-1124 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 jp.go.aist.six.oval.model.definitions;
 
The OVAL Variable describes different sources for obtaining a value(s) for the variable. There are currently three types of variables; local, external, and constant.

Author(s):
Akihito Nakamura, AIST
Version:
$Id: VariableType.java 3055 2013-02-22 10:26:33Z nakamura5akihito@gmail.com $
See also:
OVAL Language
 
 @Entity"oval.def.variable" )
 public class VariableType
     extends DefinitionsComponent
 {
 
     public enum Type
     implements OvalEnumeration
     {
         CONSTANT,
         LOCAL,
         EXTERNAL;


        
A factory method.
 
         public static Type fromValue(
                         final String value
                         )
         {
 //            return valueOf( value.toUpperCase() );
 
             for (Type  e : Type.values()) {
                 if (e.value.equalsvalue )) {
                     return e;
                 }
             }
 
             throw new IllegalArgumentExceptionvalue );
         }
 
 
 
         private String  value = null;
 
 
         Type()
         {
              = name().toLowerCase();
         }
 
 
 
         public String value()
         {
             return ;
         }
 
 
 
         @Override
         public String toString()
         {
             return ;
         }
     }
     //Type
 
 
    ////////////////////////////////////////////////////////////////
    private DatatypeEnumeration  datatype;
    //{required}



    
Constructor.
    public VariableType()
    {
        thisnull, 0 );
    }
    public VariableType(
                    final String id,
                    final int version
                    )
    {
        thisidversionnull );
    }
    public VariableType(
                    final String id,
                    final int version,
                    final String comment
                    )
    {
        thisidversioncommentnull );
    }
    public VariableType(
                    final String id,
                    final int version,
                    final String comment,
                    final DatatypeEnumeration datatype
                    )
    {
        superidversioncomment );
        setDatatypedatatype );
//        _oval_entity_type = OvalEntityType.variable;
//        _definitions_element_type = DefinitionsElement.Type.variable;
    }



    
    public void setDatatype(
                    final DatatypeEnumeration datatype
                    )
    {
        this. = datatype;
    }
    {
        return ;
    }
    //*********************************************************************
    //  Element
    //*********************************************************************
    @Override
    public final ElementType ovalGetType()
    {
        return .;
    }
    //*********************************************************************
    //  DefinitionsElement
    //*********************************************************************
//    @Override
//    public final DefinitionsElement.Type ovalGetElementType()
//    {
//        return DefinitionsElement.Type.VARIABLE;
//    }
    @Override
    {
        return Collections.emptyList();
//        Collection<ElementRef>  ref_list = new ArrayList<ElementRef>();
//        return ref_list;
    }
    {
        throw new UnsupportedOperationException(
                        "concrete VariableType must return its type.");
//        return Type.LOCAL;
    }
    //**************************************************************
    //  java.lang.Object
    //**************************************************************
    @Override
    public String toString()
    {
        return super.toString()
                        + ", datatype=" + getDatatype();
    }
//
New to GrepCode? Check out our FAQ X